[pulseaudio-discuss] How to find the latest created bluetooth sink/source via event hook?

Lin, Mengdong mengdong.lin at intel.com
Tue May 17 20:43:29 PDT 2011

I'm developing an routing module to automatically set a new created Bluetooth sink as the default sink when a Bluetooth headset is connected.
So I need to get the new BT sink when it's created.

But when I hook event " PA_CORE_HOOK_SINK_NEW", I found that the sink pointer for the callback function is *not* the real sink pointer value.
So although in the hook of "PA_CORE_HOOK_SINK_STATE_CHANGED", I can get the proper sink pointer, it's not straightforward to know whether an IDLE sink is a new created one.

So could anyone share some hint on how to find the new created sink/source? Shall I iterate the core's sink/source list and compare pointers in sink/source state change callback function?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20110518/67829288/attachment.htm>

More information about the pulseaudio-discuss mailing list