Skip to content

Commit 05a29a5

Browse files
authored
Remove unused C++ decoder creation (#542)
1 parent e423460 commit 05a29a5

File tree

4 files changed

+0
-86
lines changed

4 files changed

+0
-86
lines changed

src/torchcodec/decoders/_core/VideoDecoderOps.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,6 @@ at::Tensor create_from_tensor(
142142
return wrapDecoderPointerToTensor(std::move(uniqueDecoder));
143143
}
144144

145-
at::Tensor create_from_buffer(
146-
const void* buffer,
147-
size_t length,
148-
std::optional<std::string_view> seek_mode) {
149-
VideoDecoder::SeekMode realSeek = VideoDecoder::SeekMode::exact;
150-
if (seek_mode.has_value()) {
151-
realSeek = seekModeFromString(seek_mode.value());
152-
}
153-
154-
std::unique_ptr<VideoDecoder> uniqueDecoder =
155-
std::make_unique<VideoDecoder>(buffer, length, realSeek);
156-
return wrapDecoderPointerToTensor(std::move(uniqueDecoder));
157-
}
158-
159145
void add_video_stream(
160146
at::Tensor& decoder,
161147
std::optional<int64_t> width,

src/torchcodec/decoders/_core/VideoDecoderOps.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ at::Tensor create_from_tensor(
2828
at::Tensor video_tensor,
2929
std::optional<std::string_view> seek_mode = std::nullopt);
3030

31-
// This API is C++ only and will not be exposed via custom ops, use
32-
// videodecoder_create_from_bytes in Python
33-
at::Tensor create_from_buffer(
34-
const void* buffer,
35-
size_t length,
36-
std::optional<std::string_view> seek_mode = std::nullopt);
37-
3831
// Add a new video stream at `stream_index` using the provided options.
3932
void add_video_stream(
4033
at::Tensor& decoder,

test/decoders/CMakeLists.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,14 @@ add_executable(
2121
VideoDecoderTest.cpp
2222
)
2323

24-
add_executable(
25-
VideoDecoderOpsTest
26-
VideoDecoderOpsTest.cpp
27-
)
28-
2924
target_include_directories(VideoDecoderTest SYSTEM PRIVATE ${TORCH_INCLUDE_DIRS})
3025
target_include_directories(VideoDecoderTest PRIVATE ../../)
31-
target_include_directories(VideoDecoderOpsTest SYSTEM PRIVATE ${TORCH_INCLUDE_DIRS})
32-
target_include_directories(VideoDecoderOpsTest PRIVATE ../../)
3326

3427
target_link_libraries(
3528
VideoDecoderTest
3629
${libtorchcodec_target_name}
3730
GTest::gtest_main
3831
)
3932

40-
target_link_libraries(
41-
VideoDecoderOpsTest
42-
${libtorchcodec_target_name}
43-
GTest::gtest_main
44-
)
45-
4633
include(GoogleTest)
4734
gtest_discover_tests(VideoDecoderTest)
48-
gtest_discover_tests(VideoDecoderOpsTest)

test/decoders/VideoDecoderOpsTest.cpp

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)