GstBuffer send via g_signal_emit_by_name()

Sebastian Dröge sebastian at centricular.com
Fri Oct 26 08:19:33 UTC 2018


On Wed, 2018-10-24 at 15:08 +0000, Martin Vachovski wrote:
> 
> The question is: is the above idiomatic use legit (i.e. is
> the g_signal_emit_by_name increases the refcount of the buffer)
> or the above construction is illegal and I must switch to using
> gst_app_src_push_buffer() instead?

That's correct. Signal emission never takes ownership of the parameters
but instead increases the reference count internally. You need to unref
your buffer after signal emission in one way or another when it's no
longer needed by your code.

It is generally a better idea to use gst_app_src_push_buffer() for that
reason, as that would allow the buffer to have a reference count of 1
and thus be writable for elements in your pipeline without first
requiring a copy.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20181026/05a223e8/attachment-0001.sig>


More information about the gstreamer-devel mailing list