Skip to content

Commit

Permalink
c10::string_view -> std::string_view in torchcodec
Browse files Browse the repository at this point in the history
Differential Revision: D67312321

Pull Request resolved: #439
  • Loading branch information
r-barnes authored Dec 19, 2024
1 parent d37d3a5 commit 22ce083
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/torchcodec/decoders/_core/VideoDecoderOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ OpsBatchDecodedOutput makeOpsBatchDecodedOutput(
// Implementations for the operators
// ==============================

at::Tensor create_from_file(c10::string_view filename) {
at::Tensor create_from_file(std::string_view filename) {
std::string filenameStr(filename);
std::unique_ptr<VideoDecoder> uniqueDecoder =
VideoDecoder::createFromFilePath(filenameStr);
Expand All @@ -121,9 +121,9 @@ void add_video_stream(
std::optional<int64_t> width,
std::optional<int64_t> height,
std::optional<int64_t> num_threads,
std::optional<c10::string_view> dimension_order,
std::optional<std::string_view> dimension_order,
std::optional<int64_t> stream_index,
std::optional<c10::string_view> device) {
std::optional<std::string_view> device) {
_add_video_stream(
decoder,
width,
Expand All @@ -139,10 +139,10 @@ void _add_video_stream(
std::optional<int64_t> width,
std::optional<int64_t> height,
std::optional<int64_t> num_threads,
std::optional<c10::string_view> dimension_order,
std::optional<std::string_view> dimension_order,
std::optional<int64_t> stream_index,
std::optional<c10::string_view> device,
std::optional<c10::string_view> color_conversion_library) {
std::optional<std::string_view> device,
std::optional<std::string_view> color_conversion_library) {
VideoDecoder::VideoStreamDecoderOptions options;
options.width = width;
options.height = height;
Expand Down
12 changes: 6 additions & 6 deletions src/torchcodec/decoders/_core/VideoDecoderOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace facebook::torchcodec {
// auto decoderTensor = createDecoderOp.call(videoPath);

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

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

Expand All @@ -34,19 +34,19 @@ void add_video_stream(
std::optional<int64_t> width = std::nullopt,
std::optional<int64_t> height = std::nullopt,
std::optional<int64_t> num_threads = std::nullopt,
std::optional<c10::string_view> dimension_order = std::nullopt,
std::optional<std::string_view> dimension_order = std::nullopt,
std::optional<int64_t> stream_index = std::nullopt,
std::optional<c10::string_view> device = std::nullopt);
std::optional<std::string_view> device = std::nullopt);

void _add_video_stream(
at::Tensor& decoder,
std::optional<int64_t> width = std::nullopt,
std::optional<int64_t> height = std::nullopt,
std::optional<int64_t> num_threads = std::nullopt,
std::optional<c10::string_view> dimension_order = std::nullopt,
std::optional<std::string_view> dimension_order = std::nullopt,
std::optional<int64_t> stream_index = std::nullopt,
std::optional<c10::string_view> device = std::nullopt,
std::optional<c10::string_view> color_conversion_library = std::nullopt);
std::optional<std::string_view> device = std::nullopt,
std::optional<std::string_view> color_conversion_library = std::nullopt);

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

0 comments on commit 22ce083

Please sign in to comment.