Trait gstreamer_base::prelude::BaseSinkExt[][src]

pub trait BaseSinkExt: 'static {
Show methods fn blocksize(&self) -> u32;
fn is_drop_out_of_segment(&self) -> bool;
fn last_sample(&self) -> Option<Sample>;
fn latency(&self) -> ClockTime;
fn max_bitrate(&self) -> u64;
fn max_lateness(&self) -> i64;
fn processing_deadline(&self) -> ClockTime;
fn render_delay(&self) -> ClockTime;
fn stats(&self) -> Structure;
fn is_sync(&self) -> bool;
fn throttle_time(&self) -> u64;
fn ts_offset(&self) -> ClockTimeDiff;
fn is_async_enabled(&self) -> bool;
fn is_last_sample_enabled(&self) -> bool;
fn is_qos_enabled(&self) -> bool;
fn set_async_enabled(&self, enabled: bool);
fn set_blocksize(&self, blocksize: u32);
fn set_drop_out_of_segment(&self, drop_out_of_segment: bool);
fn set_last_sample_enabled(&self, enabled: bool);
fn set_max_bitrate(&self, max_bitrate: u64);
fn set_max_lateness(&self, max_lateness: i64);
fn set_processing_deadline(&self, processing_deadline: ClockTime);
fn set_qos_enabled(&self, enabled: bool);
fn set_render_delay(&self, delay: ClockTime);
fn set_sync(&self, sync: bool);
fn set_throttle_time(&self, throttle: u64);
fn set_ts_offset(&self, offset: ClockTimeDiff);
fn wait(
        &self,
        time: ClockTime
    ) -> (Result<FlowSuccess, FlowError>, ClockTimeDiff);
fn wait_clock(
        &self,
        time: ClockTime
    ) -> (Result<ClockSuccess, ClockError>, ClockTimeDiff);
fn wait_preroll(&self) -> Result<FlowSuccess, FlowError>;
fn is_async(&self) -> bool;
fn set_async(&self, async_: bool);
fn enables_last_sample(&self) -> bool;
fn set_enable_last_sample(&self, enable_last_sample: bool);
fn is_qos(&self) -> bool;
fn set_qos(&self, qos: bool);
fn connect_async_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_enable_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_max_bitrate_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_max_lateness_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_processing_deadline_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_render_delay_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_stats_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_sync_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_throttle_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_ts_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}

Trait containing all BaseSink methods.

Implementors

crate::BaseSink

Required methods

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

Get the number of bytes that the sink will pull when it is operating in pull mode.

Returns

the number of bytes self will pull in pull mode.

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

This is supported on crate feature v1_12 only.

Checks if self is currently configured to drop buffers which are outside the current segment

Returns

true if the sink is configured to drop buffers outside the current segment.

fn last_sample(&self) -> Option<Sample>[src]

Get the last sample that arrived in the sink and was used for preroll or for rendering. This property can be used to generate thumbnails.

The crate::gst::Caps on the sample can be used to determine the type of the buffer.

Free-function: gst_sample_unref

Returns

a crate::gst::Sample. gst_sample_unref() after usage. This function returns None when no buffer has arrived in the sink yet or when the sink is not in PAUSED or PLAYING.

fn latency(&self) -> ClockTime[src]

Get the currently configured latency.

Returns

The configured latency.

fn max_bitrate(&self) -> u64[src]

Get the maximum amount of bits per second that the sink will render.

Returns

the maximum number of bits per second self will render.

fn max_lateness(&self) -> i64[src]

Gets the max lateness value. See Self::set_max_lateness() for more details.

Returns

The maximum time in nanoseconds that a buffer can be late before it is dropped and not rendered. A value of -1 means an unlimited time.

fn processing_deadline(&self) -> ClockTime[src]

This is supported on crate feature v1_16 only.

Get the processing deadline of self. see Self::set_processing_deadline() for more information about the processing deadline.

Returns

the processing deadline

fn render_delay(&self) -> ClockTime[src]

Get the render delay of self. see Self::set_render_delay() for more information about the render delay.

Returns

the render delay of self.

fn stats(&self) -> Structure[src]

This is supported on crate feature v1_18 only.

Return various crate::BaseSink statistics. This function returns a crate::gst::Structure with name application/x-gst-base-sink-stats with the following fields:

  • “average-rate” G_TYPE_DOUBLE average frame rate
  • “dropped” G_TYPE_UINT64 Number of dropped frames
  • “rendered” G_TYPE_UINT64 Number of rendered frames

Returns

pointer to crate::gst::Structure

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

Checks if self is currently configured to synchronize against the clock.

Returns

true if the sink is configured to synchronize against the clock.

fn throttle_time(&self) -> u64[src]

Get the time that will be inserted between frames to control the maximum buffers per second.

Returns

the number of nanoseconds self will put between frames.

fn ts_offset(&self) -> ClockTimeDiff[src]

Get the synchronisation offset of self.

Returns

The synchronisation offset.

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

Checks if self is currently configured to perform asynchronous state changes to PAUSED.

Returns

true if the sink is configured to perform asynchronous state changes.

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

Checks if self is currently configured to store the last received sample in the last-sample property.

Returns

true if the sink is configured to store the last received sample.

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

Checks if self is currently configured to send Quality-of-Service events upstream.

Returns

true if the sink is configured to perform Quality-of-Service.

fn set_async_enabled(&self, enabled: bool)[src]

Configures self to perform all state changes asynchronously. When async is disabled, the sink will immediately go to PAUSED instead of waiting for a preroll buffer. This feature is useful if the sink does not synchronize against the clock or when it is dealing with sparse streams.

enabled

the new async value.

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

Set the number of bytes that the sink will pull when it is operating in pull mode.

blocksize

the blocksize in bytes

fn set_drop_out_of_segment(&self, drop_out_of_segment: bool)[src]

This is supported on crate feature v1_12 only.

Configure self to drop buffers which are outside the current segment

drop_out_of_segment

drop buffers outside the segment

fn set_last_sample_enabled(&self, enabled: bool)[src]

Configures self to store the last received sample in the last-sample property.

enabled

the new enable-last-sample value.

fn set_max_bitrate(&self, max_bitrate: u64)[src]

Set the maximum amount of bits per second that the sink will render.

max_bitrate

the max_bitrate in bits per second

fn set_max_lateness(&self, max_lateness: i64)[src]

Sets the new max lateness value to max_lateness. This value is used to decide if a buffer should be dropped or not based on the buffer timestamp and the current clock time. A value of -1 means an unlimited time.

max_lateness

the new max lateness value.

fn set_processing_deadline(&self, processing_deadline: ClockTime)[src]

This is supported on crate feature v1_16 only.

Maximum amount of time (in nanoseconds) that the pipeline can take for processing the buffer. This is added to the latency of live pipelines.

This function is usually called by subclasses.

processing_deadline

the new processing deadline in nanoseconds.

fn set_qos_enabled(&self, enabled: bool)[src]

Configures self to send Quality-of-Service events upstream.

enabled

the new qos value.

fn set_render_delay(&self, delay: ClockTime)[src]

Set the render delay in self to delay. The render delay is the time between actual rendering of a buffer and its synchronisation time. Some devices might delay media rendering which can be compensated for with this function.

After calling this function, this sink will report additional latency and other sinks will adjust their latency to delay the rendering of their media.

This function is usually called by subclasses.

delay

the new delay

fn set_sync(&self, sync: bool)[src]

Configures self to synchronize on the clock or not. When sync is false, incoming samples will be played as fast as possible. If sync is true, the timestamps of the incoming buffers will be used to schedule the exact render time of its contents.

sync

the new sync value.

fn set_throttle_time(&self, throttle: u64)[src]

Set the time that will be inserted between rendered buffers. This can be used to control the maximum buffers per second that the sink will render.

throttle

the throttle time in nanoseconds

fn set_ts_offset(&self, offset: ClockTimeDiff)[src]

Adjust the synchronisation of self with offset. A negative value will render buffers earlier than their timestamp. A positive value will delay rendering. This function can be used to fix playback of badly timestamped buffers.

offset

the new offset

fn wait(
    &self,
    time: ClockTime
) -> (Result<FlowSuccess, FlowError>, ClockTimeDiff)
[src]

This function will wait for preroll to complete and will then block until time is reached. It is usually called by subclasses that use their own internal synchronisation but want to let some synchronization (like EOS) be handled by the base class.

This function should only be called with the PREROLL_LOCK held (like when receiving an EOS event in the ::event vmethod or when handling buffers in ::render).

