Trait gstreamer_base::BaseSrcExt[][src]

pub trait BaseSrcExt {
    fn get_blocksize(&self) -> u32;
fn get_buffer_pool(&self) -> Option<BufferPool>;
fn get_do_timestamp(&self) -> bool;
fn is_async(&self) -> bool;
fn is_live(&self) -> bool;
fn new_seamless_segment(&self, start: i64, stop: i64, time: i64) -> bool;
fn query_latency(&self) -> Option<(bool, ClockTime, ClockTime)>;
fn set_async(&self, async: bool);
fn set_automatic_eos(&self, automatic_eos: bool);
fn set_blocksize(&self, blocksize: u32);
fn set_caps(&self, caps: &Caps) -> bool;
fn set_do_timestamp(&self, timestamp: bool);
fn set_dynamic_size(&self, dynamic: bool);
fn set_format(&self, format: Format);
fn set_live(&self, live: bool);
fn start_complete(&self, ret: FlowReturn);
fn start_wait(&self) -> FlowReturn;
fn wait_playing(&self) -> FlowReturn;
fn get_property_num_buffers(&self) -> i32;
fn set_property_num_buffers(&self, num_buffers: i32);
fn get_property_typefind(&self) -> bool;
fn set_property_typefind(&self, typefind: bool);
fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_do_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_num_buffers_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_typefind_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all BaseSrc methods.

Implementors

BaseSrc, PushSrc

Required Methods

Get the number of bytes that self will push out with each buffer.

Returns

the number of bytes pushed with each buffer.

Returns

the instance of the gst::BufferPool used by the src; unref it after usage.

Query if self timestamps outgoing buffers based on the current running_time.

Returns

true if the base class will automatically timestamp outgoing buffers.

Get the current async behaviour of self. See also BaseSrcExt::set_async.

Returns

true if self is operating in async mode.

Check if an element is in live mode.

Returns

true if element is in live mode.

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

The format for the new segment will be the current format of the source, as configured with BaseSrcExt::set_format

start

The new start value for the segment

stop

Stop value for the new segment

time

The new time value for the start of the new segment

Returns

true if preparation of the seamless segment succeeded.

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.

live

if the source is live

min_latency

the min latency of the source

max_latency

the max latency of the source

Returns

true if the query succeeded.

Configure async behaviour in self, no state change will block. The open, close, start, stop, play and pause virtual methods will be executed in a different thread and are thus allowed to perform blocking operations. Any blocking operation should be unblocked with the unlock vmethod.

async

new async mode

If automatic_eos is true, self will automatically go EOS if a buffer after the total size is returned. By default this is true but sources that can't return an authoritative size and only know that they're EOS when trying to read more should set this to false.

automatic_eos

automatic eos

Set the number of bytes that self will push out with each buffer. When blocksize is set to -1, a default length will be used.

blocksize

the new blocksize in bytes

Set new caps on the basesrc source pad.

caps

a gst::Caps

Returns

true if the caps could be set

Configure self to automatically timestamp outgoing buffers based on the current running_time of the pipeline. This property is mostly useful for live sources.

timestamp

enable or disable timestamping

If not dynamic, size is only updated when needed, such as when trying to read past current tracked size. Otherwise, size is checked for upon each read.

dynamic

new dynamic size mode

Sets the default format of the source. This will be the format used for sending SEGMENT events and for performing seeks.

If a format of GST_FORMAT_BYTES is set, the element will be able to operate in pull mode if the BaseSrcClass.is_seekable() returns true.

This function must only be called in states < gst::State::Paused.

format

the format to use

If the element listens to a live source, live should be set to true.

A live source will not produce data in the PAUSED state and will therefore not be able to participate in the PREROLL phase of a pipeline. To signal this fact to the application and the pipeline, the state change return value of the live source will be GST_STATE_CHANGE_NO_PREROLL.

live

new live-mode

Complete an asynchronous start operation. When the subclass overrides the start method, it should call BaseSrcExt::start_complete when the start operation completes either from the same thread or from an asynchronous helper thread.

ret

a gst::FlowReturn

Wait until the start operation completes.

Returns

a gst::FlowReturn.

If the BaseSrcClass.create() method performs its own synchronisation against the clock it must unblock when going from PLAYING to the PAUSED state and call this method before continuing to produce the remaining data.

This function will block until a state change to PLAYING happens (in which case this function returns gst::FlowReturn::Ok) or the processing must be stopped due to a state change to READY or a FLUSH event (in which case this function returns gst::FlowReturn::Flushing).

Returns

gst::FlowReturn::Ok if self is PLAYING and processing can continue. Any other return value should be returned from the create vmethod.

Implementors