GstBuffer send via g_signal_emit_by_name()
Martin Vachovski
Martin.Vachovski at skytek.com
Tue Oct 30 09:29:38 UTC 2018
Thanks Sebastian,
Bet Regards
Martin
________________________________________
From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> on behalf of Sebastian Dröge <sebastian at centricular.com>
Sent: Friday, October 26, 2018 9:19 AM
To: Discussion of the development of and with GStreamer
Subject: Re: GstBuffer send via g_signal_emit_by_name()
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
More information about the gstreamer-devel
mailing list