Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[droidmedia] Fix AsyncCodecSource to be asynchronous. JB#57676 #101

Closed
wants to merge 1 commit into from

Conversation

d-grigorev
Copy link
Contributor

When MediaCodec starts up, it spits a number of CB_INPUT_AVAILABLE
messages with indexes of available input buffers. The messages are
queued in message channel, so the output buffer will hang in queue
and will not be processed until all input buffers are filled with
data from MediaSource. It may take some time in case of a slow media
source, e.g. camera. This causes the output frame to be delayed by
12-14 frames.

This commit adds a SourceReader that stores available input buffer
indexes on order to unblock message queue and fetches the data from
the MediaSource in a separate thread.

@d-grigorev
Copy link
Contributor Author

In this version of the commit I changed the print format for size_t typed variable to fix build for 64-bit systems.

When MediaCodec starts up, it spits a number of CB_INPUT_AVAILABLE
messages with indexes of available input buffers. The messages are
queued in message channel, so the output buffer will hang in queue
and will not be processed until all input buffers are filled with
data from MediaSource. It may take some time in case of a slow media
source, e.g. camera. This causes the output frame to be delayed by
12-14 frames.

This commit adds a SourceReader that stores available input buffer
indexes on order to unblock message queue and fetches the data from
the MediaSource in a separate thread.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants