Hi,

On 07/19/2014 09:18 AM, Hans Verkuil wrote:
The RGB32 formats start with an alpha byte in memory. So before calling the
v4lconvert_rgb32_to_rgb24 or v4lconvert_rgb24_to_yuv420 function skip that 
initial
alpha byte so the src pointer is aligned with the first color component, since
that is what those functions expect.

Signed-off-by: Hans Verkuil <hans.verk...@cisco.com>

diff --git a/lib/libv4lconvert/libv4lconvert.c 
b/lib/libv4lconvert/libv4lconvert.c
index cea65aa..e4aa54a 100644
--- a/lib/libv4lconvert/libv4lconvert.c
+++ b/lib/libv4lconvert/libv4lconvert.c
@@ -1132,6 +1132,7 @@ static int v4lconvert_convert_pixfmt(struct 
v4lconvert_data *data,
                        errno = EPIPE;
                        result = -1;
                }
+               src++;

Hmm what about bgr versus rgb, since those are mirrored, maybe the location of
the alpha byte is mirrored to, and we should only do the src++ for one of them ?

                switch (dest_pix_fmt) {
                case V4L2_PIX_FMT_RGB24:
                        v4lconvert_rgb32_to_rgb24(src, dest, width, height, 0);


Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to