diff options
author | hans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain> | 2009-04-14 15:03:07 +0200 |
---|---|---|
committer | hans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain> | 2009-04-14 15:03:07 +0200 |
commit | 58d3334b54c207b8e04e7035969e0c2acfa1ce73 (patch) | |
tree | 79bfcb91241d0468871696b189ac8ee344ea1ed0 /v4l2-apps/libv4l/libv4l2 | |
parent | 10a09b9ec6e08fb95c36f26d7f69834b0387386b (diff) | |
download | mediapointer-dvb-s2-58d3334b54c207b8e04e7035969e0c2acfa1ce73.tar.gz mediapointer-dvb-s2-58d3334b54c207b8e04e7035969e0c2acfa1ce73.tar.bz2 |
libv4l: Only allow supported destination formats when doing processing
From: Hans de Goede <hdegoede@redhat.com>
Only report / allow supported destination formats in enum_fmt / try_fmt /
g_fmt / s_fmt when processing, rotating or flipping.
Priority: normal
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'v4l2-apps/libv4l/libv4l2')
-rw-r--r-- | v4l2-apps/libv4l/libv4l2/libv4l2.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/v4l2-apps/libv4l/libv4l2/libv4l2.c b/v4l2-apps/libv4l/libv4l2/libv4l2.c index 91e0193ee..8d01b034c 100644 --- a/v4l2-apps/libv4l/libv4l2/libv4l2.c +++ b/v4l2-apps/libv4l/libv4l2/libv4l2.c @@ -516,6 +516,14 @@ int v4l2_fd_open(int fd, int v4l2_flags) V4L2_LOG("open: %d\n", fd); + if (v4lconvert_supported_dst_fmt_only(convert) && + !v4lconvert_supported_dst_format(fmt.fmt.pix.pixelformat)) { + V4L2_LOG("open %d: setting pixelformat to RGB24\n", fd); + fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24; + v4l2_ioctl(fd, VIDIOC_S_FMT, &fmt); + V4L2_LOG("open %d: done setting pixelformat\n", fd); + } + return fd; } |