From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 1/2] uvcvideo: Factor out video device registration to a function
Date: Tue, 05 Dec 2017 11:24:48 +0200 [thread overview]
Message-ID: <2198509.Q7DjPqLdEd@avalon> (raw)
In-Reply-To: <alpine.DEB.2.20.1712051008040.22421@axis700.grange>
Hi Guennadi,
On Tuesday, 5 December 2017 11:14:18 EET Guennadi Liakhovetski wrote:
> On Tue, 5 Dec 2017, Laurent Pinchart wrote:
> > The function will then be used to register the video device for metadata
> > capture.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >
> > drivers/media/usb/uvc/uvc_driver.c | 66 ++++++++++++++++++++-------------
> > drivers/media/usb/uvc/uvcvideo.h | 8 +++++
> > 2 files changed, 49 insertions(+), 25 deletions(-)
> >
> > diff --git a/drivers/media/usb/uvc/uvc_driver.c
> > b/drivers/media/usb/uvc/uvc_driver.c index f77e31fcfc57..b832929d3382
> > 100644
> > --- a/drivers/media/usb/uvc/uvc_driver.c
> > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > @@ -24,6 +24,7 @@
> > #include <asm/unaligned.h>
> >
> > #include <media/v4l2-common.h>
> > +#include <media/v4l2-ioctl.h>
> >
> > #include "uvcvideo.h"
> > @@ -1895,52 +1896,63 @@ static void uvc_unregister_video(struct uvc_device
> > *dev)
>
> [snip]
>
> > vdev->release = uvc_release;
> > vdev->prio = &stream->chain->prio;
> >
> > - if (stream->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
> > + if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
> > vdev->vfl_dir = VFL_DIR_TX;
>
> Why isn't .vfl_dir set for other stream types? Are you jusut relying on
> VFL_DIR_RX == 0? I'd use a switch (type) here which then would be extended
> in your next patch with .device_caps fields.
Yes, and I agree it's not right. How about
if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
vdev->vfl_dir = VFL_DIR_TX;
else
vdev->vfl_dir = VFL_DIR_RX;
Then it won't need to be touched when adding metadata support.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2017-12-05 9:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-04 23:23 [PATCH 0/2] uvcvideo: Refactor code to ease metadata implementation Laurent Pinchart
2017-12-04 23:23 ` [PATCH 1/2] uvcvideo: Factor out video device registration to a function Laurent Pinchart
2017-12-05 9:14 ` Guennadi Liakhovetski
2017-12-05 9:24 ` Laurent Pinchart [this message]
2017-12-05 9:37 ` Guennadi Liakhovetski
2017-12-04 23:23 ` [PATCH 2/2] uvcvideo: Report V4L2 device caps through the video_device structure Laurent Pinchart
2017-12-12 7:45 ` [PATCH 0/2] uvcvideo: Refactor code to ease metadata implementation Guennadi Liakhovetski
2017-12-13 9:36 ` 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=2198509.Q7DjPqLdEd@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=g.liakhovetski@gmx.de \
--cc=linux-media@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.