Plumb frame type information into the decoder

This commit is contained in:
Cameron Gutman
2022-05-29 21:58:28 -05:00
parent 5dbf18d66e
commit 82619063ee
4 changed files with 16 additions and 9 deletions

View File

@@ -714,7 +714,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
@SuppressWarnings("deprecation")
@Override
public int submitDecodeUnit(byte[] decodeUnitData, int decodeUnitLength, int decodeUnitType,
int frameNumber, long receiveTimeMs, long enqueueTimeMs) {
int frameNumber, int frameType, long receiveTimeMs, long enqueueTimeMs) {
if (stopping) {
// Don't bother if we're stopping
return MoonBridge.DR_OK;
@@ -997,6 +997,10 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
submitCsdNextCall = false;
}
if (frameType == MoonBridge.FRAME_TYPE_IDR) {
codecFlags |= MediaCodec.BUFFER_FLAG_SYNC_FRAME;
}
numFramesIn++;
}