Trait gstreamer::prelude::ElementExt[][src]

pub trait ElementExt: 'static {
Show methods fn abort_state(&self);
fn add_pad<P: IsA<Pad>>(&self, pad: &P) -> Result<(), BoolError>;
fn change_state(
        &self,
        transition: StateChange
    ) -> Result<StateChangeSuccess, StateChangeError>;
fn continue_state(
        &self,
        ret: impl Into<StateChangeReturn>
    ) -> Result<StateChangeSuccess, StateChangeError>;
fn create_all_pads(&self);
fn foreach_pad<P: FnMut(&Element, &Pad) -> bool>(&self, func: P) -> bool;
fn foreach_sink_pad<P: FnMut(&Element, &Pad) -> bool>(
        &self,
        func: P
    ) -> bool;
fn foreach_src_pad<P: FnMut(&Element, &Pad) -> bool>(&self, func: P) -> bool;
fn base_time(&self) -> Option<ClockTime>;
fn bus(&self) -> Option<Bus>;
fn clock(&self) -> Option<Clock>;
fn compatible_pad<P: IsA<Pad>>(
        &self,
        pad: &P,
        caps: Option<&Caps>
    ) -> Option<Pad>;
fn compatible_pad_template(
        &self,
        compattempl: &PadTemplate
    ) -> Option<PadTemplate>;
fn context(&self, context_type: &str) -> Option<Context>;
fn contexts(&self) -> Vec<Context>;
fn factory(&self) -> Option<ElementFactory>;
fn start_time(&self) -> Option<ClockTime>;
fn state(
        &self,
        timeout: impl Into<Option<ClockTime>>
    ) -> (Result<StateChangeSuccess, StateChangeError>, State, State);
fn static_pad(&self, name: &str) -> Option<Pad>;
fn is_locked_state(&self) -> bool;
fn link<P: IsA<Element>>(&self, dest: &P) -> Result<(), BoolError>;
fn link_filtered<P: IsA<Element>>(
        &self,
        dest: &P,
        filter: &Caps
    ) -> Result<(), BoolError>;
fn link_pads<P: IsA<Element>>(
        &self,
        srcpadname: Option<&str>,
        dest: &P,
        destpadname: Option<&str>
    ) -> Result<(), BoolError>;
fn link_pads_filtered<P: IsA<Element>>(
        &self,
        srcpadname: Option<&str>,
        dest: &P,
        destpadname: Option<&str>,
        filter: &Caps
    ) -> Result<(), BoolError>;
fn link_pads_full<P: IsA<Element>>(
        &self,
        srcpadname: Option<&str>,
        dest: &P,
        destpadname: Option<&str>,
        flags: PadLinkCheck
    ) -> Result<(), BoolError>;
fn lost_state(&self);
fn no_more_pads(&self);
fn provide_clock(&self) -> Option<Clock>;
fn release_request_pad<P: IsA<Pad>>(&self, pad: &P);
fn remove_pad<P: IsA<Pad>>(&self, pad: &P) -> Result<(), BoolError>;
fn request_pad(
        &self,
        templ: &PadTemplate,
        name: Option<&str>,
        caps: Option<&Caps>
    ) -> Option<Pad>;
fn request_pad_simple(&self, name: &str) -> Option<Pad>;
fn set_base_time(&self, time: ClockTime);
fn set_bus(&self, bus: Option<&Bus>);
fn set_clock<P: IsA<Clock>>(
        &self,
        clock: Option<&P>
    ) -> Result<(), BoolError>;
fn set_context(&self, context: &Context);
fn set_locked_state(&self, locked_state: bool) -> bool;
fn set_start_time(&self, time: impl Into<Option<ClockTime>>);
fn set_state(
        &self,
        state: State
    ) -> Result<StateChangeSuccess, StateChangeError>;
fn sync_state_with_parent(&self) -> Result<(), BoolError>;
fn unlink<P: IsA<Element>>(&self, dest: &P);
fn unlink_pads<P: IsA<Element>>(
        &self,
        srcpadname: &str,
        dest: &P,
        destpadname: &str
    );
fn connect_no_more_pads<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_pad_added<F: Fn(&Self, &Pad) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_pad_removed<F: Fn(&Self, &Pad) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}
Expand description

Trait containing all Element methods.

Implementors

Bin, Element, TagSetter, TocSetter

Required methods

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.

Adds a pad (link point) to self. pad’s parent will be set to self; see GstObjectExt::set_parent() for refcounting information.

Pads are automatically activated when added in the PAUSED or PLAYING state.

The pad and the element should be unlocked when calling this function.

This function will emit the signal::Element::pad-added signal on the element.

pad

the Pad to add to the element.

Returns

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.

MT safe.

Perform transition on self.

This function must be called with STATE_LOCK held and is mainly used internally.

transition

the requested transition

Returns

the StateChangeReturn of the state transition.

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 StateChangeReturn::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.

This function must be called with STATE_LOCK held.

ret

The previous state return value

Returns

The result of the commit state change.

MT safe.

This is supported on crate feature v1_14 only.
This is supported on crate feature v1_14 only.
This is supported on crate feature v1_14 only.
This is supported on crate feature v1_20 only.

Implementors

This is supported on crate feature v1_14 only.
This is supported on crate feature v1_14 only.
This is supported on crate feature v1_14 only.
This is supported on crate feature v1_20 only.