All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Stanislawski <t.stanislaws@samsung.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, m.szyprowski@samsung.com,
	kyungmin.park@samsung.com, hverkuil@xs4all.nl
Subject: Re: [PATCH 1/5] [media] v4l: add support for selection api
Date: Tue, 30 Aug 2011 20:38:54 +0200	[thread overview]
Message-ID: <4E5D2E3E.4040504@samsung.com> (raw)
In-Reply-To: <201108261701.15699.laurent.pinchart@ideasonboard.com>

On 08/26/2011 05:01 PM, Laurent Pinchart wrote:
> Hi Tomasz,
>
> On Friday 26 August 2011 15:06:03 Tomasz Stanislawski wrote:
>> This patch introduces new api for a precise control of cropping and
>> composing features for video devices. The new ioctls are
>> VIDIOC_S_SELECTION and VIDIOC_G_SELECTION.
>>
>> Signed-off-by: Tomasz Stanislawski<t.stanislaws@samsung.com>
>> Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
>> ---
>>   drivers/media/video/v4l2-compat-ioctl32.c |    2 ++
>>   drivers/media/video/v4l2-ioctl.c          |   28
>> ++++++++++++++++++++++++++++ include/linux/videodev2.h                 |
>> 27 +++++++++++++++++++++++++++ include/media/v4l2-ioctl.h                |
>>     4 ++++
>>   4 files changed, 61 insertions(+), 0 deletions(-)
>>
> [snip]
>
>> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
>> index fca24cc..fad4fb3 100644
>> --- a/include/linux/videodev2.h
>> +++ b/include/linux/videodev2.h
>> @@ -738,6 +738,29 @@ struct v4l2_crop {
>>   	struct v4l2_rect        c;
>>   };
>>
>> +/* Hints for adjustments of selection rectangle */
>> +#define V4L2_SEL_SIZE_GE	0x00000001
>> +#define V4L2_SEL_SIZE_LE	0x00000002
>> +
>> +enum v4l2_sel_target {
>> +	V4L2_SEL_CROP_ACTIVE  = 0,
>> +	V4L2_SEL_CROP_DEFAULT = 1,
>> +	V4L2_SEL_CROP_BOUNDS  = 2,
>> +	V4L2_SEL_COMPOSE_ACTIVE  = 256 + 0,
>> +	V4L2_SEL_COMPOSE_DEFAULT = 256 + 1,
>> +	V4L2_SEL_COMPOSE_BOUNDS  = 256 + 2,
>> +	V4L2_SEL_COMPOSE_PADDED  = 256 + 3,
>> +};
>> +
>> +struct v4l2_selection {
>> +	enum v4l2_buf_type      type;
>> +	enum v4l2_sel_target	target;
>> +	__u32                   flags;
>> +	struct v4l2_rect        r;
> Maybe rect instead of r ? Lines such as
>
> 	p->c = s.r;
>
> in patch 3/5 look a bit cryptic.
Notice that struct v4l2_crop contains field c of struct v4l2_rect type.
I wanted to keep this name as short as possible because it is obvious 
that selection is a rectangle,
so its coordinates should be accessed in "the shortest" possible way :)
>> +	__u32                   reserved[9];
>> +};
>> +
>> +
>>   /*
>>    *      A N A L O G   V I D E O   S T A N D A R D
>>    */
> [snip]
>
>> diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
>> index dd9f1e7..2c0396b 100644
>> --- a/include/media/v4l2-ioctl.h
>> +++ b/include/media/v4l2-ioctl.h
>> @@ -194,6 +194,10 @@ struct v4l2_ioctl_ops {
>>   					struct v4l2_crop *a);
>>   	int (*vidioc_s_crop)           (struct file *file, void *fh,
>>   					struct v4l2_crop *a);
>> +	int (*vidioc_g_selection)      (struct file *file, void *fh,
>> +					struct v4l2_selection *a);
>> +	int (*vidioc_s_selection)      (struct file *file, void *fh,
>> +					struct v4l2_selection *a);
> Why 'a' ? Don't blindly copy past mistakes :-) 'sel' would be a more
> descriptive parameter name.
Maybe just 's' is good enough. It keeps naming used by other ops.
>>   	/* Compression ioctls */
>>   	int (*vidioc_g_jpegcomp)       (struct file *file, void *fh,
>>   					struct v4l2_jpegcompression *a);


  reply	other threads:[~2011-08-30 18:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26 13:06 [PATCH v4 0/5] v4l: extended crop/compose api Tomasz Stanislawski
2011-08-26 13:06 ` [PATCH 1/5] [media] v4l: add support for selection api Tomasz Stanislawski
2011-08-26 14:57   ` Laurent Pinchart
2011-08-26 15:01   ` Laurent Pinchart
2011-08-30 18:38     ` Tomasz Stanislawski [this message]
2011-08-30 21:30   ` Sakari Ailus
2011-08-26 13:06 ` [PATCH 2/5] [media] v4l: add documentation for selection API Tomasz Stanislawski
2011-08-26 13:06 ` [PATCH 3/5] [media] v4l: simulate old crop API using extended crop/compose API Tomasz Stanislawski
2011-08-26 15:05   ` Laurent Pinchart
2011-09-27  9:30   ` Hans Verkuil
2011-09-28 10:27     ` Tomasz Stanislawski
2011-08-26 13:06 ` [PATCH 4/5] [media] v4l: fix copying ioctl results on failure Tomasz Stanislawski
2011-08-26 15:09   ` Laurent Pinchart
2011-08-29  8:01     ` Tomasz Stanislawski
2011-08-29  8:56       ` Laurent Pinchart
2011-08-29 11:55         ` Tomasz Stanislawski
2011-08-29 12:58           ` Laurent Pinchart
2011-08-26 13:06 ` [PATCH 5/5] [media] v4l: s5p-tv: mixer: add support for selection API Tomasz Stanislawski

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=4E5D2E3E.4040504@samsung.com \
    --to=t.stanislaws@samsung.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.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 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.