![]() |
![]() |
![]() |
Aravis Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
enum ArvStreamCallbackType; void (*ArvStreamCallback) (void *user_data
,ArvStreamCallbackType type
,ArvBuffer *buffer
); ArvStream; void arv_stream_push_buffer (ArvStream *stream
,ArvBuffer *buffer
); ArvBuffer * arv_stream_pop_buffer (ArvStream *stream
); ArvBuffer * arv_stream_try_pop_buffer (ArvStream *stream
); ArvBuffer * arv_stream_timeout_pop_buffer (ArvStream *stream
,guint64 timeout
); void arv_stream_get_n_buffers (ArvStream *stream
,gint *n_input_buffers
,gint *n_output_buffers
); void arv_stream_get_statistics (ArvStream *stream
,guint64 *n_completed_buffers
,guint64 *n_failures
,guint64 *n_underruns
); gboolean arv_stream_get_emit_signals (ArvStream *stream
); void arv_stream_set_emit_signals (ArvStream *stream
,gboolean emit_signals
); void arv_g_string_append_hex_dump (GString *string
,const void *data
,size_t size
);
ArvStream 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 ArvBuffer objects.
typedef enum { ARV_STREAM_CALLBACK_TYPE_INIT, ARV_STREAM_CALLBACK_TYPE_EXIT, ARV_STREAM_CALLBACK_TYPE_START_BUFFER, ARV_STREAM_CALLBACK_TYPE_BUFFER_DONE } ArvStreamCallbackType;
Describes when the stream callback is called.
void (*ArvStreamCallback) (void *user_data
,ArvStreamCallbackType type
,ArvBuffer *buffer
);
void arv_stream_push_buffer (ArvStream *stream
,ArvBuffer *buffer
);
Pushes a ArvBuffer to the stream
thread. The stream
takes ownership of buffer
,
and will free all the buffers still in its queues when destroyed.
|
a ArvStream |
|
buffer to push. [transfer full] |
ArvBuffer * arv_stream_pop_buffer (ArvStream *stream
);
Pops a buffer from the output queue of stream
. 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.
Since 0.1.12
ArvBuffer * arv_stream_try_pop_buffer (ArvStream *stream
);
Pops a buffer from the output queue of stream
. 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.
Since 0.1.12
ArvBuffer * arv_stream_timeout_pop_buffer (ArvStream *stream
,guint64 timeout
);
Pops a buffer from the output queue of stream
, waiting no more than timeout
. The retrieved buffer
may contain an invalid image. Caller should check the buffer status before using it.
void arv_stream_get_n_buffers (ArvStream *stream
,gint *n_input_buffers
,gint *n_output_buffers
);
An accessor to the stream buffer queue lengths.
|
a ArvStream |
|
input queue length. [out][allow-none] |
|
output queue length. [out][allow-none] |
void arv_stream_get_statistics (ArvStream *stream
,guint64 *n_completed_buffers
,guint64 *n_failures
,guint64 *n_underruns
);
An accessor to the stream statistics.
|
a ArvStream |
|
number of complete received buffers. [out][allow-none] |
|
number of reception failures. [out][allow-none] |
|
number of input buffer underruns. [out][allow-none] |
gboolean arv_stream_get_emit_signals (ArvStream *stream
);
Check if stream will emit its signals.
Since 0.1.3
void arv_stream_set_emit_signals (ArvStream *stream
,gboolean emit_signals
);
Make stream emit signals. This option is by default disabled because signal emission is expensive and unneeded when the application prefers to operate in pull mode.
|
a ArvStream |
|
the new state |
Since 0.1.3
void arv_g_string_append_hex_dump (GString *string
,const void *data
,size_t size
);
Adds an hexadecimal dump of data
to string
, which consists in lines displaying the data adress, 16 8 bit values in hexadecimal representation, followed by their corresponding ASCII character (replaced by a dot for control ones).
Here is an example of the output:
01e0 c8 b7 89 b0 45 fa 3d 9d 8c e9 a7 33 46 85 1f 2c ....E.=....3F..,
01f0 3f 4c ba 8d 99 f3 ff d0 40 78 73 37 32 e5 4f 9f ?L......xs72.O
.
0200 d0 d2 f2 ef 5a 2f fc 61 e3 64 36 21 ....Z/.a.d6!
|
a GString |
|
binary data |
|
size of binary data |
"emit-signals"
property"emit-signals" gboolean : Read / Write
Emit signals.
Default value: FALSE
"new-buffer"
signalvoid user_function (ArvStream *stream,
gpointer user_data) : Run Last
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 arv_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.
|
the stream that emited the signal |
|
user data set when the signal handler was connected. |