public class Bin extends Element
See upstream documentation at https://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/GstBin.html
Bin is an element that can contain other Element
s, 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.
A new Bin
is created with Bin(String)
. Use a
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
add(Element)
. Elements can be removed with
remove(Element)
An element can be retrieved from a bin with
getElementByName(String)
.
A list of elements contained in a bin can be retrieved with
getElements()
The Bin.ELEMENT_ADDED
signal is fired whenever a new element is added to
the bin. Likewise the Bin.ELEMENT_REMOVED
signal is fired whenever an
element is removed from the bin.
Modifier and Type | Class and Description |
---|---|
static class |
Bin.DebugGraphDetails
Available details for pipeline graphs produced by
#debugToDotFile(int, java.lang.String, boolean) |
static interface |
Bin.DEEP_ELEMENT_ADDED
|
static interface |
Bin.DEEP_ELEMENT_REMOVED
|
static interface |
Bin.DO_LATENCY
Signal emitted when an
Element has latency |
static interface |
Bin.ELEMENT_ADDED
Signal emitted when an
Element is added to this Bin |
static interface |
Bin.ELEMENT_REMOVED
Signal emitted when an
Element is removed from this Bin |
Element.NO_MORE_PADS, Element.PAD_ADDED, Element.PAD_REMOVED
GObject.GCallback, GObject.GInterface
NativeObject.Initializer, NativeObject.TypeProvider, NativeObject.TypeRegistration<T extends NativeObject>
Modifier and Type | Field and Description |
---|---|
static String |
GST_NAME |
static String |
GTYPE_NAME |
Modifier | Constructor and Description |
---|---|
|
Bin()
Creates a new Bin with a unique name.
|
protected |
Bin(NativeObject.Initializer init) |
|
Bin(String name)
Creates a new Bin with the given name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Element element)
Adds an Element to this Bin.
|
void |
addMany(Element... elements)
Adds an array of Element objects to this Bin
|
void |
connect(Bin.DEEP_ELEMENT_ADDED listener)
Add a listener for the
deep-element-added signal on this Bin |
void |
connect(Bin.DEEP_ELEMENT_REMOVED listener)
Add a listener for the
deep-element-removed signal on this
Bin |
void |
connect(Bin.DO_LATENCY listener)
Add a listener for the
do-latency signal on this Bin |
void |
connect(Bin.ELEMENT_ADDED listener)
Add a listener for the
element-added signal on this Bin |
void |
connect(Bin.ELEMENT_REMOVED listener)
Add a listener for the
element-removed signal on this Bin |
void |
debugToDotFile(EnumSet<Bin.DebugGraphDetails> details,
String fileName)
To aid debugging applications one can use this method to write out the
whole network of gstreamer elements that form the pipeline into a dot
file.
|
void |
debugToDotFileWithTS(EnumSet<Bin.DebugGraphDetails> details,
String fileName)
To aid debugging applications one can use this method to write out the
whole network of gstreamer elements that form the pipeline into a dot
file.
|
void |
disconnect(Bin.DEEP_ELEMENT_ADDED listener)
Disconnect the listener for the
deep-element-added signal |
void |
disconnect(Bin.DEEP_ELEMENT_REMOVED listener)
Disconnect the listener for the
deep-element-removed signal |
void |
disconnect(Bin.DO_LATENCY listener)
Disconnect the listener for the
do-latency signal |
void |
disconnect(Bin.ELEMENT_ADDED listener)
Disconnect the listener for the
element-added signal |
void |
disconnect(Bin.ELEMENT_REMOVED listener)
Disconnect the listener for the
element-removed signal |
Element |
getElementByName(String name)
Gets the
Element with the given name from the bin. |
Element |
getElementByNameRecurseUp(String name)
Gets the element with the given name from this bin.
|
List<Element> |
getElements()
Retrieve a list of the
Element s contained in the Bin. |
List<Element> |
getElementsRecursive()
Retrieve a list of the
Element s contained in the Bin and its Bin
children. |
List<Element> |
getElementsSorted()
Gets an a list of the elements in this bin in topologically sorted order.
|
List<Element> |
getSinks()
Retrieve a list of the sink
Element s contained in the Bin. |
List<Element> |
getSources()
Retrieve a list of the source
Element s contained in the Bin. |
boolean |
remove(Element element)
Removes a Element from this Bin
|
void |
removeMany(Element... elements)
Removes an array of
Element objects from this Bin |
addPad, connect, connect, connect, disconnect, disconnect, disconnect, getBaseTime, getBus, getClock, getFactory, getPads, getRequestPad, getSinkPads, getSrcPads, getStartTime, getState, getState, getState, getState, getStaticPad, isPlaying, link, linkFiltered, linkMany, linkPads, linkPadsFiltered, makeRawElement, pause, play, postMessage, query, ready, releaseRequestPad, removePad, sendEvent, setBaseTime, setCaps, setLockedState, setStartTime, setState, stop, syncStateWithParent, unlink, unlinkMany, unlinkPads
addControlBinding, getControlBinding, getName, getParent, hasActiveControlBindings, removeControlBinding, setControlBindingDisabled, setControlBindingsDisabled, setName, suggestNextSync, syncValues, toString
addCallback, connect, connect, disconnect, dispose, emit, emit, get, getPropertyDefaultValue, getPropertyMaximumValue, getPropertyMinimumValue, getRefCount, getTypeName, invalidate, listPropertyNames, removeCallback, set
close, disown, equals, getPointer, getRawPointer, hashCode
public static final String GST_NAME
public static final String GTYPE_NAME
protected Bin(NativeObject.Initializer init)
public Bin()
public Bin(String name)
name
- The Name to assign to the new Binpublic boolean add(Element element)
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.
element
- The Element
to add to this Bin.public void addMany(Element... elements)
elements
- The array of Element
to add to this Binadd(Element)
public boolean remove(Element 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.
element
- The Element
to removepublic void removeMany(Element... elements)
Element
objects from this Binelements
- The list Element
to removepublic List<Element> getElements()
Element
s contained in the Bin.Element
s.public List<Element> getElementsSorted()
Element
s.public List<Element> getElementsRecursive()
Element
s contained in the Bin and its Bin
children.
This differs from getElements()
as it will also return
Element
s that are in any Bin elements contained in this Bin, also
recursing down those Bins.Element
s.public List<Element> getSinks()
Element
s contained in the Bin.Element
s.public List<Element> getSources()
Element
s contained in the Bin.Element
s.public Element getElementByName(String name)
Element
with the given name from the bin. This function
recurses into child bins.public Element getElementByNameRecurseUp(String name)
public void debugToDotFile(EnumSet<Bin.DebugGraphDetails> details, String fileName)
The function is only active if gstreamer is configured with "--gst-enable-gst-debug" and the environment variable GST_DEBUG_DUMP_DOT_DIR is set to a basepath (e.g. /tmp).
details
- to show in the graphfileName
- output base filename (e.g. "myplayer")public void debugToDotFileWithTS(EnumSet<Bin.DebugGraphDetails> details, String fileName)
The function is only active if gstreamer is configured with "--gst-enable-gst-debug" and the environment variable GST_DEBUG_DUMP_DOT_DIR is set to a basepath (e.g. /tmp).
Unlike debugToDotFile(java.util.EnumSet, java.lang.String)
this
method adds the current timestamp to the filename, so that it can be
used to take multiple snapshots.
details
- to show in the graphfileName
- output base filename (e.g. "myplayer")public void connect(Bin.ELEMENT_ADDED listener)
element-added
signal on this Binlistener
- The listener to be called when an Element
is
added.public void disconnect(Bin.ELEMENT_ADDED listener)
element-added
signallistener
- The listener that was registered to receive the signal.public void connect(Bin.ELEMENT_REMOVED listener)
element-removed
signal on this Binlistener
- The listener to be called when an Element
is
removed.public void disconnect(Bin.ELEMENT_REMOVED listener)
element-removed
signallistener
- The listener that was registered to receive the signal.@Gst.Since(minor=10) public void connect(Bin.DEEP_ELEMENT_ADDED listener)
deep-element-added
signal on this Binlistener
- The listener to be called when an Element
is
added.@Gst.Since(minor=10) public void disconnect(Bin.DEEP_ELEMENT_ADDED listener)
deep-element-added
signallistener
- The listener that was registered to receive the signal.@Gst.Since(minor=10) public void connect(Bin.DEEP_ELEMENT_REMOVED listener)
deep-element-removed
signal on this
Binlistener
- The listener to be called when an Element
is
removed.@Gst.Since(minor=10) public void disconnect(Bin.DEEP_ELEMENT_REMOVED listener)
deep-element-removed
signallistener
- The listener that was registered to receive the signal.public void connect(Bin.DO_LATENCY listener)
do-latency
signal on this Binlistener
- The listener to be called when an Element
is
removed.public void disconnect(Bin.DO_LATENCY listener)
do-latency
signallistener
- The listener that was registered to receive the signal.Copyright © 2019 gstreamer-java. All rights reserved.