linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
To: Gregor Jasny <gjasny@googlemail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH v2 2/2] libv4lconvert: Support for RGB32 and BGR32 format
Date: Fri, 9 Aug 2013 18:03:37 +0200	[thread overview]
Message-ID: <CAPybu_3mE16EeEuUvbimZr2Z2a0cNfPGpWYAZ2_qHPptqXQppQ@mail.gmail.com> (raw)
In-Reply-To: <CAPybu_2nzJ5YmjzMViK+bnChKdNT_XvP3KPz5JARTbQPKQugjA@mail.gmail.com>

ping?

On Sun, Aug 4, 2013 at 10:05 AM, Ricardo Ribalda Delgado
<ricardo.ribalda@gmail.com> wrote:
> Hello Gregor
>
> Thanks for your comments. I have replied inline.
>
> On Sat, Aug 3, 2013 at 6:42 PM, Gregor Jasny <gjasny@googlemail.com> wrote:
>> On 8/3/13 12:42 AM, Ricardo Ribalda Delgado wrote:
>>>
>>> +       case V4L2_PIX_FMT_RGB32:
>>> +               switch (dest_pix_fmt) {
>>> +               case V4L2_PIX_FMT_RGB24:
>>> +                       v4lconvert_rgb32_to_rgb24(src, dest, width,
>>> height, 0);
>>> +                       break;
>>> +               case V4L2_PIX_FMT_BGR24:
>>> +                       v4lconvert_rgb32_to_rgb24(src, dest, width,
>>> height, 1);
>>> +                       break;
>>> +               case V4L2_PIX_FMT_YUV420:
>>> +                       v4lconvert_rgb24_to_yuv420(src, dest, fmt, 0, 0,
>>> 4);
>>> +                       break;
>>> +               case V4L2_PIX_FMT_YVU420:
>>> +                       v4lconvert_rgb24_to_yuv420(src, dest, fmt, 0, 1,
>>> 4);
>>> +                       break;
>>> +               }
>>> +               if (src_size < (width * height * 4)) {
>>> +                       V4LCONVERT_ERR("short rgb32 data frame\n");
>>> +                       errno = EPIPE;
>>> +                       result = -1;
>>> +               }
>>> +               break;
>>
>>
>> I have not looked at the whole function but shouldn't this sanity check
>> happen before the actual work?
>
> Yes, but it is how it is done in the whole library with all the
> formats. Please grep for "short " on libv4lconvert.c
>
>> Also aren't you applying the condition here
>> also for rgb24_to_xxx which should have only three bpp?
>>
>
> I have modified the function rgb24_to_yuv420 to support other bytes per pixel.
>
>>
>>> +       case V4L2_PIX_FMT_BGR32:
>>> +               switch (dest_pix_fmt) {
>>> +               case V4L2_PIX_FMT_RGB24:
>>> +                       v4lconvert_rgb32_to_rgb24(src, dest, width,
>>> height, 1);
>>> +                       break;
>>> +               case V4L2_PIX_FMT_BGR24:
>>> +                       v4lconvert_rgb32_to_rgb24(src, dest, width,
>>> height, 0);
>>> +                       break;
>>> +               case V4L2_PIX_FMT_YUV420:
>>> +                       v4lconvert_rgb24_to_yuv420(src, dest, fmt, 1, 0,
>>> 4);
>>> +                       break;
>>> +               case V4L2_PIX_FMT_YVU420:
>>> +                       v4lconvert_rgb24_to_yuv420(src, dest, fmt, 1, 1,
>>> 4);
>>> +                       break;
>>> +               }
>>> +               if (src_size < (width * height * 4)) {
>>> +                       V4LCONVERT_ERR("short bgr32 data frame\n");
>>> +                       errno = EPIPE;
>>> +                       result = -1;
>>> +               }
>>> +               break;
>>
>>
>> Same here. And also in the other patch.
>>
>>
>
> Thanks again
>
> --
> Ricardo Ribalda



-- 
Ricardo Ribalda

      reply	other threads:[~2013-08-09 16:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02 22:42 [PATCH v2 0/2] Add support for V4L2_PIX_FMT_Y16, V4L2_PIX_FMT_RGB32 and V4L2_PIX_FMT_BGR32 Ricardo Ribalda Delgado
2013-08-02 22:42 ` [PATCH v2 1/2] libv4lconvert: Support for Y16 pixel format Ricardo Ribalda Delgado
2013-08-09 16:04   ` Ricardo Ribalda Delgado
2013-08-12 19:39     ` Gregor Jasny
2013-08-12 20:29       ` Ricardo Ribalda Delgado
2013-08-13  8:56       ` Hans de Goede
2013-08-16 16:03         ` Gregor Jasny
2013-08-02 22:42 ` [PATCH v2 2/2] libv4lconvert: Support for RGB32 and BGR32 format Ricardo Ribalda Delgado
2013-08-03 16:42   ` Gregor Jasny
2013-08-04  8:05     ` Ricardo Ribalda Delgado
2013-08-09 16:03       ` Ricardo Ribalda Delgado [this message]

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=CAPybu_3mE16EeEuUvbimZr2Z2a0cNfPGpWYAZ2_qHPptqXQppQ@mail.gmail.com \
    --to=ricardo.ribalda@gmail.com \
    --cc=gjasny@googlemail.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).