After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 638844 - [PATCH] Fix pad callbacks so they handle when parent goes away
[PATCH] Fix pad callbacks so they handle when parent goes away
Status: RESOLVED DUPLICATE of bug 631580
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-01-06 17:18 UTC by Ole André Vadla Ravnås
Modified: 2011-01-10 13:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch fixing known issues of this nature in -core. (5.44 KB, patch)
2011-01-06 17:18 UTC, Ole André Vadla Ravnås
none Details | Review
Patch fixing known issues of this nature in -base RTP pay/depay base classes (2.25 KB, patch)
2011-01-06 17:23 UTC, Ole André Vadla Ravnås
none Details | Review
Patch fixing known issues of this nature in -good rtpmanager plugin (3.64 KB, patch)
2011-01-06 17:25 UTC, Ole André Vadla Ravnås
none Details | Review
Patch fixing known issues of this nature in -bad. (4.11 KB, patch)
2011-01-06 17:27 UTC, Ole André Vadla Ravnås
none Details | Review

Description Ole André Vadla Ravnås 2011-01-06 17:18:24 UTC
Created attachment 177671 [details] [review]
Patch fixing known issues of this nature in -core.

1) We need to lock and get a strong ref to the parent, if still there.
2) If it has gone away, we need to handle that gracefully.

This is necessary in order to safely modify a running pipeline. Has been
observed when a streaming thread is doing a buffer_alloc() while an
application thread sends an event on a pad further downstream, and from
within a pad probe (holding STREAM_LOCK) carries out the pipeline plumbing
while the streaming thread has its buffer_alloc() in progress.
Comment 1 Ole André Vadla Ravnås 2011-01-06 17:23:25 UTC
Created attachment 177673 [details] [review]
Patch fixing known issues of this nature in -base RTP pay/depay base classes
Comment 2 Ole André Vadla Ravnås 2011-01-06 17:25:40 UTC
Created attachment 177674 [details] [review]
Patch fixing known issues of this nature in -good rtpmanager plugin
Comment 3 Ole André Vadla Ravnås 2011-01-06 17:27:49 UTC
Created attachment 177675 [details] [review]
Patch fixing known issues of this nature in -bad.
Comment 4 Olivier Crête 2011-01-06 17:36:06 UTC
I've come accross the same problem and proposed the same solution. That said, I think the best solution is to change GstPad to do that for us.

*** This bug has been marked as a duplicate of bug 631580 ***
Comment 5 Ole André Vadla Ravnås 2011-01-10 13:15:50 UTC
(In reply to comment #4)
> I've come accross the same problem and proposed the same solution. That said, I
> think the best solution is to change GstPad to do that for us.
> 
> *** This bug has been marked as a duplicate of bug 631580 ***

Missed out on that bug -- thanks! The only immediate downside I can see with changing GstPad is that it would potentially result in a few extra ref/unrefs for the (few) callbacks that don't need the parent. But on the upside it would make it possible to combine the two consecutive GST_PAD_LOCK()/GST_PAD_UNLOCK()s into one. So I'm leaning towards changing GstPad to just do this for us.

Thoughts, anyone?