Skip to content

Commit

Permalink
c10::nullopt -> std::nullopt
Browse files Browse the repository at this point in the history
Summary:
X-link: pytorch/ao#1151

X-link: facebookincubator/AITemplate#1032

Reviewed By: houseroad

Differential Revision: D64835967
  • Loading branch information
r-barnes authored and facebook-github-bot committed Oct 23, 2024
1 parent a95cfa8 commit 9c28366
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 50 deletions.
26 changes: 13 additions & 13 deletions src/libtorio/ffmpeg/stream_reader/stream_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class StreamingMediaDecoder {
/// (opening source).
explicit StreamingMediaDecoder(
AVIOContext* io_ctx,
const std::optional<std::string>& format = c10::nullopt,
const std::optional<OptionDict>& option = c10::nullopt);
const std::optional<std::string>& format = std::nullopt,
const std::optional<OptionDict>& option = std::nullopt);

/// @endcond

Expand All @@ -81,8 +81,8 @@ class StreamingMediaDecoder {
/// (opening source).
explicit StreamingMediaDecoder(
const std::string& src,
const std::optional<std::string>& format = c10::nullopt,
const std::optional<OptionDict>& option = c10::nullopt);
const std::optional<std::string>& format = std::nullopt,
const std::optional<OptionDict>& option = std::nullopt);

///@}

Expand Down Expand Up @@ -205,9 +205,9 @@ class StreamingMediaDecoder {
int64_t i,
int64_t frames_per_chunk,
int64_t num_chunks,
const std::optional<std::string>& filter_desc = c10::nullopt,
const std::optional<std::string>& decoder = c10::nullopt,
const std::optional<OptionDict>& decoder_option = c10::nullopt);
const std::optional<std::string>& filter_desc = std::nullopt,
const std::optional<std::string>& decoder = std::nullopt,
const std::optional<OptionDict>& decoder_option = std::nullopt);
/// Define an output video stream.
///
/// @param i,frames_per_chunk,num_chunks,filter_desc,decoder,decoder_option
Expand All @@ -226,10 +226,10 @@ class StreamingMediaDecoder {
int64_t i,
int64_t frames_per_chunk,
int64_t num_chunks,
const std::optional<std::string>& filter_desc = c10::nullopt,
const std::optional<std::string>& decoder = c10::nullopt,
const std::optional<OptionDict>& decoder_option = c10::nullopt,
const std::optional<std::string>& hw_accel = c10::nullopt);
const std::optional<std::string>& filter_desc = std::nullopt,
const std::optional<std::string>& decoder = std::nullopt,
const std::optional<OptionDict>& decoder_option = std::nullopt,
const std::optional<std::string>& hw_accel = std::nullopt);

/// @cond
/// Add a output packet stream.
Expand Down Expand Up @@ -315,7 +315,7 @@ class StreamingMediaDecoder {
/// @param timeout See `process_packet_block()`
/// @param backoff See `process_packet_block()`
int fill_buffer(
const std::optional<double>& timeout = c10::nullopt,
const std::optional<double>& timeout = std::nullopt,
const double backoff = 10.);

///@}
Expand Down Expand Up @@ -383,7 +383,7 @@ class StreamingMediaDecoderCustomIO : private detail::CustomInput,
int buffer_size,
int (*read_packet)(void* opaque, uint8_t* buf, int buf_size),
int64_t (*seek)(void* opaque, int64_t offset, int whence) = nullptr,
const std::optional<OptionDict>& option = c10::nullopt);
const std::optional<OptionDict>& option = std::nullopt);
};

// For BC
Expand Down
74 changes: 37 additions & 37 deletions src/libtorio/ffmpeg/stream_writer/stream_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class StreamingMediaEncoder {
/// @param format Specify output format.
explicit StreamingMediaEncoder(
AVIOContext* io_ctx,
const std::optional<std::string>& format = c10::nullopt);
const std::optional<std::string>& format = std::nullopt);

/// @endcond

Expand All @@ -50,7 +50,7 @@ class StreamingMediaEncoder {
/// ``dst``.
explicit StreamingMediaEncoder(
const std::string& dst,
const std::optional<std::string>& format = c10::nullopt);
const std::optional<std::string>& format = std::nullopt);

// Non-copyable
StreamingMediaEncoder(const StreamingMediaEncoder&) = delete;
Expand Down Expand Up @@ -113,13 +113,13 @@ class StreamingMediaEncoder {
int sample_rate,
int num_channels,
const std::string& format,
const std::optional<std::string>& encoder = c10::nullopt,
const std::optional<OptionDict>& encoder_option = c10::nullopt,
const std::optional<std::string>& encoder_format = c10::nullopt,
const std::optional<int>& encoder_sample_rate = c10::nullopt,
const std::optional<int>& encoder_num_channels = c10::nullopt,
const std::optional<CodecConfig>& codec_config = c10::nullopt,
const std::optional<std::string>& filter_desc = c10::nullopt);
const std::optional<std::string>& encoder = std::nullopt,
const std::optional<OptionDict>& encoder_option = std::nullopt,
const std::optional<std::string>& encoder_format = std::nullopt,
const std::optional<int>& encoder_sample_rate = std::nullopt,
const std::optional<int>& encoder_num_channels = std::nullopt,
const std::optional<CodecConfig>& codec_config = std::nullopt,
const std::optional<std::string>& filter_desc = std::nullopt);

/// Add an output video stream.
///
Expand Down Expand Up @@ -161,15 +161,15 @@ class StreamingMediaEncoder {
int width,
int height,
const std::string& format,
const std::optional<std::string>& encoder = c10::nullopt,
const std::optional<OptionDict>& encoder_option = c10::nullopt,
const std::optional<std::string>& encoder_format = c10::nullopt,
const std::optional<double>& encoder_frame_rate = c10::nullopt,
const std::optional<int>& encoder_width = c10::nullopt,
const std::optional<int>& encoder_height = c10::nullopt,
const std::optional<std::string>& hw_accel = c10::nullopt,
const std::optional<CodecConfig>& codec_config = c10::nullopt,
const std::optional<std::string>& filter_desc = c10::nullopt);
const std::optional<std::string>& encoder = std::nullopt,
const std::optional<OptionDict>& encoder_option = std::nullopt,
const std::optional<std::string>& encoder_format = std::nullopt,
const std::optional<double>& encoder_frame_rate = std::nullopt,
const std::optional<int>& encoder_width = std::nullopt,
const std::optional<int>& encoder_height = std::nullopt,
const std::optional<std::string>& hw_accel = std::nullopt,
const std::optional<CodecConfig>& codec_config = std::nullopt,
const std::optional<std::string>& filter_desc = std::nullopt);
/// @cond
/// Add output audio frame stream.
/// Allows for writing frames rather than tensors via `write_frame`.
Expand All @@ -179,13 +179,13 @@ class StreamingMediaEncoder {
int sample_rate,
int num_channels,
const std::string& format,
const std::optional<std::string>& encoder = c10::nullopt,
const std::optional<OptionDict>& encoder_option = c10::nullopt,
const std::optional<std::string>& encoder_format = c10::nullopt,
const std::optional<int>& encoder_sample_rate = c10::nullopt,
const std::optional<int>& encoder_num_channels = c10::nullopt,
const std::optional<CodecConfig>& codec_config = c10::nullopt,
const std::optional<std::string>& filter_desc = c10::nullopt);
const std::optional<std::string>& encoder = std::nullopt,
const std::optional<OptionDict>& encoder_option = std::nullopt,
const std::optional<std::string>& encoder_format = std::nullopt,
const std::optional<int>& encoder_sample_rate = std::nullopt,
const std::optional<int>& encoder_num_channels = std::nullopt,
const std::optional<CodecConfig>& codec_config = std::nullopt,
const std::optional<std::string>& filter_desc = std::nullopt);

/// Add output video frame stream.
/// Allows for writing frames rather than tensors via `write_frame`.
Expand All @@ -196,15 +196,15 @@ class StreamingMediaEncoder {
int width,
int height,
const std::string& format,
const std::optional<std::string>& encoder = c10::nullopt,
const std::optional<OptionDict>& encoder_option = c10::nullopt,
const std::optional<std::string>& encoder_format = c10::nullopt,
const std::optional<double>& encoder_frame_rate = c10::nullopt,
const std::optional<int>& encoder_width = c10::nullopt,
const std::optional<int>& encoder_height = c10::nullopt,
const std::optional<std::string>& hw_accel = c10::nullopt,
const std::optional<CodecConfig>& codec_config = c10::nullopt,
const std::optional<std::string>& filter_desc = c10::nullopt);
const std::optional<std::string>& encoder = std::nullopt,
const std::optional<OptionDict>& encoder_option = std::nullopt,
const std::optional<std::string>& encoder_format = std::nullopt,
const std::optional<double>& encoder_frame_rate = std::nullopt,
const std::optional<int>& encoder_width = std::nullopt,
const std::optional<int>& encoder_height = std::nullopt,
const std::optional<std::string>& hw_accel = std::nullopt,
const std::optional<CodecConfig>& codec_config = std::nullopt,
const std::optional<std::string>& filter_desc = std::nullopt);

/// Add packet stream. Intended to be used in conjunction with
/// ``StreamingMediaDecoder`` to perform packet passthrough.
Expand All @@ -226,7 +226,7 @@ class StreamingMediaEncoder {
/// Open the output file / device and write the header.
///
/// @param opt Private options for protocol, device and muxer.
void open(const std::optional<OptionDict>& opt = c10::nullopt);
void open(const std::optional<OptionDict>& opt = std::nullopt);
/// Close the output file / device and finalize metadata.
void close();

Expand All @@ -248,7 +248,7 @@ class StreamingMediaEncoder {
void write_audio_chunk(
int i,
const torch::Tensor& frames,
const std::optional<double>& pts = c10::nullopt);
const std::optional<double>& pts = std::nullopt);
/// Write video data
/// @param i Stream index.
/// @param frames Video/image tensor. Shape: ``(time, channel, height,
Expand All @@ -269,7 +269,7 @@ class StreamingMediaEncoder {
void write_video_chunk(
int i,
const torch::Tensor& frames,
const std::optional<double>& pts = c10::nullopt);
const std::optional<double>& pts = std::nullopt);
/// @cond
/// Write frame to stream.
/// @param i Stream index.
Expand Down

0 comments on commit 9c28366

Please sign in to comment.