[aravis] arvstream: add an accessor to the stream queue lengths.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] arvstream: add an accessor to the stream queue lengths.
- Date: Tue, 27 Jul 2010 11:47:57 +0000 (UTC)
commit 5e5062d414bc075a1af077dd9cea396587dc1d89
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Tue Jul 27 13:47:24 2010 +0200
arvstream: add an accessor to the stream queue lengths.
docs/reference/aravis/aravis-sections.txt | 7 ++++-
src/arvstream.c | 38 +++++++++++++++++++++++++----
src/arvstream.h | 4 ++-
3 files changed, 41 insertions(+), 8 deletions(-)
---
diff --git a/docs/reference/aravis/aravis-sections.txt b/docs/reference/aravis/aravis-sections.txt
index f233139..4d0784f 100644
--- a/docs/reference/aravis/aravis-sections.txt
+++ b/docs/reference/aravis/aravis-sections.txt
@@ -5,6 +5,7 @@ ArvCameraVendor
ArvCamera
arv_camera_new
arv_camera_create_stream
+arv_camera_get_device
arv_camera_get_vendor_name
arv_camera_get_model_name
arv_camera_get_device_id
@@ -261,7 +262,7 @@ ArvStreamCallback
ArvStream
arv_stream_push_buffer
arv_stream_pop_buffer
-arv_stream_get_n_available_buffers
+arv_stream_get_n_buffers
arv_stream_get_statistics
<SUBSECTION Standard>
ARV_STREAM
@@ -523,6 +524,8 @@ arv_fake_camera_get_payload
arv_fake_camera_get_stream_address
arv_fake_camera_set_control_channel_privilege
arv_fake_camera_set_fill_pattern
+arv_fake_camera_set_trigger_frequency
+arv_fake_device_get_fake_camera
arv_set_fake_camera_genicam_filename
arv_get_fake_camera_genicam_data
<SUBSECTION Standard>
@@ -566,7 +569,7 @@ ARV_FAKE_CAMERA_REGISTER_GAIN_RAW
ARV_FAKE_CAMERA_REGISTER_GAIN_MODE
ArvFakeCameraClass
ArvFakeCameraPrivate
-ArvFakeCameraFillPatern
+ArvFakeCameraFillPattern
</SECTION>
<SECTION>
diff --git a/src/arvstream.c b/src/arvstream.c
index 4d85f4c..1d42685 100644
--- a/src/arvstream.c
+++ b/src/arvstream.c
@@ -71,14 +71,42 @@ arv_stream_pop_buffer (ArvStream *stream)
return g_async_queue_try_pop (stream->output_queue);
}
-int
-arv_stream_get_n_available_buffers (ArvStream *stream)
-{
- g_return_val_if_fail (ARV_IS_STREAM (stream), 0);
+/**
+ * arv_stream_get_n_buffers:
+ * @stream: a #ArvStream
+ * @n_input_buffers: (out) (allow-none): input queue length
+ * @n_output_buffers: (out) (allow-none): output queue length
+ *
+ * An accessor to the stream buffer queue lengths.
+ */
- return g_async_queue_length (stream->output_queue);
+void
+arv_stream_get_n_buffers (ArvStream *stream, gint *n_input_buffers, gint *n_output_buffers)
+{
+ if (!ARV_IS_STREAM (stream)) {
+ if (n_input_buffers != NULL)
+ *n_input_buffers = 0;
+ if (n_output_buffers != NULL)
+ *n_output_buffers = 0;
+ return;
+ }
+
+ if (n_input_buffers != NULL)
+ *n_input_buffers = g_async_queue_length (stream->input_queue);
+ if (n_output_buffers != NULL)
+ *n_output_buffers = g_async_queue_length (stream->output_queue);
}
+/**
+ * arv_stream_get_statistics:
+ * @stream: a #ArvStream
+ * @n_completed_buffers: (out) (allow-none): number of complete received buffers
+ * @n_failures: (out) (allow-none): number of reception failures
+ * @n_underruns: (out) (allow-none): number of input buffer underruns
+ *
+ * An accessor to the stream statistics.
+ */
+
void
arv_stream_get_statistics (ArvStream *stream,
guint64 *n_completed_buffers,
diff --git a/src/arvstream.h b/src/arvstream.h
index 790720b..e8c444c 100644
--- a/src/arvstream.h
+++ b/src/arvstream.h
@@ -73,7 +73,9 @@ GType arv_stream_get_type (void);
void arv_stream_push_buffer (ArvStream *stream, ArvBuffer *buffer);
ArvBuffer * arv_stream_pop_buffer (ArvStream *stream);
-int arv_stream_get_n_available_buffers (ArvStream *stream);
+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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]