linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Frank Schäfer" <fschaefer.oss@googlemail.com>
To: linux-media@vger.kernel.org
Cc: hdegoede@redhat.com
Subject: pac7302-webcams and libv4lconvert interaction
Date: Thu, 06 Sep 2012 17:13:38 +0200	[thread overview]
Message-ID: <5048BDA2.7090203@googlemail.com> (raw)


Hi,

I'm currently looking into the gspca_pac7302-driver and how it interacts
with libv4lconvert.
This is how it currently works
- driver announces v4l2_pix_format 640x480 (width x height)
- the frames (jpeg) passed to userspace are encoded as 480x640 and this
complies with the jpeg-header we generate
- libv4lconvert checks width/height in the jpeg-header and compares them
with the image format announced by the kernel:
   a) values are the same:
      1) V4LCONTROL_ROTATED_90_JPEG is NOT set for the device (standard
case):
          => everything is fine, image is decoded
      2) V4LCONTROL_ROTATED_90_JPEG is set for the device:
          => libv4lconvert bails out with -EIO displaying the error
message "unexpected width / height in JPEG header: expected: 640x480,
header: 480x640"
   b) values are different:
      1) V4LCONTROL_ROTATED_90_JPEG is NOT set:
          => libv4lconvert bails out with -EIO displaying the error
message "unexpected width / height in JPEG header: expected: 640x480,
header: 480x640"
      2) V4LCONTROL_ROTATED_90_JPEG is set:
          => image is decoded and rotated correctly


Thinking about this for some minutes:

1) shouldn't the kernel always announce the real image format (size) of
the data it passes to userspace ?
Current behavior seems inconsistent to me...
Announcing the actual image size allows applications which trust the API
value more than the value in the frame header to decode the image
correctly without using libv4lconvert (although the image would still be
rotated).

2) shouldn't libv4lconvert always rotate the image if
V4LCONTROL_ROTATED_90_JPEG is set for a device ?
It seems like a2) is a bug, because the expected size should be 640x480,
too.

3) because all pac7302 devices are sending rotated image data, we should
add them ALL to libv4lconvert. Currently only 4 of the 14 devices are on
the list.
Do you want me to send a patch ?


What do you think ?

Regards,
Frank


             reply	other threads:[~2012-09-06 15:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 15:13 Frank Schäfer [this message]
2012-09-09 21:20 ` pac7302-webcams and libv4lconvert interaction Hans de Goede
2012-09-10 15:36   ` Frank Schäfer
2012-09-10 18:31     ` Hans de Goede
2012-09-10 20:24       ` Frank Schäfer
2012-09-11  7:29         ` Hans de Goede
2012-09-12 14:36           ` Frank Schäfer
2012-09-13 12:05             ` Hans de Goede
2012-09-16 12:21               ` Frank Schäfer
2012-09-17  9:39                 ` Hans de Goede

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=5048BDA2.7090203@googlemail.com \
    --to=fschaefer.oss@googlemail.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-media@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).