Fix DefaultVideoCompositor deadlock during media item transitions#2744
Open
AradiPatrik wants to merge 1 commit intoandroidx:mainfrom
Open
Fix DefaultVideoCompositor deadlock during media item transitions#2744AradiPatrik wants to merge 1 commit intoandroidx:mainfrom
AradiPatrik wants to merge 1 commit intoandroidx:mainfrom
Conversation
Contributor
Author
|
Here's the manual test result. The sequences transition without deadlock in demo-composition. test.mov |
Collaborator
|
@ychaparov Could you take a look or reassign as needed? |
Contributor
|
Hello @AradiPatrik, thanks for sending the PR. I have a few naive questions:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using MultipleInputVideoGraph with sequences containing multiple
media items, the compositor would deadlock when transitioning between
items within a sequence. This prevented other sequences from reaching
their end-of-stream signal, causing the entire composition to freeze.
The root cause was getFramesToComposite() returning an empty list
whenever ANY input source had an empty frame queue. During media item
transitions, the transitioning sequence's queue becomes temporarily
empty while the decoder reinitializes (~200ms). This blocked all
composition, preventing other sequences from compositing their final
frames needed to signal end-of-stream.
This change introduces frame caching to maintain composition continuity:
each input source
queue is temporarily empty
of waiting for buffering
With these changes, composition continues using the last available frame
from transitioning sequences, allowing other sequences to properly reach
end-of-stream while maintaining visual continuity (no black frames).
Fixes: #2742