GStreamer does not give up her secrets very easily :-)
Tim Müller
tim at centricular.com
Fri Feb 12 10:40:03 UTC 2016
On Thu, 2016-02-11 at 18:10 -0800, Andres Gonzalez wrote:
Hi Andres,
> then I call:
>
> tReturnCode =
> gst_app_src_push_buffer(GST_APP_SRC(m_pPipelineData->pvideo_appsrc),
> pVideoBuffer);
> gst_buffer_unref(pVideoBuffer);
>
> The documentation for gst_app_src_push_buffer() says: "This function
> takes ownership of the buffer" so I am calling gst_buffer_unref()
> since its reference was bumped up by gst_app_src_push_buffer().
>
> However, the buffer is still writable after the call to
> gst_app_src_push_buffer() so the reference count was not
> incremented.
I think you misunderstood what this means.
"Takes ownership" means that before the _push() you owned the buffer
reference (meaning you were responsible for freeing it), after the
_push() the appsrc owns the ref to the buffer (and is responsible for
freeing it), meaning that you must no longer free it or use it, since
it's not yours any longer. (You can take an additional ref before
pushing to hold on to it if you like of course).
Cheers
-Tim
--
Tim Müller, Centricular Ltd - http://www.centricular.com
More information about the gstreamer-devel
mailing list