Re: [RFC v0] media: Extend media API with optional acquire
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2012-07-16 09:17:09
Hi Mikel, On Mon, Jul 9, 2012 at 5:21 PM, Mikel Astiz [off-list ref] wrote:
From: Mikel Astiz <redacted>
unsigned int gateway_request_stream(struct audio_device *dev,
+ gboolean try_only,
gateway_stream_cb_t cb, void *user_data)
{
struct gateway *gw = dev->gateway;
GError *err = NULL;
GIOChannel *io;
+ if (try_only && !gw->sco)
+ return 0;Perhaps if we store the status of the transport we don't need to even call gateway_request_stream.
quoted hunk ↗ jump to hunk
@@ -88,6 +88,7 @@ struct media_transport { gboolean write_lock; gboolean in_use; guint (*resume) (struct media_transport *transport, + gboolean try_only, struct media_owner *owner);
What about creating a new callback e.g. try_resume? Also I don't think we should restrict to just gateway, although it is probably the only one that has a real use case once we introduce "?" flag it should be supported by every transport or properly document which transport does support it. -- Luiz Augusto von Dentz