Skip to content

Commit fa44bda

Browse files
authored
c10::nullopt -> std::nullopt
Differential Revision: D64835967 Pull Request resolved: #3848
1 parent a95cfa8 commit fa44bda

File tree

2 files changed

+50
-50
lines changed

2 files changed

+50
-50
lines changed

src/libtorio/ffmpeg/stream_reader/stream_reader.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class StreamingMediaDecoder {
6666
/// (opening source).
6767
explicit StreamingMediaDecoder(
6868
AVIOContext* io_ctx,
69-
const std::optional<std::string>& format = c10::nullopt,
70-
const std::optional<OptionDict>& option = c10::nullopt);
69+
const std::optional<std::string>& format = std::nullopt,
70+
const std::optional<OptionDict>& option = std::nullopt);
7171

7272
/// @endcond
7373

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

8787
///@}
8888

@@ -205,9 +205,9 @@ class StreamingMediaDecoder {
205205
int64_t i,
206206
int64_t frames_per_chunk,
207207
int64_t num_chunks,
208-
const std::optional<std::string>& filter_desc = c10::nullopt,
209-
const std::optional<std::string>& decoder = c10::nullopt,
210-
const std::optional<OptionDict>& decoder_option = c10::nullopt);
208+
const std::optional<std::string>& filter_desc = std::nullopt,
209+
const std::optional<std::string>& decoder = std::nullopt,
210+
const std::optional<OptionDict>& decoder_option = std::nullopt);
211211
/// Define an output video stream.
212212
///
213213
/// @param i,frames_per_chunk,num_chunks,filter_desc,decoder,decoder_option
@@ -226,10 +226,10 @@ class StreamingMediaDecoder {
226226
int64_t i,
227227
int64_t frames_per_chunk,
228228
int64_t num_chunks,
229-
const std::optional<std::string>& filter_desc = c10::nullopt,
230-
const std::optional<std::string>& decoder = c10::nullopt,
231-
const std::optional<OptionDict>& decoder_option = c10::nullopt,
232-
const std::optional<std::string>& hw_accel = c10::nullopt);
229+
const std::optional<std::string>& filter_desc = std::nullopt,
230+
const std::optional<std::string>& decoder = std::nullopt,
231+
const std::optional<OptionDict>& decoder_option = std::nullopt,
232+
const std::optional<std::string>& hw_accel = std::nullopt);
233233

234234
/// @cond
235235
/// Add a output packet stream.
@@ -315,7 +315,7 @@ class StreamingMediaDecoder {
315315
/// @param timeout See `process_packet_block()`
316316
/// @param backoff See `process_packet_block()`
317317
int fill_buffer(
318-
const std::optional<double>& timeout = c10::nullopt,
318+
const std::optional<double>& timeout = std::nullopt,
319319
const double backoff = 10.);
320320

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

389389
// For BC

src/libtorio/ffmpeg/stream_writer/stream_writer.h

+37-37
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class StreamingMediaEncoder {
3838
/// @param format Specify output format.
3939
explicit StreamingMediaEncoder(
4040
AVIOContext* io_ctx,
41-
const std::optional<std::string>& format = c10::nullopt);
41+
const std::optional<std::string>& format = std::nullopt);
4242

4343
/// @endcond
4444

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

5555
// Non-copyable
5656
StreamingMediaEncoder(const StreamingMediaEncoder&) = delete;
@@ -113,13 +113,13 @@ class StreamingMediaEncoder {
113113
int sample_rate,
114114
int num_channels,
115115
const std::string& format,
116-
const std::optional<std::string>& encoder = c10::nullopt,
117-
const std::optional<OptionDict>& encoder_option = c10::nullopt,
118-
const std::optional<std::string>& encoder_format = c10::nullopt,
119-
const std::optional<int>& encoder_sample_rate = c10::nullopt,
120-
const std::optional<int>& encoder_num_channels = c10::nullopt,
121-
const std::optional<CodecConfig>& codec_config = c10::nullopt,
122-
const std::optional<std::string>& filter_desc = c10::nullopt);
116+
const std::optional<std::string>& encoder = std::nullopt,
117+
const std::optional<OptionDict>& encoder_option = std::nullopt,
118+
const std::optional<std::string>& encoder_format = std::nullopt,
119+
const std::optional<int>& encoder_sample_rate = std::nullopt,
120+
const std::optional<int>& encoder_num_channels = std::nullopt,
121+
const std::optional<CodecConfig>& codec_config = std::nullopt,
122+
const std::optional<std::string>& filter_desc = std::nullopt);
123123

