Package ch.bailu.gtk.gst
Klasse Bin
- Alle implementierten Schnittstellen:
PointerInterface
- Bekannte direkte Unterklassen:
Pipeline
#GstBin is an element that can contain other #GstElement, allowing them to be
managed as a group.
Pads from the child elements can be ghosted to the bin, see #GstGhostPad.
This makes the bin look like any other elements and enables creation of
higher-level abstraction elements.
A new #GstBin is created with gst_bin_new(). Use a #GstPipeline 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
gst_bin_add(). You can remove elements with gst_bin_remove().
An element can be retrieved from a bin with gst_bin_get_by_name(), using the
elements name. gst_bin_get_by_name_recurse_up() 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
gst_bin_iterate_elements(). Various other iterators exist to retrieve the
elements in a bin.
gst_object_unref() is used to drop your reference to the bin.
The #GstBin::element-added signal is fired whenever a new element is added to
the bin. Likewise the #GstBin::element-removed signal is fired whenever an
element is removed from the bin.
A #GstBin internally intercepts every #GstMessage 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 #GstBin 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 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.
Note also that there might be a discrepancy (due to internal buffering/queueing)
between the stream being currently displayed and the returned duration query.
Applications might want to also query for duration (and changes) by
listening to the %GST_MESSAGE_STREAM_START message, signaling the active start
of a (new) stream.
* %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 to the application but is forwarded to
the parent of the bin.
* OTHERS: posted upwards.
A #GstBin implements the following default behaviour for answering to a
#GstQuery:
* %GST_QUERY_DURATION: The bin will forward the query to all sink
elements contained within and will return the maximum value.
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 #GstBin will by default forward any event sent to it to all sink
( %GST_EVENT_TYPE_UPSTREAM ) or source ( %GST_EVENT_TYPE_DOWNSTREAM ) 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.
managed as a group.
Pads from the child elements can be ghosted to the bin, see #GstGhostPad.
This makes the bin look like any other elements and enables creation of
higher-level abstraction elements.
A new #GstBin is created with gst_bin_new(). Use a #GstPipeline 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
gst_bin_add(). You can remove elements with gst_bin_remove().
An element can be retrieved from a bin with gst_bin_get_by_name(), using the
elements name. gst_bin_get_by_name_recurse_up() 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
gst_bin_iterate_elements(). Various other iterators exist to retrieve the
elements in a bin.
gst_object_unref() is used to drop your reference to the bin.
The #GstBin::element-added signal is fired whenever a new element is added to
the bin. Likewise the #GstBin::element-removed signal is fired whenever an
element is removed from the bin.
A #GstBin internally intercepts every #GstMessage 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 #GstBin 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 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.
Note also that there might be a discrepancy (due to internal buffering/queueing)
between the stream being currently displayed and the returned duration query.
Applications might want to also query for duration (and changes) by
listening to the %GST_MESSAGE_STREAM_START message, signaling the active start
of a (new) stream.
* %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 to the application but is forwarded to
the parent of the bin.
* OTHERS: posted upwards.
A #GstBin implements the following default behaviour for answering to a
#GstQuery:
* %GST_QUERY_DURATION: The bin will forward the query to all sink
elements contained within and will return the maximum value.
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 #GstBin will by default forward any event sent to it to all sink
( %GST_EVENT_TYPE_UPSTREAM ) or source ( %GST_EVENT_TYPE_DOWNSTREAM ) 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.
https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
static interface
static interface
static interface
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gst.Element
Element.OnDestroyNotify, Element.OnElementCallAsyncFunc, Element.OnElementForeachPadFunc, Element.OnNoMorePads, Element.OnPadAdded, Element.OnPadRemoved
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final String
static final String
static final String
static final String
static final String
Von Klasse geerbte Felder ch.bailu.gtk.gst.Element
SIGNAL_ON_NO_MORE_PADS, SIGNAL_ON_PAD_ADDED, SIGNAL_ON_PAD_REMOVED
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
Adds the given element to the bin.void
Adds a %NULL-terminated list of elements to a bin.Implements interfaceChildProxy
.findUnlinkedPad
(int direction) 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.getByInterface
(long iface) Looks for an element inside the bin that implements the given
interface.Gets the element with the given name from a bin.Gets the element with the given name from a bin.getByNameRecurseUp
(Str name) Gets the element with the given name from this bin.getByNameRecurseUp
(String name) Gets the element with the given name from this bin.static ClassHandler
static int
static long
static TypeSystem.TypeSize
int
static long
static TypeSystem.TypeSize
iterateAllByElementFactoryName
(Str factory_name) Looks for all elements inside the bin with the given element factory name.iterateAllByElementFactoryName
(String factory_name) Looks for all elements inside the bin with the given element factory name.iterateAllByInterface
(long iface) Looks for all elements inside the bin that implements the given
interface.Gets an iterator for the elements in this bin.Gets an iterator for the elements in this bin.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.Gets an iterator for all elements in the bin that have the
#GST_ELEMENT_FLAG_SOURCE flag set.Connect to signal "deep-element-added".Connect to signal "deep-element-removed".onDoLatency
(Bin.OnDoLatency signal) Connect to signal "do-latency".onElementAdded
(Bin.OnElementAdded signal) Connect to signal "element-added".onElementRemoved
(Bin.OnElementRemoved signal) Connect to signal "element-removed".boolean
Queries @bin for the current latency and reconfigures this latency on all the
elements using a LATENCY event.boolean
Removes the element from the bin, unparenting it as well.void
removeMany
(Element element_1, Object... _ellipsis) Removes a list of elements from a bin.void
setSuppressedFlags
(int flags) Suppresses the given flags on the bin.boolean
Synchronizes the state of every child of @bin with the state
of @bin.Von Klasse geerbte Methoden ch.bailu.gtk.gst.Element
abortState, addPad, addPropertyDeepNotifyWatch, addPropertyDeepNotifyWatch, addPropertyNotifyWatch, addPropertyNotifyWatch, callAsync, changeState, continueState, createAllPads, decorateStreamId, decorateStreamId, decorateStreamIdPrintf, decorateStreamIdPrintf, foreachPad, foreachSinkPad, foreachSrcPad, getBaseTime, getBus, getClock, getCompatiblePad, getCompatiblePadTemplate, getContext, getContext, getContexts, getContextUnlocked, getContextUnlocked, getCurrentClockTime, getCurrentRunningTime, getFactory, getMetadata, getMetadata, getPadTemplate, getPadTemplate, getPadTemplateList, getRequestPad, getRequestPad, getStartTime, getState, getStaticPad, getStaticPad, isLockedState, iteratePads, iterateSinkPads, iterateSrcPads, link, linkFiltered, linkMany, linkPads, linkPads, linkPadsFiltered, linkPadsFiltered, linkPadsFull, linkPadsFull, lostState, makeFromUri, messageFull, messageFull, messageFullWithDetails, messageFullWithDetails, noMorePads, onNoMorePads, onPadAdded, onPadRemoved, postMessage, provideClock, query, register, releaseRequestPad, removePad, removePropertyNotifyWatch, requestPad, requestPad, requestPadSimple, requestPadSimple, seek, seekSimple, sendEvent, setBaseTime, setBus, setClock, setContext, setLockedState, setStartTime, setState, stateChangeReturnGetName, stateGetName, syncStateWithParent, typeSetSkipDocumentation, unlink, unlinkMany, unlinkPads, unlinkPads
Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_DEEP_ELEMENT_ADDED
- Siehe auch:
-
SIGNAL_ON_DEEP_ELEMENT_REMOVED
- Siehe auch:
-
SIGNAL_ON_DO_LATENCY
- Siehe auch:
-
SIGNAL_ON_ELEMENT_ADDED
- Siehe auch:
-
SIGNAL_ON_ELEMENT_REMOVED
- Siehe auch:
-
-
Konstruktordetails
-
Bin
-
Bin
Creates a new bin with the given name.- Parameter:
name
- the name of the new bin
-
Bin
Creates a new bin with the given name.- Parameter:
name
- the name of the new bin
-
-
Methodendetails
-
getClassHandler
-
add
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.
> When you add an element to an already-running pipeline, you will have to
> take care to set the state of the newly-added element to the desired
> state (usually PLAYING or PAUSED, same you set the pipeline to originally)
> with gst_element_set_state(), or use gst_element_sync_state_with_parent().
> The bin or pipeline will not take care of this for you.- Parameter:
element
- the #GstElement to add- Gibt zurück:
- %TRUE if the element could be added, %FALSE if the bin does not want to accept the element.
-
addMany
Adds a %NULL-terminated list of elements to a bin. This function is
equivalent to calling gst_bin_add() for each member of the list. The return
value of each gst_bin_add() is ignored.- Parameter:
element_1
- the #GstElement element to add to the bin_ellipsis
- additional elements to add to the bin
-
findUnlinkedPad
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.- Parameter:
direction
- whether to look for an unlinked source or sink pad- Gibt zurück:
- unlinked pad of the given direction.
-
getByInterface
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
gst_bin_iterate_all_by_interface(). This function recurses into child bins.- Parameter:
iface
- the #GType of an interface- Gibt zurück:
- A #GstElement inside the bin implementing the interface
-
getByName
Gets the element with the given name from a bin. This
function recurses into child bins.- Parameter:
name
- the element name to search for- Gibt zurück:
- the #GstElement with the given name
-
getByName
Gets the element with the given name from a bin. This
function recurses into child bins.- Parameter:
name
- the element name to search for- Gibt zurück:
- the #GstElement with the given name
-
getByNameRecurseUp
Gets the element with the given name from this bin. If the
element is not found, a recursion is performed on the parent bin.- Parameter:
name
- the element name to search for- Gibt zurück:
- the #GstElement with the given name
-
getByNameRecurseUp
Gets the element with the given name from this bin. If the
element is not found, a recursion is performed on the parent bin.- Parameter:
name
- the element name to search for- Gibt zurück:
- the #GstElement with the given name
-
getSuppressedFlags
public int getSuppressedFlags()- Gibt zurück:
- the bin's suppressed #GstElementFlags.
-
iterateAllByElementFactoryName
Looks for all elements inside the bin with the given element factory name.
The function recurses inside child bins. The iterator will yield a series of
#GstElement.- Parameter:
factory_name
- the name of the #GstElementFactory- Gibt zurück:
- a #GstIterator of #GstElement for all elements in the bin with the given element factory name
-
iterateAllByElementFactoryName
Looks for all elements inside the bin with the given element factory name.
The function recurses inside child bins. The iterator will yield a series of
#GstElement.- Parameter:
factory_name
- the name of the #GstElementFactory- Gibt zurück:
- a #GstIterator of #GstElement for all elements in the bin with the given element factory name
-
iterateAllByInterface
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 #GstElement.- Parameter:
iface
- the #GType of an interface- Gibt zurück:
- a #GstIterator of #GstElement for all elements in the bin implementing the given interface
-
iterateElements
Gets an iterator for the elements in this bin.- Gibt zurück:
- a #GstIterator of #GstElement
-
iterateRecurse
Gets an iterator for the elements in this bin.
This iterator recurses into GstBin children.- Gibt zurück:
- a #GstIterator of #GstElement
-
iterateSinks
Gets an iterator for all elements in the bin that have the
#GST_ELEMENT_FLAG_SINK flag set.- Gibt zurück:
- a #GstIterator of #GstElement
-
iterateSorted
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.
This function is used internally to perform the state changes
of the bin elements and for clock selection.- Gibt zurück:
- a #GstIterator of #GstElement
-
iterateSources
Gets an iterator for all elements in the bin that have the
#GST_ELEMENT_FLAG_SOURCE flag set.- Gibt zurück:
- a #GstIterator of #GstElement
-
recalculateLatency
public boolean recalculateLatency()Queries @bin for the current latency and reconfigures this latency on all the
elements using a LATENCY event.
This method is typically called on the pipeline when a #GST_MESSAGE_LATENCY
is posted on the bus.
This function simply emits the #GstBin::do-latency signal so any custom latency
calculations will be performed.- Gibt zurück:
- %TRUE if the latency could be queried and reconfigured.
-
remove
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.
If the element's pads are linked to other pads, the pads will be unlinked
before the element is removed from the bin.- Parameter:
element
- the #GstElement to remove- Gibt zurück:
- %TRUE if the element could be removed, %FALSE if the bin does not want to remove the element.
-
removeMany
Removes a list of elements from a bin. This function is equivalent
to calling gst_bin_remove() with each member of the list.- Parameter:
element_1
- the first #GstElement to remove from the bin_ellipsis
- %NULL-terminated list of elements to remove from the bin
-
setSuppressedFlags
public void setSuppressedFlags(int flags) Suppresses 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.- Parameter:
flags
- the #GstElementFlags to suppress
-
syncChildrenStates
public boolean syncChildrenStates()Synchronizes the state of every child of @bin with the state
of @bin. See also gst_element_sync_state_with_parent().- Gibt zurück:
- %TRUE if syncing the state was successful for all children, otherwise %FALSE.
-
onDeepElementAdded
Connect to signal "deep-element-added".
SeeBin.OnDeepElementAdded.onDeepElementAdded(ch.bailu.gtk.gst.Bin, ch.bailu.gtk.gst.Element)
for signal description.
FieldSIGNAL_ON_DEEP_ELEMENT_ADDED
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onDeepElementRemoved
Connect to signal "deep-element-removed".
SeeBin.OnDeepElementRemoved.onDeepElementRemoved(ch.bailu.gtk.gst.Bin, ch.bailu.gtk.gst.Element)
for signal description.
FieldSIGNAL_ON_DEEP_ELEMENT_REMOVED
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onDoLatency
Connect to signal "do-latency".
SeeBin.OnDoLatency.onDoLatency()
for signal description.
FieldSIGNAL_ON_DO_LATENCY
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onElementAdded
Connect to signal "element-added".
SeeBin.OnElementAdded.onElementAdded(ch.bailu.gtk.gst.Element)
for signal description.
FieldSIGNAL_ON_ELEMENT_ADDED
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onElementRemoved
Connect to signal "element-removed".
SeeBin.OnElementRemoved.onElementRemoved(ch.bailu.gtk.gst.Element)
for signal description.
FieldSIGNAL_ON_ELEMENT_REMOVED
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
asChildProxy
Implements interfaceChildProxy
. Call this to get access to interface functions.- Gibt zurück:
ChildProxy
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-