Buffer-type probe at 'src' pad of GstAudioAggregator

vinod kesti vinodkesti at yahoo.com
Tue Mar 7 20:36:13 UTC 2023


Here is documentation for 
https://gstreamer.freedesktop.org/documentation/audio/gstaudioaggregator.html?gi-language=c

Refer mixer code for more details:
https://github.com/GStreamer/gst-plugins-base/blob/master/gst/audiomixer/gstaudiomixer.c

Sent from Yahoo Mail. Get the app 

    On Tuesday, 7 March, 2023 at 12:43:59 am GMT-6, Sergei Hrushev via gstreamer-devel <gstreamer-devel at lists.freedesktop.org> wrote:  
 
 Hello everyone!
I have a question on usage of GstAudioAggregator: tried to search docs, StackOverflow etc. - but no luck.
I'm trying to implement a Spatial Audio mixing logic based on GstAudioAggregator. 
My basic idea is simple enough: 
1. Capture samples from 'sink_%u' pads of GstAudioAggregator;2. Put the samples captured at step 1 into the Spatial Audio library;3. Get the mixed result from Spatial Audio libraryand transfer it to 'src' pad of GstAudioAggregator.
For Step 1 I created a descendant of GstAudioAggregator where parts of buffers are collected with correct reordering based on their offsets.For steps 2 and 3 I added a probe of type GST_PAD_PROBE_TYPE_BUFFER to 'src' pad of my Element, made the buffer writable in the callback, 
then I transfer the data to Spatial Audio library and receive result.
But when I'm writing data to the output buffer the resulting sound is always "jammed".
I even tried to generate 100Hz sine wave and wrote it directly to output buffer, and the result is always jammed too. 
To not miss something I carefully checked the output buffer offsets received at _aggregate_one_buffer, 
so for each pad I see that it starts from zero, but when I write frames starting at the output buffer's first address - the resulting sound is always "jammed".Of course I checked frame rate, number of channels and audio format: all values are correct.

Is there any example of how to write frames from probe to the 'src' of GstAudioAggregator (of any 'src' in general if the problem in my misunderstanding of the idea)?How is possible to write to the output buffer manually?

Best regards, Sergei Hrushev.   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230307/199e5c6f/attachment.htm>


More information about the gstreamer-devel mailing list