mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
Make the base audiosink return an error when there is no audiobuffer negotiated.
Original commit message from CVS: Make the base audiosink return an error when there is no audiobuffer negotiated.
This commit is contained in:
parent
393df2e486
commit
fa8c2eb659
6 changed files with 71 additions and 0 deletions
32
ChangeLog
32
ChangeLog
|
@ -1,3 +1,35 @@
|
|||
2005-05-06 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst-libs/gst/audio/gstaudiosink.c:
|
||||
(gst_audioringbuffer_get_type), (gst_audioringbuffer_class_init),
|
||||
(audioringbuffer_thread_func), (gst_audioringbuffer_init),
|
||||
(gst_audioringbuffer_acquire), (gst_audioringbuffer_release),
|
||||
(gst_audioringbuffer_play), (gst_audioringbuffer_stop),
|
||||
(gst_audioringbuffer_delay), (gst_audiosink_class_init),
|
||||
(gst_audiosink_create_ringbuffer):
|
||||
* gst-libs/gst/audio/gstbaseaudiosink.c:
|
||||
(gst_baseaudiosink_class_init), (gst_baseaudiosink_init),
|
||||
(gst_baseaudiosink_get_clock), (gst_baseaudiosink_get_time),
|
||||
(gst_baseaudiosink_set_property), (build_linear_format),
|
||||
(debug_spec_caps), (debug_spec_buffer),
|
||||
(gst_baseaudiosink_setcaps), (gst_baseaudiosink_get_times),
|
||||
(gst_baseaudiosink_event), (gst_baseaudiosink_preroll),
|
||||
(gst_baseaudiosink_render), (gst_baseaudiosink_create_ringbuffer),
|
||||
(gst_baseaudiosink_callback), (gst_baseaudiosink_change_state):
|
||||
* gst-libs/gst/audio/gstbaseaudiosink.h:
|
||||
* gst-libs/gst/audio/gstringbuffer.c: (gst_ringbuffer_get_type),
|
||||
(gst_ringbuffer_set_callback), (gst_ringbuffer_acquire),
|
||||
(gst_ringbuffer_release), (gst_ringbuffer_is_acquired),
|
||||
(gst_ringbuffer_play), (gst_ringbuffer_pause),
|
||||
(gst_ringbuffer_stop), (gst_ringbuffer_delay),
|
||||
(gst_ringbuffer_played_samples), (gst_ringbuffer_set_sample),
|
||||
(wait_segment), (gst_ringbuffer_commit),
|
||||
(gst_ringbuffer_prepare_read), (gst_ringbuffer_advance),
|
||||
(gst_ringbuffer_clear):
|
||||
* gst-libs/gst/audio/gstringbuffer.h:
|
||||
Make the base audiosink return an error when there is no
|
||||
audiobuffer negotiated.
|
||||
|
||||
2005-05-06 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||
|
||||
* ext/Makefile.am:
|
||||
|
|
|
@ -292,6 +292,9 @@ gst_audioringbuffer_release (GstRingBuffer * buf)
|
|||
|
||||
GST_LOCK (buf);
|
||||
|
||||
/* free the buffer */
|
||||
gst_buffer_unref (buf->data);
|
||||
|
||||
if (csink->close)
|
||||
result = csink->close (sink);
|
||||
|
||||
|
|
|
@ -484,11 +484,19 @@ gst_baseaudiosink_render (GstBaseSink * bsink, GstBuffer * buf)
|
|||
offset = GST_BUFFER_OFFSET (buf);
|
||||
|
||||
GST_DEBUG ("in offset %llu, time %lld", offset, GST_BUFFER_TIMESTAMP (buf));
|
||||
if (!gst_ringbuffer_is_acquired (sink->ringbuffer))
|
||||
goto wrong_state;
|
||||
|
||||
gst_ringbuffer_commit (sink->ringbuffer, offset,
|
||||
GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
|
||||
|
||||
return GST_FLOW_OK;
|
||||
|
||||
wrong_state:
|
||||
{
|
||||
GST_DEBUG ("ringbuffer in wrong state");
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
GstRingBuffer *
|
||||
|
|
|
@ -72,6 +72,7 @@ typedef struct _GstBaseAudioSinkClass GstBaseAudioSinkClass;
|
|||
struct _GstBaseAudioSink {
|
||||
GstBaseSink element;
|
||||
|
||||
/*< protected >*/ /* with LOCK */
|
||||
/* our ringbuffer */
|
||||
GstRingBuffer *ringbuffer;
|
||||
|
||||
|
|
|
@ -238,6 +238,31 @@ done:
|
|||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_ringbuffer_is_acquired:
|
||||
* @buf: the #GstRingBuffer to check
|
||||
*
|
||||
* Check if the ringbuffer is acquired and ready to use.
|
||||
*
|
||||
* Returns: TRUE if the ringbuffer is acquired, FALSE on error.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
gboolean
|
||||
gst_ringbuffer_is_acquired (GstRingBuffer * buf)
|
||||
{
|
||||
gboolean res;
|
||||
|
||||
g_return_val_if_fail (buf != NULL, FALSE);
|
||||
|
||||
GST_LOCK (buf);
|
||||
res = buf->acquired;
|
||||
GST_UNLOCK (buf);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gst_ringbuffer_play:
|
||||
* @buf: the #GstRingBuffer to play
|
||||
|
|
|
@ -198,6 +198,8 @@ void gst_ringbuffer_set_callback (GstRingBuffer *buf, GstRingBufferCallb
|
|||
gboolean gst_ringbuffer_acquire (GstRingBuffer *buf, GstRingBufferSpec *spec);
|
||||
gboolean gst_ringbuffer_release (GstRingBuffer *buf);
|
||||
|
||||
gboolean gst_ringbuffer_is_acquired (GstRingBuffer *buf);
|
||||
|
||||
/* playback/pause */
|
||||
gboolean gst_ringbuffer_play (GstRingBuffer *buf);
|
||||
gboolean gst_ringbuffer_pause (GstRingBuffer *buf);
|
||||
|
|
Loading…
Reference in a new issue