Trait aravis::StreamExt

source ·
pub trait StreamExt: 'static {
Show 20 methods // Required methods fn emits_signals(&self) -> bool; fn info_double(&self, id: u32) -> f64; fn info_double_by_name(&self, name: &str) -> f64; fn info_name(&self, id: u32) -> Option<GString>; fn info_type(&self, id: u32) -> Type; fn info_uint64(&self, id: u32) -> u64; fn info_uint64_by_name(&self, name: &str) -> u64; fn n_buffers(&self) -> (i32, i32); fn n_infos(&self) -> u32; fn statistics(&self) -> (u64, u64, u64); fn pop_buffer(&self) -> Option<Buffer>; fn push_buffer(&self, buffer: &Buffer); fn set_emit_signals(&self, emit_signals: bool); fn start_thread(&self); fn stop_thread(&self, delete_buffers: bool) -> u32; fn timeout_pop_buffer(&self, timeout: u64) -> Option<Buffer>; fn try_pop_buffer(&self) -> Option<Buffer>; fn device(&self) -> Option<Device>; fn connect_new_buffer<F: Fn(&Self) + Send + 'static>( &self, f: F ) -> SignalHandlerId; fn connect_emit_signals_notify<F: Fn(&Self) + Send + 'static>( &self, f: F ) -> SignalHandlerId;
}
Expand description

Trait containing all Stream methods.

Implementors

FakeStream, GvStream, Stream, UvStream

Required Methods§

source

fn emits_signals(&self) -> bool

Check if stream will emit its signals.

Returns

true if self is emiting its signals.

source

fn info_double(&self, id: u32) -> f64

Available on crate feature v0_8_11 only.
id

info id

Returns

the value of the corresponding stream information, as a double.

source

fn info_double_by_name(&self, name: &str) -> f64

Available on crate feature v0_8_11 only.
name

info name

Returns

the value of the corresponding stream information, as a double.

source

fn info_name(&self, id: u32) -> Option<GString>

Available on crate feature v0_8_11 only.
id

info id

Returns

the name of the corresponding stream information.

source

fn info_type(&self, id: u32) -> Type

Available on crate feature v0_8_11 only.
id

info id

Returns

the GType of the corresponding stream information, which indicates what API to use to retrieve the information value (info_uint64() or info_double()).

source

fn info_uint64(&self, id: u32) -> u64

Available on crate feature v0_8_11 only.
id

info id

Returns

the value of the corresponding stream information, as a 64 bit unsigned integer.

source

fn info_uint64_by_name(&self, name: &str) -> u64

Available on crate feature v0_8_11 only.
name

info name

Returns

the value of the corresponding stream information, as a 64 bit unsigned integer.

source

fn n_buffers(&self) -> (i32, i32)

An accessor to the stream buffer queue lengths.

Returns
n_input_buffers

input queue length

n_output_buffers

output queue length

source

fn n_infos(&self) -> u32

Available on crate feature v0_8_11 only.
Returns

the number of stream informations. These informations contain useful numbers about data transfer quality.

source

fn statistics(&self) -> (u64, u64, u64)

An accessor to the stream statistics.

Returns
n_completed_buffers

number of complete received buffers

n_failures

number of reception failures

n_underruns

number of input buffer underruns

source

fn pop_buffer(&self) -> Option<Buffer>

Pops a buffer from the output queue of self. The retrieved buffer may contain an invalid image. Caller should check the buffer status before using it. This function blocks until a buffer is available.

This method is thread safe.

Returns

a Buffer

source

fn push_buffer(&self, buffer: &Buffer)

Pushes a Buffer to the self thread. The self takes ownership of buffer, and will free all the buffers still in its queues when destroyed.

This method is thread safe.

buffer

buffer to push

source

fn set_emit_signals(&self, emit_signals: bool)

Make self emit signals. This option is by default disabled because signal emission is expensive and unneeded when the application prefers to operate in pull mode.

emit_signals

the new state

source

fn start_thread(&self)

Start the stream receiving thread. The thread is automatically started when the Stream object is instantiated, so this function is only useful if the thread was stopped using stop_thread().

source

fn stop_thread(&self, delete_buffers: bool) -> u32

Stop the stream receiving thread, and optionally delete all the Buffer stored in the stream object queues. Main use of this function is to be able to quickly change an acquisition parameter that changes the payload size, without deleting/recreating the stream object.

delete_buffers

enable buffer deletion

Returns

the number of deleted buffers if delete_buffers == true, 0 otherwise.

source

fn timeout_pop_buffer(&self, timeout: u64) -> Option<Buffer>

Pops a buffer from the output queue of self, waiting no more than timeout. The retrieved buffer may contain an invalid image. Caller should check the buffer status before using it.

This method is thread safe.

timeout

timeout, in µs

Returns

a Buffer, NULL if no buffer is available until the timeout occurs.

source

fn try_pop_buffer(&self) -> Option<Buffer>

Pops a buffer from the output queue of self. The retrieved buffer may contain an invalid image. Caller should check the buffer status before using it. This is the non blocking version of pop_buffer.

This method is thread safe.

Returns

a Buffer, NULL if no buffer is available.

source

fn device(&self) -> Option<Device>

source

fn connect_new_buffer<F: Fn(&Self) + Send + 'static>( &self, f: F ) -> SignalHandlerId

Signal that a new buffer is available.

This signal is emited from the stream receive thread and only when the “emit-signals” property is true.

The new buffer can be retrieved with pop_buffer().

Note that this signal is only emited when the “emit-signals” property is set to true, which it is not by default for performance reasons.

source

fn connect_emit_signals_notify<F: Fn(&Self) + Send + 'static>( &self, f: F ) -> SignalHandlerId

Implementors§

source§

impl<O: IsA<Stream>> StreamExt for O