[gst-devel] Question on reference handling of GstEvents

Tim Müller t.i.m at zen.co.uk
Thu Jan 3 10:53:34 CET 2008


On Wed, 2008-01-02 at 22:33 -0500, José Alburquerque wrote:

Hi Jose,

> As I understand it, the gst_element_send_event() function 
> takes "ownership" of the GstEvent and, as the docs say, it is necessary 
> to "reference" it if a copy of the GstEvent is wanted.  My question is:  
> In general, do all functions taking GstEvents take "ownership" of 
> GstEvents this way?

No, see e.g. gst_event_parse_*().

>   The only real function I have found that accepts a 
> GstEvent is the one I just mentioned.  Are there others?

Yes, e.g. gst_pad_{push|send}_event(), gst_pad_event_default().

> I'm trying to decide how to handle the referencing of GstEvents in the
>  bindings so I'm trying to get a sense of what happens with GstEvents. 
>  Any help will be greatly appreciated.

Generally, all functions that push or send events or buffers to another
pad or an element take ownership of that event or buffer.  Others do
usually not (with exceptions such as gst_adapter_push()).  This only
applies to events and buffers, but not for example queries, where the
called function never takes ownership (IIRC).

Cheers
 -Tim






More information about the gstreamer-devel mailing list