From: Hans de Goede <hdegoede@redhat.com>
To: Trent Piepho <xyzzy@speakeasy.org>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
kilgota@banach.math.auburn.edu,
Adam Baker <linux@baker-net.org.uk>,
linux-media@vger.kernel.org,
Jean-Francois Moine <moinejf@free.fr>,
Olivier Lorin <o.lorin@laposte.net>
Subject: Re: Adding a control for Sensor Orientation
Date: Sun, 15 Feb 2009 14:46:07 +0100 [thread overview]
Message-ID: <49981C9F.7000305@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0902150445490.24268@shell2.speakeasy.net>
Trent Piepho wrote:
> On Sun, 15 Feb 2009, Hans de Goede wrote:
>> Hans Verkuil wrote:
>>> On Sunday 15 February 2009 10:08:04 Hans de Goede wrote:
>>>> kilgota@banach.math.auburn.edu wrote:
>>>>> On Sat, 14 Feb 2009, Hans Verkuil wrote:
>>>>>> On Saturday 14 February 2009 22:55:39 Hans de Goede wrote:
>>>>>>> Adam Baker wrote:
>>>>>> OK, make it a buffer flag. I've got to agree that it makes more sense
>>>>>> to do
>>>>>> it that way.
>>>>>>
>>>>> The most particular problem is that some of the cameras require byte
>>>>> reversal of the frame data string, which would rotate the image 180
>>>>> degrees around its center. Others of these cameras require reversal of
>>>>> the horizontal lines in the image (vertical 180 degree rotation of the
>>>>> image across a horizontal axis).
>>>>>
>>>>> The point is, one can not tell from the Vendor:Product number which of
>>>>> these actions is required. However, one *is* able to tell immediately
>>>>> after the camera is initialized, which of these actions is required.
>>>>> Namely, one reads and parses the response to the first USB command sent
>>>>> to the camera.
>
>>>> Ack, but the problem later was extended by the fact that it turns out
>>>> some cams have a rotation detection (gravity direction) switch, which
>>>> means you can flip the cam on its socket while streaming, and then the
>>>> cam will tell you its rotation has changed, that makes this a per frame
>>>> property rather then a static property of the cam. Which lead to this
>>>> discussion, but we (the 2 Hans 's) agree now that using the flags field
>>>> in the buffer struct is the best way forward. So there is a standard now,
>>>> simply add 2 buffer flags to videodev2.h, one for content is h-flipped
>>>> and one for content is v-flipped and you are done.
>>> I think we should also be able to detect 90 and 270 degree rotations. Or at
>>> the very least prepare for it. It's a safe bet to assume that webcams will
>>> arrive that can detect portrait vs landscape orientation.
>> Handling those (esp on the fly) will be rather hard as width and height then
>> get swapped. So lets worry about those when we need to. We will need an
>> additional flag for those cases anyways.
>
> Why would you need to worry about width and height getting swapped?
> Meta-data about the frame would indicate it's now in portrait mode vs
> landscape mode, but the dimentions would be unchanged.
Yes, unless ofcourse you want to display a proper picture and not one on its
side, when the camera is rotated 90 degrees, so somewere you need to rotate the
picture 90 degrees, and the lower down in the stack you do that, the bigger the
chance you do not need to duplicate the rotation code in every single app.
however the app will mostlikely become unhappy when you start out pushing
frames whith a changed width / height.
Regards,
Hans
next prev parent reply other threads:[~2009-02-15 13:41 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-14 20:48 Adding a control for Sensor Orientation Adam Baker
2009-02-14 21:04 ` Hans Verkuil
2009-02-14 21:55 ` Hans de Goede
2009-02-14 21:59 ` Hans Verkuil
2009-02-14 22:44 ` kilgota
2009-02-15 9:08 ` Hans de Goede
2009-02-15 9:19 ` Hans Verkuil
2009-02-15 9:29 ` Hans de Goede
2009-02-15 13:03 ` Trent Piepho
2009-02-15 13:46 ` Hans de Goede [this message]
2009-02-15 23:09 ` Trent Piepho
2009-02-16 1:46 ` kilgota
2009-02-16 3:47 ` hermann pitton
2009-02-16 3:55 ` Trent Piepho
2009-02-16 8:30 ` Hans de Goede
2009-02-16 2:26 ` Mauro Carvalho Chehab
2009-02-16 4:04 ` Trent Piepho
2009-02-16 7:44 ` Hans Verkuil
2009-02-16 8:37 ` Hans de Goede
-- strict thread matches above, loose matches on Subject: below --
2009-02-16 8:33 Hans Verkuil
2009-02-16 22:36 ` Adam Baker
2009-02-17 2:00 ` kilgota
2009-02-17 7:27 ` Hans Verkuil
2009-02-17 22:29 ` Adam Baker
2009-02-16 8:57 Hans Verkuil
2009-02-16 9:07 Hans Verkuil
2009-02-16 9:44 ` Hans de Goede
2009-02-16 11:11 ` Mauro Carvalho Chehab
2009-02-16 12:19 ` Hans de Goede
2009-02-16 14:20 ` Mauro Carvalho Chehab
2009-02-16 15:00 ` Mauro Carvalho Chehab
2009-02-16 15:24 ` Hans de Goede
2009-02-16 11:01 Hans Verkuil
2009-02-16 11:12 ` Jean-Francois Moine
2009-02-16 12:07 ` Hans de Goede
2009-02-16 12:02 Hans Verkuil
2009-02-16 14:00 Hans Verkuil
2009-02-16 14:25 ` Hans de Goede
2009-02-16 16:09 ` Trent Piepho
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=49981C9F.7000305@redhat.com \
--to=hdegoede@redhat.com \
--cc=hverkuil@xs4all.nl \
--cc=kilgota@banach.math.auburn.edu \
--cc=linux-media@vger.kernel.org \
--cc=linux@baker-net.org.uk \
--cc=moinejf@free.fr \
--cc=o.lorin@laposte.net \
--cc=xyzzy@speakeasy.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox