public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Stanislawski <t.stanislaws@samsung.com>
To: linux-media@vger.kernel.org
Cc: linux-media@vger.kernel.org, m.szyprowski@samsung.com,
	kyungmin.park@samsung.com, hverkuil@xs4all.nl,
	laurent.pinchart@ideasonboard.com,
	sakari.ailus@maxwell.research.nokia.com
Subject: Re: [PATCH 2/2] v4l: simulate old crop API using extended crop/compose API
Date: Mon, 09 May 2011 13:01:51 +0200	[thread overview]
Message-ID: <4DC7C99F.9040900@samsung.com> (raw)
In-Reply-To: <004d01cc0e11$9c715e10$d5541a30$%han@samsung.com>

Jonghun Han wrote:
> Hi Tomasz Stanislawski,
> 
> On Thursday, May 05, 2011 6:40 PM Tomasz Stanislawski wrote:
>> This patch allows new drivers to work correctly with applications that use
>> old-style crop API.
>> The old crop ioctl is simulated by using selection ioctls.
>>
>> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
>> ---
>>  drivers/media/video/v4l2-ioctl.c |   85
> +++++++++++++++++++++++++++++++++----
>>  1 files changed, 75 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-
>> ioctl.c
>> index aeef966..d0a4073 100644
>> --- a/drivers/media/video/v4l2-ioctl.c
>> +++ b/drivers/media/video/v4l2-ioctl.c
>> @@ -1723,11 +1723,31 @@ static long __video_do_ioctl(struct file *file,
>>  	{
>>  		struct v4l2_crop *p = arg;
>>
>> -		if (!ops->vidioc_g_crop)
>> +		dbgarg(cmd, "type=%s\n", prt_names(p->type,
> v4l2_type_names));
>> +
>> +		if (ops->vidioc_g_crop) {
>> +			ret = ops->vidioc_g_crop(file, fh, p);
>> +		} else
>> +		if (ops->vidioc_g_selection) {
>> +			/* simulate capture crop using selection api */
>> +			struct v4l2_selection s = {
>> +				.type = p->type,
>> +				.target = V4L2_SEL_CROP_ACTIVE,
>> +			};
>> +
>> +			/* crop means compose for output devices */
>> +			if (p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
>> +				s.target = V4L2_SEL_COMPOSE_ACTIVE;
>> +
> 
> If it also supports V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
> how about using Macro like V4L2_TYPE_IS_OUTPUT(type) ?
> 
> [snip]
> 
> Best regards,
> Jonghun Han
> 
> 
Hi Jonghun,
Thank you for noticing MPLANE bug. I will fix it in next version.
There is some version of V4L2 with automatic conversion of buffer type.
However, the main purpose of this RFC is discussion over extended crop API.
Patches are a less relevant part at the moment.
I hope that the final consensus over API will emerge soon.
Do you have any comment or suggestions?

Best regards,
Tomasz Stanislawski


  reply	other threads:[~2011-05-09 11:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05  9:39 [PATCH 0/2] V4L: Extended crop/compose API Tomasz Stanislawski
2011-05-05  9:39 ` [PATCH 1/2] v4l: add support for extended " Tomasz Stanislawski
2011-05-05  9:39 ` [PATCH 2/2] v4l: simulate old crop API using " Tomasz Stanislawski
2011-05-09  6:23   ` Jonghun Han
2011-05-09 11:01     ` Tomasz Stanislawski [this message]
2011-05-07 11:52 ` [PATCH 0/2] V4L: Extended " Hans Verkuil
2011-05-13 12:43   ` Laurent Pinchart
2011-05-14 10:50     ` Hans Verkuil
2011-05-16  7:21       ` Laurent Pinchart
2011-05-18 12:06         ` Sylwester Nawrocki
     [not found]           ` <201105181431.59580.hansverk@cisco.com>
2011-05-18 13:03             ` Sylwester Nawrocki
2011-05-19 13:47               ` Laurent Pinchart
2011-05-19 14:05                 ` Marek Szyprowski
2011-05-19 14:06                 ` Tomasz Stanislawski
2011-05-19 14:12                   ` Laurent Pinchart
2011-05-19 13:45             ` Laurent Pinchart
2011-05-18 16:55         ` Tomasz Stanislawski
2011-05-19 15:50           ` Tomasz Stanislawski
2011-05-23 21:29           ` Laurent Pinchart
2011-05-24 12:28             ` Tomasz Stanislawski
2011-05-25 13:43               ` Laurent Pinchart
2011-05-25 16:03                 ` 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=4DC7C99F.9040900@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 \
    --cc=sakari.ailus@maxwell.research.nokia.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