Commit 0cdeb555 by hoangtc Committed by Oliver Woodman

Use a custom video renderer for MetadataRetrieverImpl.

Currently, MetadataRetrieverImpl uses MediaCodecVideoRenderer to renderering
frames to capture. It suffers from 2 issues:
- MediaCodecVideoRenderer has a lot of logic to time frame release, including
drop frames if late or try to keep up with feeding speed etc... These are not
necessary at all for frame retrieval.
- MediaCodecVideoRenderer always tries to render 1 frame after video surface
update. This may some times lead to the wrong image being rendered for
MetadataRetriever.
This CL replaces this with a custom video renderer, that does not time frame
releases, and only render first frame after position reset / renderer
re-enabling.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207276937
parent b3d52f5d
...@@ -685,6 +685,15 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -685,6 +685,15 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
} }
/** /**
* Returns the offset that should be subtracted from {@code bufferPresentationTimeUs} in {@link
* #processOutputBuffer(long, long, MediaCodec, ByteBuffer, int, int, long, boolean)} to get the
* playback position with respect to the media.
*/
protected long getOutputStreamOffsetUs() {
return outputStreamOffsetUs;
}
/**
* Called when an output buffer is successfully processed. * Called when an output buffer is successfully processed.
* *
* @param presentationTimeUs The timestamp associated with the output buffer. * @param presentationTimeUs The timestamp associated with the output buffer.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment