Logo Search packages:      
Sourcecode: qt-gstreamer version File versions  Download package

Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends

QGst::Utils::ApplicationSink Class Reference

Helper class for using a GstAppSink. More...

#include <QGst/Utils/ApplicationSink>

Inheritance diagram for QGst::Utils::ApplicationSink:
Inheritance graph
[legend]

List of all members.

Public Member Functions

GstAppSink * appSink ()
CapsPtr caps () const
bool dropEnabled () const
ElementPtr element () const
void enableDrop (bool enable)
bool isEos () const
void lazyConstruct (ApplicationSink *self)
uint maxBuffers () const
BufferPtr pullBuffer ()
BufferListPtr pullBufferList ()
BufferPtr pullPreroll ()
void setCallbacks (ApplicationSink *self)
void setCaps (const CapsPtr &caps)
void setElement (const ElementPtr &appsink)
void setMaxBuffers (uint maxbuffers)

Public Attributes

ElementPtr m_appsink

Protected Member Functions

virtual void eos ()
virtual FlowReturn newBuffer ()
virtual FlowReturn newBufferList ()
virtual FlowReturn newPreroll ()

Private Member Functions

virtual void reservedVirtual1 ()
virtual void reservedVirtual2 ()
virtual void reservedVirtual3 ()

Static Private Member Functions

static void eos (GstAppSink *sink, gpointer user_data)
static void eos_noop (GstAppSink *, gpointer)
static GstFlowReturn new_buffer (GstAppSink *sink, gpointer user_data)
static GstFlowReturn new_buffer_list (GstAppSink *sink, gpointer user_data)
static GstFlowReturn new_buffer_list_noop (GstAppSink *, gpointer)
static GstFlowReturn new_buffer_noop (GstAppSink *, gpointer)
static GstFlowReturn new_preroll (GstAppSink *sink, gpointer user_data)
static GstFlowReturn new_preroll_noop (GstAppSink *, gpointer)

Private Attributes

Priv *const d

Friends

struct Priv

Detailed Description

Helper class for using a GstAppSink.

Appsink is a sink plugin that supports many different methods for making the application get a handle on the GStreamer data in a pipeline. Unlike most GStreamer elements, appsink provides external API functions. This class exports those API functions in the bindings and makes it easy to implement a custom sink.

The normal way of retrieving buffers from appsink is by using the pullBuffer() and pullPreroll() methods. These methods block until a buffer becomes available in the sink or when the sink is shut down or reaches EOS.

Appsink will internally use a queue to collect buffers from the streaming thread. If the application is not pulling buffers fast enough, this queue will consume a lot of memory over time. setMaxBuffers() can be used to limit the queue size. enableDrop() controls whether the streaming thread blocks or if older buffers are dropped when the maximum queue size is reached. Note that blocking the streaming thread can negatively affect real-time performance and should be avoided.

If a blocking behaviour is not desirable, you can subclass this class and implement the newPreroll(), newBuffer() and newBufferList() which will be called to notify you when a new buffer is available.

setCaps() can be used to control the formats that appsink can receive. This property can contain non-fixed caps. The format of the pulled buffers can be obtained by getting the buffer caps.

If one of the pullPreroll() or pullBuffer() methods return NULL, the appsink is stopped or in the EOS state. You can check for the EOS state with isEos(). The eos() virtual method can also be reimplemented to be informed when the EOS state is reached to avoid polling.

The actuall appsink element can be retrieved with element() and set with setElement(). It is not necessary to set an appsink, as this class will create one as soon as it is needed.

Note:
It is not necessary to use this class in order to use GstAppSink. GstAppSink also provides signals and properties that fully substitute the functionality of this class.
See also:
ApplicationSource

Definition at line 23 of file applicationsink.cpp.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index