Thread (12 messages) flat view 12 messages, 4 authors, 2012-07-05

RE: media transport -- when is acquire ok to call?

From: Mikel Astiz <hidden>
Date: 2012-03-27 06:31:09

Hi Mike,
 
So that has me confused.  If the MediaTransport interface is somewhat
generic, why would I want to listen to another interface to know if I
should call Acquire?  In my case, I would need to listen to
HeadsetGateway.  As it is, the audio from my SCO connection is sent
over a PCM bus, so I currently do not even register an SCO endpoint,
because it was not needed.  I agree that if you are the initiator,
Acquire/Release is sufficient.  In my case, as the non-initiator, it is
not sufficient because I do not want to open an audio link by calling
acquire unless it already exists.
I'm not sure if this solves your specific problem(s) but I would propose that the MediaTransport API is extended with a method such as TryAcquire (or alternatively Acquire can be extended with either one more parameter, or some specific flag in accesstype). In that case the transport would not be acquired unless the audio link already exists.

The current approach of listening to a state property and then calling Acquire is racy, no matter if the property is in the same interface or not.

Regarding your comment on the need to listen to a different interface, I don't think this should be a big problem. Having said that, the Playing state in HeadsetGateway (and equivalents) could be replaced by a state in MediaTransport. That actually seems more appropriate to me.

Cheers,
Mikel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help