pub trait BaseSrcExtManual: 'static {
    fn allocator(&self) -> (Option<Allocator>, AllocationParams);
fn segment(&self) -> Segment;
fn query_latency(
    ) -> Result<(bool, Option<ClockTime>, Option<ClockTime>), BoolError>;
fn new_segment(&self, segment: &Segment) -> Result<(), BoolError>;
fn src_pad(&self) -> Pad; }

Required methods

Lets BaseSrc sub-classes to know the memory allocator used by the base class and its params.

Unref the allocator after usage.


the gst::Allocator used


the gst::AllocationParams of allocator

Query the source for the latency parameters. live will be true when self is configured as a live source. min_latency and max_latency will be set to the difference between the running time and the timestamp of the first buffer.

This function is mostly used by subclasses.


true if the query succeeded.


if the source is live


the min latency of the source


the max latency of the source

This is supported on crate feature v1_18 only.

Prepare a new segment for emission downstream. This function must only be called by derived sub-classes, and only from the GstBaseSrcClass::create function, as the stream-lock needs to be held.

The format for the segment must be identical with the current format of the source, as configured with BaseSrcExt::set_format().

The format of self must not be gst::Format::Undefined and the format should be configured via BaseSrcExt::set_format() before calling this method.


a pointer to a gst::Segment


true if preparation of new segment succeeded.