GStreamer Plugin Writer's Guide (0.10.10) | ||
---|---|---|
Prev | Chapter 24. Things to check when writing an element | Next |
All elements to which it applies (sources, sinks, demuxers) should implement query functions on their pads, so that applications and neighbour elements can request the current position, the stream length (if known) and so on.
Elements should make sure they forward events they do not handle with gst_pad_event_default (pad, event) instead of just dropping them. Events should never be dropped unless specifically intended.
Elements should make sure they forward queries they do not handle with gst_pad_query_default (pad, query) instead of just dropping them.
Elements should use gst_pad_get_parent() in event and query functions, so that they hold a reference to the element while they are operating. Note that gst_pad_get_parent() increases the reference count of the element, so you must be very careful to call gst_object_unref (element) before returning from your query or event function, otherwise you will leak memory.