public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: kieran.bingham@ideasonboard.com
Cc: linux-media@vger.kernel.org,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Olivier BRAUN <olivier.braun@stereolabs.com>,
	Troy Kisky <troy.kisky@boundarydevices.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Philipp Zabel <philipp.zabel@gmail.com>,
	Ezequiel Garcia <ezequiel@collabora.com>
Subject: Re: [PATCH v5 8/9] media: uvcvideo: Rename uvc_{un,}init_video()
Date: Wed, 07 Nov 2018 22:25:27 +0200	[thread overview]
Message-ID: <9290334.s72v5oSQOh@avalon> (raw)
In-Reply-To: <bf3dcb4c-0039-8bf7-d059-30ac5279cda2@ideasonboard.com>

Hi Kieran,

On Wednesday, 7 November 2018 16:30:46 EET Kieran Bingham wrote:
> On 06/11/2018 23:13, Laurent Pinchart wrote:
> > On Tuesday, 6 November 2018 23:27:19 EET Kieran Bingham wrote:
> >> From: Kieran Bingham <kieran.bingham@ideasonboard.com>
> >> 
> >> We have both uvc_init_video() and uvc_video_init() calls which can be
> >> quite confusing to determine the process for each. Now that video
> >> uvc_video_enable() has been renamed to uvc_video_start_streaming(),
> >> adapt these calls to suit the new flow.
> >> 
> >> Rename uvc_init_video() to uvc_video_start() and uvc_uninit_video() to
> >> uvc_video_stop().
> > 
> > I agree that these functions are badly named and should be renamed. We are
> > however entering the nitpicking territory :-) The two functions do more
> > that starting and stopping, they also allocate and free URBs and the
> > associated buffers. It could also be argued that they don't actually
> > start and stop anything, as beyond URB management, they just queue the
> > URBs initially and kill them. I thus wonder if we could come up with
> > better names.
> 
> Well the act of killing (poisoning now) the URBs will certainly stop the
> stream, but I guess submitting the URBs isn't necessarily the key act to
> starting the stream.
> 
> I believe that needs the interface to be set correctly, and the buffers
> to be available?
> 
> Although - I've just double-checked uvc_{video_start,init_video}() and
> that is indeed what it does?
> 
>  - start stats
>  - Initialise endpoints
>    - Perform allocations
>  - Submit URBs
> 
> Am I missing something? Is there another step that is pivotal to
> starting the USB packet/urb stream flow after this point ?
> 
> 
> Is it not true that the USB stack will start processing data at
> submitting URB completion callbacks after the end of uvc_video_start();
> and will no longer process data at the end of uvc_video_stop() (and thus
> no more completion callbacks)?
> 
>  (That's a real question to verify my interpretation)
> 
> To me - these functions feel like the real 'start' and 'stop' components
> of the data stream - hence my choice in naming.

The other part of the start operation is committing the streaming parameters 
(see uvc_video_start_streaming()). For the stop operation it's issuing a 
SET_INTERFACE or CLEAR_FEATURE(HALT) request (see uvc_video_stop_streaming()).

> Is your concern that you would like the functions to be more descriptive
> over their other actions such as? :
> 
>   uvc_video_initialise_start()
>   uvc_video_allocate_init_start()
> 
> Or something else? (I don't think those two are good names though)

Probably something else :-) A possibly equally bad proposal would be 
uvc_video_start_transfer() and uvc_video_stop_transfer().

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2018-11-08  5:57 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 21:27 [PATCH v5 0/9] Asynchronous UVC Kieran Bingham
2018-11-06 21:27 ` [PATCH v5 1/9] media: uvcvideo: Refactor URB descriptors Kieran Bingham
2018-11-06 21:27 ` [PATCH v5 2/9] media: uvcvideo: Convert decode functions to use new context structure Kieran Bingham
2018-11-06 21:27 ` [PATCH v5 3/9] media: uvcvideo: Protect queue internals with helper Kieran Bingham
2018-11-06 21:27 ` [PATCH v5 4/9] media: uvcvideo: queue: Simplify spin-lock usage Kieran Bingham
2018-11-06 21:27 ` [PATCH v5 5/9] media: uvcvideo: queue: Support asynchronous buffer handling Kieran Bingham
2018-11-06 22:38   ` Laurent Pinchart
2018-11-06 21:27 ` [PATCH v5 6/9] media: uvcvideo: Move decode processing to process context Kieran Bingham
2018-11-06 22:58   ` Laurent Pinchart
2018-11-07 12:22     ` Kieran Bingham
2018-11-06 21:27 ` [PATCH v5 7/9] media: uvcvideo: Split uvc_video_enable into two Kieran Bingham
2018-11-06 23:08   ` Laurent Pinchart
2018-11-07 12:20     ` Kieran Bingham
2018-11-06 21:27 ` [PATCH v5 8/9] media: uvcvideo: Rename uvc_{un,}init_video() Kieran Bingham
2018-11-06 23:13   ` Laurent Pinchart
2018-11-07 14:30     ` Kieran Bingham
2018-11-07 20:25       ` Laurent Pinchart [this message]
2018-11-09 15:41         ` Philipp Zabel
2018-11-09 16:08           ` Kieran Bingham
2018-11-06 21:27 ` [PATCH v5 9/9] media: uvcvideo: Utilise for_each_uvc_urb iterator Kieran Bingham
2018-11-06 23:21   ` Laurent Pinchart
2018-11-07 13:50     ` Kieran Bingham
2018-11-06 23:31 ` [PATCH v5 0/9] Asynchronous UVC Laurent Pinchart
2018-11-08 17:01   ` Laurent Pinchart
2018-11-09 13:25     ` Kieran Bingham
2018-11-27 20:17 ` Pavel Machek
2018-11-27 21:48   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9290334.s72v5oSQOh@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=ezequiel@collabora.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=olivier.braun@stereolabs.com \
    --cc=philipp.zabel@gmail.com \
    --cc=rdunlap@infradead.org \
    --cc=troy.kisky@boundarydevices.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox