Buffer-type probe at 'src' pad of GstAudioAggregator

Sergei Hrushev hrushev at gmail.com
Tue Mar 7 06:43:29 UTC 2023


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 library and 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/313c08c6/attachment.htm>


More information about the gstreamer-devel mailing list