diff options
author | hans@localhost.localdomain <hans@localhost.localdomain> | 2008-09-03 11:36:18 +0200 |
---|---|---|
committer | hans@localhost.localdomain <hans@localhost.localdomain> | 2008-09-03 11:36:18 +0200 |
commit | fd1a54135c2d7959bf7b78cada95ee9152eedf41 (patch) | |
tree | 0cc4380eae3f712e76bb4e19e7e1cbe39501e472 /v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c | |
parent | b29c49d48ca0db5d5e8e98f1622be4d0311656c4 (diff) | |
download | mediapointer-dvb-s2-fd1a54135c2d7959bf7b78cada95ee9152eedf41.tar.gz mediapointer-dvb-s2-fd1a54135c2d7959bf7b78cada95ee9152eedf41.tar.bz2 |
libv4l: Add suport for YUYV and YVYU packed pixel formats
From: Jean-Francois Moine <moinejf@free.fr>
libv4l: Add suport for YUYV and YVYU packed pixel formats
Priority: normal
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Diffstat (limited to 'v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c')
-rw-r--r-- | v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c b/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c index 4b48bfac4..2a9f6effd 100644 --- a/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c +++ b/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c @@ -38,6 +38,8 @@ static const unsigned int supported_src_pixfmts[] = { SUPPORTED_DST_PIXFMTS, V4L2_PIX_FMT_MJPEG, V4L2_PIX_FMT_JPEG, + V4L2_PIX_FMT_YUYV, + V4L2_PIX_FMT_YVYU, V4L2_PIX_FMT_SBGGR8, V4L2_PIX_FMT_SGBRG8, V4L2_PIX_FMT_SGRBG8, @@ -518,6 +520,40 @@ int v4lconvert_convert(struct v4lconvert_data *data, } break; + case V4L2_PIX_FMT_YUYV: + switch (dest_fmt->fmt.pix.pixelformat) { + case V4L2_PIX_FMT_RGB24: + v4lconvert_yuyv_to_rgb24(src, dest, dest_fmt->fmt.pix.width, + dest_fmt->fmt.pix.height); + break; + case V4L2_PIX_FMT_BGR24: + v4lconvert_yuyv_to_bgr24(src, dest, dest_fmt->fmt.pix.width, + dest_fmt->fmt.pix.height); + break; + default: + v4lconvert_yuyv_to_yuv420(src, dest, dest_fmt->fmt.pix.width, + dest_fmt->fmt.pix.height); + break; + } + break; + + case V4L2_PIX_FMT_YVYU: + switch (dest_fmt->fmt.pix.pixelformat) { + case V4L2_PIX_FMT_RGB24: + v4lconvert_yvyu_to_rgb24(src, dest, dest_fmt->fmt.pix.width, + dest_fmt->fmt.pix.height); + break; + case V4L2_PIX_FMT_BGR24: + v4lconvert_yvyu_to_bgr24(src, dest, dest_fmt->fmt.pix.width, + dest_fmt->fmt.pix.height); + break; + default: + v4lconvert_yvyu_to_yuv420(src, dest, dest_fmt->fmt.pix.width, + dest_fmt->fmt.pix.height); + break; + } + break; + default: V4LCONVERT_ERR("Unknown src format in conversion\n"); errno = EINVAL; |