/* Allocate the queue associated ringbuffer memory */
thiz->data_segtotal = loc_bufq.numBuffers;
- thiz->data = g_malloc (spec->segsize * thiz->data_segtotal);
+ thiz->data_size = spec->segsize * thiz->data_segtotal;
+ thiz->data = g_malloc0 (thiz->data_size);
+ g_atomic_int_set (&thiz->segqueued, 0);
thiz->cursor = 0;
return TRUE;
* OpenSL ES ringbuffer wrapper
*/
-
GstRingBuffer *
gst_opensles_ringbuffer_new (RingBufferMode mode)
{
}
static void
+gst_opensles_ringbuffer_clear_all (GstRingBuffer * rb)
+{
+ GstOpenSLESRingBuffer *thiz;
+
+ thiz = GST_OPENSLES_RING_BUFFER_CAST (rb);
+
+ if (thiz->data) {
+ memset (thiz->data, 0, thiz->data_size);
+ g_atomic_int_set (&thiz->segqueued, 0);
+ thiz->cursor = 0;
+ }
+}
+
+static void
gst_opensles_ringbuffer_dispose (GObject * object)
{
G_OBJECT_CLASS (ring_parent_class)->dispose (object);
gstringbuffer_class->stop = GST_DEBUG_FUNCPTR (gst_opensles_ringbuffer_stop);
gstringbuffer_class->delay =
GST_DEBUG_FUNCPTR (gst_opensles_ringbuffer_delay);
+ gstringbuffer_class->clear_all =
+ GST_DEBUG_FUNCPTR (gst_opensles_ringbuffer_clear_all);
}
static void