diff options
author | hans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain> | 2009-06-17 21:57:05 +0200 |
---|---|---|
committer | hans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain> | 2009-06-17 21:57:05 +0200 |
commit | f475df33ab13799d25650081e64fd0f6e59d3792 (patch) | |
tree | 10f577b709a386c2db556167cf14d8e99e44349d /v4l2-apps | |
parent | e84f05aeceff30413ad2d1ee68bb11888e04e167 (diff) | |
download | mediapointer-dvb-s2-f475df33ab13799d25650081e64fd0f6e59d3792.tar.gz mediapointer-dvb-s2-f475df33ab13799d25650081e64fd0f6e59d3792.tar.bz2 |
libv4l1: Emulate VIDIOCGWIN instead of passing it through to the kernel
From: Hans de Goede <hdegoede@redhat.com>
Emulate VIDIOCGWIN instead of passing it through to the kernel, this fixes
us reporting a wrong size to the app when libv4l2 / libv4lconvert is
cropping / downsampling the image.
Priority: normal
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'v4l2-apps')
-rw-r--r-- | v4l2-apps/libv4l/libv4l1/libv4l1.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/v4l2-apps/libv4l/libv4l1/libv4l1.c b/v4l2-apps/libv4l/libv4l1/libv4l1.c index 4d251a481..9b23926be 100644 --- a/v4l2-apps/libv4l/libv4l1/libv4l1.c +++ b/v4l2-apps/libv4l/libv4l1/libv4l1.c @@ -307,7 +307,7 @@ int v4l1_open (const char *file, int oflag, ...) /* Register with libv4l2, as we use that todo format conversion and read() emulation for us */ - if (v4l2_fd_open(fd, V4L2_ENABLE_ENUM_FMT_EMULATION) == -1) { + if (v4l2_fd_open(fd, 0) == -1) { int saved_err = errno; SYS_CLOSE(fd); errno = saved_err; @@ -542,24 +542,27 @@ int v4l1_ioctl (int fd, unsigned long int request, ...) break; case VIDIOCSWIN: + case VIDIOCGWIN: { struct video_window *win = arg; devices[index].flags |= V4L1_PIX_SIZE_TOUCHED; - result = v4l1_set_format(index, win->width, win->height, -1, 1); + if (request == VIDIOCSWIN) + result = v4l1_set_format(index, win->width, win->height, -1, 1); + else + result = 0; + if (result == 0) { + win->x = 0; + win->y = 0; win->width = devices[index].width; win->height = devices[index].height; + win->flags = 0; } } break; - case VIDIOCGWIN: - devices[index].flags |= V4L1_PIX_SIZE_TOUCHED; - result = SYS_IOCTL(fd, request, arg); - break; - case VIDIOCGCHAN: { struct v4l2_input input2; |