Define Sync and Send traits for AudioInfo...
... if this is acceptable.
I need this in my sink_pad.add_probe
closure, because I'd like to avoid reading AudioInfo
(and Caps
) on every buffer reception. So I defined a Mutex<Option<AudioInfo>>
initialized to None
outside of the closure. When the first buffer arrives, I read the AudioInfo
, set the Option
to Some(audio_info)
and reuse it for subsequent buffers.
Full code is here.