linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Stanislawski <t.stanislaws@samsung.com>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	linux-media@vger.kernel.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Hans Verkuil <hverkuil@xs4all.nl>
Subject: Re: [GIT PULL] Selection API and fixes for v3.2
Date: Mon, 26 Sep 2011 10:42:43 +0200	[thread overview]
Message-ID: <4E803B03.5090702@samsung.com> (raw)
In-Reply-To: <4E7D5561.6080303@redhat.com>

On 09/24/2011 05:58 AM, Mauro Carvalho Chehab wrote:

Hi Mauro
Thank you for your comments. Please refer to the answers below.
> Em 22-09-2011 12:13, Marek Szyprowski escreveu:
>> Hello Mauro,
>>
>> I've collected pending selection API patches together with pending
>> videobuf2 and Samsung driver fixes to a single git branch. Please pull
>> them to your media tree.
>>
>
>> Marek Szyprowski (1):
>>        staging: dt3155v4l: fix build break
>
> I've applied this one previously, from the patch you sent me.
>
>
>> Tomasz Stanislawski (6):
>>        v4l: add support for selection api
>>        v4l: add documentation for selection API
>
> I need more time to review those two patches. I'll probably do it at the next week.
> I generally start analyzing API changes based on the DocBook, so, let me point a few
> things I've noticed on a quick read, at the vidioc-g-selection.html DocBook-generated page:
>
> 1) "The coordinates are expressed in driver-dependant units"
>
> Why? coordinates should be expressed in pixels, as otherwise there's no way to
> use this API on a hardware-independent way.
The documentation for existing cropping API contains following sentence:

"To support a wide range of hardware this specification does not define 
an origin or units."

I decided to follow the same convention for the selection API.
I thought that the only exception would be images in memory buffers, 
whose coordinated would be pixels.

However, as Laurent mentioned, some devices are capable of sub-pixel 
cropping. Moreover, there are image exotic formats that have no 
well-defined resolution (fractal or vector graphics). Now I am still not 
sure if the requirement for resolution in pixels should be used any 
more. The problem is that this requirement is very intuitive and useful 
in "let's say" 95% of cases.

>
> 2)
>      0 - driver is free to adjust size, it is recommended to choose the crop/compose rectangle as close as possible to the original one
>
>      SEL_SIZE_GE - driver is not allowed to shrink the rectangle. The original rectangle must lay inside the adjusted one
>
>      SEL_SIZE_LE - drive is not allowed to grow the rectangle. The adjusted rectangle must lay inside the original one
>
>      SEL_SIZE_GE | SEL_SIZE_LE - choose size exactly the same as in desired rectangle.
>
> The macro names above don't match the definition, as they aren't prefixed by V4L2_.
ok.. I will fix it.
>
> 3) There was no hyperlink for the struct v4l2_selection, as on other API definitions.
ok.. I will fix it.
>
> 4) the language doesn't seem too consistent with the way other ioctl's are defined. For example,
> you're using struct::field for a field at the struct. Other parts of the API just say "field foo of struct bar".
ok.. I will fix it.

> 5) There's not a single mention at the git commit or at the DocBook about why the old crop API
> is being deprecated. You need to convince me about such need (ok, I followed a few discussions in
> the past, but, my brain patch buffer is shorter than the 7000 patchwork patches I reviewed just on
> this week). Besides that: do we really need to obsolete the crop API for TV cards? If so, why? If not,
> you need to explain why a developer should opt between one ioctl set of the other.

There are a few reasons to drop support for the cropping ioctls.

First, the selection API covers existing crop API. Therefore there is no 
need to implement {S/G}_CROP and G_CROPCAP. The {S/G}_SELECTION is 
enough to provide the same functionality. We should avoiding duplication 
inside the api, therefore S_CROP should be dropped.

Second, there is a patch that adds simulation of old crop API using 
selection API. Therefore there is no need to change code of the existing 
applications.

Third, the selection is much more powerful API, and it could be extended 
in future. There no more reserved fields inside structures
used by current cropping api. Moreover cropping is very inconsistent. 
For output devices cropping into display actually means composing into 
display. Moreover it not possible to select only the part of the image 
from the buffer to be inserted or filled by the hardware. The selection 
API introduced the idea of the constraints flags, that are used for 
precise control of the coordinates' rounding policy.

I could split commit 'v4l: add documentation for selection API' into two 
commits. One that deprecates S_CROP, and another one that introduces 
selection.

>
> 6) You should add a note about it at hist-v4l2.html page, stating what happened, and why a new crop
> ioctl set is needed.
ok.. I missed it. Sorry.
>
> 7) You didn't update the Experimental API Elements or the Obsolete API Elements at the hist-v4l2.html
ok.. I missed it. Sorry.
>
> Thanks,
> Mauro

Thank again for your comments.
I hope that my answers will convince you to the selection API.

Best regards,
Tomasz Stanislawski


  reply	other threads:[~2011-09-26  8:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 15:13 [GIT PULL] Selection API and fixes for v3.2 Marek Szyprowski
2011-09-24  3:58 ` Mauro Carvalho Chehab
2011-09-26  8:42   ` Tomasz Stanislawski [this message]
2011-09-26 12:10     ` Mauro Carvalho Chehab
2011-09-26 12:17       ` Mauro Carvalho Chehab
2011-09-27 13:02       ` Tomasz Stanislawski
2011-09-27 14:10         ` Mauro Carvalho Chehab
2011-09-27 16:46           ` Tomasz Stanislawski
2011-09-28  8:01             ` Hans Verkuil
2011-09-28  8:29               ` Laurent Pinchart
2011-09-28  9:00                 ` Hans Verkuil
2011-09-28  9:59               ` Tomasz Stanislawski
2011-09-28 10:40                 ` Mauro Carvalho Chehab
2011-09-28 15:17                   ` Tomasz Stanislawski
2011-09-28 11:20                 ` Hans Verkuil
2011-09-26 10:03   ` Marek Szyprowski
2011-09-26 11:18     ` Mauro Carvalho Chehab
2011-09-26 12:45   ` Hans Verkuil
2011-09-26 11:13 ` Mauro Carvalho Chehab
2011-09-26 11:21   ` Marek Szyprowski
2011-09-26 13:30     ` Mauro Carvalho Chehab
2011-09-26 14:41       ` Laurent Pinchart
2011-09-27  8:23       ` Marek Szyprowski
2011-09-27 11:40         ` Mauro Carvalho Chehab

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=4E803B03.5090702@samsung.com \
    --to=t.stanislaws@samsung.com \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@redhat.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;
as well as URLs for NNTP newsgroup(s).