Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading