gstreamer-0.12.8: Binding to the GStreamer open source multimedia framework.

Maintainergtk2hs-devel@lists.sourceforge.net
Stabilityalpha
Portabilityportable (depends on GHC)
Safe HaskellNone
LanguageHaskell98

Media.Streaming.GStreamer.Core.Bin

Contents

Description

Base class for elements that can contain other elements.

Synopsis

Detail

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 element, and enables creation of higher-level abstractions.

A new Bin is created with binNew. 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 binAdd. You can remove elements with binRemove.

An element can be retrieved from a bin with binGetByName, using the element's name. binGetByNameRecurseUp 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 binIterateElements. Various other iterators exist to retrieve the elements in a bin.

The binElementAdded signal is fired whenever a new element is added to the bin. Likewise the binElementRemoved signal is fired whenever an element is removed from the bin.

Types

data Bin Source #

Instances

castToBin :: GObjectClass obj => obj -> Bin Source #

Bin Operations

binNew Source #

Arguments

:: String

name - the name to give the new Bin

-> IO Bin

the new Bin

Create a new Bin with the given name.

binAdd Source #

Arguments

:: (BinClass bin, ElementClass element) 
=> bin

bin - a Bin

-> element

element - the element to add

-> IO Bool

True if the element could be added, False if the bin does not want to accept the element

Add element to bin, and set element's parent to bin. An Element can only be added to one Bin at a time.

If any of element's pads are linked to other Pads, they will be unlinked before element is added to bin.

binRemove Source #

Arguments

:: (BinClass bin, ElementClass element) 
=> bin

bin - a Bin

-> element

element - the element to remove

-> IO Bool

True if element could be removed, otherwise False

Remove element from bin, unparenting it as well.

If any element's pads are linked to other pads, they will be unlinked before element is added to bin.

binGetByName Source #

Arguments

:: BinClass bin 
=> bin

bin - a Bin

-> String

name - the name to search for

-> IO (Maybe Element)

the Element with the name name, or Nothing

Get the Element with the given name name from bin, recursing down through bin's children. Nothing is returned if no Element with the given name is found.

binGetByNameRecurseUp Source #

Arguments

:: BinClass bin 
=> bin

bin - a Bin

-> String

element - the name to search for

-> IO (Maybe Element)

the Element with the given name, or Nothing

Get the Element with the given name name from bin, recursing up through bin's parents. Returns Nothing if no element with the given name is found.

binGetByInterface Source #

Arguments

:: BinClass bin 
=> bin

bin - a Bin

-> GType

iface - the type of the requested interface

-> IO (Maybe Element)

the Element inside bin that implements iface, or Nothing

Find an Element inside bin that implements the interface given by iface. The returned Element can be casted to iface's type. If you want all the Elements that implement an interface, use binIterateAllByInterface.

This function recurses into child bins.

binIterateElements Source #

Arguments

:: BinClass bin 
=> bin

bin - a Bin

-> IO (Maybe (Iterator Element))

an Iterator over the Elements in bin, or Nothing

Get an Iterator over the Elements in bin.

binIterateRecurse Source #

Arguments

:: BinClass bin 
=> bin

bin - a Bin

-> IO (Maybe (Iterator Element))

an Iterator over the Elements in bin and its descendents, or Nothing

Get an Iterator over the Elements in bin. This iterator recurses into bin's children.

binIterateSinks Source #

Arguments

:: BinClass bin 
=> bin

bin - a Bin

-> IO (Maybe (Iterator Element))

an Iterator over the sinks in bin, or Nothing

Get an iterator over the Elements in bin that have the ElementIsSink flag set.

binIterateSorted Source #

Arguments

:: BinClass bin 
=> bin

bin - a Bin

-> IO (Maybe (Iterator Element))

an Iterator over the Elements in bin, or Nothing

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 state changes of the bin elements.

binIterateSources Source #

Arguments

:: BinClass bin 
=> bin

bin - a Bin

-> IO (Maybe (Iterator Element))

an Iterator on elements, or Nothing

Gets an iterator for all elements in the bin that have no sink pads and have the ElementIsSink flag unset.

binIterateAllByInterface Source #

Arguments

:: BinClass bin 
=> bin

bin - a Bin

-> GType

iface - the interface's GType

-> IO (Maybe (Iterator Element))

an Iterator on elements, or Nothing

Looks for all elements inside the bin that implement the given interface. You can safely case all elements to the given interface. The function recurses inside child bins.

binFindUnconnectedPad Source #

Arguments

:: BinClass bin 
=> bin

bin - a Bin

-> PadDirection

direction - the direction of the requested Pad

-> IO (Maybe Pad)

an unconnected Pad, or Nothing

Recursively looks for elements with an unconnected pad of the given direction within the specified bin. Returns an unconnected pad if one is found, otherwise Nothing.

Since 0.10.3.

Bin Signals

binElementAdded :: BinClass bin => Signal bin (Element -> IO ()) Source #

An Element has been added to the Bin.

binElementRemoved :: BinClass bin => Signal bin (Element -> IO ()) Source #

An Element has been removed from the Bin.