The time argument should be the running_time of when the timeout should happen and will be adjusted with any latency and offset configured in the sink.

time

the running_time to be reached

jitter

the jitter to be filled with time diff, or None

Returns

crate::gst::FlowReturn

fn wait_clock(
    &self,
    time: ClockTime
) -> (Result<ClockSuccess, ClockError>, ClockTimeDiff)
[src]

This function will block until time is reached. It is usually called by subclasses that use their own internal synchronisation.

If time is not valid, no synchronisation is done and crate::gst::ClockReturn::Badtime is returned. Likewise, if synchronisation is disabled in the element or there is no clock, no synchronisation is done and crate::gst::ClockReturn::Badtime is returned.

This function should only be called with the PREROLL_LOCK held, like when receiving an EOS event in the [crate::GstBaseSinkClass.event()] vmethod or when receiving a buffer in the [crate::GstBaseSinkClass.render()] vmethod.

The time argument should be the running_time of when this method should return and is not adjusted with any latency or offset configured in the sink.

time

the running_time to be reached

jitter

the jitter to be filled with time diff, or None

Returns

crate::gst::ClockReturn

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

If the [crate::GstBaseSinkClass.render()] 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 render the remaining data.

If the [crate::GstBaseSinkClass.render()] method can block on something else than the clock, it must also be ready to unblock immediately on the [crate::GstBaseSinkClass.unlock()] method and cause the [crate::GstBaseSinkClass.render()] method to immediately call this function. In this case, the subclass must be prepared to continue rendering where it left off if this function returns crate::gst::FlowReturn::Ok.

This function will block until a state change to PLAYING happens (in which case this function returns crate::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 crate::gst::FlowReturn::Flushing).

This function should only be called with the PREROLL_LOCK held, like in the render function.

Returns

crate::gst::FlowReturn::Ok if the preroll completed and processing can continue. Any other return value should be returned from the render vmethod.

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

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

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

fn set_enable_last_sample(&self, enable_last_sample: bool)[src]

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

fn set_qos(&self, qos: bool)[src]

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

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

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

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

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

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

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

This is supported on crate feature v1_16 only.

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

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

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

This is supported on crate feature v1_18 only.

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

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

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

Loading content...

Implementors

impl<O: IsA<BaseSink>> BaseSinkExt for O[src]

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

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

This is supported on crate feature v1_12 only.

fn last_sample(&self) -> Option<Sample>[src]

fn latency(&self) -> ClockTime[src]

fn max_bitrate(&self) -> u64[src]

fn max_lateness(&self) -> i64[src]

fn processing_deadline(&self) -> ClockTime[src]

This is supported on crate feature v1_16 only.

fn render_delay(&self) -> ClockTime[src]

fn stats(&self) -> Structure[src]

This is supported on crate feature v1_18 only.

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

fn throttle_time(&self) -> u64[src]

fn ts_offset(&self) -> ClockTimeDiff[src]

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

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

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

fn set_async_enabled(&self, enabled: bool)[src]

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

fn set_drop_out_of_segment(&self, drop_out_of_segment: bool)[src]

This is supported on crate feature v1_12 only.

fn set_last_sample_enabled(&self, enabled: bool)[src]

fn set_max_bitrate(&self, max_bitrate: u64)[src]

fn set_max_lateness(&self, max_lateness: i64)[src]

fn set_processing_deadline(&self, processing_deadline: ClockTime)[src]

This is supported on crate feature v1_16 only.

fn set_qos_enabled(&self, enabled: bool)[src]

fn set_render_delay(&self, delay: ClockTime)[src]

fn set_sync(&self, sync: bool)[src]

fn set_throttle_time(&self, throttle: u64)[src]

fn set_ts_offset(&self, offset: ClockTimeDiff)[src]

fn wait(
    &self,
    time: ClockTime
) -> (Result<FlowSuccess, FlowError>, ClockTimeDiff)
[src]

fn wait_clock(
    &self,
    time: ClockTime
) -> (Result<ClockSuccess, ClockError>, ClockTimeDiff)
[src]

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

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

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

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

fn set_enable_last_sample(&self, enable_last_sample: bool)[src]

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

fn set_qos(&self, qos: bool)[src]

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

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

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

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

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

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

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

This is supported on crate feature v1_16 only.

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

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

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

This is supported on crate feature v1_18 only.

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

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

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

Loading content...