Return-Path: MIME-Version: 1.0 In-Reply-To: <1341865311-21266-1-git-send-email-mikel.astiz.oss@gmail.com> References: <1341865311-21266-1-git-send-email-mikel.astiz.oss@gmail.com> Date: Mon, 16 Jul 2012 06:17:09 -0300 Message-ID: Subject: Re: [RFC v0] media: Extend media API with optional acquire From: Luiz Augusto von Dentz To: Mikel Astiz Cc: linux-bluetooth@vger.kernel.org, Mikel Astiz Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Mikel, On Mon, Jul 9, 2012 at 5:21 PM, Mikel Astiz wrote: > From: Mikel Astiz > 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. > @@ -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