[]Struct gstreamer_base::BaseParse

pub struct BaseParse(_, _);

This base class is for parser elements that process data and splits it into separate audio/video/whatever frames.

It provides for:

The purpose of this base class is to provide the basic functionality of a parser and share a lot of rather complex code.

Description of the parsing mechanism:

Set-up phase

Parsing phase

Of course, BaseParseExt::set_min_frame_size could also be used if a very specific known amount of additional data is required. If, however, the buffer holds a complete valid frame, it can pass the size of this frame to BaseParse::finish_frame.

If acting as a converter, it can also merely indicate consumed input data while simultaneously providing custom output data. Note that baseclass performs some processing (such as tracking overall consumed data rate versus duration) for each finished frame, but other state is only updated upon each call to BaseParseClass.handle_frame() (such as tracking upstream input timestamp).

Subclass is also responsible for setting the buffer metadata (e.g. buffer timestamp and duration, or keyframe if applicable). (although the latter can also be done by BaseParse if it is appropriately configured, see below). Frame is provided with timestamp derived from upstream (as much as generally possible), duration obtained from configuration (see below), and offset if meaningful (in pull mode).

Note that BaseParseClass.handle_frame() might receive any small amount of input data when leftover data is being drained (e.g. at EOS).

Shutdown phase

Subclass is responsible for providing pad template caps for source and sink pads. The pads need to be named "sink" and "src". It also needs to set the fixed caps on srcpad, when the format is ensured (e.g. when base class calls subclass' BaseParseClass.set_sink_caps() function).

This base class uses gst::Format::Default as a meaning of frames. So, subclass conversion routine needs to know that conversion from gst::Format::Time to gst::Format::Default must return the frame number that can be found from the given byte position.

BaseParse uses subclasses conversion methods also for seeking (or otherwise uses its own default one, see also below).

Subclass start and stop functions will be called to inform the beginning and end of data processing.

Things that subclass need to take care of:

Implements

BaseParseExt, gst::ElementExt, gst::ObjectExt, glib::object::ObjectExt

Trait Implementations

impl Clone for BaseParse

impl Debug for BaseParse

impl Eq for BaseParse

impl Hash for BaseParse

impl IsA<Element> for BaseParse

impl IsA<Object> for BaseParse

impl Ord for BaseParse

impl<T: ObjectType> PartialEq<T> for BaseParse

impl<T: ObjectType> PartialOrd<T> for BaseParse

impl Send for BaseParse[src]

impl StaticType for BaseParse

impl Sync for BaseParse[src]

Auto Trait Implementations

impl RefUnwindSafe for BaseParse

impl Unpin for BaseParse

impl UnwindSafe for BaseParse

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 
[src]

impl<T> Cast for T where
    T: ObjectType
[src]

impl<O> ElementExt for O where
    O: IsA<Element>, 
[src]

impl<O> ElementExtManual for O where
    O: IsA<Element>, 
[src]

impl<T> From<T> for T[src]

impl<O> GObjectExtManualGst for O where
    O: IsA<Object>, 
[src]

impl<O> GstObjectExt for O where
    O: IsA<Object>, 
[src]

impl<O> GstObjectExtManual for O where
    O: IsA<Object>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.