File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
src/torchcodec/decoders/_core Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -1472,15 +1472,6 @@ VideoDecoder::FrameBatchOutput VideoDecoder::getFramesPlayedInRange(
1472
1472
return frameBatchOutput;
1473
1473
}
1474
1474
1475
- VideoDecoder::AVFrameStream VideoDecoder::getNextAVFrameNoDemux () {
1476
- auto avFrameStream = getAVFrameUsingFilterFunction (
1477
- [this ](int frameStreamIndex, AVFrame* avFrame) {
1478
- StreamInfo& activeStreamInfo = streamInfos_[frameStreamIndex];
1479
- return avFrame->pts >= activeStreamInfo.discardFramesBeforePts ;
1480
- });
1481
- return avFrameStream;
1482
- }
1483
-
1484
1475
VideoDecoder::FrameOutput VideoDecoder::getNextFrameNoDemux () {
1485
1476
auto output = getNextFrameNoDemuxInternal ();
1486
1477
output.data = maybePermuteHWC2CHW (output.streamIndex , output.data );
@@ -1489,7 +1480,11 @@ VideoDecoder::FrameOutput VideoDecoder::getNextFrameNoDemux() {
1489
1480
1490
1481
VideoDecoder::FrameOutput VideoDecoder::getNextFrameNoDemuxInternal (
1491
1482
std::optional<torch::Tensor> preAllocatedOutputTensor) {
1492
- auto avFrameStream = getNextAVFrameNoDemux ();
1483
+ AVFrameStream avFrameStream = getAVFrameUsingFilterFunction (
1484
+ [this ](int frameStreamIndex, AVFrame* avFrame) {
1485
+ StreamInfo& activeStreamInfo = streamInfos_[frameStreamIndex];
1486
+ return avFrame->pts >= activeStreamInfo.discardFramesBeforePts ;
1487
+ });
1493
1488
return convertAVFrameToFrameOutput (avFrameStream, preAllocatedOutputTensor);
1494
1489
}
1495
1490
Original file line number Diff line number Diff line change @@ -403,7 +403,6 @@ class VideoDecoder {
403
403
void maybeSeekToBeforeDesiredPts ();
404
404
AVFrameStream getAVFrameUsingFilterFunction (
405
405
std::function<bool (int , AVFrame*)>);
406
- AVFrameStream getNextAVFrameNoDemux ();
407
406
// Once we create a decoder can update the metadata with the codec context.
408
407
// For example, for video streams, we can add the height and width of the
409
408
// decoded stream.
You can’t perform that action at this time.
0 commit comments