[aravis] stream: avoid deprecation warning and introduce a new API break.



commit 60f3a980a050d40935379f766002e4d03186b782
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Tue May 1 19:13:43 2012 +0200

    stream: avoid deprecation warning and introduce a new API break.
    
    arv_stream_timed_pop_buffer is replaced with arv_stream_tiemout_pop_buffer,
    which is consitent with glib g_async_queue naming.

 docs/reference/aravis/aravis-sections.txt |    2 +-
 gst/gstaravis.c                           |    2 +-
 src/arvstream.c                           |   10 ++++++++--
 src/arvstream.h                           |    2 +-
 tests/arvheartbeattest.c                  |    2 +-
 5 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/docs/reference/aravis/aravis-sections.txt b/docs/reference/aravis/aravis-sections.txt
index 7e26dd5..38cf73a 100644
--- a/docs/reference/aravis/aravis-sections.txt
+++ b/docs/reference/aravis/aravis-sections.txt
@@ -557,7 +557,7 @@ ArvStream
 arv_stream_push_buffer
 arv_stream_pop_buffer
 arv_stream_try_pop_buffer
-arv_stream_timed_pop_buffer
+arv_stream_timeout_pop_buffer
 arv_stream_get_n_buffers
 arv_stream_get_statistics
 arv_stream_get_emit_signals
diff --git a/gst/gstaravis.c b/gst/gstaravis.c
index 149bc49..5cc92f4 100644
--- a/gst/gstaravis.c
+++ b/gst/gstaravis.c
@@ -297,7 +297,7 @@ gst_aravis_create (GstPushSrc * push_src, GstBuffer ** buffer)
 	gst_aravis = GST_ARAVIS (push_src);
 
 	do {
-		arv_buffer = arv_stream_timed_pop_buffer (gst_aravis->stream, gst_aravis->buffer_timeout_us);
+		arv_buffer = arv_stream_timeout_pop_buffer (gst_aravis->stream, gst_aravis->buffer_timeout_us);
 		if (arv_buffer != NULL && arv_buffer->status != ARV_BUFFER_STATUS_SUCCESS)
 			arv_stream_push_buffer (gst_aravis->stream, arv_buffer);
 	} while (arv_buffer != NULL && arv_buffer->status != ARV_BUFFER_STATUS_SUCCESS);
diff --git a/src/arvstream.c b/src/arvstream.c
index 39a68e2..f81a88d 100644
--- a/src/arvstream.c
+++ b/src/arvstream.c
@@ -115,7 +115,7 @@ arv_stream_try_pop_buffer (ArvStream *stream)
 }
 
 /**
- * arv_stream_timed_pop_buffer:
+ * arv_stream_timeout_pop_buffer:
  * @stream: a #ArvStream
  * @timeout: timeout, in Âs
  * Returns: (transfer full): a #ArvBuffer, NULL if no buffer is available until the timeout occurs.
@@ -125,8 +125,13 @@ arv_stream_try_pop_buffer (ArvStream *stream)
  */
 
 ArvBuffer *
-arv_stream_timed_pop_buffer (ArvStream *stream, guint64 timeout)
+arv_stream_timeout_pop_buffer (ArvStream *stream, guint64 timeout)
 {
+#if GLIB_CHECK_VERSION(2,32,0)
+	g_return_val_if_fail (ARV_IS_STREAM (stream), NULL);
+
+	return g_async_queue_timeout_pop (stream->priv->output_queue, timeout);
+#else
 	GTimeVal end_time;
 
 	g_return_val_if_fail (ARV_IS_STREAM (stream), NULL);
@@ -135,6 +140,7 @@ arv_stream_timed_pop_buffer (ArvStream *stream, guint64 timeout)
 	g_time_val_add (&end_time, timeout);
 
 	return g_async_queue_timed_pop (stream->priv->output_queue, &end_time);
+#endif
 }
 
 /**
diff --git a/src/arvstream.h b/src/arvstream.h
index 002be32..3183d38 100644
--- a/src/arvstream.h
+++ b/src/arvstream.h
@@ -77,7 +77,7 @@ GType arv_stream_get_type (void);
 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_timed_pop_buffer 		(ArvStream *stream, guint64 timeout);
+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);
diff --git a/tests/arvheartbeattest.c b/tests/arvheartbeattest.c
index 3241502..cf15cbd 100644
--- a/tests/arvheartbeattest.c
+++ b/tests/arvheartbeattest.c
@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
 	    old_sigint_handler = signal (SIGINT, set_cancel);
 
 	    while (!cancel) {
-		    ArvBuffer *buffer = arv_stream_timed_pop_buffer(stream, 2000000);
+		    ArvBuffer *buffer = arv_stream_timeout_pop_buffer(stream, 2000000);
 		    if (buffer) {
 			    usleep(10);
 			    arv_stream_push_buffer (stream, buffer);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]