Skip to content

Commit a61eb8e

Browse files
committed
Cleanup
Signed-off-by: Joaquin Anton <janton@nvidia.com>
1 parent 0885825 commit a61eb8e

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

plugins/video/pkg_src/src/decoder/video_decoder_mixed.cc

+3-27
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ bool VideoDecoderMixed::SetupImpl(
5555
sample.data_provider_ = std::make_unique<MemoryVideoFile>(input.raw_tensor(i), input[i].shape().num_elements());
5656
sample.demuxer_ = std::make_unique<FFmpegDemuxer>(sample.data_provider_.get());
5757
sample.current_packet_ = std::make_unique<PacketData>();
58-
std::cout << "Sample #" << i << " {10x" << sample.demuxer_->GetHeight() << "x" << sample.demuxer_->GetWidth() << "x" << 3 << "}\n";
5958
sh.set_tensor_shape(i, dali::TensorShape<>(10, sample.demuxer_->GetHeight(), sample.demuxer_->GetWidth(), 3));
6059
}
6160
output_desc.resize(1);
@@ -92,49 +91,26 @@ void VideoDecoderMixed::Run(dali::Workspace &ws) {
9291

9392
cuCtxPushCurrent(cuContext);
9493
cuStreamCreate(&cuStream, 0);
95-
cuCtxPopCurrent(nullptr);
9694

97-
cuCtxPushCurrent(cuContext);
98-
9995
for (int i = 0; i < batch_size; i++) {
100-
auto& sample = samples_[i];
96+
auto &sample = samples_[i];
10197
sample.decoder_ = std::make_unique<NvDecoder>(
10298
cuStream, cuContext, true, FFmpeg2NvCodecId(sample.demuxer_->GetVideoCodec()), false,
10399
false /*_enableasyncallocations*/, false);
104100

105101

106-
uint8_t* pVideo = NULL;
102+
uint8_t *pVideo = NULL;
107103
int nVideoBytes = 0;
108104
while (sample.demuxer_->Demux(&pVideo, &nVideoBytes)) {
109105
if (nVideoBytes) {
110106
auto vecTupFrame = sample.decoder_->Decode(pVideo, nVideoBytes);
111107
}
112108
}
113-
114-
cuCtxPopCurrent(&cuContext);
115-
116-
// uint8_t* data = nullptr;
117-
// int data_size = 0;
118-
119-
// data_provider_ = std::make_unique<HostMemDataProvider>(data, data_size);
120-
// demuxer_ = std::make_unique<FFmpegDemuxer>(data_provider_.get());
121-
// current_packet_ = std::make_unique<PacketData>();
122-
123-
// int nVideoBytes = 0, nFrameReturned = 0, nFrame = 0;
124-
// uint8_t* pVideo = NULL, * pFrame;
125-
// memset(current_packet_.get(), 0, sizeof(PacketData));
126-
127-
// while (demuxer_->Demux(&pVideo, &nVideoBytes)) {
128-
// if (nVideoBytes) {
129-
// current_packet_->bsl_data = (uintptr_t)pVideo;
130-
// current_packet_->bsl = nVideoBytes;
131-
// }
132-
// }
133109
}
110+
cuCtxPopCurrent(&cuContext);
134111
}
135112

136113

137-
138114
DALI_SCHEMA(plugin__video__decoders__Video)
139115
.DocStr(
140116
R"code(Decodes a video file from a memory buffer (e.g. provided by external source).

0 commit comments

Comments
 (0)