Sets our main struct and passes it to the parent class.
Creates a new bin with the given name.
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.
Adds a list of elements to a bin. This function is equivalent to calling add() for each member of the list. The return value of each add() is ignored.
Will be emitted after the element was added to sub_bin.
Will be emitted after the element was removed from sub_bin.
Will be emitted when the bin needs to perform latency calculations. This signal is only emitted for toplevel bins or when async-handling is enabled.
Will be emitted after the element was added to the bin.
Will be emitted after the element was removed from the bin.
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 NULL otherwise. If a pad is found, the caller owns a reference to it and should use gst_object_unref() on the pad when it is not needed any longer.
Get the main Gtk struct
Looks for an element inside the bin that implements the given interface. If such an element is found, it returns the element. You can cast this element to the given interface afterwards. If you want all elements that implement the interface, use Bin.iterateAllByInterface. This function recurses into child bins.
Gets the element with the given name from a bin. This function recurses into child bins.
Gets the element with the given name from this bin. If the element is not found, a recursion is performed on the parent bin.
the main Gtk struct as a void*
Return the suppressed flags of the bin.
Looks for all elements inside the bin that implements the given interface. You can safely cast all returned elements to the given interface. The function recurses inside child bins. The iterator will yield a series of gstreamer.Element that should be unreffed after use.
Gets an iterator for the elements in this bin.
Gets an iterator for the elements in this bin. This iterator recurses into GstBin children.
Gets an iterator for all elements in the bin that have the GST_ELEMENT_FLAG_SINK flag set.
Gets an iterator for the elements in this bin in topologically sorted order. This means that the elements are returned from the most downstream elements (sinks) to the sources.
Gets an iterator for all elements in the bin that have the GST_ELEMENT_FLAG_SOURCE flag set.
Query bin for the current latency using and reconfigures this latency to all the elements with a LATENCY event.
Removes the element from the bin, unparenting it as well. Unparenting the element means that the element will be dereferenced, so if the bin holds the only reference to the element, the element will be freed in the process of removing it from the bin. If you want the element to still exist after removing, you need to call gst_object_ref() before removing it from the bin.
Remove a list of elements from a bin. This function is equivalent to calling remove() with each member of the list.
Suppress the given flags on the bin. GstElementFlags of a child element are propagated when it is added to the bin. When suppressed flags are set, those specified flags will not be propagated to the bin.
Synchronizes the state of every child of bin with the state of bin. See also Element.syncStateWithParent.
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
Queries an element for the stream position. This is a convenience function for gstreamerD.
Queries an element for the stream duration. This is a convenience function for gstreamerD.
This set's the filename for a filesrc element.
Set the caps property of an Element.
For your convenience in gstreamerD: you can seek to the position of the pipeline measured in time_nanoseconds.
Get's all the pads from an element in a Pad[].
Creates an element for handling the given URI.
Create a new elementfactory capable of instantiating objects of the type and add the factory to plugin.
Gets a string representing the given state change result.
Gets a string representing the given state.
Abort the state change of the element. This function is used by elements that do asynchronous state changes and find out something is wrong.
Adds a pad (link point) to element. pad's parent will be set to element; see gst_object_set_parent() for refcounting information.
Calls func from another thread and passes user_data to it. This is to be used for cases when a state change has to be performed from a streaming thread, directly via Element.setState or indirectly e.g. via SEEK events.
Perform transition on element.
Commit the state change of the element and proceed to the next pending state if any. This function is used by elements that do asynchronous state changes. The core will normally call this method automatically when an element returned GST_STATE_CHANGE_SUCCESS from the state change function.
Creates a pad for each pad template that is always available. This function is only useful during object initialization of subclasses of gstreamer.Element
Call func with user_data for each of element's pads. func will be called exactly once for each pad that exists at the time of this call, unless one of the calls to func returns FALSE in which case we will stop iterating pads and return early. If new pads are added or pads are removed while pads are being iterated, this will not be taken into account until next time this function is used.
Call func with user_data for each of element's sink pads. func will be called exactly once for each sink pad that exists at the time of this call, unless one of the calls to func returns FALSE in which case we will stop iterating pads and return early. If new sink pads are added or sink pads are removed while the sink pads are being iterated, this will not be taken into account until next time this function is used.
Call func with user_data for each of element's source pads. func will be called exactly once for each source pad that exists at the time of this call, unless one of the calls to func returns FALSE in which case we will stop iterating pads and return early. If new source pads are added or source pads are removed while the source pads are being iterated, this will not be taken into account until next time this function is used.
Returns the base time of the element. The base time is the absolute time of the clock when this element was last put to PLAYING. Subtracting the base time from the clock time gives the running time of the element.
Returns the bus of the element. Note that only a gstreamer.Pipeline will provide a bus for the application.
Gets the currently configured clock of the element. This is the clock as was last set with Element.setClock.
Looks for an unlinked pad to which the given pad can link. It is not guaranteed that linking the pads will work, though it should work in most cases.
Retrieves a pad template from element that is compatible with compattempl. Pads from compatible templates can be linked together.
Gets the context with context_type set on the element or NULL.
Gets the context with context_type set on the element or NULL.
Gets the contexts set on the element.
Retrieves the factory that was used to create this element.
Get metadata with key in klass.
Retrieves a padtemplate from element with the given name.
Retrieves a list of the pad templates associated with element. The list must not be modified by the calling code.
Retrieves a pad from the element by name (e.g. "src_\d"). This version only retrieves request pads. The pad should be released with Element.releaseRequestPad.
Returns the start time of the element. The start time is the running time of the clock when this element was last put to PAUSED.
Gets the state of the element.
Retrieves a pad from element by name. This version only retrieves already-existing (i.e. 'static') pads.
Checks if the state of an element is locked. If the state of an element is locked, state changes of the parent don't affect the element. This way you can leave currently unused elements inside bins. Just lock their state before changing the state from GST_STATE_NULL
Retrieves an iterator of element's pads. The iterator should be freed after usage. Also more specialized iterators exists such as Element.iterateSrcPads or Element.iterateSinkPads.
Retrieves an iterator of element's sink pads.
Retrieves an iterator of element's source pads.
Links src to dest. The link must be from source to destination; the other direction will not be tried. The function looks for existing pads that aren't linked yet. It will request new pads if necessary. Such pads need to be released manually when unlinking. If multiple links are possible, only one is established.
Links src to dest using the given caps as filtercaps. The link must be from source to destination; the other direction will not be tried. The function looks for existing pads that aren't linked yet. It will request new pads if necessary. If multiple links are possible, only one is established.
Links the two named pads of the source and destination elements. Side effect is that if one of the pads has no parent, it becomes a child of the parent of the other element. If they have different parents, the link fails.
Links the two named pads of the source and destination elements. Side effect is that if one of the pads has no parent, it becomes a child of the parent of the other element. If they have different parents, the link fails. If caps is not NULL, makes sure that the caps of the link is a subset of caps.
Links the two named pads of the source and destination elements. Side effect is that if one of the pads has no parent, it becomes a child of the parent of the other element. If they have different parents, the link fails.
Brings the element to the lost state. The current state of the element is copied to the pending state so that any call to Element.getState will return GST_STATE_CHANGE_ASYNC.
Post an error, warning or info message on the bus from inside an element.
Post an error, warning or info message on the bus from inside an element.
Use this function to signal that the element does not expect any more pads to show up in the current pipeline. This function should be called whenever pads have been added by the element itself. Elements with GST_PAD_SOMETIMES pad templates use this in combination with autopluggers to figure out that the element is done initializing its pads.
Post a message on the element's gstreamer.Bus This function takes ownership of the message; if you want to access the message after this call, you should add an additional reference before calling.
Get the clock provided by the given element. > An element is only required to provide a clock in the PAUSED > state. Some elements can provide a clock in other states.
Performs a query on the given element.
Queries an element to convert src_val in src_format to dest_format.
Queries an element (usually top-level pipeline or playbin element) for the total stream duration in nanoseconds. This query will only work once the pipeline is prerolled (i.e. reached PAUSED or PLAYING state). The application will receive an ASYNC_DONE message on the pipeline bus when that is the case.
Queries an element (usually top-level pipeline or playbin element) for the stream position in nanoseconds. This will be a value between 0 and the stream duration (if the stream duration is known). This query will usually only work once the pipeline is prerolled (i.e. reached PAUSED or PLAYING state). The application will receive an ASYNC_DONE message on the pipeline bus when that is the case.
Makes the element free the previously requested pad as obtained with Element.requestPad.
Removes pad from element. pad will be destroyed if it has not been referenced elsewhere using gst_object_unparent().
Retrieves a request pad from the element according to the provided template. Pad templates can be looked up using Element.factoryGetStaticPadTemplates.
Sends a seek event to an element. See Event.newSeek for the details of the parameters. The seek event is sent to the element using Element.sendEvent.
Simple API to perform a seek on the given element, meaning it just seeks to the given position relative to the start of the stream. For more complex operations like segment seeks (e.g. for looping) or changing the playback rate or seeking relative to the last configured playback segment you should use Element.seek.
Sends an event to an element. If the element doesn't implement an event handler, the event will be pushed on a random linked sink pad for downstream events or a random linked source pad for upstream events.
Set the base time of an element. See Element.getBaseTime.
Sets the bus of the element. Increases the refcount on the bus. For internal use only, unless you're testing elements.
Sets the clock for the element. This function increases the refcount on the clock. Any previously set clock on the object is unreffed.
Sets the context of the element. Increases the refcount of the context.
Locks the state of an element, so state changes of the parent don't affect this element anymore.
Set the start time of an element. The start time of the element is the running time of the element when it last went to the PAUSED state. In READY or after a flushing seek, it is set to 0.
Sets the state of the element. This function will try to set the requested state by going through all the intermediary states and calling the class's state change function for each.
Tries to change the state of the element to the same as its parent. If this function returns FALSE, the state of element is undefined.
Unlinks all source pads of the source element with all sink pads of the sink element to which they are linked.
Unlinks the two named pads of the source and destination elements.
This signals that the element will not generate more dynamic pads. Note that this signal will usually be emitted from the context of the streaming thread.
a new gstreamer.Pad has been added to the element. Note that this signal will usually be emitted from the context of the streaming thread. Also keep in mind that if you add new elements to the pipeline in the signal handler you will need to set them to the desired target state with Element.setState or Element.syncStateWithParent.
a gstreamer.Pad has been removed from the element
Get the main Gtk struct
the main Gtk struct as a void*
Emits the "child-added" signal.
Emits the "child-removed" signal.
Fetches a child by its number.
Looks up a child element by the given name.
Gets the number of child objects this parent contains.
Gets a single property using the GstChildProxy mechanism. You are responsible for freeing it by calling Value.unset
Gets properties of the parent object and its children.
Looks up which object and gobject.ParamSpec would be effected by the given name.
Sets a single property using the GstChildProxy mechanism.
Sets properties of the parent object and its children.
Will be emitted after the object was added to the child_proxy.
Will be emitted after the object was removed from the child_proxy.
gstreamer.Bin is an element that can contain other gstreamer.Element, allowing them to be managed as a group. Pads from the child elements can be ghosted to the bin, see gstreamer.GhostPad This makes the bin look like any other elements and enables creation of higher-level abstraction elements.
A new gstreamer.Bin is created with Bin.new. Use a gstreamer.Pipeline instead if you want to create a toplevel bin because a normal bin doesn't have a bus or handle clock distribution of its own.
After the bin has been created you will typically add elements to it with Bin.add. You can remove elements with Bin.remove.
An element can be retrieved from a bin with Bin.getByName, using the elements name. Bin.getByNameRecurseUp is mainly used for internal purposes and will query the parent bins when the element is not found in the current bin.
An iterator of elements in a bin can be retrieved with Bin.iterateElements. Various other iterators exist to retrieve the elements in a bin.
gst_object_unref() is used to drop your reference to the bin.
The element-added signal is fired whenever a new element is added to the bin. Likewise the element-removed signal is fired whenever an element is removed from the bin.
Notes
A gstreamer.Bin internally intercepts every gstreamer.Message posted by its children and implements the following default behaviour for each of them:
* GST_MESSAGE_EOS: This message is only posted by sinks in the PLAYING state. If all sinks posted the EOS message, this bin will post and EOS message upwards.
* GST_MESSAGE_SEGMENT_START: Just collected and never forwarded upwards. The messages are used to decide when all elements have completed playback of their segment.
* GST_MESSAGE_SEGMENT_DONE: Is posted by gstreamer.Bin when all elements that posted a SEGMENT_START have posted a SEGMENT_DONE.
* GST_MESSAGE_DURATION_CHANGED: Is posted by an element that detected a change in the stream duration. The default bin behaviour is to clear any cached duration values so that the next duration query will perform a full duration recalculation. The duration change is posted to the application so that it can refetch the new duration with a duration query. Note that these messages can be posted before the bin is prerolled, in which case the duration query might fail.
* GST_MESSAGE_CLOCK_LOST: This message is posted by an element when it can no longer provide a clock. The default bin behaviour is to check if the lost clock was the one provided by the bin. If so and the bin is currently in the PLAYING state, the message is forwarded to the bin parent. This message is also generated when a clock provider is removed from the bin. If this message is received by the application, it should PAUSE the pipeline and set it back to PLAYING to force a new clock distribution.
* GST_MESSAGE_CLOCK_PROVIDE: This message is generated when an element can provide a clock. This mostly happens when a new clock provider is added to the bin. The default behaviour of the bin is to mark the currently selected clock as dirty, which will perform a clock recalculation the next time the bin is asked to provide a clock. This message is never sent tot the application but is forwarded to the parent of the bin.
* OTHERS: posted upwards.
A gstreamer.Bin implements the following default behaviour for answering to a gstreamer.Query.get
* GST_QUERY_DURATION:If the query has been asked before with the same format and the bin is a toplevel bin (ie. has no parent), use the cached previous value. If no previous value was cached, the query is sent to all sink elements in the bin and the MAXIMUM of all values is returned. If the bin is a toplevel bin the value is cached. If no sinks are available in the bin, the query fails.
* GST_QUERY_POSITION:The query is sent to all sink elements in the bin and the MAXIMUM of all values is returned. If no sinks are available in the bin, the query fails.
* OTHERS:the query is forwarded to all sink elements, the result of the first sink that answers the query successfully is returned. If no sink is in the bin, the query fails.
A gstreamer.Bin will by default forward any event sent to it to all sink (GST_EVENT_TYPE_DOWNSTREAM) or source (GST_EVENT_TYPE_UPSTREAM) elements depending on the event type. If all the elements return TRUE, the bin will also return TRUE, else FALSE is returned. If no elements of the required type are in the bin, the event handler will return TRUE.