mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-22 10:23:47 +00:00
gst-libs/gst/audio/gstbaseaudiosink.c: Add some more info in a WARNING.
Original commit message from CVS: * gst-libs/gst/audio/gstbaseaudiosink.c: (gst_base_audio_sink_render): Add some more info in a WARNING. * gst-libs/gst/audio/gstbaseaudiosrc.c: (gst_base_audio_src_create): Handle PAUSE in create function, use new -core addition to wait for playing. Fixes pausing and resuming capture from an audiosrc. * gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_commit), (gst_ring_buffer_read): Constify some more. Caller supports interrupted reads now.
This commit is contained in:
parent
bfbdfb8d45
commit
1980f16731
4 changed files with 38 additions and 9 deletions
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
||||||
|
2006-09-27 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* gst-libs/gst/audio/gstbaseaudiosink.c:
|
||||||
|
(gst_base_audio_sink_render):
|
||||||
|
Add some more info in a WARNING.
|
||||||
|
|
||||||
|
* gst-libs/gst/audio/gstbaseaudiosrc.c:
|
||||||
|
(gst_base_audio_src_create):
|
||||||
|
Handle PAUSE in create function, use new -core addition to
|
||||||
|
wait for playing. Fixes pausing and resuming capture from an
|
||||||
|
audiosrc.
|
||||||
|
|
||||||
|
* gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_commit),
|
||||||
|
(gst_ring_buffer_read):
|
||||||
|
Constify some more.
|
||||||
|
Caller supports interrupted reads now.
|
||||||
|
|
||||||
2006-09-27 Tim-Philipp Müller <tim at centricular dot net>
|
2006-09-27 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* tests/check/Makefile.am:
|
* tests/check/Makefile.am:
|
||||||
|
|
|
@ -649,6 +649,7 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
no_align:
|
no_align:
|
||||||
|
/* crate contains diff against the clock we are using in the pipeline. */
|
||||||
crate =
|
crate =
|
||||||
gst_guint64_to_gdouble (crate_num) / gst_guint64_to_gdouble (crate_denom);
|
gst_guint64_to_gdouble (crate_num) / gst_guint64_to_gdouble (crate_denom);
|
||||||
GST_DEBUG_OBJECT (sink,
|
GST_DEBUG_OBJECT (sink,
|
||||||
|
|
|
@ -449,10 +449,10 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
guchar *data;
|
guchar *data;
|
||||||
guint samples;
|
guint samples;
|
||||||
guint res;
|
|
||||||
guint64 sample;
|
guint64 sample;
|
||||||
gint bps;
|
gint bps;
|
||||||
GstRingBuffer *ringbuffer;
|
GstRingBuffer *ringbuffer;
|
||||||
|
guint read;
|
||||||
|
|
||||||
ringbuffer = src->ringbuffer;
|
ringbuffer = src->ringbuffer;
|
||||||
|
|
||||||
|
@ -488,11 +488,23 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
|
||||||
buf = gst_buffer_new_and_alloc (length);
|
buf = gst_buffer_new_and_alloc (length);
|
||||||
data = GST_BUFFER_DATA (buf);
|
data = GST_BUFFER_DATA (buf);
|
||||||
|
|
||||||
/* read the sample */
|
do {
|
||||||
res = gst_ring_buffer_read (ringbuffer, sample, data, samples);
|
read = gst_ring_buffer_read (ringbuffer, sample, data, samples);
|
||||||
if (G_UNLIKELY (res == -1))
|
GST_DEBUG_OBJECT (src, "read %u of %u", read, samples);
|
||||||
|
/* if we read all, we're done */
|
||||||
|
if (read == samples)
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* else something interrupted us and we wait for playing again. */
|
||||||
|
if (gst_base_src_wait_playing (bsrc) != GST_FLOW_OK)
|
||||||
goto stopped;
|
goto stopped;
|
||||||
|
|
||||||
|
/* read next samples */
|
||||||
|
sample += read;
|
||||||
|
samples -= read;
|
||||||
|
data += read * bps;
|
||||||
|
} while (TRUE);
|
||||||
|
|
||||||
/* mark discontinuity if needed */
|
/* mark discontinuity if needed */
|
||||||
if (G_UNLIKELY (sample != src->next_sample) && src->next_sample != -1) {
|
if (G_UNLIKELY (sample != src->next_sample) && src->next_sample != -1) {
|
||||||
GST_WARNING_OBJECT (src,
|
GST_WARNING_OBJECT (src,
|
||||||
|
|
|
@ -134,8 +134,8 @@ gst_ring_buffer_finalize (GObject * object)
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GstBufferFormat format;
|
const GstBufferFormat format;
|
||||||
guint8 silence[4];
|
const guint8 silence[4];
|
||||||
} FormatDef;
|
} FormatDef;
|
||||||
|
|
||||||
static const FormatDef linear_defs[4 * 2 * 2] = {
|
static const FormatDef linear_defs[4 * 2 * 2] = {
|
||||||
|
@ -1387,8 +1387,7 @@ gst_ring_buffer_read (GstRingBuffer * buf, guint64 sample, guchar * data,
|
||||||
not_started:
|
not_started:
|
||||||
{
|
{
|
||||||
GST_DEBUG_OBJECT (buf, "stopped processing");
|
GST_DEBUG_OBJECT (buf, "stopped processing");
|
||||||
/* FIXME, return len - to_read after fixing caller */
|
return len - to_read;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue