Skip to content

Commit 8ea5d19

Browse files
author
pytorchbot
committed
2025-04-03 nightly release (9ebac73)
1 parent f93f4e7 commit 8ea5d19

24 files changed

+359
-230
lines changed

.github/workflows/linux_cuda_wheel.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ jobs:
135135
# aren't present there.
136136
rm -r src/
137137
ls
138-
- name: Smoke test
139-
run: |
140-
${CONDA_RUN} python test/decoders/manual_smoke_test.py
141138
- name: Run Python tests
142139
run: |
143140
${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest test -v --tb=short

.github/workflows/linux_wheel.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@ jobs:
122122
# aren't present there.
123123
rm -r src/
124124
ls
125-
- name: Smoke test
126-
run: |
127-
python -X faulthandler test/decoders/manual_smoke_test.py
128125
- name: Run Python tests
129126
run: |
130127
pytest test -vvv

.github/workflows/macos_wheel.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ jobs:
121121
rm -r src/
122122
ls -lh
123123
124-
- name: Smoke test
125-
run: |
126-
python -X faulthandler test/decoders/manual_smoke_test.py
127-
128124
- name: Run Python tests
129125
run: |
130126
pytest test -vvv

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ add_subdirectory(src/torchcodec/_core)
77
option(BUILD_TESTS "Build tests" OFF)
88
if(BUILD_TESTS)
99
enable_testing()
10-
add_subdirectory(test/decoders)
10+
add_subdirectory(test)
1111
endif()

src/torchcodec/_core/AVIOContextHolder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace facebook::torchcodec {
3232
// createAVIOContext(), ideally in their constructor.
3333
// 3. A generic handle for those that just need to manage having access to an
3434
// AVIOContext, but aren't necessarily concerned with how it was customized:
35-
// typically, the VideoDecoder.
35+
// typically, the SingleStreamDecoder.
3636
class AVIOContextHolder {
3737
public:
3838
virtual ~AVIOContextHolder();

src/torchcodec/_core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function(make_torchcodec_libraries
6060
set(decoder_sources
6161
AVIOContextHolder.cpp
6262
FFMPEGCommon.cpp
63-
VideoDecoder.cpp
63+
SingleStreamDecoder.cpp
6464
)
6565

6666
if(ENABLE_CUDA)

src/torchcodec/_core/CPUOnlyDevice.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ namespace facebook::torchcodec {
1616

1717
void convertAVFrameToFrameOutputOnCuda(
1818
const torch::Device& device,
19-
[[maybe_unused]] const VideoDecoder::VideoStreamOptions& videoStreamOptions,
19+
[[maybe_unused]] const SingleStreamDecoder::VideoStreamOptions&
20+
videoStreamOptions,
2021
[[maybe_unused]] UniqueAVFrame& avFrame,
21-
[[maybe_unused]] VideoDecoder::FrameOutput& frameOutput,
22+
[[maybe_unused]] SingleStreamDecoder::FrameOutput& frameOutput,
2223
[[maybe_unused]] std::optional<torch::Tensor> preAllocatedOutputTensor) {
2324
throwUnsupportedDeviceError(device);
2425
}

src/torchcodec/_core/CudaDevice.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include "src/torchcodec/_core/DeviceInterface.h"
88
#include "src/torchcodec/_core/FFMPEGCommon.h"
9-
#include "src/torchcodec/_core/VideoDecoder.h"
9+
#include "src/torchcodec/_core/SingleStreamDecoder.h"
1010

1111
extern "C" {
1212
#include <libavutil/hwcontext_cuda.h>
@@ -20,9 +20,11 @@ namespace {
2020
// creating a cuda context is expensive. The cache mechanism is as follows:
2121
// 1. There is a cache of size MAX_CONTEXTS_PER_GPU_IN_CACHE cuda contexts for
2222
// each GPU.
23-
// 2. When we destroy a VideoDecoder instance we release the cuda context to
23+
// 2. When we destroy a SingleStreamDecoder instance we release the cuda context
24+
// to
2425
// the cache if the cache is not full.
25-
// 3. When we create a VideoDecoder instance we try to get a cuda context from
26+
// 3. When we create a SingleStreamDecoder instance we try to get a cuda context
27+
// from
2628
// the cache. If the cache is empty we create a new cuda context.
2729

2830
// Pytorch can only handle up to 128 GPUs.
@@ -189,9 +191,9 @@ void initializeContextOnCuda(
189191

190192
void convertAVFrameToFrameOutputOnCuda(
191193
const torch::Device& device,
192-
const VideoDecoder::VideoStreamOptions& videoStreamOptions,
194+
const SingleStreamDecoder::VideoStreamOptions& videoStreamOptions,
193195
UniqueAVFrame& avFrame,
194-
VideoDecoder::FrameOutput& frameOutput,
196+
SingleStreamDecoder::FrameOutput& frameOutput,
195197
std::optional<torch::Tensor> preAllocatedOutputTensor) {
196198
TORCH_CHECK(
197199
avFrame->format == AV_PIX_FMT_CUDA,

src/torchcodec/_core/DeviceInterface.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
#include <stdexcept>
1212
#include <string>
1313
#include "FFMPEGCommon.h"
14-
#include "src/torchcodec/_core/VideoDecoder.h"
14+
#include "src/torchcodec/_core/SingleStreamDecoder.h"
1515

1616
namespace facebook::torchcodec {
1717

1818
// Note that all these device functions should only be called if the device is
1919
// not a CPU device. CPU device functions are already implemented in the
20-
// VideoDecoder implementation.
20+
// SingleStreamDecoder implementation.
2121
// These functions should only be called from within an if block like this:
2222
// if (device.type() != torch::kCPU) {
2323
// deviceFunction(device, ...);
@@ -31,9 +31,9 @@ void initializeContextOnCuda(
3131

3232
void convertAVFrameToFrameOutputOnCuda(
3333
const torch::Device& device,
34-
const VideoDecoder::VideoStreamOptions& videoStreamOptions,
34+
const SingleStreamDecoder::VideoStreamOptions& videoStreamOptions,
3535
UniqueAVFrame& avFrame,
36-
VideoDecoder::FrameOutput& frameOutput,
36+
SingleStreamDecoder::FrameOutput& frameOutput,
3737
std::optional<torch::Tensor> preAllocatedOutputTensor = std::nullopt);
3838

3939
void releaseContextOnCuda(

0 commit comments

Comments
 (0)