Skip to content

Commit 1753f9c

Browse files
committed
Name change
1 parent db2ea07 commit 1753f9c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/torchcodec/_core/CudaDeviceInterface.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ void CudaDeviceInterface::initializeVideo(
209209
videoStreamOptions_ = videoStreamOptions;
210210
}
211211

212-
UniqueAVFrame CudaDeviceInterface::maybeConvertAVFrameToNV12(
212+
UniqueAVFrame CudaDeviceInterface::maybeConvertAVFrameToNV12OrRGB24(
213213
UniqueAVFrame& avFrame) {
214214
// We need FFmpeg filters to handle those conversion cases which are not
215215
// directly implemented in CUDA or CPU device interface (in case of a
@@ -323,16 +323,16 @@ void CudaDeviceInterface::convertAVFrameToFrameOutput(
323323

324324
// All of our CUDA decoding assumes NV12 format. We handle non-NV12 formats by
325325
// converting them to NV12.
326-
avFrame = maybeConvertAVFrameToNV12(avFrame);
326+
avFrame = maybeConvertAVFrameToNV12OrRGB24(avFrame);
327327

328328
if (avFrame->format != AV_PIX_FMT_CUDA) {
329329
// The frame's format is AV_PIX_FMT_CUDA if and only if its content is on
330330
// the GPU. In this branch, the frame is on the CPU. There are two possible
331331
// reasons:
332332
//
333-
// 1. During maybeConvertAVFrameToNV12(), we had a non-NV12 format frame
334-
// and we're on FFmpeg 4.4 or earlier. In such cases, we had to use CPU
335-
// filters and we just converted the frame to RGB24.
333+
// 1. During maybeConvertAVFrameToNV12OrRGB24(), we had a non-NV12 format
334+
// frame and we're on FFmpeg 4.4 or earlier. In such cases, we had to
335+
// use CPU filters and we just converted the frame to RGB24.
336336
// 2. This is what NVDEC gave us if it wasn't able to decode a frame, for
337337
// whatever reason. Typically that happens if the video's encoder isn't
338338
// supported by NVDEC.
@@ -382,7 +382,7 @@ void CudaDeviceInterface::convertAVFrameToFrameOutput(
382382
// Above we checked that the AVFrame was on GPU, but that's not enough, we
383383
// also need to check that the AVFrame is in AV_PIX_FMT_NV12 format (8 bits),
384384
// because this is what the NPP color conversion routines expect. This SHOULD
385-
// be enforced by our call to maybeConvertAVFrameToNV12() above.
385+
// be enforced by our call to maybeConvertAVFrameToNV12OrRGB24() above.
386386
auto hwFramesCtx =
387387
reinterpret_cast<AVHWFramesContext*>(avFrame->hw_frames_ctx->data);
388388
TORCH_CHECK(

src/torchcodec/_core/CudaDeviceInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class CudaDeviceInterface : public DeviceInterface {
4040
// Our CUDA decoding code assumes NV12 format. In order to handle other
4141
// kinds of input, we need to convert them to NV12. Our current implementation
4242
// does this using filtergraph.
43-
UniqueAVFrame maybeConvertAVFrameToNV12(UniqueAVFrame& avFrame);
43+
UniqueAVFrame maybeConvertAVFrameToNV12OrRGB24(UniqueAVFrame& avFrame);
4444

4545
VideoStreamOptions videoStreamOptions_;
4646
AVRational timeBase_;

0 commit comments

Comments
 (0)