Adaptive resampling in gstaudiobasesink.c

charleslaub at sbcglobal.net charleslaub at sbcglobal.net
Sat Oct 17 20:24:41 UTC 2020


Nicolas, this is the message/thread on adaptive resampling that I mentioned.
-Charlie

-----Original Message-----
From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> On
Behalf Of Pavel Hofman
Sent: Wednesday, October 14, 2020 4:12 AM
To: gstreamer-devel at lists.freedesktop.org
Subject: Adaptive resampling in gstaudiobasesink.c

Hi,

Please do I understand correctly that the slave clock alignment methods in
gstaudiobasesink.c never touch the actual samples and handle only various
ways of adjusting pointers into the ringbuffer? Including the
GST_AUDIO_BASE_SINK_SLAVE_CUSTOM method.

Calculation of the master/slave clock difference is already available in
gstaudiobasesink.c. Adaptive resampling (like used in PA, alsaloop,
etc.) would require having two buffers with input and resampled samples: 
in -> resampling -> out. If the out buffer were available, calling e.g. 
src_process of libsamplerate would not be so difficult, IMO.

Please how complicated would be to add the out buffer and let the
implementations for specific audio outputs (e.g. GstAlsaSink) use it instead
of the buffer with incoming data? I am afraid it is not trivial due to the
"inheritance" within the code

struct _GstAlsaSink {
   GstAudioSink    sink;
..

} .

Perhaps the ring buffer would become the "out" buffer and the resampling
code had to read from another buffer written by the "input" side of the
plugin.

Thanks a lot for any suggestions and comments.

Best regards,

Pavel.
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list