diff options
author | hans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain> | 2009-08-14 09:57:02 +0200 |
---|---|---|
committer | hans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain> | 2009-08-14 09:57:02 +0200 |
commit | 78119829e59604c3996a9af01c254dc1f8026962 (patch) | |
tree | 38a1a16aa8a07c3053a394f706e754b6b073131c /v4l2-apps/libv4l | |
parent | 1717b46f2e34d1655a665db31979f4bfaf969c06 (diff) | |
download | mediapointer-dvb-s2-78119829e59604c3996a9af01c254dc1f8026962.tar.gz mediapointer-dvb-s2-78119829e59604c3996a9af01c254dc1f8026962.tar.bz2 |
libv4l: Do not hide JPG / MJPG pixfmt from applications
From: Hans de Goede <hdegoede@redhat.com>
Some applications want to use jpg format if possible, so do not hide
it from the apps (do not assume it always needs conversion)
Priority: normal
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'v4l2-apps/libv4l')
-rw-r--r-- | v4l2-apps/libv4l/ChangeLog | 2 | ||||
-rw-r--r-- | v4l2-apps/libv4l/libv4lconvert/libv4lconvert-priv.h | 1 | ||||
-rw-r--r-- | v4l2-apps/libv4l/libv4lconvert/libv4lconvert.c | 18 |
3 files changed, 12 insertions, 9 deletions
diff --git a/v4l2-apps/libv4l/ChangeLog b/v4l2-apps/libv4l/ChangeLog index 93371a1fc..8614df14e 100644 --- a/v4l2-apps/libv4l/ChangeLog +++ b/v4l2-apps/libv4l/ChangeLog @@ -5,6 +5,8 @@ libv4l-0.6.1 * Bugfix: fixup 320x240 output for pac7302 cameras * README improvements / clarifications (Bifferos) * Bugfix: fix reqbuf Device or Resource busy error when using v4l2_read() +* Some applications want to use jpg format if possible, so do not hide + it from the apps (do not assume it always needs conversion) libv4l-0.6.0 ------------ diff --git a/v4l2-apps/libv4l/libv4lconvert/libv4lconvert-priv.h b/v4l2-apps/libv4l/libv4lconvert/libv4lconvert-priv.h index a61a2eeb7..f10f3f607 100644 --- a/v4l2-apps/libv4l/libv4lconvert/libv4lconvert-priv.h +++ b/v4l2-apps/libv4l/libv4lconvert/libv4lconvert-priv.h @@ -108,6 +108,7 @@ /* Pixformat flags */ #define V4LCONVERT_COMPRESSED 0x01 /* Compressed format */ #define V4LCONVERT_NEEDS_CONVERSION 0x02 /* Apps likely wont know this */ +#define V4LCONVERT_COMPRESSED_AND_NEEDS_CONVERSION 0x03 struct v4lconvert_data { int fd; diff --git a/v4l2-apps/libv4l/libv4lconvert/libv4lconvert.c b/v4l2-apps/libv4l/libv4lconvert/libv4lconvert.c index fda9f8e80..f5e9d9762 100644 --- a/v4l2-apps/libv4l/libv4lconvert/libv4lconvert.c +++ b/v4l2-apps/libv4l/libv4lconvert/libv4lconvert.c @@ -58,14 +58,14 @@ static const struct v4lconvert_pixfmt supported_src_pixfmts[] = { { V4L2_PIX_FMT_HM12, V4LCONVERT_NEEDS_CONVERSION }, { V4L2_PIX_FMT_MJPEG, V4LCONVERT_COMPRESSED }, { V4L2_PIX_FMT_JPEG, V4LCONVERT_COMPRESSED }, - { V4L2_PIX_FMT_SPCA561, V4LCONVERT_COMPRESSED }, - { V4L2_PIX_FMT_SN9C10X, V4LCONVERT_COMPRESSED }, - { V4L2_PIX_FMT_PAC207, V4LCONVERT_COMPRESSED }, - { V4L2_PIX_FMT_MR97310A, V4LCONVERT_COMPRESSED }, - { V4L2_PIX_FMT_SQ905C, V4LCONVERT_COMPRESSED }, - { V4L2_PIX_FMT_PJPG, V4LCONVERT_COMPRESSED }, - { V4L2_PIX_FMT_OV511, V4LCONVERT_COMPRESSED }, - { V4L2_PIX_FMT_OV518, V4LCONVERT_COMPRESSED }, + { V4L2_PIX_FMT_SPCA561, V4LCONVERT_COMPRESSED_AND_NEEDS_CONVERSION }, + { V4L2_PIX_FMT_SN9C10X, V4LCONVERT_COMPRESSED_AND_NEEDS_CONVERSION }, + { V4L2_PIX_FMT_PAC207, V4LCONVERT_COMPRESSED_AND_NEEDS_CONVERSION }, + { V4L2_PIX_FMT_MR97310A, V4LCONVERT_COMPRESSED_AND_NEEDS_CONVERSION }, + { V4L2_PIX_FMT_SQ905C, V4LCONVERT_COMPRESSED_AND_NEEDS_CONVERSION }, + { V4L2_PIX_FMT_PJPG, V4LCONVERT_COMPRESSED_AND_NEEDS_CONVERSION }, + { V4L2_PIX_FMT_OV511, V4LCONVERT_COMPRESSED_AND_NEEDS_CONVERSION }, + { V4L2_PIX_FMT_OV518, V4LCONVERT_COMPRESSED_AND_NEEDS_CONVERSION }, }; static const struct v4lconvert_pixfmt supported_dst_pixfmts[] = { @@ -114,7 +114,7 @@ struct v4lconvert_data *v4lconvert_create(int fd) if (fmt.pixelformat == supported_src_pixfmts[j].fmt) { data->supported_src_formats |= 1 << j; v4lconvert_get_framesizes(data, fmt.pixelformat, j); - if (!supported_src_pixfmts[j].flags) + if (!(supported_src_pixfmts[j].flags & V4LCONVERT_NEEDS_CONVERSION)) always_needs_conversion = 0; break; } |