|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gstreamer.lowlevel.NativeValue
org.gstreamer.lowlevel.Handle
org.gstreamer.lowlevel.NativeObject
org.gstreamer.lowlevel.RefCountedObject
org.gstreamer.GObject
org.gstreamer.GstObject
org.gstreamer.Element
org.gstreamer.Bin
public class Bin
Base class and element that can contain other elements.
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.
Nested Class Summary | |
---|---|
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 |
Nested classes/interfaces inherited from class org.gstreamer.Element |
---|
Element.HANDOFF, Element.NO_MORE_PADS, Element.PAD_ADDED, Element.PAD_REMOVED |
Nested classes/interfaces inherited from class org.gstreamer.GObject |
---|
GObject.GCallback |
Nested classes/interfaces inherited from class org.gstreamer.lowlevel.NativeObject |
---|
NativeObject.Initializer |
Field Summary | |
---|---|
static int |
DEBUG_GRAPH_SHOW_ALL
|
static int |
DEBUG_GRAPH_SHOW_CAPS_DETAILS
|
static int |
DEBUG_GRAPH_SHOW_MEDIA_TYPE
|
static int |
DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS
|
static int |
DEBUG_GRAPH_SHOW_STATES
|
Fields inherited from class org.gstreamer.lowlevel.NativeObject |
---|
defaultInit, ownsHandle |
Constructor Summary | |
---|---|
Bin()
Creates a new Bin with a unique name. |
|
Bin(NativeObject.Initializer init)
|
|
Bin(java.lang.String name)
Creates a new Bin with the given name. |
Method Summary | ||
---|---|---|
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.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(int details,
java.lang.String fileName)
Calls debugToDotFile(int, String, boolean) without timestamping |
|
void |
debugToDotFile(int details,
java.lang.String fileName,
boolean timestampFileName)
To aid debugging applications one can use this method to write out the whole network of gstreamer elements that form the pipeline into an dot file. |
|
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 |
|
|
getElementByInterface(java.lang.Class<T> iface)
Looks for an element inside the bin that implements the given interface. |
|
Element |
getElementByName(java.lang.String name)
Gets the Element with the given name from the bin. |
|
Element |
getElementByNameRecurseUp(java.lang.String name)
Gets the element with the given name from this bin. |
|
java.util.List<Element> |
getElements()
Retrieve a list of the Element s contained in the Bin. |
|
java.util.List<Element> |
getElementsRecursive()
Retrieve a list of the Element s contained in the Bin and its Bin children. |
|
java.util.List<Element> |
getElementsSorted()
Gets an a list of the elements in this bin in topologically sorted order. |
|
java.util.List<Element> |
getSinks()
Retrieve a list of the sink Element s contained in the Bin. |
|
java.util.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 |
Methods inherited from class org.gstreamer.Element |
---|
addPad, connect, connect, connect, connect, disconnect, disconnect, disconnect, disconnect, getBaseTime, getBus, getClock, getFactory, getPad, getPads, getRequestPad, getSinkPads, getSrcPads, getState, getState, getState, getState, getStaticPad, link, link, linkMany, linkPads, linkPadsFiltered, makeRawElement, postMessage, releaseRequestPad, removePad, sendEvent, setCaps, setState, syncStateWithParent, unlink, unlinkMany, unlinkPads |
Methods inherited from class org.gstreamer.GstObject |
---|
addListenerProxy, getName, getParent, initializer, initializer, objectFor, objectFor, ref, removeListenerProxy, setName, steal, toString, unref |
Methods inherited from class org.gstreamer.GObject |
---|
addCallback, connect, connect, connect, disconnect, disconnect, disposeNativeHandle, g_signal_connect, get, getPointer, getPropertyDefaultValue, getPropertyMaximumValue, getPropertyMinimumValue, invalidate, objectFor, removeCallback, set |
Methods inherited from class org.gstreamer.lowlevel.NativeObject |
---|
classFor, disown, dispose, equals, finalize, getNativeAddress, handle, hashCode, initializer, instanceFor, isDisposed, nativeValue, objectFor, objectFor |
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEBUG_GRAPH_SHOW_MEDIA_TYPE
public static final int DEBUG_GRAPH_SHOW_CAPS_DETAILS
public static final int DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS
public static final int DEBUG_GRAPH_SHOW_STATES
public static final int DEBUG_GRAPH_SHOW_ALL
Constructor Detail |
---|
public Bin(NativeObject.Initializer init)
public Bin()
public Bin(java.lang.String name)
name
- The Name to assign to the new BinMethod Detail |
---|
public 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 remove
public void removeMany(Element... elements)
Element
objects from this Bin
elements
- The list Element
to removepublic java.util.List<Element> getElements()
Element
s contained in the Bin.
Element
s.public java.util.List<Element> getElementsSorted()
Element
s.public java.util.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 java.util.List<Element> getSinks()
Element
s contained in the Bin.
Element
s.public java.util.List<Element> getSources()
Element
s contained in the Bin.
Element
s.public Element getElementByName(java.lang.String name)
Element
with the given name from the bin. This
function recurses into child bins.
name
- The name of the Element
to find.
Element
if found, else null.public Element getElementByNameRecurseUp(java.lang.String name)
name
- The name of the Element
to find.
Element
if found, else null.public <T extends Element> T getElementByInterface(java.lang.Class<T> iface)
iface
- The class of the Element
to search for.
Element
that implements the interface.public void debugToDotFile(int details, java.lang.String fileName)
debugToDotFile(int, String, boolean)
without timestamping
public void debugToDotFile(int details, java.lang.String fileName, boolean timestampFileName)
details
- to show in the graph, e.g. DEBUG_GRAPH_SHOW_ALLfileName
- output base filename (e.g. "myplayer")timestampFileName
- if true it adds the current timestamp
to the filename, so that it can be used to take multiple snapshots.public void connect(Bin.ELEMENT_ADDED listener)
element-added
signal on this Bin
listener
- The listener to be called when an Element
is added.public void connect(Bin.ELEMENT_REMOVED listener)
element-removed
signal on this Bin
listener
- The listener to be called when an Element
is removed.public void disconnect(Bin.ELEMENT_ADDED listener)
element-added
signal
listener
- The listener that was registered to receive the signal.public void disconnect(Bin.ELEMENT_REMOVED listener)
element-removed
signal
listener
- The listener that was registered to receive the signal.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |