#include <element.h>
Public Member Functions | |
virtual | ~Element () |
GstElement* | gobj () |
Provides access to the underlying C GObject. | |
const GstElement* | gobj () const |
Provides access to the underlying C GObject. | |
GstElement* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Glib::RefPtr<Gst::Element> | link (const Glib::RefPtr<Gst::Element>& dest) |
Links this source element to the element. | |
bool | add_pad (const Glib::RefPtr<Gst::Pad>& pad) |
Adds a pad (link point) to element. | |
void | create_all_pads () |
Creates a pad for each pad template that is always available. | |
Glib::RefPtr<Gst::Pad> | create_compatible_pad (const Glib::RefPtr<Gst::Pad>& pad, const Glib::RefPtr<Gst::Caps>& caps) |
Glib::RefPtr<Gst::PadTemplate> | get_compatible_pad_template (const Glib::RefPtr<Gst::PadTemplate>& padtemplate) |
Glib::RefPtr<Gst::Pad> | get_request_pad (const Glib::ustring& name) |
Retrieves a pad from the element by name. | |
Glib::RefPtr<Gst::Pad> | get_static_pad (const Glib::ustring& name) |
Retrieves a pad from element by name. | |
void | no_more_pads () |
Use this function to signal that the element does not expect any more pads to show up in the current pipeline. | |
void | release_request_pad (const Glib::RefPtr<Gst::Pad>& pad) |
Makes the element free the previously requested pad as obtained with get_request_pad(). | |
bool | remove_pad (const Glib::RefPtr<Gst::Pad>& pad) |
Removes pad from element. | |
Gst::Iterator<Gst::Pad> | iterate_pads () |
Retrieves an iterattor of element's pads. | |
Gst::Iterator<Gst::Pad> | iterate_sink_pads () |
Retrieves an iterator of element's sink pads. | |
Gst::Iterator<Gst::Pad> | iterate_src_pads () |
Retrieves an iterator of element's source pads. | |
void | unlink (const Glib::RefPtr<Gst::Element>& other_element) |
Unlinks all source pads of the source element with all sink pads of the sink element to which they are linked. | |
bool | link_pads (const Glib::ustring& padname, const Glib::RefPtr<Gst::Element>& other_element, const Glib::ustring& others_padname) |
Links the two named pads of the source and destination elements. | |
void | unlink_pads (const Glib::ustring& padname, const Glib::RefPtr<Gst::Element>& other_element, const Glib::ustring& other_padname) |
Unlinks the two named pads of the source and destination elements. | |
bool | link_pads_filtered (const Glib::ustring& padname, const Glib::RefPtr<Gst::Element>& other_element, const Glib::ustring& others_padname, const Glib::RefPtr<Gst::Caps>& filter) |
Links the two named pads of the source and destination elements. | |
bool | link_filtered (const Glib::RefPtr<Gst::Element>& other_element, const Glib::RefPtr<Gst::Caps>& filter) |
Links src to dest using the given caps as filtercaps. | |
void | set_base_time (ClockTime time) |
Set the base time of an element. | |
ClockTime | get_base_time () const |
Returns: the base time of the element. | |
void | set_bus (const Glib::RefPtr<Gst::Bus>& bus) |
Sets the bus of the element. | |
Glib::RefPtr<Gst::Bus> | get_bus () |
Returns: the element's Gst::Bus. | |
Glib::RefPtr<const Gst::Bus> | get_bus () const |
Returns: the element's Gst::Bus. | |
void | set_index (const Glib::RefPtr<Gst::Index>& index) |
Set index on the element. | |
Glib::RefPtr<Gst::Index> | get_index () |
Gets the index from the element. | |
Glib::RefPtr<const Gst::Index> | get_index () const |
Gets the index from the element. | |
Glib::RefPtr<Gst::ElementFactory> | get_factory () |
Retrieves the factory that was used to create this element. | |
Glib::RefPtr< const Gst::ElementFactory > | get_factory () const |
Retrieves the factory that was used to create this element. | |
bool | is_indexable () const |
Queries if the element can be indexed. | |
bool | requires_clock () const |
Query if the element requires a clock. | |
bool | set_clock (const Glib::RefPtr<Gst::Clock>& clock) |
Sets the clock for the element. | |
Glib::RefPtr<Gst::Clock> | get_clock () |
Gets the currently configured clock of the element. | |
Glib::RefPtr<const Gst::Clock> | get_clock () const |
Gets the currently configured clock of the element. | |
bool | provides_clock () const |
Query if the element provides a clock. | |
Glib::RefPtr<Gst::Clock> | provide_clock () |
Get the clock provided by the given element. | |
Glib::RefPtr<const Gst::Clock> | provide_clock () const |
Get the clock provided by the given element. | |
StateChangeReturn | set_state (State state) |
Sets the state of the element. | |
StateChangeReturn | get_state (State& state, State& pending, ClockTime timeout) const |
Gets the state of the element. | |
bool | set_locked_state (gboolean locked_state) |
Locks the state of an element, so state changes of the parent don't affect this element anymore. | |
bool | is_locked_state () const |
Checks if the state of an element is locked. | |
void | abort_state () |
Abort the state change of the element. | |
StateChangeReturn | continue_state (StateChangeReturn prestate_value) |
Commit the state change of the element and proceed to the next pending state if any. | |
void | lost_state () |
Brings the element to the lost state. | |
bool | sync_state_with_parent () |
Tries to change the state of the element to the same as its parent. | |
StateChangeReturn | change_state (StateChange transition) |
Perform transition on element. | |
void | found_tags (const Gst::TagList& list) |
Posts a message to the bus that new tags were found, and pushes an event to all sourcepads. | |
void | found_tags_for_pad (const Glib::RefPtr<Gst::Pad>& pad, const Gst::TagList& list) |
Posts a message to the bus that new tags were found and pushes the tags as event. | |
void | post_message (MessageType message_type, const Glib::QueryQuark& domain, int code, const Glib::ustring& message, const Glib::ustring& debug, const Glib::ustring& filename, const Glib::ustring& function_name, int line_number) |
Post an error, warning or info message on the bus from inside an element. | |
bool | post_message (const Glib::RefPtr<Gst::Message>& message) |
Post a message on the element's Gst::Bus. | |
Glib::ArrayHandle<QueryType> | get_query_types () const |
Get an array of query types from the element. | |
bool | query (const Glib::RefPtr<Gst::Query>& query) |
Performs a query on the given element. | |
bool | query_convert (Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const |
Queries an element to convert src_val in src_format to dest_format. | |
bool | query_position (Format& format, gint64& position) const |
Queries an element for the stream position. | |
bool | query_position (Format& format) const |
Queries an element for the stream position. | |
bool | query_duration (Format& format, gint64& duration) const |
Queries an element for the total stream duration. | |
bool | query_duration (Format& format) const |
Queries an element for the total stream duration. | |
bool | seek (Format format, SeekFlags flags, gint64 position) |
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. | |
bool | seek (double rate, Format format, SeekFlags flags, SeekType current_type, gint64 current_position, SeekType stop_type, gint64 stop_position) |
Sends a seek event to an element. | |
bool | send_event (const Glib::RefPtr<Gst::Event>& event) |
Sends an event to an element. | |
bool | implements_interface (GType iface_type) |
Test whether the given element implements a certain interface of type iface_type, and test whether it is supported for this specific instance. | |
Glib::SignalProxy0<void> | signal_no_more_pads () |
This signals that the element will not generate more dynamic pads. | |
Glib::SignalProxy1< void, const Glib::RefPtr<Gst::Pad >&> | signal_pad_added () |
signals that a new Gst::Pad has been added to the element. | |
Glib::SignalProxy1< void, const Glib::RefPtr<Gst::Pad >&> | signal_pad_removed () |
signals that a Gst::Pad has been removed from the element | |
virtual Glib::RefPtr<Gst::Pad> | request_new_pad_vfunc (const Glib::RefPtr<Gst::PadTemplate>& templ, const Glib::ustring& name) |
Called when a new pad is requested. | |
virtual void | release_pad_vfunc (const Glib::RefPtr<Gst::Pad>& pad) |
Called when a request pad is to be released. | |
virtual StateChangeReturn | get_state_vfunc (State& state, State& pending, ClockTime timeout) |
Get the state of the element. | |
virtual StateChangeReturn | set_state_vfunc (State state) |
Set a new state on the element. | |
virtual StateChangeReturn | change_state_vfunc (StateChange transition) |
Called by set_state to perform an incremental state change. | |
virtual void | set_bus_vfunc (const Glib::RefPtr<Gst::Bus>& bus) |
Set a Gst::Bus on the element. | |
virtual Glib::RefPtr<Gst::Clock> | provide_clock_vfunc () |
Gets the Gst::Clock provided by the element. | |
virtual Glib::RefPtr<Gst::Index> | get_index_vfunc () |
Set the Gst::Clock on the element. | |
virtual void | set_index_vfunc (const Glib::RefPtr<Gst::Index>& index) |
Set the Gst::Index of an element. | |
virtual bool | send_event_vfunc (const Glib::RefPtr<Gst::Event>& event) |
Send a Gst::Event to the element. | |
virtual bool | query_vfunc (const Glib::RefPtr<Gst::Query>& query) |
Get the supported Gst::QueryType of this element. | |
Protected Member Functions | |
Element () | |
virtual void | on_no_more_pads () |
virtual void | on_pad_added (const Glib::RefPtr<Gst::Pad>& new_pad) |
virtual void | on_pad_removed (const Glib::RefPtr<Gst::Pad>& old_pad) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gst::Element> | wrap (GstElement* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
Gst::Element is the abstract base class needed to construct an element that can be used in a GStreamer pipeline. Please refer to the plugin writers guide for more information on creating Gst::Element subclasses.
The name of a Gst::Element can be get with get_name() and set with set_name().
All elements have pads (of the type Gst::Pad). These pads link to pads on other elements. Gst::Buffer flow between these linked pads. An Element has a GList of Gst::Pad structures for all their input (or sink) and output (or source) pads. Core and plug-in writers can add and remove pads with add_pad() and remove_pad().
A pad of an element can be retrieved by name with get_request_pad() or get_static_pad(). An iterator of all pads can be retrieved with iterate_pads().
Gst::Elements can be linked through their pads. Use the link() function to link elements. Use link_filtered() to link two elements constrained by a specified set of Gst::Caps. For finer control, use link_pads() and link_pads_filtered() to specify the pads to link on each element by name.
Each element has a state (see State). You can get and set the state of an element with get_state() and set_state(). To get a string representation of a State, use Gst::Enums::get_name().
You can get and set a Clock on an element using get_clock() and set_clock(). Some elements can provide a clock for the pipeline if provides_clock() returns true. With the provide_clock() method one can retrieve the clock provided by such an element. Not all elements require a clock to operate correctly. If requires_clock() returns true, a clock should be set on the element with set_clock().
Note that clock slection and distribution is normally handled by the toplevel Gst::Pipeline so the clock functions are only to be used in very specific situations.
Last reviewed on 2006-03-12 (0.10.5)
virtual Gst::Element::~Element | ( | ) | [virtual] |
Gst::Element::Element | ( | ) | [protected] |
void Gst::Element::abort_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.
This function should be called with the STATE_LOCK held.
MT safe.
bool Gst::Element::add_pad | ( | const Glib::RefPtr<Gst::Pad>& | pad | ) |
Adds a pad (link point) to element.
pad's parent will be set to element; see Gst::Object::set_parent() for refcounting information.
Pads are not automatically activated so elements should perform the needed steps to activate the pad in case this pad is added in the PAUSED or PLAYING state. See Gst::Pad::set_active() for more information about activating pads.
The pad and the element should be unlocked when calling this function.
This function will emit the Gst::Element::pad-added signal on the element.
pad | The Gst::Pad to add to the element. |
true
if the pad could be added. This function can fail when a pad with the same name already existed or the pad already had another parent.StateChangeReturn Gst::Element::change_state | ( | StateChange | transition | ) |
Perform transition on element.
This function must be called with STATE_LOCK held and is mainly used internally.
transition | The requested transition. |
virtual StateChangeReturn Gst::Element::change_state_vfunc | ( | StateChange | transition | ) | [virtual] |
Called by set_state to perform an incremental state change.
StateChangeReturn Gst::Element::continue_state | ( | StateChangeReturn | prestate_value | ) |
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.
If after calling this method the element still has not reached the pending state, the next state change is performed.
This method is used internally and should normally not be called by plugins or applications.
ret | The previous state return value. |
void Gst::Element::create_all_pads | ( | ) |
Creates a pad for each pad template that is always available.
This function is only useful during object intialization of subclasses of Gst::Element.
Glib::RefPtr<Gst::Pad> Gst::Element::create_compatible_pad | ( | const Glib::RefPtr<Gst::Pad>& | pad, | |
const Glib::RefPtr<Gst::Caps>& | caps | |||
) |
void Gst::Element::found_tags | ( | const Gst::TagList& | list | ) |
Posts a message to the bus that new tags were found, and pushes an event to all sourcepads.
Takes ownership of the list.
This is a utility method for elements. Applications should use the Gst::TagSetter interface.
list | List of tags. |
void Gst::Element::found_tags_for_pad | ( | const Glib::RefPtr<Gst::Pad>& | pad, | |
const Gst::TagList& | list | |||
) |
Posts a message to the bus that new tags were found and pushes the tags as event.
Takes ownership of the list.
This is a utility method for elements. Applications should use the Gst::TagSetter interface.
pad | Pad on which to push tag-event. | |
list | The taglist to post on the bus and create event from. |
ClockTime Gst::Element::get_base_time | ( | ) | const |
Returns: the base time of the element.
Glib::RefPtr<const Gst::Bus> Gst::Element::get_bus | ( | ) | const |
Returns: the element's Gst::Bus.
unref after usage.
Reimplemented in Gst::Pipeline.
Glib::RefPtr<Gst::Bus> Gst::Element::get_bus | ( | ) |
Returns: the element's Gst::Bus.
unref after usage.
Reimplemented in Gst::Pipeline.
Glib::RefPtr<const Gst::Clock> Gst::Element::get_clock | ( | ) | const |
Gets the currently configured clock of the element.
This is the clock as was last set with set_clock().
Reimplemented in Gst::Pipeline, and GstBase::BaseAudioSrc.
Glib::RefPtr<Gst::Clock> Gst::Element::get_clock | ( | ) |
Gets the currently configured clock of the element.
This is the clock as was last set with set_clock().
Reimplemented in Gst::Pipeline.
Glib::RefPtr<Gst::PadTemplate> Gst::Element::get_compatible_pad_template | ( | const Glib::RefPtr<Gst::PadTemplate>& | padtemplate | ) |
Glib::RefPtr<const Gst::ElementFactory> Gst::Element::get_factory | ( | ) | const |
Retrieves the factory that was used to create this element.
Glib::RefPtr<Gst::ElementFactory> Gst::Element::get_factory | ( | ) |
Retrieves the factory that was used to create this element.
Glib::RefPtr<const Gst::Index > Gst::Element::get_index | ( | ) | const |
Gets the index from the element.
0
when no index was set on the element. unref after usage.Glib::RefPtr<Gst::Index> Gst::Element::get_index | ( | ) |
Gets the index from the element.
0
when no index was set on the element. unref after usage.virtual Glib::RefPtr<Gst::Index> Gst::Element::get_index_vfunc | ( | ) | [virtual] |
Set the Gst::Clock on the element.
Get a Gst::Index on the element.
Glib::ArrayHandle<QueryType> Gst::Element::get_query_types | ( | ) | const |
Get an array of query types from the element.
If the element doesn't implement a query types function, the query will be forwarded to the peer of a random linked sink pad.
Glib::RefPtr<Gst::Pad> Gst::Element::get_request_pad | ( | const Glib::ustring & | name | ) |
Retrieves a pad from the element by name.
This version only retrieves request pads. The pad should be released with release_request_pad().
name | The name of the request Gst::Pad to retrieve. |
0
. Release after usage. StateChangeReturn Gst::Element::get_state | ( | State& | state, | |
State& | pending, | |||
ClockTime | timeout | |||
) | const |
Gets the state of the element.
For elements that performed an ASYNC state change, as reported by set_state(), this function will block up to the specified timeout value for the state change to complete. If the element completes the state change or goes into an error, this function returns immediately with a return value of Gst::STATE_CHANGE_SUCCESS or Gst::STATE_CHANGE_FAILURE respectively.
For elements that did not return Gst::STATE_CHANGE_ASYNC, this function Returns: Gst::STATE_CHANGE_SUCCESS if the element has no more pending state
state | A pointer to Gst::State to hold the state. Can be 0 . | |
pending | A pointer to Gst::State to hold the pending state. Can be 0 . | |
timeout | A Gst::ClockTime to specify the timeout for an async state change or Gst::CLOCK_TIME_NONE for infinite timeout. |
virtual StateChangeReturn Gst::Element::get_state_vfunc | ( | State& | state, | |
State& | pending, | |||
ClockTime | timeout | |||
) | [virtual] |
Get the state of the element.
Glib::RefPtr<Gst::Pad> Gst::Element::get_static_pad | ( | const Glib::ustring & | name | ) |
const GstElement* Gst::Element::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gst::Object.
Reimplemented in Gst::BaseSink, Gst::BaseSrc, Gst::BaseTransform, Gst::Bin, Gst::CapsFilter, Gst::ElementInterfaced<T_Interface>, Gst::FakeSink, Gst::FakeSrc, Gst::FdSink, Gst::FdSrc, Gst::FileSink, Gst::FileSrc, Gst::Identity, Gst::MultiQueue, Gst::Pipeline, Gst::PushSrc, Gst::Queue, Gst::Tee, Gst::TypeFind, GstBase::Adder, GstBase::AlsaMixer, GstBase::AlsaSink, GstBase::AlsaSrc, GstBase::AudioConvert, GstBase::AudioFilter, GstBase::AudioResample, GstBase::AudioSink, GstBase::AudioSrc, GstBase::AudioTestSrc, GstBase::BaseAudioSink, GstBase::BaseAudioSrc, GstBase::CddaBaseSrc, GstBase::CdParanoiaSrc, GstBase::ClockOverlay, GstBase::DecodeBin, GstBase::FfmpegColorSpace, GstBase::GioSink, GstBase::GioSrc, GstBase::GioStreamSink, GstBase::GioStreamSrc, GstBase::OggDemux, GstBase::OggMux, GstBase::PlayBin2, GstBase::TextOverlay, GstBase::TextRender, GstBase::TheoraDec, GstBase::TheoraEnc, GstBase::TimeOverlay, GstBase::VideoRate, GstBase::VideoScale, GstBase::VideoSink, GstBase::VideoTestSrc, GstBase::Volume, GstBase::VorbisDec, GstBase::VorbisEnc, GstBase::VorbisParse, GstBase::VorbisTag, GstBase::XImageSink, and GstBase::XvImageSink.
GstElement* Gst::Element::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gst::Object.
Reimplemented in Gst::BaseSink, Gst::BaseSrc, Gst::BaseTransform, Gst::Bin, Gst::CapsFilter, Gst::ElementInterfaced<T_Interface>, Gst::FakeSink, Gst::FakeSrc, Gst::FdSink, Gst::FdSrc, Gst::FileSink, Gst::FileSrc, Gst::Identity, Gst::MultiQueue, Gst::Pipeline, Gst::PushSrc, Gst::Queue, Gst::Tee, Gst::TypeFind, GstBase::Adder, GstBase::AlsaMixer, GstBase::AlsaSink, GstBase::AlsaSrc, GstBase::AudioConvert, GstBase::AudioFilter, GstBase::AudioResample, GstBase::AudioSink, GstBase::AudioSrc, GstBase::AudioTestSrc, GstBase::BaseAudioSink, GstBase::BaseAudioSrc, GstBase::CddaBaseSrc, GstBase::CdParanoiaSrc, GstBase::ClockOverlay, GstBase::DecodeBin, GstBase::FfmpegColorSpace, GstBase::GioSink, GstBase::GioSrc, GstBase::GioStreamSink, GstBase::GioStreamSrc, GstBase::OggDemux, GstBase::OggMux, GstBase::PlayBin2, GstBase::TextOverlay, GstBase::TextRender, GstBase::TheoraDec, GstBase::TheoraEnc, GstBase::TimeOverlay, GstBase::VideoRate, GstBase::VideoScale, GstBase::VideoSink, GstBase::VideoTestSrc, GstBase::Volume, GstBase::VorbisDec, GstBase::VorbisEnc, GstBase::VorbisParse, GstBase::VorbisTag, GstBase::XImageSink, and GstBase::XvImageSink.
GstElement* Gst::Element::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Reimplemented from Gst::Object.
Reimplemented in Gst::BaseSink, Gst::BaseSrc, Gst::BaseTransform, Gst::Bin, Gst::CapsFilter, Gst::ElementInterfaced<T_Interface>, Gst::FakeSink, Gst::FakeSrc, Gst::FdSink, Gst::FdSrc, Gst::FileSink, Gst::FileSrc, Gst::Identity, Gst::MultiQueue, Gst::Pipeline, Gst::PushSrc, Gst::Queue, Gst::Tee, Gst::TypeFind, GstBase::Adder, GstBase::AlsaMixer, GstBase::AlsaSink, GstBase::AlsaSrc, GstBase::AudioConvert, GstBase::AudioFilter, GstBase::AudioResample, GstBase::AudioSink, GstBase::AudioSrc, GstBase::AudioTestSrc, GstBase::BaseAudioSink, GstBase::BaseAudioSrc, GstBase::CddaBaseSrc, GstBase::CdParanoiaSrc, GstBase::ClockOverlay, GstBase::DecodeBin, GstBase::FfmpegColorSpace, GstBase::GioSink, GstBase::GioSrc, GstBase::GioStreamSink, GstBase::GioStreamSrc, GstBase::OggDemux, GstBase::OggMux, GstBase::PlayBin2, GstBase::TextOverlay, GstBase::TextRender, GstBase::TheoraDec, GstBase::TheoraEnc, GstBase::TimeOverlay, GstBase::VideoRate, GstBase::VideoScale, GstBase::VideoSink, GstBase::VideoTestSrc, GstBase::Volume, GstBase::VorbisDec, GstBase::VorbisEnc, GstBase::VorbisParse, GstBase::VorbisTag, GstBase::XImageSink, and GstBase::XvImageSink.
bool Gst::Element::implements_interface | ( | GType | iface_type | ) |
Test whether the given element implements a certain interface of type iface_type, and test whether it is supported for this specific instance.
iface_type | (final) type of the interface which we want to be implemented. |
bool Gst::Element::is_indexable | ( | ) | const |
Queries if the element can be indexed.
true
if the element can be indexed.bool Gst::Element::is_locked_state | ( | ) | const |
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_<tt>0.
MT safe.
true
, if the element's state is locked. Gst::Iterator<Gst::Pad> Gst::Element::iterate_pads | ( | ) |
Retrieves an iterattor of element's pads.
The iterator should be freed after usage.
Gst::Iterator<Gst::Pad> Gst::Element::iterate_sink_pads | ( | ) |
Retrieves an iterator of element's sink pads.
Gst::Iterator<Gst::Pad> Gst::Element::iterate_src_pads | ( | ) |
Retrieves an iterator of element's source pads.
Glib::RefPtr<Gst::Element> Gst::Element::link | ( | const Glib::RefPtr<Gst::Element>& | dest | ) |
Links this source element to the element.
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.
Make sure you have added your elements to a bin or pipeline with Gst::Bin::add() before trying to link them.
std::runtime_error | If the elements could not be linked. |
bool Gst::Element::link_filtered | ( | const Glib::RefPtr<Gst::Element>& | other_element, | |
const Glib::RefPtr<Gst::Caps>& | filter | |||
) |
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.
Make sure you have added your elements to a bin or pipeline with Gst::Bin::add() before trying to link them.
dest | The Gst::Element containing the destination pad. | |
filter | The Gst::Caps to filter the link, or #0 for no filter. |
true
if the pads could be linked, false
otherwise. bool Gst::Element::link_pads | ( | const Glib::ustring & | padname, | |
const Glib::RefPtr<Gst::Element>& | other_element, | |||
const Glib::ustring & | others_padname | |||
) |
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.
srcpadname | The name of the Gst::Pad in source element or 0 for any pad. | |
dest | The Gst::Element containing the destination pad. | |
destpadname | The name of the Gst::Pad in destination element, or 0 for any pad. |
true
if the pads could be linked, false
otherwise. bool Gst::Element::link_pads_filtered | ( | const Glib::ustring & | padname, | |
const Glib::RefPtr<Gst::Element>& | other_element, | |||
const Glib::ustring & | others_padname, | |||
const Glib::RefPtr<Gst::Caps>& | filter | |||
) |
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 #0
, makes sure that the caps of the link is a subset of caps.
srcpadname | The name of the Gst::Pad in source element or 0 for any pad. | |
dest | The Gst::Element containing the destination pad. | |
destpadname | The name of the Gst::Pad in destination element or 0 for any pad. | |
filter | The Gst::Caps to filter the link, or #0 for no filter. |
true
if the pads could be linked, false
otherwise. void Gst::Element::lost_state | ( | ) |
Brings the element to the lost state.
The current state of the element is copied to the pending state so that any call to get_state() will return Gst::STATE_CHANGE_ASYNC.
An ASYNC_START message is posted with an indication to distribute a new base_time to the element. If the element was PLAYING, it will go to PAUSED. The element will be restored to its PLAYING state by the parent pipeline when it prerolls again.
This is mostly used for elements that lost their preroll buffer in the Gst::STATE_PAUSED or Gst::STATE_PLAYING state after a flush, they will go to their pending state again when a new preroll buffer is queued. This function can only be called when the element is currently not in error or an async state change.
This function is used internally and should normally not be called from plugins or applications.
MT safe.
void Gst::Element::no_more_pads | ( | ) |
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.
This function emits the Gst::Element::no-more-pads signal.
MT safe.
virtual void Gst::Element::on_no_more_pads | ( | ) | [protected, virtual] |
virtual void Gst::Element::on_pad_added | ( | const Glib::RefPtr<Gst::Pad>& | new_pad | ) | [protected, virtual] |
virtual void Gst::Element::on_pad_removed | ( | const Glib::RefPtr<Gst::Pad>& | old_pad | ) | [protected, virtual] |
bool Gst::Element::post_message | ( | const Glib::RefPtr<Gst::Message>& | message | ) |
Post a message on the element's Gst::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.
message | A Gst::Message to post. |
true
if the message was successfully posted. The function returns false
if the element did not have a bus.void Gst::Element::post_message | ( | MessageType | message_type, | |
const Glib::QueryQuark & | domain, | |||
int | code, | |||
const Glib::ustring & | message, | |||
const Glib::ustring & | debug, | |||
const Glib::ustring & | filename, | |||
const Glib::ustring & | function_name, | |||
int | line_number | |||
) |
Post an error, warning or info message on the bus from inside an element.
type must be of Gst::MESSAGE_ERROR, Gst::MESSAGE_WARNING or Gst::MESSAGE_INFO.
MT safe.
type | The Gst::MessageType. | |
domain | The GStreamer GError domain this message belongs to. | |
code | The GError code belonging to the domain. | |
text | An allocated text string to be used as a replacement for the default message connected to code, or 0 . | |
debug | An allocated debug message to be used as a replacement for the default debugging information, or 0 . | |
file | The source code file where the error was generated. | |
function | The source code function where the error was generated. | |
line | The source code line where the error was generated. |
Glib::RefPtr<const Gst::Clock> Gst::Element::provide_clock | ( | ) | const |
Get the clock provided by the given element.
<note>An element is only required to provide a clock in the PAUSED state. Some elements can provide a clock in other states.</note>
0
if no clock could be provided. Unref after usage.Glib::RefPtr<Gst::Clock> Gst::Element::provide_clock | ( | ) |
Get the clock provided by the given element.
<note>An element is only required to provide a clock in the PAUSED state. Some elements can provide a clock in other states.</note>
0
if no clock could be provided. Unref after usage.virtual Glib::RefPtr<Gst::Clock> Gst::Element::provide_clock_vfunc | ( | ) | [virtual] |
Gets the Gst::Clock provided by the element.
bool Gst::Element::provides_clock | ( | ) | const |
Query if the element provides a clock.
A Gst::Clock provided by an element can be used as the global Gst::Clock for the pipeline. An element that can provide a clock is only required to do so in the PAUSED state, this means when it is fully negotiated and has allocated the resources to operate the clock.
true
if the element provides a clockbool Gst::Element::query | ( | const Glib::RefPtr<Gst::Query>& | query | ) |
Performs a query on the given element.
For elements that don't implement a query handler, this function forwards the query to a random srcpad or to the peer of a random linked sinkpad of this element.
query | The Gst::Query. |
true
if the query could be performed.bool Gst::Element::query_convert | ( | Format | src_format, | |
gint64 | src_value, | |||
Format& | dst_format, | |||
gint64 & | dst_value | |||
) | const |
Queries an element to convert src_val in src_format to dest_format.
src_format | A Gst::Format to convert from. | |
src_val | A value to convert. | |
dest_format | A pointer to the Gst::Format to convert to. | |
dest_val | A pointer to the result. |
true
if the query could be performed. bool Gst::Element::query_duration | ( | Format& | format | ) | const |
Queries an element for the total stream duration.
format | A pointer to the Gst::Format asked for. On return contains the Gst::Format used. |
bool Gst::Element::query_duration | ( | Format& | format, | |
gint64 & | duration | |||
) | const |
Queries an element for the total stream duration.
format | A pointer to the Gst::Format asked for. On return contains the Gst::Format used. | |
duration | A location in which to store the total duration, or 0 . |
true
if the query could be performed. bool Gst::Element::query_position | ( | Format& | format | ) | const |
Queries an element for the stream position.
format | A pointer to the Gst::Format asked for. On return will contain the Gst::Format used. |
bool Gst::Element::query_position | ( | Format& | format, | |
gint64 & | position | |||
) | const |
Queries an element for the stream position.
format | A pointer to the Gst::Format asked for. On return contains the Gst::Format used. | |
cur | A location in which to store the current position, or 0 . |
true
if the query could be performed. virtual bool Gst::Element::query_vfunc | ( | const Glib::RefPtr<Gst::Query>& | query | ) | [virtual] |
Get the supported Gst::QueryType of this element.
Perform a Gst::Query on the element.
virtual void Gst::Element::release_pad_vfunc | ( | const Glib::RefPtr<Gst::Pad>& | pad | ) | [virtual] |
Called when a request pad is to be released.
void Gst::Element::release_request_pad | ( | const Glib::RefPtr<Gst::Pad>& | pad | ) |
Makes the element free the previously requested pad as obtained with get_request_pad().
MT safe.
pad | The Gst::Pad to release. |
bool Gst::Element::remove_pad | ( | const Glib::RefPtr<Gst::Pad>& | pad | ) |
Removes pad from element.
pad will be destroyed if it has not been referenced elsewhere using Gst::Object::unparent().
This function is used by plugin developers and should not be used by applications. Pads that were dynamically requested from elements with get_request_pad() should be released with the release_request_pad() function instead.
Pads are not automatically deactivated so elements should perform the needed steps to deactivate the pad in case this pad is removed in the PAUSED or PLAYING state. See Gst::Pad::set_active() for more information about deactivating pads.
The pad and the element should be unlocked when calling this function.
This function will emit the Gst::Element::pad-removed signal on the element.
pad | The Gst::Pad to remove from the element. |
true
if the pad could be removed. Can return false
if the pad does not belong to the provided element.virtual Glib::RefPtr<Gst::Pad> Gst::Element::request_new_pad_vfunc | ( | const Glib::RefPtr<Gst::PadTemplate>& | templ, | |
const Glib::ustring & | name | |||
) | [virtual] |
Called when a new pad is requested.
bool Gst::Element::requires_clock | ( | ) | const |
bool Gst::Element::seek | ( | double | rate, | |
Format | format, | |||
SeekFlags | flags, | |||
SeekType | current_type, | |||
gint64 | current_position, | |||
SeekType | stop_type, | |||
gint64 | stop_position | |||
) |
Sends a seek event to an element.
See Gst::Event::new_seek() for the details of the parameters. The seek event is sent to the element using send_event().
rate | The new playback rate. | |
format | The format of the seek values. | |
flags | The optional seek flags. | |
cur_type | The type and flags for the new current position. | |
cur | The value of the new current position. | |
stop_type | The type and flags for the new stop position. | |
stop | The value of the new stop position. |
true
if the event was handled.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 seek().
In a completely prerolled PAUSED or PLAYING pipeline, seeking is always guaranteed to return true
on a seekable media type or false
when the media type is certainly not seekable (such as a live stream).
Some elements allow for seeking in the READY state, in this case they will store the seek event and execute it when they are put to PAUSED. If the element supports seek in READY, it will always return true
when it receives the event in the READY state.
format | A Gst::Format to execute the seek in, such as Gst::FORMAT_TIME. | |
seek_flags | Seek options; playback applications will usually want to use GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT here. | |
seek_pos | Position to seek to (relative to the start); if you are doing a seek in Gst::FORMAT_TIME this value is in nanoseconds - multiply with Gst::SECOND to convert seconds to nanoseconds or with Gst::MSECOND to convert milliseconds to nanoseconds. |
true
if the seek operation succeeded (the seek might not always be executed instantly though)bool Gst::Element::send_event | ( | const Glib::RefPtr<Gst::Event>& | event | ) |
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 upstream events or a random linked source pad for downstream events.
This function takes owership of the provided event.
event | The Gst::Event to send to the element. |
virtual bool Gst::Element::send_event_vfunc | ( | const Glib::RefPtr<Gst::Event>& | event | ) | [virtual] |
Send a Gst::Event to the element.
void Gst::Element::set_base_time | ( | ClockTime | time | ) |
Set the base time of an element.
See get_base_time().
MT safe.
time | The base time to set. |
void Gst::Element::set_bus | ( | const Glib::RefPtr<Gst::Bus>& | bus | ) |
Sets the bus of the element.
Increases the refcount on the bus. For internal use only, unless you're testing elements.
MT safe.
bus | The Gst::Bus to set. |
virtual void Gst::Element::set_bus_vfunc | ( | const Glib::RefPtr<Gst::Bus>& | bus | ) | [virtual] |
Set a Gst::Bus on the element.
bool Gst::Element::set_clock | ( | const Glib::RefPtr<Gst::Clock>& | clock | ) |
Sets the clock for the element.
This function increases the refcount on the clock. Any previously set clock on the object is unreffed.
clock | The Gst::Clock to set for the element. |
true
if the element accepted the clock. An element can refuse a clock when it, for example, is not able to slave its internal clock to the clock or when it requires a specific clock to operate.Reimplemented in Gst::Pipeline.
void Gst::Element::set_index | ( | const Glib::RefPtr<Gst::Index>& | index | ) |
Set index on the element.
The refcount of the index will be increased, any previously set index is unreffed.
MT safe.
index | A Gst::Index. |
virtual void Gst::Element::set_index_vfunc | ( | const Glib::RefPtr<Gst::Index>& | index | ) | [virtual] |
Set the Gst::Index of an element.
bool Gst::Element::set_locked_state | ( | gboolean | locked_state | ) |
Locks the state of an element, so state changes of the parent don't affect this element anymore.
MT safe.
locked_state | true to lock the element's state. |
true
if the state was changed, false
if bad parameters were given or the elements state-locking needed no change. StateChangeReturn Gst::Element::set_state | ( | State | state | ) |
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.
This function can return Gst::STATE_CHANGE_ASYNC, in which case the element will perform the remainder of the state change asynchronously in another thread. An application can use get_state() to wait for the completion of the state change or it can wait for a state change message on the bus.
state | The element's new Gst::State. |
virtual StateChangeReturn Gst::Element::set_state_vfunc | ( | State | state | ) | [virtual] |
Set a new state on the element.
Glib::SignalProxy0< void > Gst::Element::signal_no_more_pads | ( | ) |
This signals that the element will not generate more dynamic pads.
void on_my_no_more_pads()
Glib::SignalProxy1<void,const Glib::RefPtr<Gst::Pad>&> Gst::Element::signal_pad_added | ( | ) |
signals that a new Gst::Pad has been added to the element.
void on_my_pad_added(const Glib::RefPtr<Gst::Pad>& new_pad)
Glib::SignalProxy1<void,const Glib::RefPtr<Gst::Pad>&> Gst::Element::signal_pad_removed | ( | ) |
signals that a Gst::Pad has been removed from the element
void on_my_pad_removed(const Glib::RefPtr<Gst::Pad>& old_pad)
bool Gst::Element::sync_state_with_parent | ( | ) |
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.
true
, if the element's state could be synced to the parent's state.void Gst::Element::unlink | ( | const Glib::RefPtr<Gst::Element>& | other_element | ) |
Unlinks all source pads of the source element with all sink pads of the sink element to which they are linked.
If the link has been made using link(), it could have created an requestpad, which has to be released using release_request_pad().
dest | The sink Gst::Element to unlink. |
void Gst::Element::unlink_pads | ( | const Glib::ustring & | padname, | |
const Glib::RefPtr<Gst::Element>& | other_element, | |||
const Glib::ustring & | other_padname | |||
) |
Unlinks the two named pads of the source and destination elements.
srcpadname | The name of the Gst::Pad in source element. | |
dest | A Gst::Element containing the destination pad. | |
destpadname | The name of the Gst::Pad in destination element. |
Glib::RefPtr<Gst::Element> wrap | ( | GstElement * | object, | |
bool | take_copy = false | |||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. | |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |