Trait gstreamer_base::prelude::BaseSrcExt[][src]

pub trait BaseSrcExt: 'static {
Show methods fn blocksize(&self) -> u32;
fn buffer_pool(&self) -> Option<BufferPool>;
fn does_timestamp(&self) -> bool;
fn is_async(&self) -> bool;
fn is_live(&self) -> bool;
fn negotiate(&self) -> bool;
fn new_seamless_segment(&self, start: i64, stop: i64, time: i64) -> bool;
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) -> Result<(), BoolError>;
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: impl Into<FlowReturn>);
fn start_wait(&self) -> Result<FlowSuccess, FlowError>;
fn wait_playing(&self) -> Result<FlowSuccess, FlowError>;
fn num_buffers(&self) -> i32;
fn set_num_buffers(&self, num_buffers: i32);
fn is_typefind(&self) -> bool;
fn set_typefind(&self, typefind: bool);
fn connect_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_do_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_num_buffers_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_typefind_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}

Trait containing all BaseSrc methods.

Implementors

crate::BaseSrc, crate::PushSrc

Required methods

fn blocksize(&self) -> u32[src]

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

Returns

the number of bytes pushed with each buffer.

fn buffer_pool(&self) -> Option<BufferPool>[src]

Returns

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

fn does_timestamp(&self) -> bool[src]

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

Returns

true if the base class will automatically timestamp outgoing buffers.

fn is_async(&self) -> bool[src]

Get the current async behaviour of self. See also Self::set_async().

Returns

true if self is operating in async mode.

fn is_live(&self) -> bool[src]

Check if an element is in live mode.

Returns

true if element is in live mode.

fn negotiate(&self) -> bool[src]

This is supported on crate feature v1_18 only.

Negotiates src pad caps with downstream elements. Unmarks GST_PAD_FLAG_NEED_RECONFIGURE in any case. But marks it again if [crate::GstBaseSrcClass.negotiate()] fails.

Do not call this in the [crate::GstBaseSrcClass.fill()] vmethod. Call this in [crate::GstBaseSrcClass.create()] or in [crate::GstBaseSrcClass.alloc()], before any buffer is allocated.

Returns

true if the negotiation succeeded, else false.

fn new_seamless_segment(&self, start: i64, stop: i64, time: i64) -> bool[src]

👎 Deprecated:

Since 1.18

Prepare a new seamless segment for emission downstream. This function must only be called by derived sub-classes, and only from the [crate::BaseSrcClass::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 Self::set_format()

Deprecated since 1.18

Use [crate::BaseSrc::new_segment()]

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.

fn set_async(&self, async_: bool)[src]

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

fn set_automatic_eos(&self, automatic_eos: bool)[src]

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.

When self operates in crate::gst::Format::Time, crate::BaseSrc will send an EOS when a buffer outside of the currently configured segment is pushed if automatic_eos is true. Since 1.16, if automatic_eos is false an EOS will be pushed only when the [crate::GstBaseSrcClass.create()] implementation returns crate::gst::FlowReturn::Eos.

automatic_eos

automatic eos

fn set_blocksize(&self, blocksize: u32)[src]

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

fn set_caps(&self, caps: &Caps) -> Result<(), BoolError>[src]

Set new caps on the basesrc source pad.

caps

a crate::gst::Caps

Returns

true if the caps could be set

fn set_do_timestamp(&self, timestamp: bool)[src]

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

fn set_dynamic_size(&self, dynamic: bool)[src]

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

fn set_format(&self, format: Format)[src]

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 [crate::GstBaseSrcClass.is_seekable()] returns true.

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

format

the format to use

fn set_live(&self, live: bool)[src]

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

fn start_complete(&self, ret: impl Into<FlowReturn>)[src]

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

ret

a crate::gst::FlowReturn

fn start_wait(&self) -> Result<FlowSuccess, FlowError>[src]

fn wait_playing(&self) -> Result<FlowSuccess, FlowError>[src]

fn num_buffers(&self) -> i32[src]

fn set_num_buffers(&self, num_buffers: i32)[src]

fn is_typefind(&self) -> bool[src]

fn set_typefind(&self, typefind: bool)[src]

fn connect_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_do_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_num_buffers_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_typefind_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Loading content...

Implementors

impl<O: IsA<BaseSrc>> BaseSrcExt for O[src]

fn blocksize(&self) -> u32[src]

fn buffer_pool(&self) -> Option<BufferPool>[src]

fn does_timestamp(&self) -> bool[src]

fn is_async(&self) -> bool[src]

fn is_live(&self) -> bool[src]

fn negotiate(&self) -> bool[src]

This is supported on crate feature v1_18 only.

fn new_seamless_segment(&self, start: i64, stop: i64, time: i64) -> bool[src]

👎 Deprecated:

Since 1.18

fn set_async(&self, async_: bool)[src]

fn set_automatic_eos(&self, automatic_eos: bool)[src]

fn set_blocksize(&self, blocksize: u32)[src]

fn set_caps(&self, caps: &Caps) -> Result<(), BoolError>[src]

fn set_do_timestamp(&self, timestamp: bool)[src]

fn set_dynamic_size(&self, dynamic: bool)[src]

fn set_format(&self, format: Format)[src]

fn set_live(&self, live: bool)[src]

fn start_complete(&self, ret: impl Into<FlowReturn>)[src]

fn start_wait(&self) -> Result<FlowSuccess, FlowError>[src]

fn wait_playing(&self) -> Result<FlowSuccess, FlowError>[src]

fn num_buffers(&self) -> i32[src]

fn set_num_buffers(&self, num_buffers: i32)[src]

fn is_typefind(&self) -> bool[src]

fn set_typefind(&self, typefind: bool)[src]

fn connect_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_do_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_num_buffers_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_typefind_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Loading content...