ringbuffer: add method to check the flushing state
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 10 Sep 2012 10:12:26 +0000 (12:12 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 10 Sep 2012 10:19:22 +0000 (12:19 +0200)
gst-libs/gst/audio/gstaudioringbuffer.c
gst-libs/gst/audio/gstaudioringbuffer.h

index df60172..978caec 100644 (file)
@@ -834,6 +834,30 @@ gst_audio_ring_buffer_set_flushing (GstAudioRingBuffer * buf, gboolean flushing)
 }
 
 /**
+ * gst_audio_ring_buffer_is_flushing:
+ * @buf: the #GstAudioRingBuffer
+ *
+ * Check if @buf is flushing.
+ *
+ * MT safe.
+ *
+ * Returns: TRUE if the device is flushing.
+ */
+gboolean
+gst_audio_ring_buffer_is_flushing (GstAudioRingBuffer * buf)
+{
+  gboolean res;
+
+  g_return_val_if_fail (GST_IS_AUDIO_RING_BUFFER (buf), TRUE);
+
+  GST_OBJECT_LOCK (buf);
+  res = buf->flushing;
+  GST_OBJECT_UNLOCK (buf);
+
+  return res;
+}
+
+/**
  * gst_audio_ring_buffer_start:
  * @buf: the #GstAudioRingBuffer to start
  *
index 4441963..e578aea 100644 (file)
@@ -288,6 +288,7 @@ gboolean        gst_audio_ring_buffer_is_active       (GstAudioRingBuffer *buf);
 
 /* flushing */
 void            gst_audio_ring_buffer_set_flushing    (GstAudioRingBuffer *buf, gboolean flushing);
+gboolean        gst_audio_ring_buffer_is_flushing     (GstAudioRingBuffer *buf);
 
 /* playback/pause */
 gboolean        gst_audio_ring_buffer_start           (GstAudioRingBuffer *buf);