124124
/// Add an output video stream.
125125
///
@@ -161,15 +161,15 @@ class StreamingMediaEncoder {
161161
int width,
162162
int height,
163163
const std::string& format,
164-
const std::optional<std::string>& encoder = c10::nullopt,
165-
const std::optional<OptionDict>& encoder_option = c10::nullopt,
166-
const std::optional<std::string>& encoder_format = c10::nullopt,
167-
const std::optional<double>& encoder_frame_rate = c10::nullopt,
168-
const std::optional<int>& encoder_width = c10::nullopt,
169-
const std::optional<int>& encoder_height = c10::nullopt,
170-
const std::optional<std::string>& hw_accel = c10::nullopt,
171-
const std::optional<CodecConfig>& codec_config = c10::nullopt,
172-
const std::optional<std::string>& filter_desc = c10::nullopt);
164+
const std::optional<std::string>& encoder = std::nullopt,
165+
const std::optional<OptionDict>& encoder_option = std::nullopt,
166+
const std::optional<std::string>& encoder_format = std::nullopt,
167+
const std::optional<double>& encoder_frame_rate = std::nullopt,
168+
const std::optional<int>& encoder_width = std::nullopt,
169+
const std::optional<int>& encoder_height = std::nullopt,
170+
const std::optional<std::string>& hw_accel = std::nullopt,
171+
const std::optional<CodecConfig>& codec_config = std::nullopt,
172+
const std::optional<std::string>& filter_desc = std::nullopt);
173173
/// @cond
174174
/// Add output audio frame stream.
175175
/// Allows for writing frames rather than tensors via `write_frame`.
@@ -179,13 +179,13 @@ class StreamingMediaEncoder {
179179
int sample_rate,
180180
int num_channels,
181181
const std::string& format,
182-
const std::optional<std::string>& encoder = c10::nullopt,
183-
const std::optional<OptionDict>& encoder_option = c10::nullopt,
184-
const std::optional<std::string>& encoder_format = c10::nullopt,
185-
const std::optional<int>& encoder_sample_rate = c10::nullopt,
186-
const std::optional<int>& encoder_num_channels = c10::nullopt,
187-
const std::optional<CodecConfig>& codec_config = c10::nullopt,
188-
const std::optional<std::string>& filter_desc = c10::nullopt);
182+
const std::optional<std::string>& encoder = std::nullopt,
183+
const std::optional<OptionDict>& encoder_option = std::nullopt,
184+
const std::optional<std::string>& encoder_format = std::nullopt,
185+
const std::optional<int>& encoder_sample_rate = std::nullopt,
186+
const std::optional<int>& encoder_num_channels = std::nullopt,
187+
const std::optional<CodecConfig>& codec_config = std::nullopt,
188+
const std::optional<std::string>& filter_desc = std::nullopt);
189189

190190
/// Add output video frame stream.
191191
/// Allows for writing frames rather than tensors via `write_frame`.
@@ -196,15 +196,15 @@ class StreamingMediaEncoder {
196196
int width,
197197
int height,
198198
const std::string& format,
199-
const std::optional<std::string>& encoder = c10::nullopt,
200-
const std::optional<OptionDict>& encoder_option = c10::nullopt,
201-
const std::optional<std::string>& encoder_format = c10::nullopt,
202-
const std::optional<double>& encoder_frame_rate = c10::nullopt,
203-
const std::optional<int>& encoder_width = c10::nullopt,
204-
const std::optional<int>& encoder_height = c10::nullopt,
205-
const std::optional<std::string>& hw_accel = c10::nullopt,
206-
const std::optional<CodecConfig>& codec_config = c10::nullopt,
207-
const std::optional<std::string>& filter_desc = c10::nullopt);
199+
const std::optional<std::string>& encoder = std::nullopt,
200+
const std::optional<OptionDict>& encoder_option = std::nullopt,
201+
const std::optional<std::string>& encoder_format = std::nullopt,
202+
const std::optional<double>& encoder_frame_rate = std::nullopt,
203+
const std::optional<int>& encoder_width = std::nullopt,
204+
const std::optional<int>& encoder_height = std::nullopt,
205+
const std::optional<std::string>& hw_accel = std::nullopt,
206+
const std::optional<CodecConfig>& codec_config = std::nullopt,
207+
const std::optional<std::string>& filter_desc = std::nullopt);
208208

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

@@ -248,7 +248,7 @@ class StreamingMediaEncoder {
248248
void write_audio_chunk(
249249
int i,
250250
const torch::Tensor& frames,
251-
const std::optional<double>& pts = c10::nullopt);
251+
const std::optional<double>& pts = std::nullopt);
252252
/// Write video data
253253
/// @param i Stream index.
254254
/// @param frames Video/image tensor. Shape: ``(time, channel, height,
@@ -269,7 +269,7 @@ class StreamingMediaEncoder {
269269
void write_video_chunk(
270270
int i,
271271
const torch::Tensor& frames,
272-
const std::optional<double>& pts = c10::nullopt);
272+
const std::optional<double>& pts = std::nullopt);
273273
/// @cond
274274
/// Write frame to stream.
275275
/// @param i Stream index.

0 commit comments

Comments
 (0)