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
1111extern " 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
190192void 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,
0 commit comments