QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Static Public Member Functions
QGst::Bin Class Reference

#include <QGst/Bin>

Inheritance diagram for QGst::Bin:
Inheritance graph
[legend]
Collaboration diagram for QGst::Bin:
Collaboration graph
[legend]

List of all members.

Public Types

enum  BinFromDescriptionOption { NoGhost = 0, Ghost = 1 }
enum  RecursionType { RecurseDown, RecurseUp }

Public Member Functions

bool add (const ElementPtr &element)
template<typename First , typename Second , typename... Rest>
void add (const First &first, const Second &second, const Rest &...rest)
bool remove (const ElementPtr &element)
ElementPtr getElementByName (const char *name, RecursionType recursionType=RecurseDown) const
ElementPtr getElementByInterface (QGlib::Type interfaceType) const
template<typename T >
QGlib::RefPointer< T > getElementByInterface () const
PadPtr findUnlinkedPad (PadDirection direction) const
bool recalculateLatency ()

Static Public Member Functions

static BinPtr create (const char *name=NULL)
static BinPtr fromDescription (const char *description, BinFromDescriptionOption ghostUnlinkedPads=Ghost)
static BinPtr fromDescription (const QString &description, BinFromDescriptionOption ghostUnlinkedPads=Ghost)

Detailed Description

Wrapper class for GstBin.

Bin is an element that can contain other Elements, allowing them to be managed as a group. Pads from the child elements can be ghosted to the bin, see GhostPad. This makes the bin look like any other elements and enables creation of higher-level abstraction elements.

For more information refer to GStreamer's C API documentation.

Definition at line 45 of file bin.h.


Member Enumeration Documentation

See also:
fromDescription()
Enumerator:
NoGhost 

Do not create ghost pads.

Ghost 

Create ghost pads.

Definition at line 53 of file bin.h.

This enum is used with getElementByName() to specify where to look for elements if an element is not found as a direct child of this Bin.

Enumerator:
RecurseDown 

Recurse down into child bins (if any)

RecurseUp 

Recurse down to child bins and if the element is not found there as well, recurse up the hierarchy to the parent bins (if any) and their children.

Definition at line 132 of file bin.h.


Member Function Documentation

BinPtr QGst::Bin::create ( const char *  name = NULL) [static]

Creates a new Bin with the specified name

Reimplemented in QGst::Pipeline.

Definition at line 26 of file bin.cpp.

BinPtr QGst::Bin::fromDescription ( const char *  description,
BinFromDescriptionOption  ghostUnlinkedPads = Ghost 
) [static]

Creates a new Bin from a bin description. The description's syntax is the same as the one used in the gst-launch tool. If ghostUnlinkedPads is set to Ghost, Ghost pads on the bin for unlinked source or sink pads within the bin can automatically be created (but only a maximum of one ghost pad for each direction will be created; if you expect multiple unlinked source pads or multiple unlinked sink pads and want them all ghosted, you will have to create the ghost pads yourself)

Exceptions:
QGlib::Errorwhen there was a problem creating the pipeline
Examples:
examples/recorder/main.cpp, and examples/voip/main.cpp.

Definition at line 36 of file bin.cpp.

BinPtr QGst::Bin::fromDescription ( const QString &  description,
BinFromDescriptionOption  ghostUnlinkedPads = Ghost 
) [inline, static]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 168 of file bin.h.

bool QGst::Bin::add ( const ElementPtr element)

Adds the given element to the bin. Sets the element's parent, and thus takes ownership of the element. An element can only be added to one bin.

If the element's pads are linked to other pads, the pads will be unlinked before the element is added to the bin.

Definition at line 50 of file bin.cpp.

template<typename First , typename Second , typename... Rest>
void QGst::Bin::add ( const First &  first,
const Second &  second,
const Rest &...  rest 
) [inline]

Adds two or more elements to the bin. This function is equivalent to calling add() for each of the elements. The return value of each add() is ignored.

Note:
This function makes use of C++0x features. If your compiler doesn't support this, a different version will be compiled. That version supports up to QGST_BIN_ADD_MAX_ARGS arguments, which defaults to 10. If you need more, define this to a greater value before including any QtGStreamer headers.

Definition at line 96 of file bin.h.

bool QGst::Bin::remove ( const ElementPtr element)

Removes the element from the bin, unparenting it as well.

If the element's pads are linked to other pads, the pads will be unlinked before the element is removed from the bin.

Definition at line 55 of file bin.cpp.

ElementPtr QGst::Bin::getElementByName ( const char *  name,
RecursionType  recursionType = RecurseDown 
) const

Gets the element with the given name from a bin. Returns a null ElementPtr if the element is not found.

By default, this function also recurses into child bins. If recursionType is set to RecurseUp, it will also search parent bins (if any) and their children.

Definition at line 60 of file bin.cpp.

Returns an element inside the bin that implements the given interface type.

Definition at line 76 of file bin.cpp.

template<typename T >
QGlib::RefPointer< T > QGst::Bin::getElementByInterface ( ) const

Looks for an element inside the bin that implements the given interface and returns it casted to the interface type. Example:

 QGst::XOverlayPtr xoverlay = bin->getElementByInterface<QGst::XOverlay>();

Definition at line 175 of file bin.h.

PadPtr QGst::Bin::findUnlinkedPad ( PadDirection  direction) const

Recursively looks for elements with an unlinked pad of the given direction within the specified bin and returns an unlinked pad if one is found, or a null PadPtr otherwise.

Definition at line 81 of file bin.cpp.


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