summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>2009-05-25 15:35:21 +0200
committerhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>2009-05-25 15:35:21 +0200
commit2ffc360be1c38ab86399d6d574ee7cc0671c03d6 (patch)
tree98c7f73c6d0c2b0daa07da8b793e9bd306eca9be
parent51949cfaadebd8e341fed1e85eca683dd40195d2 (diff)
downloadmediapointer-dvb-s2-2ffc360be1c38ab86399d6d574ee7cc0671c03d6.tar.gz
mediapointer-dvb-s2-2ffc360be1c38ab86399d6d574ee7cc0671c03d6.tar.bz2
libv4l: Obsolete the V4L2_ENABLE_ENUM_FMT_EMULATION v4l2_fd_open flag
From: Hans de Goede <hdegoede@redhat.com> The V4L2_ENABLE_ENUM_FMT_EMULATION v4l2_fd_open flag is obsolete, libv4l2 now *always* reports emulated formats through the ENUM_FMT ioctl Priority: normal Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--v4l2-apps/libv4l/ChangeLog2
-rw-r--r--v4l2-apps/libv4l/include/libv4l2.h21
-rw-r--r--v4l2-apps/libv4l/libv4l2/libv4l2.c4
-rw-r--r--v4l2-apps/libv4l/libv4l2/v4l2convert.c2
4 files changed, 14 insertions, 15 deletions
diff --git a/v4l2-apps/libv4l/ChangeLog b/v4l2-apps/libv4l/ChangeLog
index efdcda093..db2fa02b0 100644
--- a/v4l2-apps/libv4l/ChangeLog
+++ b/v4l2-apps/libv4l/ChangeLog
@@ -14,6 +14,8 @@ libv4l-0.5.98
* Add the capability to provide 320x240 to apps if the cam can only
do 320x232 (some zc3xx cams) by adding black borders
* Add software auto gain / exposure
+* The V4L2_ENABLE_ENUM_FMT_EMULATION v4l2_fd_open flag is obsolete, libv4l2
+ now *always* reports emulated formats through the ENUM_FMT ioctl
libv4l-0.5.97
-------------
diff --git a/v4l2-apps/libv4l/include/libv4l2.h b/v4l2-apps/libv4l/include/libv4l2.h
index b05b57cb6..b2451dced 100644
--- a/v4l2-apps/libv4l/include/libv4l2.h
+++ b/v4l2-apps/libv4l/include/libv4l2.h
@@ -41,18 +41,12 @@ LIBV4L_PUBLIC extern FILE *v4l2_log_file;
format which is not supported by the cam, but is supported by libv4lconvert,
then the try_fmt / set_fmt will succeed as if the cam supports the format
and on dqbuf / read the data will be converted for you and returned in
- the request format.
+ the request format. enum_fmt will also report support for the formats to
+ which conversion is possible.
Another difference is that you can make v4l2_read() calls even on devices
which do not support the regular read() method.
- Note that libv4l2 normally does not interfere with enum_fmt, so enum_fmt
- will still return the actual formats the hardware supports, and not any
- formats which may be emulated on top of that. If you pass the
- V4L2_ENABLE_ENUM_FMT_EMULATION flag to v4l2_fd_open (as the v4l2convert.so
- wrapper does) then enum_fmt will also report support for the formats to
- which conversion is possible.
-
Note the device name passed to v4l2_open must be of a video4linux2 device,
if it is anything else (including a video4linux1 device), v4l2_open will
fail.
@@ -89,11 +83,14 @@ LIBV4L_PUBLIC int v4l2_get_control(int fd, int cid);
/* Flags for v4l2_fd_open's v4l2_flags argument */
-/* Disable all format conversion done by libv4l2 (reduces libv4l2 functionality
- to offering v4l2_read() even on devices which don't implement read()) */
+/* Disable all format conversion done by libv4l2, this includes the software
+ whitebalance, gamma correction, flipping, etc. libv4lconvert does. Use this
+ if you want raw frame data, but still want the additional error checks and
+ the read() emulation libv4l2 offers. */
#define V4L2_DISABLE_CONVERSION 0x01
-/* Report not only real but also emulated formats with the ENUM_FMT ioctl */
-#define V4L2_ENABLE_ENUM_FMT_EMULATION 02
+/* This flag is *OBSOLETE*, since version 0.5.98 libv4l *always* reports
+ emulated formats to ENUM_FMT, except when conversion is disabled. */
+#define V4L2_ENABLE_ENUM_FMT_EMULATION 0x02
/* v4l2_fd_open: open an already opened fd for further use through
v4l2lib and possibly modify libv4l2's default behavior through the
diff --git a/v4l2-apps/libv4l/libv4l2/libv4l2.c b/v4l2-apps/libv4l/libv4l2/libv4l2.c
index 053e6e28b..382dc405b 100644
--- a/v4l2-apps/libv4l/libv4l2/libv4l2.c
+++ b/v4l2-apps/libv4l/libv4l2/libv4l2.c
@@ -696,12 +696,12 @@ int v4l2_ioctl (int fd, unsigned long int request, ...)
break;
case VIDIOC_ENUM_FMT:
if (((struct v4l2_fmtdesc *)arg)->type == V4L2_BUF_TYPE_VIDEO_CAPTURE &&
- (devices[index].flags & V4L2_ENABLE_ENUM_FMT_EMULATION))
+ !(devices[index].flags & V4L2_DISABLE_CONVERSION))
is_capture_request = 1;
break;
case VIDIOC_ENUM_FRAMESIZES:
case VIDIOC_ENUM_FRAMEINTERVALS:
- if (devices[index].flags & V4L2_ENABLE_ENUM_FMT_EMULATION)
+ if (!(devices[index].flags & V4L2_DISABLE_CONVERSION))
is_capture_request = 1;
break;
case VIDIOC_TRY_FMT:
diff --git a/v4l2-apps/libv4l/libv4l2/v4l2convert.c b/v4l2-apps/libv4l/libv4l2/v4l2convert.c
index 307a03ce5..b1354772d 100644
--- a/v4l2-apps/libv4l/libv4l2/v4l2convert.c
+++ b/v4l2-apps/libv4l/libv4l2/v4l2convert.c
@@ -92,7 +92,7 @@ LIBV4L_PUBLIC int open (const char *file, int oflag, ...)
/* Try to Register with libv4l2 (in case of failure pass the fd to the
application as is) */
- v4l2_fd_open(fd, V4L2_ENABLE_ENUM_FMT_EMULATION);
+ v4l2_fd_open(fd, 0);
return fd;
}