ringbuffer: add method to check the flushing state

This commit is contained in:
Wim Taymans 2012-09-10 12:12:26 +02:00
parent 75fe950c33
commit 44dab50b7a
2 changed files with 25 additions and 0 deletions

View file

@ -833,6 +833,30 @@ gst_audio_ring_buffer_set_flushing (GstAudioRingBuffer * buf, gboolean flushing)
GST_OBJECT_UNLOCK (buf);
}
/**
* 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

View 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);