[−][src]Struct gst::Pipeline
A GstPipeline is a special GstBin used as the toplevel container for the filter graph. The GstPipeline will manage the selection and distribution of a global GstClock as well as provide a GstBus to the application.
gst_pipeline_new() is used to create a pipeline. when you are done with the pipeline, use gst_object_unref() to free its resources including all added GstElement objects (if not otherwise referenced).
Elements are added and removed from the pipeline using the GstBin methods like gst_bin_add() and gst_bin_remove() (see GstBin).
Before changing the state of the GstPipeline (see GstElement) a GstBus can be retrieved with gst_pipeline_get_bus(). This bus can then be used to receive GstMessage from the elements in the pipeline.
By default, a GstPipeline will automatically flush the pending GstBus messages when going to the NULL state to ensure that no circular references exist when no messages are read from the GstBus. This behaviour can be changed with gst_pipeline_set_auto_flush_bus().
When the GstPipeline performs the PAUSED to PLAYING state change it will select a clock for the elements. The clock selection algorithm will by default select a clock provided by an element that is most upstream (closest to the source). For live pipelines (ones that return GST_STATE_CHANGE_NO_PREROLL from the gst_element_set_state() call) this will select the clock provided by the live source. For normal pipelines this will select a clock provided by the sinks (most likely the audio sink). If no element provides a clock, a default GstSystemClock is used.
The clock selection can be controlled with the gst_pipeline_use_clock() method, which will enforce a given clock on the pipeline. With gst_pipeline_auto_clock() the default clock selection algorithm can be restored.
A GstPipeline maintains a running time for the elements. The running time is defined as the difference between the current clock time and the base time. When the pipeline goes to READY or a flushing seek is performed on it, the running time is reset to 0. When the pipeline is set from PLAYING to PAUSED, the current clock time is sampled and used to configure the base time for the elements when the pipeline is set to PLAYING again. The effect is that the running time (as the difference between the clock time and the base time) will count how much time was spent in the PLAYING state. This default behaviour can be changed with the gst_element_set_start_time() method.
Methods
impl Pipeline
[src]
pub fn new(name: &str) -> Option<Pipeline>
[src]
Create a new pipeline with the given name.
pub fn new_from_str(string: &str) -> Result<Pipeline>
[src]
Creates a new pipeline based on the command-line syntax
pub unsafe fn new_from_gst_pipeline(
pipeline: *mut GstPipeline
) -> Option<Pipeline>
[src]
pipeline: *mut GstPipeline
) -> Option<Pipeline>
pub fn bus(&self) -> Option<Bus>
[src]
Gets the GstBus of pipeline . The bus allows applications to receive Message packets.
pub fn delay(&self) -> GstClockTime
[src]
Get the configured delay (see set_delay()).
pub fn set_delay(&mut self, delay: GstClockTime)
[src]
Set the expected delay needed for all elements to perform the PAUSED to PLAYING state change. delay will be added to the base time of the elements so that they wait an additional delay amount of time before starting to process buffers and cannot be GST_CLOCK_TIME_NONE.
This option is used for tuning purposes and should normally not be used.
pub unsafe fn gst_pipeline(&self) -> *const GstPipeline
[src]
Returns a const raw pointer to the internal GstElement
pub unsafe fn gst_pipeline_mut(&mut self) -> *mut GstPipeline
[src]
Returns a mut raw pointer to the internal GstElement
Methods from Deref<Target = Bin>
pub fn add<E: Into<Element>>(&mut self, element: E) -> bool
[src]
Adds the given element to the bin. Sets the element's parent, and thus adds a reference.
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 Element::set_state(), or use gst_element_sync_state_with_parent(). The bin or pipeline will not take care of this for you.
pub fn add_and_link<E: Into<Element>>(&mut self, src: E, sink: E) -> bool
[src]
pub fn add_many(&mut self, elements: Vec<Element>) -> bool
[src]
pub fn add_and_link_many(&mut self, elements: Vec<Element>) -> bool
[src]
pub fn remove(&mut self, element: &Element) -> bool
[src]
Remove the element from its associated bin.
If the element's pads are linked to other pads, the pads will be unlinked before the element is removed from the bin.
pub fn get_by_name(&self, name: &str) -> Option<Element>
[src]
Get the element with the given name from this bin.
Returns None if no element with the given name is found in the bin.
pub fn get_by_name_recurse_up(&self, name: &str) -> Option<Element>
[src]
Gets the element with the given name from this bin. If the element is not found, a recursion is performed on the parent bin.
Returns None if no element with the given name is found in the bin.
ⓘImportant traits for Iter<I>pub fn iter(&self) -> Iter<Element>
[src]
ⓘImportant traits for Iter<I>pub fn iter_recurse(&self) -> Iter<Element>
[src]
pub fn recalculate_latency(&mut self) -> bool
[src]
Query bin for the current latency using and reconfigures this latency to all the elements with 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 'do-latency' signal so any custom latency calculations will be performed.
pub fn set_async_handling(&mut self, async: bool)
[src]
If set to true, the bin will handle asynchronous state changes. This should be used only if the bin subclass is modifying the state of its children on its own
pub fn set_message_forward(&mut self, forward: bool)
[src]
Forward all children messages, even those that would normally be filtered by the bin. This can be interesting when one wants to be notified of the EOS state of individual elements, for example.
The messages are converted to an ELEMENT message with the bin as the source. The structure of the message is named 'GstBinForwarded' and contains a field named 'message' of type GST_TYPE_MESSAGE that contains the original forwarded message.
pub unsafe fn gst_bin(&self) -> *const GstBin
[src]
Returns a const raw pointer to the internal GstElement
pub unsafe fn gst_bin_mut(&mut self) -> *mut GstBin
[src]
Returns a mut raw pointer to the internal GstElement
Trait Implementations
impl Transfer<Struct__GstElement> for Pipeline
[src]
unsafe fn transfer(self) -> *mut GstElement
[src]
impl AsMut<Bin> for Pipeline
[src]
impl AsMut<Pipeline> for PlayBin
[src]
impl Sync for Pipeline
[src]
impl AsRef<Bin> for Pipeline
[src]
impl AsRef<Pipeline> for PlayBin
[src]
impl Send for Pipeline
[src]
impl From<Pipeline> for Bin
[src]
impl From<PlayBin> for Pipeline
[src]
impl Deref for Pipeline
[src]
impl DerefMut for Pipeline
[src]
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,