pub trait ElementExt: 'static {
Show 44 methods fn abort_state(&self);
fn add_pad(&self, pad: &impl IsA<Pad>) -> 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(
        &self,
        pad: &impl IsA<Pad>,
        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>
Notable traits for Vec<u8, A>
impl<A> Write for Vec<u8, A> where
    A: Allocator
;
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(&self, dest: &impl IsA<Element>) -> Result<(), BoolError>;
fn link_filtered(
        &self,
        dest: &impl IsA<Element>,
        filter: &Caps
    ) -> Result<(), BoolError>;
fn link_pads(
        &self,
        srcpadname: Option<&str>,
        dest: &impl IsA<Element>,
        destpadname: Option<&str>
    ) -> Result<(), BoolError>;
fn link_pads_filtered(
        &self,
        srcpadname: Option<&str>,
        dest: &impl IsA<Element>,
        destpadname: Option<&str>,
        filter: &Caps
    ) -> Result<(), BoolError>;
fn link_pads_full(
        &self,
        srcpadname: Option<&str>,
        dest: &impl IsA<Element>,
        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(&self, pad: &impl IsA<Pad>);
fn remove_pad(&self, pad: &impl IsA<Pad>) -> Result<(), BoolError>;
fn request_pad(
        &self,
        templ: &PadTemplate,
        name: Option<&str>,
        caps: Option<&Caps>
    ) -> Option<Pad>;
fn set_base_time(&self, time: ClockTime);
fn set_bus(&self, bus: Option<&Bus>);
fn set_clock(
        &self,
        clock: Option<&impl IsA<Clock>>
    ) -> 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(&self, dest: &impl IsA<Element>);
fn unlink_pads(
        &self,
        srcpadname: &str,
        dest: &impl IsA<Element>,
        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.

Implementors