![]() |
![]() |
![]() |
GStreamer 0.9 Core Reference Manual | ![]() |
---|
GstBaseSinkGstBaseSink — Base class for sink elements |
#include <gst/base/gstbasesink.h> GstBaseSink; #define GST_BASE_SINK_PAD (obj)
GObject +----GstObject +----GstElement +----GstBaseSink +----GstFakeSink +----GstFileSink
GstBaseSink is the base class for sink elements in GStreamer, such as xvimagesink or filesink. It is a layer on top of GstElement that provides a simplified interface to plugin writers. GstBaseSink handles many details for you, for example preroll, clock synchronization, state changes, activation in push or pull mode, and queries. In most cases, when writing sink elements, there is no need to implement class methods from GstElement or to set functions on pads, because the GstBaseSink infrastructure is sufficient.
There is only support in GstBaseSink for one sink pad, which should be named "sink". A sink implementation (subclass of GstBaseSink) should install a pad template in its base_init function, like so:
static void my_element_base_init (gpointer g_class) { GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class); // sinktemplate should be a GstStaticPadTemplate with direction // GST_PAD_SINK and name "sink" gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&sinktemplate)); // see GstElementDetails gst_element_class_set_details (gstelement_class, &details); }
The one method which all subclasses of GstBaseSink must implement is GstBaseSink::render. This method will be called...
preroll()
event()
: mostly useful for file-like sinks (seeking or flushing)
get_caps/set_caps/buffer_alloc
start/stop for resource allocation
unlock if you block on an fd, for example
get_times i'm sure is for something :P
provide example of textsink
admonishment not to try to implement your own sink with prerolling...
extending via subclassing, setting pad functions, gstelement vmethods.
#define GST_BASE_SINK_PAD(obj) (GST_BASE_SINK_CAST (obj)->sinkpad)
Gives the pointer to the GstPad object of the element.
obj : |
base sink instance |
preroll-queue-len
" property"preroll-queue-len" guint : Read / Write / Construct
Number of buffers to queue during preroll.
Default value: 0
<< GstBaseSrc | GstBaseTransform >> |