Skip to content

Commit 22ce083

Browse files
authored
c10::string_view -> std::string_view in torchcodec
Differential Revision: D67312321 Pull Request resolved: #439
1 parent d37d3a5 commit 22ce083

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/torchcodec/decoders/_core/VideoDecoderOps.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ OpsBatchDecodedOutput makeOpsBatchDecodedOutput(
9494
// Implementations for the operators
9595
// ==============================
9696

97-
at::Tensor create_from_file(c10::string_view filename) {
97+
at::Tensor create_from_file(std::string_view filename) {
9898
std::string filenameStr(filename);
9999
std::unique_ptr<VideoDecoder> uniqueDecoder =
100100
VideoDecoder::createFromFilePath(filenameStr);
@@ -121,9 +121,9 @@ void add_video_stream(
121121
std::optional<int64_t> width,
122122
std::optional<int64_t> height,
123123
std::optional<int64_t> num_threads,
124-
std::optional<c10::string_view> dimension_order,
124+
std::optional<std::string_view> dimension_order,
125125
std::optional<int64_t> stream_index,
126-
std::optional<c10::string_view> device) {
126+
std::optional<std::string_view> device) {
127127
_add_video_stream(
128128
decoder,
129129
width,
@@ -139,10 +139,10 @@ void _add_video_stream(
139139
std::optional<int64_t> width,
140140
std::optional<int64_t> height,
141141
std::optional<int64_t> num_threads,
142-
std::optional<c10::string_view> dimension_order,
142+
std::optional<std::string_view> dimension_order,
143143
std::optional<int64_t> stream_index,
144-
std::optional<c10::string_view> device,
145-
std::optional<c10::string_view> color_conversion_library) {
144+
std::optional<std::string_view> device,
145+
std::optional<std::string_view> color_conversion_library) {
146146
VideoDecoder::VideoStreamDecoderOptions options;
147147
options.width = width;
148148
options.height = height;

src/torchcodec/decoders/_core/VideoDecoderOps.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace facebook::torchcodec {
2020
// auto decoderTensor = createDecoderOp.call(videoPath);
2121

2222
// Create a VideoDecoder from file and wrap the pointer in a tensor.
23-
at::Tensor create_from_file(c10::string_view filename);
23+
at::Tensor create_from_file(std::string_view filename);
2424

2525
at::Tensor create_from_tensor(at::Tensor video_tensor);
2626

@@ -34,19 +34,19 @@ void add_video_stream(
3434
std::optional<int64_t> width = std::nullopt,
3535
std::optional<int64_t> height = std::nullopt,
3636
std::optional<int64_t> num_threads = std::nullopt,
37-
std::optional<c10::string_view> dimension_order = std::nullopt,
37+
std::optional<std::string_view> dimension_order = std::nullopt,
3838
std::optional<int64_t> stream_index = std::nullopt,
39-
std::optional<c10::string_view> device = std::nullopt);
39+
std::optional<std::string_view> device = std::nullopt);
4040

4141
void _add_video_stream(
4242
at::Tensor& decoder,
4343
std::optional<int64_t> width = std::nullopt,
4444
std::optional<int64_t> height = std::nullopt,
4545
std::optional<int64_t> num_threads = std::nullopt,
46-
std::optional<c10::string_view> dimension_order = std::nullopt,
46+
std::optional<std::string_view> dimension_order = std::nullopt,
4747
std::optional<int64_t> stream_index = std::nullopt,
48-
std::optional<c10::string_view> device = std::nullopt,
49-
std::optional<c10::string_view> color_conversion_library = std::nullopt);
48+
std::optional<std::string_view> device = std::nullopt,
49+
std::optional<std::string_view> color_conversion_library = std::nullopt);
5050

5151
// Seek to a particular presentation timestamp in the video in seconds.
5252
void seek_to_pts(at::Tensor& decoder, double seconds);

0 commit comments

Comments
 (0)