mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Flush FrameProcessor when appropriate.
PiperOrigin-RevId: 507461550
This commit is contained in:
parent
91e611d5dc
commit
274617de17
1 changed files with 4 additions and 3 deletions
|
|
@ -1174,9 +1174,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||||
if (frameProcessorManager.isEnabled()) {
|
if (frameProcessorManager.isEnabled()) {
|
||||||
notifyFrameMetaDataListener = false;
|
notifyFrameMetaDataListener = false;
|
||||||
if (!frameProcessorManager.maybeRegisterFrame(format, presentationTimeUs, isLastBuffer)) {
|
if (!frameProcessorManager.maybeRegisterFrame(format, presentationTimeUs, isLastBuffer)) {
|
||||||
// TODO(b/238302341): Handle FrameProcessor is unable to accept the force rendered buffer.
|
return false;
|
||||||
// Treat the frame as dropped for now.
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
notifyFrameMetaDataListener = true;
|
notifyFrameMetaDataListener = true;
|
||||||
|
|
@ -1450,6 +1448,9 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||||
droppedSourceBufferCount, /* droppedDecoderBufferCount= */ buffersInCodecCount);
|
droppedSourceBufferCount, /* droppedDecoderBufferCount= */ buffersInCodecCount);
|
||||||
}
|
}
|
||||||
flushOrReinitializeCodec();
|
flushOrReinitializeCodec();
|
||||||
|
if (frameProcessorManager.isEnabled()) {
|
||||||
|
frameProcessorManager.flush();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue