diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-07-02 17:49:43 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-07-02 17:49:43 -0300 |
commit | 24655815f5d1643d22194d5abbd46c1bd43669e9 (patch) | |
tree | 2381662ac0ca9ae18ae5cba63a83cc1daf694d29 /v4l2-apps | |
parent | 0e9def6497f0f045e2740fa24b0864b260678959 (diff) | |
download | mediapointer-dvb-s2-24655815f5d1643d22194d5abbd46c1bd43669e9.tar.gz mediapointer-dvb-s2-24655815f5d1643d22194d5abbd46c1bd43669e9.tar.bz2 |
v4l2grab: Be sure that libv4l is properly converting to RGB24
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To be simple, there's no format conversion inside v4l2grab. It relies
that libv4l will do the hard work of converting whatever input format
into RGB24.
Instead of just proceeding and writing wrong images, die if libv4l can't
convert into RGB24.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'v4l2-apps')
-rw-r--r-- | v4l2-apps/test/v4l2grab.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/v4l2-apps/test/v4l2grab.c b/v4l2-apps/test/v4l2grab.c index 20692117e..153a0dd30 100644 --- a/v4l2-apps/test/v4l2grab.c +++ b/v4l2-apps/test/v4l2grab.c @@ -72,6 +72,13 @@ int main(int argc, char **argv) fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24; fmt.fmt.pix.field = V4L2_FIELD_INTERLACED; xioctl(fd, VIDIOC_S_FMT, &fmt); + if (fmt.fmt.pix.pixelformat != V4L2_PIX_FMT_RGB24) { + printf("Libv4l didn't accept RGB24 format. Can't proceed.\n"); + exit(EXIT_FAILURE); + } + if ((fmt.fmt.pix.width != 640) || (fmt.fmt.pix.height != 480)) + printf("Warning: driver is sending image at %dx%d\n", + fmt.fmt.pix.width, fmt.fmt.pix.height); CLEAR(req); req.count = 2; |