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,
sakari.ailus@iki.fi, 'Kamil Debski' <k.debski@samsung.com>
Subject: Re: [PATCH 2/4] v4l: add documentation for selection API
Date: Tue, 27 Sep 2011 16:17:11 +0200 [thread overview]
Message-ID: <4E81DAE7.60509@samsung.com> (raw)
In-Reply-To: <201109271317.07571.laurent.pinchart@ideasonboard.com>
Hi Laurent,
On 09/27/2011 01:17 PM, Laurent Pinchart wrote:
> Hi Tomasz,
>
> On Friday 23 September 2011 17:22:27 Tomasz Stanislawski wrote:
>> On 09/23/2011 03:13 PM, Laurent Pinchart wrote:
>
[snip]
>>
>> I have to ideas to add subpixels to selection API.
>>
>> 1. Introduce struct v4l2_frect similar to struct v4l2_rect. All its
>> fields' type would be struct v4l2_fract.
>> 2. Add field denominator to v4l2_selection as one of reserved fields.
>> All selection coordinates would be divided by this number.
>>
>> The 2nd proposal could added in the future update to selection API.
>
> The second solution seems the simplest. Drivers will likely not support
> arbitrary denominators, so we also need a way to report the acceptable
> value(s) to userspace.
>
The driver could set denominator to zero for G_SELECTION to indicate
that no subpixel resolutions are supported. Moreover it is easy to
convert fractional value to integers because rounding would be
controlled by the constraints flags. This operation could be done by new
helper function from V4L2 kernel API.
[snip]
>>>>>
>>>>> How would an application remove them ?
>>>>
>>>> The application may use memset if it recognizes fourcc. The idea of
>>>> padding target was to provide information about artifacts introduced the
>>>> hardware. If the image is decoded directly to framebuffer then the
>>>> application could remove artifacts. We could introduce some V4L2
>>>> control to inform if the padding are is filled with zeros to avoid
>>>> redundant memset.
>>>> What do you think?
>>>
>>> OK, I understand this better now. I'm still not sure how applications
>>> will be able to cope with that. memset'ing the garbage area won't look
>>> good on the screen.
>>
>> The memset is just a simple and usually fast solution. The application
>> could fill the padding area with any pattern or background color.
>>
>>> Does your hardware have different compose and padding rectangles ?
>>
>> I assume that you mean active and padded targets for composing, right?
>> The answer is yes. The MFC inserts data to the image that dimensions are
>> multiples of 128x32. The movie inside could be any size that fits to the
>> buffer. The area that contains the movie frame is the active rectangle.
>> The padded is filled with zeros. For MFC the bounds and padded rectangle
>> are the same.
>>
>> Hmm...
>>
>> Does it violate 'no margin requirement', doesn't it?
>
> Seems so :-)
>
For S5P MFC is it not possible to satisfy 'no margin' requirement in all
cases. The default rectangle is not equal to the bound rectangle in all
cases. BTW, the MFC is mem2mem device so its API may change.
To sum up for MFC following inequalities are satisfied:
active <= padded == bound
Do you think that 'no margin' requirement should be downgraded to a
recommendation status?
[snip]
>
> I think the driver should always return the best-hit rectangle, regardless of
> whether we use hints or not.
>
The problem is that when the VIDIOC_S_SELECTION fails (could not satisfy
constraints) then the ioctl'a parameters are not copied to the
userspace. So no best-hit rectangle can be returned. On the other hand,
if the ioctl would not fail in this case then the configuration is
applied, causing pipeline messing. We have no-win situation.
If the application accepts all rectangles then it should never use the
constraint flags in the first place. Moreover, the application can
always remove the constraints flags and try again. At least, the fall
back is done explicitly in that case.
The VIDIOC_TRY_SELECTION could be added to cope with more complex
negotiations.
Best regards,
Tomasz Stanislawski
next prev parent reply other threads:[~2011-09-27 14:17 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-31 12:28 [PATCHv5 0/4] v4l: extended crop/compose api Tomasz Stanislawski
2011-08-31 12:28 ` [PATCH 1/4] v4l: add support for selection api Tomasz Stanislawski
2011-09-05 10:25 ` Sakari Ailus
2011-09-05 12:52 ` Laurent Pinchart
2011-09-05 12:55 ` Sakari Ailus
2011-09-23 8:33 ` Laurent Pinchart
2011-09-27 8:28 ` Hans Verkuil
2011-09-29 13:41 ` Tomasz Stanislawski
2011-10-12 11:48 ` Sakari Ailus
2011-10-12 15:08 ` Tomasz Stanislawski
2011-10-12 16:31 ` Sakari Ailus
2011-10-14 17:19 ` Sakari Ailus
2011-10-17 13:31 ` Tomasz Stanislawski
2011-10-17 16:54 ` Sakari Ailus
2011-08-31 12:28 ` [PATCH 2/4] v4l: add documentation for selection API Tomasz Stanislawski
2011-09-22 22:41 ` Laurent Pinchart
2011-09-23 12:36 ` Tomasz Stanislawski
2011-09-23 13:13 ` Laurent Pinchart
2011-09-23 15:22 ` Tomasz Stanislawski
2011-09-27 11:17 ` Laurent Pinchart
2011-09-27 14:17 ` Tomasz Stanislawski [this message]
2011-09-27 15:32 ` Kamil Debski
2011-09-27 9:20 ` Hans Verkuil
2011-09-27 11:11 ` Laurent Pinchart
2011-09-27 11:27 ` Hans Verkuil
2011-09-27 13:36 ` Tomasz Stanislawski
2011-09-27 13:52 ` Hans Verkuil
2011-08-31 12:28 ` [PATCH 3/4] v4l: emulate old crop API using extended crop/compose API Tomasz Stanislawski
2011-08-31 12:28 ` [PATCH 4/4] 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=4E81DAE7.60509@samsung.com \
--to=t.stanislaws@samsung.com \
--cc=hverkuil@xs4all.nl \
--cc=k.debski@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=sakari.ailus@iki.fi \
/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