summaryrefslogtreecommitdiff
path: root/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
diff options
context:
space:
mode:
Diffstat (limited to 'v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c')
-rw-r--r--v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c b/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
index e19b2f05b..4c9e67d52 100644
--- a/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
+++ b/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
@@ -414,8 +414,26 @@ int v4lconvert_convert(struct v4lconvert_data *data,
}
case V4L2_PIX_FMT_RGB24:
+ switch (dest_fmt->fmt.pix.pixelformat) {
+ case V4L2_PIX_FMT_BGR24:
+ v4lconvert_swap_rgb(src, dest, dest_fmt->fmt.pix.width,
+ dest_fmt->fmt.pix.height);
+ break;
+ case V4L2_PIX_FMT_YUV420:
+ printf("FIXME add rgb24 -> yuv420 conversion\n");
+ break;
+ }
+ break;
case V4L2_PIX_FMT_BGR24:
- printf("FIXME add rgb24/bgr24 -> yuv420 conversion\n");
+ switch (dest_fmt->fmt.pix.pixelformat) {
+ case V4L2_PIX_FMT_RGB24:
+ v4lconvert_swap_rgb(src, dest, dest_fmt->fmt.pix.width,
+ dest_fmt->fmt.pix.height);
+ break;
+ case V4L2_PIX_FMT_YUV420:
+ printf("FIXME add bgr24 -> yuv420 conversion\n");
+ break;
+ }
break;
case V4L2_PIX_FMT_YUV420: