Aravis.Stream

g Aravis.Stream Aravis.Stream GObject.GInterface GObject.GInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object GObject.Object->Aravis.Stream Gio.Initable->Aravis.Stream

Subclasses:

Aravis.FakeStream, Aravis.GvStream, Aravis.UvStream

Methods

Inherited:

GObject.Object (37), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

get_emit_signals ()

get_info_double (id)

get_info_double_by_name (name)

get_info_name (id)

get_info_type (id)

get_info_uint64 (id)

get_info_uint64_by_name (name)

get_n_buffers ()

get_n_infos ()

get_statistics ()

pop_buffer ()

push_buffer (buffer)

set_emit_signals (emit_signals)

start_thread ()

stop_thread (delete_buffers)

timeout_pop_buffer (timeout)

try_pop_buffer ()

Virtual Methods

Inherited:

GObject.Object (7), Gio.Initable (1)

do_new_buffer ()

do_start_thread ()

do_stop_thread ()

Properties

Name

Type

Flags

Short Description

callback

int

r/w/co

Optional user callback

callback-data

int

r/w/co

Optional user callback data

destroy-notify

int

r/w/co

Optional destroy notify

device

Aravis.Device

r/w/co

A Aravis.Device parent object

emit-signals

bool

r/w

Emit signals

Signals

Inherited:

GObject.Object (1)

Name

Short Description

new-buffer

Signal that a new buffer is available.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Aravis.Stream(**kwargs)
Bases:

GObject.Object, Gio.Initable

Abstract:

Yes

Structure:

Aravis.StreamClass

Aravis.Stream provides an abstract base class for the implementation of video stream reception threads. The interface between the reception thread and the main thread is done using asynchronous queues, containing Aravis.Buffer objects.

get_emit_signals()
Returns:

True if self is emiting its signals.

Return type:

bool

Check if stream will emit its signals.

New in version 0.2.0.

get_info_double(id)
Parameters:

id (int) – info id

Returns:

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

Return type:

float

New in version 0.8.11.

get_info_double_by_name(name)
Parameters:

name (str) – info name

Returns:

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

Return type:

float

New in version 0.8.11.

get_info_name(id)
Parameters:

id (int) – info id

Returns:

the name of the corresponding stream information.

Return type:

str

New in version 0.8.11.

get_info_type(id)
Parameters:

id (int) – info id

Returns:

the GObject.GType of the corresponding stream information, which indicates what API to use to retrieve the information value (Aravis.Stream.get_info_uint64() or Aravis.Stream.get_info_double()).

Return type:

GObject.GType

New in version 0.8.11.

get_info_uint64(id)
Parameters:

id (int) – info id

Returns:

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

Return type:

int

New in version 0.8.11.

get_info_uint64_by_name(name)
Parameters:

name (str) – info name

Returns:

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

Return type:

int

New in version 0.8.11.

get_n_buffers()
Returns:

n_input_buffers:

input queue length

n_output_buffers:

output queue length

Return type:

(n_input_buffers: int, n_output_buffers: int)

An accessor to the stream buffer queue lengths.

New in version 0.2.0.

get_n_infos()
Returns:

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

Return type:

int

New in version 0.8.11.

get_statistics()
Returns:

n_completed_buffers:

number of complete received buffers

n_failures:

number of reception failures

n_underruns:

number of input buffer underruns

Return type:

(n_completed_buffers: int, n_failures: int, n_underruns: int)

An accessor to the stream statistics.

New in version 0.2.0.

pop_buffer()
Returns:

a Aravis.Buffer

Return type:

Aravis.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.

New in version 0.2.0.

push_buffer(buffer)
Parameters:

buffer (Aravis.Buffer) – buffer to push

Pushes a Aravis.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.

New in version 0.2.0.

set_emit_signals(emit_signals)
Parameters:

emit_signals (bool) – the new state

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.

New in version 0.2.0.

start_thread()

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

New in version 0.6.2.

stop_thread(delete_buffers)
Parameters:

delete_buffers (bool) – enable buffer deletion

Returns:

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

Return type:

int

Stop the stream receiving thread, and optionally delete all the Aravis.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.

New in version 0.6.2.

timeout_pop_buffer(timeout)
Parameters:

timeout (int) – timeout, in µs

Returns:

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

Return type:

Aravis.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.

New in version 0.2.0.

try_pop_buffer()
Returns:

a Aravis.Buffer, None if no buffer is available.

Return type:

Aravis.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.

New in version 0.2.0.

do_new_buffer() virtual
do_start_thread() virtual

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

New in version 0.6.2.

do_stop_thread() virtual

Signal Details

Aravis.Stream.signals.new_buffer(stream)
Signal Name:

new-buffer

Flags:

RUN_LAST

Parameters:

stream (Aravis.Stream) – The object which received the signal

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 Aravis.Stream.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.

New in version 0.2.0.

Property Details

Aravis.Stream.props.callback
Name:

callback

Type:

int

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Optional user callback

Aravis.Stream.props.callback_data
Name:

callback-data

Type:

int

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Optional user callback data

Aravis.Stream.props.destroy_notify
Name:

destroy-notify

Type:

int

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Optional destroy notify

Aravis.Stream.props.device
Name:

device

Type:

Aravis.Device

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

A Aravis.Device parent object

Aravis.Stream.props.emit_signals
Name:

emit-signals

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Emit signals