@@ -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 (
0 commit comments