mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 03:56:16 +00:00
pulse: rename pa_buffer_attr variables
Makes it much easier to see what is going on and is a lot less error prone.
This commit is contained in:
parent
d1d126b5b4
commit
ccddf0643d
2 changed files with 43 additions and 43 deletions
|
@ -599,8 +599,8 @@ gst_pulseringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
|
||||||
{
|
{
|
||||||
GstPulseSink *psink;
|
GstPulseSink *psink;
|
||||||
GstPulseRingBuffer *pbuf;
|
GstPulseRingBuffer *pbuf;
|
||||||
pa_buffer_attr buf_attr;
|
pa_buffer_attr wanted;
|
||||||
const pa_buffer_attr *buf_attr_ptr;
|
const pa_buffer_attr *actual;
|
||||||
pa_channel_map channel_map;
|
pa_channel_map channel_map;
|
||||||
pa_operation *o = NULL;
|
pa_operation *o = NULL;
|
||||||
pa_cvolume v, *pv;
|
pa_cvolume v, *pv;
|
||||||
|
@ -663,16 +663,16 @@ gst_pulseringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
|
||||||
|
|
||||||
/* buffering requirements. When setting prebuf to 0, the stream will not pause
|
/* buffering requirements. When setting prebuf to 0, the stream will not pause
|
||||||
* when we cause an underrun, which causes time to continue. */
|
* when we cause an underrun, which causes time to continue. */
|
||||||
memset (&buf_attr, 0, sizeof (buf_attr));
|
memset (&wanted, 0, sizeof (wanted));
|
||||||
buf_attr.tlength = spec->segtotal * spec->segsize;
|
wanted.tlength = spec->segtotal * spec->segsize;
|
||||||
buf_attr.maxlength = -1;
|
wanted.maxlength = -1;
|
||||||
buf_attr.prebuf = 0;
|
wanted.prebuf = 0;
|
||||||
buf_attr.minreq = -1;
|
wanted.minreq = -1;
|
||||||
|
|
||||||
GST_INFO_OBJECT (psink, "tlength: %d", buf_attr.tlength);
|
GST_INFO_OBJECT (psink, "tlength: %d", wanted.tlength);
|
||||||
GST_INFO_OBJECT (psink, "maxlength: %d", buf_attr.maxlength);
|
GST_INFO_OBJECT (psink, "maxlength: %d", wanted.maxlength);
|
||||||
GST_INFO_OBJECT (psink, "prebuf: %d", buf_attr.prebuf);
|
GST_INFO_OBJECT (psink, "prebuf: %d", wanted.prebuf);
|
||||||
GST_INFO_OBJECT (psink, "minreq: %d", buf_attr.minreq);
|
GST_INFO_OBJECT (psink, "minreq: %d", wanted.minreq);
|
||||||
|
|
||||||
/* configure volume when we changed it, else we leave the default */
|
/* configure volume when we changed it, else we leave the default */
|
||||||
if (psink->volume_set) {
|
if (psink->volume_set) {
|
||||||
|
@ -703,7 +703,7 @@ gst_pulseringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
|
||||||
GST_LOG_OBJECT (psink, "connect for playback to device %s",
|
GST_LOG_OBJECT (psink, "connect for playback to device %s",
|
||||||
GST_STR_NULL (psink->device));
|
GST_STR_NULL (psink->device));
|
||||||
if (pa_stream_connect_playback (pbuf->stream, psink->device,
|
if (pa_stream_connect_playback (pbuf->stream, psink->device,
|
||||||
&buf_attr, flags, pv, NULL) < 0)
|
&wanted, flags, pv, NULL) < 0)
|
||||||
goto connect_failed;
|
goto connect_failed;
|
||||||
|
|
||||||
/* our clock will now start from 0 again */
|
/* our clock will now start from 0 again */
|
||||||
|
@ -730,17 +730,17 @@ gst_pulseringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
|
||||||
GST_LOG_OBJECT (psink, "stream is acquired now");
|
GST_LOG_OBJECT (psink, "stream is acquired now");
|
||||||
|
|
||||||
/* get the actual buffering properties now */
|
/* get the actual buffering properties now */
|
||||||
buf_attr_ptr = pa_stream_get_buffer_attr (pbuf->stream);
|
actual = pa_stream_get_buffer_attr (pbuf->stream);
|
||||||
|
|
||||||
GST_INFO_OBJECT (psink, "tlength: %d (wanted: %d)", buf_attr_ptr->tlength,
|
GST_INFO_OBJECT (psink, "tlength: %d (wanted: %d)", actual->tlength,
|
||||||
buf_attr.tlength);
|
wanted.tlength);
|
||||||
GST_INFO_OBJECT (psink, "maxlength: %d", buf_attr_ptr->maxlength);
|
GST_INFO_OBJECT (psink, "maxlength: %d", actual->maxlength);
|
||||||
GST_INFO_OBJECT (psink, "prebuf: %d", buf_attr_ptr->prebuf);
|
GST_INFO_OBJECT (psink, "prebuf: %d", actual->prebuf);
|
||||||
GST_INFO_OBJECT (psink, "minreq: %d (wanted %d)", buf_attr_ptr->minreq,
|
GST_INFO_OBJECT (psink, "minreq: %d (wanted %d)", actual->minreq,
|
||||||
buf_attr.minreq);
|
wanted.minreq);
|
||||||
|
|
||||||
spec->segsize = buf_attr_ptr->minreq;
|
spec->segsize = actual->minreq;
|
||||||
spec->segtotal = buf_attr_ptr->tlength / spec->segsize;
|
spec->segtotal = actual->tlength / spec->segsize;
|
||||||
|
|
||||||
pa_threaded_mainloop_unlock (psink->mainloop);
|
pa_threaded_mainloop_unlock (psink->mainloop);
|
||||||
|
|
||||||
|
|
|
@ -950,25 +950,25 @@ no_nego_needed:
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_pulsesrc_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec)
|
gst_pulsesrc_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec)
|
||||||
{
|
{
|
||||||
pa_buffer_attr buf_attr;
|
pa_buffer_attr wanted;
|
||||||
const pa_buffer_attr *buf_attr_ptr;
|
const pa_buffer_attr *actual;
|
||||||
GstPulseSrc *pulsesrc = GST_PULSESRC_CAST (asrc);
|
GstPulseSrc *pulsesrc = GST_PULSESRC_CAST (asrc);
|
||||||
|
|
||||||
pa_threaded_mainloop_lock (pulsesrc->mainloop);
|
pa_threaded_mainloop_lock (pulsesrc->mainloop);
|
||||||
|
|
||||||
buf_attr.maxlength = -1;
|
wanted.maxlength = -1;
|
||||||
buf_attr.tlength = -1;
|
wanted.tlength = -1;
|
||||||
buf_attr.prebuf = 0;
|
wanted.prebuf = 0;
|
||||||
buf_attr.minreq = -1;
|
wanted.minreq = -1;
|
||||||
buf_attr.fragsize = spec->segsize;
|
wanted.fragsize = spec->segsize;
|
||||||
|
|
||||||
GST_INFO_OBJECT (pulsesrc, "maxlength: %d", buf_attr.maxlength);
|
GST_INFO_OBJECT (pulsesrc, "maxlength: %d", wanted.maxlength);
|
||||||
GST_INFO_OBJECT (pulsesrc, "tlength: %d", buf_attr.tlength);
|
GST_INFO_OBJECT (pulsesrc, "tlength: %d", wanted.tlength);
|
||||||
GST_INFO_OBJECT (pulsesrc, "prebuf: %d", buf_attr.prebuf);
|
GST_INFO_OBJECT (pulsesrc, "prebuf: %d", wanted.prebuf);
|
||||||
GST_INFO_OBJECT (pulsesrc, "minreq: %d", buf_attr.minreq);
|
GST_INFO_OBJECT (pulsesrc, "minreq: %d", wanted.minreq);
|
||||||
GST_INFO_OBJECT (pulsesrc, "fragsize: %d", buf_attr.fragsize);
|
GST_INFO_OBJECT (pulsesrc, "fragsize: %d", wanted.fragsize);
|
||||||
|
|
||||||
if (pa_stream_connect_record (pulsesrc->stream, pulsesrc->device, &buf_attr,
|
if (pa_stream_connect_record (pulsesrc->stream, pulsesrc->device, &wanted,
|
||||||
PA_STREAM_INTERPOLATE_TIMING |
|
PA_STREAM_INTERPOLATE_TIMING |
|
||||||
PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_NOT_MONOTONOUS |
|
PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_NOT_MONOTONOUS |
|
||||||
#if HAVE_PULSE_0_9_11
|
#if HAVE_PULSE_0_9_11
|
||||||
|
@ -1003,20 +1003,20 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the actual buffering properties now */
|
/* get the actual buffering properties now */
|
||||||
buf_attr_ptr = pa_stream_get_buffer_attr (pulsesrc->stream);
|
actual = pa_stream_get_buffer_attr (pulsesrc->stream);
|
||||||
|
|
||||||
GST_INFO_OBJECT (pulsesrc, "maxlength: %d", buf_attr_ptr->maxlength);
|
GST_INFO_OBJECT (pulsesrc, "maxlength: %d", actual->maxlength);
|
||||||
GST_INFO_OBJECT (pulsesrc, "tlength: %d (wanted: %d)",
|
GST_INFO_OBJECT (pulsesrc, "tlength: %d (wanted: %d)",
|
||||||
buf_attr_ptr->tlength, buf_attr.tlength);
|
actual->tlength, wanted.tlength);
|
||||||
GST_INFO_OBJECT (pulsesrc, "prebuf: %d", buf_attr_ptr->prebuf);
|
GST_INFO_OBJECT (pulsesrc, "prebuf: %d", actual->prebuf);
|
||||||
GST_INFO_OBJECT (pulsesrc, "minreq: %d (wanted %d)", buf_attr_ptr->minreq,
|
GST_INFO_OBJECT (pulsesrc, "minreq: %d (wanted %d)", actual->minreq,
|
||||||
buf_attr.minreq);
|
wanted.minreq);
|
||||||
GST_INFO_OBJECT (pulsesrc, "fragsize: %d (wanted %d)",
|
GST_INFO_OBJECT (pulsesrc, "fragsize: %d (wanted %d)",
|
||||||
buf_attr_ptr->fragsize, buf_attr.fragsize);
|
actual->fragsize, wanted.fragsize);
|
||||||
|
|
||||||
/* adjust latency again */
|
/* adjust latency again */
|
||||||
spec->segsize = buf_attr_ptr->fragsize;
|
spec->segsize = actual->fragsize;
|
||||||
spec->segtotal = buf_attr_ptr->maxlength / spec->segsize;
|
spec->segtotal = actual->maxlength / spec->segsize;
|
||||||
|
|
||||||
pa_threaded_mainloop_unlock (pulsesrc->mainloop);
|
pa_threaded_mainloop_unlock (pulsesrc->mainloop);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue