GStreamer does not give up her secrets very easily :-)
Andres Gonzalez
andres.agoralabs at gmail.com
Fri Feb 12 17:18:59 UTC 2016
Wow, I am really screwed up because what I am observing is not consistent
with my interpretation of what you are explaining--so I still must be using
the GStreamer API incorrectly.
If the _push() takes ownership of the buffer, then I do NOT call
gst_buffer_unref() after I call the _push() because it now has ownership of
the buffer. Then I should expect the GDestroyNotify routine to be called
when the pipeline is done with that individual buffer. However, it is never
called at all during normal processing. The pipeline appears to be operating
correctly, in that no bus errors occur, all state transitions appear normal,
and I am indeed receiving the RTP stream on another local host and
displaying the video correctly (which has frame number and stream time
overlays). But the GDestroyNotify routine is never called during normal
processing.
Then when my application exits, I first call:
gst_element_set_state(m_pGstPipeline, GST_STATE_READY);
when the pipeline transitions from PLAYING to PAUSED, the GDestroyNotify
routine is called hundreds of times, once for each video frame processed. My
interpretation of this, is that during normal video processing, none of the
elements in the pipeline freed the buffer because the reference count NEVER
reached 0.
Question: Is my interpretation incorrect?
My reasoning is that if the reference count never reached 0, if I then call
gst_buffer_unref() on an old buffer (old enough to ensure that the buffer is
no longer in the pipeline), that should force a call to the GDestroyNotify
routine (assuming there is only 1 outstanding reference). During normal
operation, if I then explicitly try to unref an old buffer I get those
critical errors that I mentioned earlier.
My pipeline is this:
appsrc->queue->videorate->videoconvert->timeoverlay->textoverlay->vp8enc->rtpvp8pay->rtpbin->identity->udpsink
I will attach the png file.
<http://gstreamer-devel.966125.n4.nabble.com/file/n4675823/asdf.png>
Tim thank you for your patience with me on these basic concepts. I have been
studying glib reference counting this week trying to see where I am going
wrong, but I am still swimming in confusion. BTW, the 2nd chapter on
GObject in /The Official Gnome Developer's Guide/, by Matthias Warkus is an
excellent tutorial. After reading that I now understand the GStreamer source
much better. I checked out the source on decklinksink as per your suggestion
and it is very helpful.
-Andres
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/GStreamer-does-not-give-up-her-secrets-very-easily-tp4675807p4675823.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list