QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
QGst::Bin Class Reference

#include <QGst/Bin>

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

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 ()
 
- Public Member Functions inherited from QGst::Element
State currentState () const
 
State pendingState () const
 
StateChangeReturn getState (State *state, State *pending, ClockTime timeout) const
 
StateChangeReturn setState (State state)
 
bool syncStateWithParent ()
 
bool stateIsLocked () const
 
bool setStateLocked (bool locked)
 
bool addPad (const PadPtr &pad)
 
bool removePad (const PadPtr &pad)
 
PadPtr getStaticPad (const char *name)
 
PadPtr getRequestPad (const char *name)
 
void releaseRequestPad (const PadPtr &pad)
 
ClockPtr clock () const
 
bool setClock (const ClockPtr &clock)
 
bool link (const char *srcPadName, const ElementPtr &dest, const char *sinkPadName, const CapsPtr &filter=CapsPtr())
 
bool link (const char *srcPadName, const ElementPtr &dest, const CapsPtr &filter=CapsPtr())
 
bool link (const ElementPtr &dest, const char *sinkPadName, const CapsPtr &filter=CapsPtr())
 
bool link (const ElementPtr &dest, const CapsPtr &filter=CapsPtr())
 
void unlink (const char *srcPadName, const ElementPtr &dest, const char *sinkPadName)
 
void unlink (const ElementPtr &dest)
 
bool query (const QueryPtr &query)
 
bool sendEvent (const EventPtr &event)
 
bool seek (Format format, SeekFlags flags, quint64 position)
 
- Public Member Functions inherited from QGst::Object
QString name () const
 
bool setName (const char *name)
 
ObjectPtr parent () const
 
bool setParent (const ObjectPtr &parent)
 
void unparent ()
 
bool isAncestorOf (const ObjectPtr &object) const
 
QString pathString () const
 
- Public Member Functions inherited from QGlib::ObjectBase
ParamSpecPtr findProperty (const char *name) const
 
QList< ParamSpecPtrlistProperties () const
 
Value property (const char *name) const
 
template<class T >
void setProperty (const char *name, const T &value)
 
void setProperty (const char *name, const Value &value)
 
void * data (const char *key) const
 
void * stealData (const char *key) const
 
void setData (const char *key, void *data, void(*destroyCallback)(void *)=NULL)
 
void * quarkData (const Quark &quark) const
 
void * stealQuarkData (const Quark &quark) const
 
void setQuarkData (const Quark &quark, void *data, void(*destroyCallback)(void *)=NULL)
 
- Public Member Functions inherited from QGst::ChildProxy
uint childrenCount () const
 
QGlib::ObjectPtr childByName (const char *name) const
 
QGlib::ObjectPtr childByIndex (uint index) const
 
bool findChildProperty (const char *name, QGlib::ObjectPtr *object, QGlib::ParamSpecPtr *paramSpec) const
 
QGlib::Value childProperty (const char *name) const
 
template<typename T >
void setChildProperty (const char *name, const T &value)
 

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)
 
- Static Public Member Functions inherited from QGst::Element
template<typename First , typename Second , typename Third , typename... Rest>
static bool linkMany (const First &first, const Second &second, const Third &third, const Rest &...rest)
 
template<typename First , typename Second , typename Third , typename... Rest>
static void unlinkMany (const First &first, const Second &second, const Third &third, const Rest &...rest)
 

Additional Inherited Members

- Protected Member Functions inherited from QGst::Object
virtual void ref (bool increaseRef)
 
virtual void unref ()
 
- Protected Member Functions inherited from QGlib::RefCountedObject
template<class T >
T * object () const
 
- Protected Attributes inherited from QGlib::RefCountedObject
void * m_object
 

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

Definition at line 25 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 35 of file bin.cpp.

BinPtr QGst::Bin::fromDescription ( const QString &  description,
BinFromDescriptionOption  ghostUnlinkedPads = Ghost 
)
inlinestatic

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 49 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 54 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 59 of file bin.cpp.

ElementPtr QGst::Bin::getElementByInterface ( QGlib::Type  interfaceType) const

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

Definition at line 75 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::VideoOverlayPtr videooverlay = bin->getElementByInterface<QGst::VideoOverlay>();

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 80 of file bin.cpp.


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