gstreamer: Decouple ownership of the GstPlay/AppSrc from signal callbacks#456
Open
tharkum wants to merge 1 commit intoservo:mainfrom
Open
gstreamer: Decouple ownership of the GstPlay/AppSrc from signal callbacks#456tharkum wants to merge 1 commit intoservo:mainfrom
tharkum wants to merge 1 commit intoservo:mainfrom
Conversation
Contributor
Author
|
@jdm < Please take a look |
Contributor
Author
|
There is crash under heavy testing scenario, so please postpone review |
Contributor
Instead of going this way, you might want to use the |
sdroege
reviewed
Oct 30, 2025
sdroege
reviewed
Nov 1, 2025
…acks The associated signal callbacks shouldn't capture strong or weak references of a owner `GstPlay` object with which they are interact otherwise it leads to leaked underlying media resources. Note that upgrading the captured weak reference for a `GstPlay` object on another thread (the `GstPlay` streaming thread) is not safely because a `GstPlay` object could be destroyed on that thread after signal callback handling with mutex panic on the `gst_play_finalize`. To solve the `GstPlay` ownership issue between client and Gstreamer was introduced the player shared state with minimal required states (`metadata`, `pending playback rate`, `play state`, ...). Anyway the captured `GstPlay` weak reference will be used on sync `source` setup stage which is locking the client thread until a source will be ready. For `GstAppSrc` and associated `seek_data` callback a capture of a weak reference will be used with explicit set `empty` callbacks on a player destruction. Fixes: servo#455 Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
cb36475 to
32098e8
Compare
Contributor
Author
|
@jdm < Please take a look |
Member
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.
The associated signal callbacks shouldn't capture strong or weak references of a owner
GstPlayobject with which they are interact otherwise it leads to leaked underlying media resources.Note that upgrading the captured weak reference for a
GstPlayobject on another thread (theGstPlaystreaming thread) is not safely because aGstPlayobject could be destroyed on that thread after signal callback handling with mutex panic on thegst_play_finalize.To solve the
GstPlayownership issue between client and Gstreamer was introduced the player shared state with minimal required states (metadata,pending playback rate,play state, ...).Anyway the captured
GstPlayweak reference will be used on syncsourcesetup stage which is locking the client thread until a source will be ready.For
GstAppSrcand associatedseek_datacallback a capture of a weak reference will be used with explicit setemptycallbacks on a player destruction.Testing: Manually testing with the following WPT test
GST_DEBUG=3,gst-play*:7 ./mach test-wpt html/semantics/embedded-content/the-video-element/intrinsic_sizes.htm -rFixes (partially): #455