Skip to content

Commit c240c70

Browse files
committed
Fix confusing name
1 parent f00fd79 commit c240c70

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/torchcodec/_core/CustomNvdecDeviceInterface.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -381,25 +381,25 @@ void CustomNvdecDeviceInterface::convertAVFrameToFrameOutput(
381381
std::optional<torch::Tensor> preAllocatedOutputTensor) {
382382
// For custom NVDEC, the frame should already be on GPU
383383
// We need to convert from NVDEC's output format (typically NV12) to RGB
384-
printf("OKAY\n");
384+
printf("In CNI convertAVFrameToFrameOutput\n");
385385
fflush(stdout);
386386

387387
TORCH_CHECK(
388388
avFrame->format == AV_PIX_FMT_CUDA,
389389
"Expected CUDA format frame from custom NVDEC decoder");
390390

391-
auto cpuDevice = torch::Device(torch::kCUDA);
392-
auto cpuInterface = createDeviceInterface(cpuDevice);
391+
auto cudaDevice = torch::Device(torch::kCUDA);
392+
auto cudaInterface = createDeviceInterface(cudaDevice);
393393

394-
FrameOutput cpuFrameOutput;
395-
cpuInterface->convertAVFrameToFrameOutput(
394+
FrameOutput cudaFrameOutput;
395+
cudaInterface->convertAVFrameToFrameOutput(
396396
videoStreamOptions,
397397
timeBase,
398398
avFrame,
399-
cpuFrameOutput,
399+
cudaFrameOutput,
400400
preAllocatedOutputTensor);
401401

402-
frameOutput.data = cpuFrameOutput.data.to(device_);
402+
frameOutput.data = cudaFrameOutput.data.to(device_);
403403
}
404404

405405
} // namespace facebook::torchcodec

src/torchcodec/_core/SingleStreamDecoder.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,8 +1333,6 @@ FrameOutput SingleStreamDecoder::convertAVFrameToFrameOutput(
13331333
if (streamInfo.avMediaType == AVMEDIA_TYPE_AUDIO) {
13341334
convertAudioAVFrameToFrameOutputOnCPU(avFrame, frameOutput);
13351335
} else if (deviceInterface_) {
1336-
printf("Calling device interface to convert AVFrame to FrameOutput\n");
1337-
fflush(stdout);
13381336
deviceInterface_->convertAVFrameToFrameOutput(
13391337
streamInfo.videoStreamOptions,
13401338
streamInfo.timeBase,

0 commit comments

Comments
 (0)