linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Frank Schäfer" <fschaefer.oss@googlemail.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: linux-media@vger.kernel.org
Subject: Re: pac7302-webcams and libv4lconvert interaction
Date: Sun, 16 Sep 2012 14:21:10 +0200	[thread overview]
Message-ID: <5055C436.8060407@googlemail.com> (raw)
In-Reply-To: <5051CBFB.9030200@redhat.com>

Hi,

Am 13.09.2012 14:05, schrieb Hans de Goede:
> Hi,
>
> On 09/12/2012 04:36 PM, Frank Schäfer wrote:
>
> <snip>
>
>>
>> And a negative side effect is, that unknown pac7302 devices (with no
>> V4LCONTROL_ROTATED_90_JPEG entry in libv4lconvert) do not work.
>> With a consistent API behavior, they would work fine (output a rotated
>> image). Users would at least know that their device is working and most
>> of them know what to do next.
>> For image rotation, we still need to add an entry to libv4lconvert and
>> to modify it to invert the width and height values in v4l2_pix_format in
>> this case.
>
> That is a good point, unfortunately we are stuck with how we are doing
> things now, since changing things would break the kernel ABI.

Yeah, we can't break things. But I think this would be ABI fixing not
breaking. ;)
Actually...I'm not sure if this would be really an ABI change, because
the interface itself wouldn't change.
We would only fix a driver which passes a wrong value to userspace.
Its a question of interpretation...

>
> Also ...
>
>>
>> The device I have here is a good example: many people reported this
>> device as not working years ago, one of them even got a hint in a forum
>> that this could be a pac7302 device 2 years ago.
>> But with the gpsca-pac7302 driver, he got no picture and gave up.
>> And if I had not started q4vl2 from the terminal and had noticed the
>> error message from libv4lconvert, I would have needed much more time to
>> find out what's wrong...
>
> True, OTOH just having this fixed won't help a regular user, as he/she
> would still need to first add the new usb-id to the pac7302 driver...

Regular users, sure. But it would be a big step forward.
Adding new device IDs for testing is one of the easier things in the
Unix world.

Hans, I have a bunch of smaller things on my ToDo list which I want to
do first.
For now: maybe we can improve things by trusting the jpeg-header ?
That would mean removing the following section from
v4lconvert_decode_jpeg_tinyjpeg() :

    if (data->control_flags & V4LCONTROL_ROTATED_90_JPEG) {
        unsigned int tmp = width;
        width = height;
        height = tmp;
    }

    if (header_width != width || header_height != height) {
        V4LCONVERT_ERR("unexpected width / height in JPEG header: "
                   "expected: %ux%u, header: %ux%u\n",
                   width, height, header_width, header_height);
        errno = EIO;
        return -1;
    }


V4LCONTROL_ROTATED_90_JPEG is only used for the pac7302 devices and we
know that their header is correct.
And even in cases where the header is wrong, I think it would we better
to get a garbeled picture instead of -EIO.

Regards,
Frank

>
> Regards,
>
> Hans


  reply	other threads:[~2012-09-16 12:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 15:13 pac7302-webcams and libv4lconvert interaction Frank Schäfer
2012-09-09 21:20 ` 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 [this message]
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=5055C436.8060407@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).