@@ -22,7 +22,7 @@ EncodeProcess::EncodeProcess(
2222
2323void EncodeProcess::process (
2424 const torch::Tensor& tensor,
25- const c10 ::optional<double >& pts) {
25+ const std ::optional<double >& pts) {
2626 if (pts) {
2727 const double & pts_val = pts.value ();
2828 TORCH_CHECK (
@@ -127,7 +127,7 @@ enum AVPixelFormat get_src_pix_fmt(const std::string& src) {
127127// //////////////////////////////////////////////////////////////////////////////
128128const AVCodec* get_codec (
129129 AVCodecID default_codec,
130- const c10 ::optional<std::string>& encoder) {
130+ const std ::optional<std::string>& encoder) {
131131 if (encoder) {
132132 const AVCodec* c = avcodec_find_encoder_by_name (encoder.value ().c_str ());
133133 TORCH_CHECK (c, " Unexpected codec: " , encoder.value ());
@@ -151,7 +151,7 @@ AVCodecContextPtr get_codec_ctx(const AVCodec* codec, int flags) {
151151
152152void open_codec (
153153 AVCodecContext* codec_ctx,
154- const c10 ::optional<OptionDict>& option) {
154+ const std ::optional<OptionDict>& option) {
155155 AVDictionary* opt = get_option_dict (option);
156156
157157 // Enable experimental feature if required
@@ -224,7 +224,7 @@ std::string get_supported_formats(const AVSampleFormat* sample_fmts) {
224224
225225AVSampleFormat get_enc_fmt (
226226 AVSampleFormat src_fmt,
227- const c10 ::optional<std::string>& encoder_format,
227+ const std ::optional<std::string>& encoder_format,
228228 const AVCodec* codec) {
229229 if (encoder_format) {
230230 auto & enc_fmt_val = encoder_format.value ();
@@ -273,7 +273,7 @@ std::string get_supported_samplerates(const int* supported_samplerates) {
273273
274274int get_enc_sr (
275275 int src_sample_rate,
276- const c10 ::optional<int >& encoder_sample_rate,
276+ const std ::optional<int >& encoder_sample_rate,
277277 const AVCodec* codec) {
278278 // G.722 only supports 16000 Hz, but it does not list the sample rate in
279279 // supported_samplerates so we hard code it here.
@@ -325,7 +325,7 @@ std::string get_supported_channels(const uint64_t* channel_layouts) {
325325
326326uint64_t get_channel_layout (
327327 const uint64_t src_ch_layout,
328- const c10 ::optional<int > enc_num_channels,
328+ const std ::optional<int > enc_num_channels,
329329 const AVCodec* codec) {
330330 // If the override is presented, and if it is supported by codec, we use it.
331331 if (enc_num_channels) {
@@ -370,7 +370,7 @@ void configure_audio_codec_ctx(
370370 AVSampleFormat format,
371371 int sample_rate,
372372 uint64_t channel_layout,
373- const c10 ::optional<CodecConfig>& codec_config) {
373+ const std ::optional<CodecConfig>& codec_config) {
374374 codec_ctx->sample_fmt = format;
375375 codec_ctx->sample_rate = sample_rate;
376376 codec_ctx->time_base = av_inv_q (av_d2q (sample_rate, 1 << 24 ));
@@ -421,7 +421,7 @@ std::string get_supported_formats(const AVPixelFormat* pix_fmts) {
421421
422422AVPixelFormat get_enc_fmt (
423423 AVPixelFormat src_fmt,
424- const c10 ::optional<std::string>& encoder_format,
424+ const std ::optional<std::string>& encoder_format,
425425 const AVCodec* codec) {
426426 if (encoder_format) {
427427 const auto & val = encoder_format.value ();
@@ -455,7 +455,7 @@ bool supported_frame_rate(AVRational rate, const AVRational* rates) {
455455
456456AVRational get_enc_rate (
457457 AVRational src_rate,
458- const c10 ::optional<double >& encoder_sample_rate,
458+ const std ::optional<double >& encoder_sample_rate,
459459 const AVCodec* codec) {
460460 if (encoder_sample_rate) {
461461 const double & enc_rate = encoder_sample_rate.value ();
@@ -494,7 +494,7 @@ void configure_video_codec_ctx(
494494 AVRational frame_rate,
495495 int width,
496496 int height,
497- const c10 ::optional<CodecConfig>& codec_config) {
497+ const std ::optional<CodecConfig>& codec_config) {
498498 // TODO: Review other options and make them configurable?
499499 // https://ffmpeg.org/doxygen/4.1/muxing_8c_source.html#l00147
500500 // - bit_rate_tolerance
@@ -596,7 +596,7 @@ FilterGraph get_audio_filter_graph(
596596 AVSampleFormat src_fmt,
597597 int src_sample_rate,
598598 uint64_t src_ch_layout,
599- const c10 ::optional<std::string>& filter_desc,
599+ const std ::optional<std::string>& filter_desc,
600600 AVSampleFormat enc_fmt,
601601 int enc_sample_rate,
602602 uint64_t enc_ch_layout,
@@ -639,7 +639,7 @@ FilterGraph get_video_filter_graph(
639639 AVRational src_rate,
640640 int src_width,
641641 int src_height,
642- const c10 ::optional<std::string>& filter_desc,
642+ const std ::optional<std::string>& filter_desc,
643643 AVPixelFormat enc_fmt,
644644 AVRational enc_rate,
645645 int enc_width,
@@ -743,13 +743,13 @@ EncodeProcess get_audio_encode_process(
743743 int src_sample_rate,
744744 int src_num_channels,
745745 const std::string& format,
746- const c10 ::optional<std::string>& encoder,
747- const c10 ::optional<OptionDict>& encoder_option,
748- const c10 ::optional<std::string>& encoder_format,
749- const c10 ::optional<int >& encoder_sample_rate,
750- const c10 ::optional<int >& encoder_num_channels,
751- const c10 ::optional<CodecConfig>& codec_config,
752- const c10 ::optional<std::string>& filter_desc,
746+ const std ::optional<std::string>& encoder,
747+ const std ::optional<OptionDict>& encoder_option,
748+ const std ::optional<std::string>& encoder_format,
749+ const std ::optional<int >& encoder_sample_rate,
750+ const std ::optional<int >& encoder_num_channels,
751+ const std ::optional<CodecConfig>& codec_config,
752+ const std ::optional<std::string>& filter_desc,
753753 bool disable_converter) {
754754 // 1. Check the source format, rate and channels
755755 TORCH_CHECK (
@@ -854,15 +854,15 @@ EncodeProcess get_video_encode_process(
854854 int src_width,
855855 int src_height,
856856 const std::string& format,
857- const c10 ::optional<std::string>& encoder,
858- const c10 ::optional<OptionDict>& encoder_option,
859- const c10 ::optional<std::string>& encoder_format,
860- const c10 ::optional<double >& encoder_frame_rate,
861- const c10 ::optional<int >& encoder_width,
862- const c10 ::optional<int >& encoder_height,
863- const c10 ::optional<std::string>& hw_accel,
864- const c10 ::optional<CodecConfig>& codec_config,
865- const c10 ::optional<std::string>& filter_desc,
857+ const std ::optional<std::string>& encoder,
858+ const std ::optional<OptionDict>& encoder_option,
859+ const std ::optional<std::string>& encoder_format,
860+ const std ::optional<double >& encoder_frame_rate,
861+ const std ::optional<int >& encoder_width,
862+ const std ::optional<int >& encoder_height,
863+ const std ::optional<std::string>& hw_accel,
864+ const std ::optional<CodecConfig>& codec_config,
865+ const std ::optional<std::string>& filter_desc,
866866 bool disable_converter) {
867867 // 1. Checkc the source format, rate and resolution
868868 TORCH_CHECK (
0 commit comments