New, also help on dealing with multiple audio streams using gstreamer-rs

Sebastian Dröge sebastian at centricular.com
Thu Dec 17 11:02:32 UTC 2020


On Thu, 2020-12-17 at 10:46 +0000, Michael Johnson wrote:
> Another point here, connecting to the audio-stream signal and
> printing the current-audio yields -1 until I physically close the
> window when it gets the correct audio stream here

That seems wrong, please provide a testcase for that.

> Also, I imagine when I want to bind changing stream to a key press I
> need to emit this signal to be caught. But I can't access any data
> structures from the callback, so it'll always chose a constant
> stream. Am I missing something? here 

You can pass any heap allocated data without references to stack memory
into the signal handler closure.

A common pattern would be to store your state in a std::sync::Arc to
give it reference counting, and use a std::sync::Mutex for getting
interior mutability of whatever state you need to change.

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201217/e369ccba/attachment.htm>


More information about the gstreamer-devel mailing list