debian/0000755000000000000000000000000011745304002007162 5ustar debian/menu0000644000000000000000000000030011550271303010043 0ustar ?package(luvcview):\ needs="X11"\ section="Applications/Video"\ title="luvcview"\ longtitle="camera viewer for UVC based webcams"\ command="/usr/bin/luvcview" debian/luvcview.10000644000000000000000000000417311550271303011116 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH LUVCVIEW 1 "June 19, 2007" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH "NAME" luvcview \- USB Video Class grabber .SH SYNOPSIS .BI luvcview [\fIoptions\fR]... .SH "DESCRIPTION" .PP .B luvcview is a camera viewer for UVC based webcams. It includes an mjpeg decoder and is able to save the video stream as an AVI file. .SH "OPTIONS" A summary of options is included below. .TP .B \-c Enable raw frame capturing for the first frame. .TP .B \-C Enable raw frame stream capturing from the start. .TP .B \-d \fI/dev/videoX\fR Specify the video device to use. .TP .B \-f \fIformat\fR Specify the video format to use. .RS .TP .I jpg or MJPG JPEG format. This is the default if available. .TP .I yuv or YUYV YUV format. .TP .I uyvy or UYVY UYV format. .RE .TP .B \-g Grab the images with READ method instead of default MMAP. .TP .B \-h Print a help text and exit. .TP .B \-L Query valid video formats. .TP .B \-l Query valid controls and settings. .TP .B \-o \fIoutputfile\fR Create an AVI file with the stream received from the video device. .TP .B \-r Read and set control settings from the \fBluvcview.cfg\fR file in the current directory. Such a configuration file can be created by using the \fBF1\fR key in the interface. .TP .B \-s \fIwidth\fRx\fIheight\fR Select the image input size. .TP .B \-S Enable raw stream capturing from the start. .SH "AUTHORS" .PP Laurent Pinchart && Michel Xhaard. .PP This manual page was originaly written by Aurelien Jarno , for the Debian GNU/Linux system (but may be used by others). debian/rules0000755000000000000000000000324411745244326010261 0ustar #!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS += -g endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif build: build-arch build-indep build-arch: build-arch-stamp build-arch-stamp: dh_testdir $(MAKE) touch build-stamp build-indep: # We have nothing to do. clean: dh_testdir dh_testroot dh_clean $(MAKE) clean -rm -f *-stamp install: build dh_testdir dh_testroot dh_clean -k dh_installdirs mkdir -p $(CURDIR)/debian/luvcview/usr/bin $(MAKE) install BIN=$(CURDIR)/debian/luvcview/usr/bin # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot # dh_installdebconf dh_installdocs dh_installexamples dh_installmenu # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_installinit dh_installcron dh_installman dh_installinfo dh_installchangelogs dh_link dh_strip dh_compress dh_fixperms # dh_makeshlibs dh_installdeb # dh_perl dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build build-arch build-indep clean binary-indep binary-arch binary install debian/docs0000644000000000000000000000001411550271303010031 0ustar README ToDo debian/changelog0000644000000000000000000000524711745304002011044 0ustar luvcview (1:0.2.6-6) unstable; urgency=low * Build-depends on pkg-config (closes: bug#669471). * Add build-arch and build-indep targets. * Bump Standards-Version to 3.9.3 (no changes). -- Aurelien Jarno Mon, 23 Apr 2012 18:49:04 +0200 luvcview (1:0.2.6-5) unstable; urgency=low * Don't include anymore now that libv4l2 is used instead (closes: bug#621957). * Bump Standards-Version to 3.9.2 (no changes) -- Aurelien Jarno Sun, 10 Apr 2011 11:11:07 +0200 luvcview (1:0.2.6-4) unstable; urgency=low * Improve luvcview.1 (closes: bug#570495). -- Aurelien Jarno Fri, 19 Feb 2010 20:02:18 +0100 luvcview (1:0.2.6-3) unstable; urgency=low * Use libv4l2 for format conversion (closes: bug#569100). -- Aurelien Jarno Fri, 12 Feb 2010 21:49:51 +0100 luvcview (1:0.2.6-2) unstable; urgency=low * Use instead of (closes: bug#569100). * Bump Standards-Version to 3.8.4 (no changes) -- Aurelien Jarno Wed, 10 Feb 2010 11:05:14 +0100 luvcview (1:0.2.6-1) unstable; urgency=low * New upstream version. * Bump Standards-Version to 3.8.3: - Add README.source. * Fix a copy'n'paste error in manpage (closes: bug#507595). -- Aurelien Jarno Thu, 27 Aug 2009 12:18:57 +0200 luvcview (1:0.2.4-2) unstable; urgency=low * Use quilt for patch management. * Add patch from Nobuhiro Iwamatsu to support UYVY format (closes: bug#481757). -- Aurelien Jarno Wed, 21 May 2008 17:36:17 +0200 luvcview (1:0.2.4-1) unstable; urgency=low * New upstream version (closes: bug#480629). * Reintroduce the menu item. * Update debian/copyright. -- Aurelien Jarno Sun, 11 May 2008 09:35:34 +0200 luvcview (20070512-5) unstable; urgency=low * Remove the menu item (closes: bug#475632). -- Aurelien Jarno Sat, 12 Apr 2008 09:33:58 +0200 luvcview (20070512-4) unstable; urgency=low * Make the video format mandatory (closes: bug#473273). -- Aurelien Jarno Mon, 31 Mar 2008 09:46:18 +0200 luvcview (20070512-3) unstable; urgency=low * Build with -g (closes: bug#437544). -- Aurelien Jarno Mon, 13 Aug 2007 11:08:00 +0200 luvcview (20070512-2) unstable; urgency=low * Update the menufile following the new Debian menu subpolicy. -- Aurelien Jarno Mon, 30 Jul 2007 19:20:18 +0200 luvcview (20070512-1) unstable; urgency=low * Initial Release (closes: #429735). -- Aurelien Jarno Wed, 20 Jun 2007 12:27:44 +0200 debian/patches/0000755000000000000000000000000011745243346010626 5ustar debian/patches/03-libv4l.patch0000644000000000000000000003467111550272014013262 0ustar --- Makefile | 5 ++- luvcview.c | 1 uvcvideo.h | 1 v4l2uvc.c | 86 +++++++++++++++++++++++++++++++------------------------------ 4 files changed, 48 insertions(+), 45 deletions(-) --- a/Makefile +++ b/Makefile @@ -12,6 +12,8 @@ MATH_LIB = -lm SDLLIBS = $(shell sdl-config --libs) SDLFLAGS = $(shell sdl-config --cflags) +V4L2LIBS = $(shell pkg-config --libs libv4l2) +V4L2FLAGS = $(shell pkg-config --cflags libv4l2) #LIBX11FLAGS= -I/usr/X11R6/include -L/usr/X11R6/lib VERSION = 0.2.6 @@ -23,7 +25,7 @@ # -Wno-unused # -Wunused -CFLAGS += -DUSE_SDL -O2 -DLINUX -DVERSION=\"$(VERSION)\" -I$(SDLFLAGS) $(WARNINGS) +CFLAGS += -DUSE_SDL -O2 -DLINUX -DVERSION=\"$(VERSION)\" -I$(SDLFLAGS) $(V4L2FLAGS) $(WARNINGS) CPPFLAGS = $(CFLAGS) OBJECTS= luvcview.o color.o utils.o v4l2uvc.o gui.o avilib.o @@ -40,6 +42,7 @@ $(CC) $(CFLAGS) $(OBJECTS) $(X11_LIB) $(XPM_LIB)\ $(MATH_LIB) \ $(SDLLIBS)\ + $(V4L2LIBS)\ -o $(APP_BINARY) chmod 755 $(APP_BINARY) --- a/v4l2uvc.c +++ b/v4l2uvc.c @@ -25,6 +25,8 @@ #include #include +#include + #include "v4l2uvc.h" #include "utils.h" @@ -72,12 +74,12 @@ snprintf(vd->videodevice, 12, "%s", device); printf("Device information:\n"); printf(" Device path: %s\n", vd->videodevice); - if ((vd->fd = open(vd->videodevice, O_RDWR)) == -1) { + if ((vd->fd = v4l2_open(vd->videodevice, O_RDWR)) == -1) { perror("ERROR opening V4L interface"); exit(1); } memset(&vd->cap, 0, sizeof(struct v4l2_capability)); - ret = ioctl(vd->fd, VIDIOC_QUERYCAP, &vd->cap); + ret = v4l2_ioctl(vd->fd, VIDIOC_QUERYCAP, &vd->cap); if (ret < 0) { printf("Error opening device %s: unable to query device.\n", vd->videodevice); @@ -95,7 +97,7 @@ } enum_frame_formats(vd->fd, NULL, 0); fatal: - close(vd->fd); + v4l2_close(vd->fd); free(vd->videodevice); return 0; } @@ -174,7 +176,7 @@ free(vd->videodevice); free(vd->status); free(vd->pictName); - close(vd->fd); + v4l2_close(vd->fd); return -1; } int enum_controls(int vd) //struct vdIn *vd) @@ -188,7 +190,7 @@ getinput=(struct v4l2_input *) calloc(1, sizeof(struct v4l2_input)); memset(getinput, 0, sizeof(struct v4l2_input)); getinput->index=0; - ioctl(vd,VIDIOC_ENUMINPUT , getinput); + v4l2_ioctl(vd,VIDIOC_ENUMINPUT , getinput); printf ("Available controls of device '%s' (Type 1=Integer 2=Boolean 3=Menu 4=Button)\n", getinput->name); //subroutine to read menu items of controls with type 3 @@ -219,7 +221,7 @@ if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED) continue; control_s.id=queryctrl.id; - ioctl(vd, VIDIOC_G_CTRL, &control_s); + v4l2_ioctl(vd, VIDIOC_G_CTRL, &control_s); SDL_Delay(10); printf (" index:%-10d name:%-32s type:%d min:%-5d max:%-5d step:%-5d def:%-5d now:%d\n", queryctrl.id, queryctrl.name, queryctrl.type, queryctrl.minimum, @@ -242,7 +244,7 @@ if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED) continue; control_s.id=queryctrl.id; - ioctl(vd, VIDIOC_G_CTRL, &control_s); + v4l2_ioctl(vd, VIDIOC_G_CTRL, &control_s); SDL_Delay(20); printf (" index:%-10d name:%-32s type:%d min:%-5d max:%-5d step:%-5d def:%-5d now:%d\n", queryctrl.id, queryctrl.name, queryctrl.type, queryctrl.minimum, @@ -280,7 +282,7 @@ if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED) continue; control_s.id=queryctrl.id; - ioctl(vd, VIDIOC_G_CTRL, &control_s); + v4l2_ioctl(vd, VIDIOC_G_CTRL, &control_s); SDL_Delay(10); fprintf (configfile, "%-10d %-10d # name:%-32s type:%d min:%-5d max:%-5d step:%-5d def:%d\n", queryctrl.id, control_s.value, queryctrl.name, queryctrl.type, queryctrl.minimum, @@ -299,7 +301,7 @@ if ((queryctrl.id==134217735) || (queryctrl.id==134217736)) continue; control_s.id=queryctrl.id; - ioctl(vd, VIDIOC_G_CTRL, &control_s); + v4l2_ioctl(vd, VIDIOC_G_CTRL, &control_s); SDL_Delay(10); fprintf (configfile, "%-10d %-10d # name:%-32s type:%d min:%-5d max:%-5d step:%-5d def:%d\n", queryctrl.id, control_s.value, queryctrl.name, queryctrl.type, queryctrl.minimum, @@ -335,7 +337,7 @@ while (NULL !=fgets(buffer, sizeof(buffer), configfile) ) { sscanf(buffer, "%i%i", &control.id, &control.value); - if (ioctl(vd, VIDIOC_S_CTRL, &control)) + if (v4l2_ioctl(vd, VIDIOC_S_CTRL, &control)) printf("ERROR id:%d val:%d\n", control.id, control.value); else printf("OK id:%d val:%d\n", control.id, control.value); @@ -350,12 +352,12 @@ int i; int ret = 0; - if ((vd->fd = open(vd->videodevice, O_RDWR)) == -1) { + if ((vd->fd = v4l2_open(vd->videodevice, O_RDWR)) == -1) { perror("ERROR opening V4L interface"); exit(1); } memset(&vd->cap, 0, sizeof(struct v4l2_capability)); - ret = ioctl(vd->fd, VIDIOC_QUERYCAP, &vd->cap); + ret = v4l2_ioctl(vd->fd, VIDIOC_QUERYCAP, &vd->cap); if (ret < 0) { printf("Error opening device %s: unable to query device.\n", vd->videodevice); @@ -424,7 +426,7 @@ vd->fmt.fmt.pix.height = vd->height; vd->fmt.fmt.pix.pixelformat = vd->formatIn; vd->fmt.fmt.pix.field = V4L2_FIELD_ANY; - ret = ioctl(vd->fd, VIDIOC_S_FMT, &vd->fmt); + ret = v4l2_ioctl(vd->fd, VIDIOC_S_FMT, &vd->fmt); if (ret < 0) { perror("Unable to set format"); goto fatal; @@ -454,12 +456,12 @@ setfps->parm.capture.timeperframe.numerator = d; setfps->parm.capture.timeperframe.denominator = n; - ret = ioctl(vd->fd, VIDIOC_S_PARM, setfps); + ret = v4l2_ioctl(vd->fd, VIDIOC_S_PARM, setfps); if(ret == -1) { perror("Unable to set frame rate"); goto fatal; } - ret = ioctl(vd->fd, VIDIOC_G_PARM, setfps); + ret = v4l2_ioctl(vd->fd, VIDIOC_G_PARM, setfps); if(ret == 0) { float confirmed_fps = (float)setfps->parm.capture.timeperframe.denominator / (float)setfps->parm.capture.timeperframe.numerator; if (confirmed_fps != (float)n / (float)d) { @@ -484,7 +486,7 @@ vd->rb.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vd->rb.memory = V4L2_MEMORY_MMAP; - ret = ioctl(vd->fd, VIDIOC_REQBUFS, &vd->rb); + ret = v4l2_ioctl(vd->fd, VIDIOC_REQBUFS, &vd->rb); if (ret < 0) { perror("Unable to allocate buffers"); goto fatal; @@ -495,7 +497,7 @@ vd->buf.index = i; vd->buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vd->buf.memory = V4L2_MEMORY_MMAP; - ret = ioctl(vd->fd, VIDIOC_QUERYBUF, &vd->buf); + ret = v4l2_ioctl(vd->fd, VIDIOC_QUERYBUF, &vd->buf); if (ret < 0) { perror("Unable to query buffer"); goto fatal; @@ -503,7 +505,7 @@ if (debug) printf("length: %u offset: %u\n", vd->buf.length, vd->buf.m.offset); - vd->mem[i] = mmap(0 /* start anywhere */ , + vd->mem[i] = v4l2_mmap(0 /* start anywhere */ , vd->buf.length, PROT_READ, MAP_SHARED, vd->fd, vd->buf.m.offset); if (vd->mem[i] == MAP_FAILED) { @@ -519,7 +521,7 @@ vd->buf.index = i; vd->buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vd->buf.memory = V4L2_MEMORY_MMAP; - ret = ioctl(vd->fd, VIDIOC_QBUF, &vd->buf); + ret = v4l2_ioctl(vd->fd, VIDIOC_QBUF, &vd->buf); if (ret < 0) { perror("Unable to queue buffer"); goto fatal;; @@ -536,7 +538,7 @@ int type = V4L2_BUF_TYPE_VIDEO_CAPTURE; int ret; - ret = ioctl(vd->fd, VIDIOC_STREAMON, &type); + ret = v4l2_ioctl(vd->fd, VIDIOC_STREAMON, &type); if (ret < 0) { perror("Unable to start capture"); return ret; @@ -550,7 +552,7 @@ int type = V4L2_BUF_TYPE_VIDEO_CAPTURE; int ret; - ret = ioctl(vd->fd, VIDIOC_STREAMOFF, &type); + ret = v4l2_ioctl(vd->fd, VIDIOC_STREAMOFF, &type); if (ret < 0) { perror("Unable to stop capture"); return ret; @@ -571,7 +573,7 @@ memset(&vd->buf, 0, sizeof(struct v4l2_buffer)); vd->buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vd->buf.memory = V4L2_MEMORY_MMAP; - ret = ioctl(vd->fd, VIDIOC_DQBUF, &vd->buf); + ret = v4l2_ioctl(vd->fd, VIDIOC_DQBUF, &vd->buf); if (ret < 0) { perror("Unable to dequeue buffer"); goto err; @@ -687,7 +689,7 @@ goto err; break; } - ret = ioctl(vd->fd, VIDIOC_QBUF, &vd->buf); + ret = v4l2_ioctl(vd->fd, VIDIOC_QBUF, &vd->buf); if (ret < 0) { perror("Unable to requeue buffer"); goto err; @@ -721,7 +723,7 @@ { int err =0; queryctrl->id = control; - if ((err= ioctl(vd->fd, VIDIOC_QUERYCTRL, queryctrl)) < 0) { + if ((err= v4l2_ioctl(vd->fd, VIDIOC_QUERYCTRL, queryctrl)) < 0) { perror("ioctl querycontrol error"); } else if (queryctrl->flags & V4L2_CTRL_FLAG_DISABLED) { printf("control %s disabled\n", (char *) queryctrl->name); @@ -743,7 +745,7 @@ if (isv4l2Control(vd, control, &queryctrl) < 0) return -1; control_s.id = control; - if ((err = ioctl(vd->fd, VIDIOC_G_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_G_CTRL, &control_s)) < 0) { printf("ioctl get control error\n"); return -1; } @@ -765,7 +767,7 @@ if ((value >= min) && (value <= max)) { control_s.id = control; control_s.value = value; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ioctl set control error\n"); return -1; } @@ -791,7 +793,7 @@ if (current <= max) { control_s.id = control; control_s.value = current; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ioctl set control error\n"); return -1; } @@ -819,7 +821,7 @@ if (current >= min) { control_s.id = control; control_s.value = current; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ioctl set control error\n"); return -1; } @@ -841,7 +843,7 @@ current = v4l2GetControl(vd, control); control_s.id = control; control_s.value = !current; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ioctl toggle control error\n"); return -1; } @@ -858,7 +860,7 @@ val_def = queryctrl.default_value; control_s.id = control; control_s.value = val_def; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ioctl reset control error\n"); return -1; } @@ -878,7 +880,7 @@ control_s.id = control; control_s.value = 1; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ERROR: Unable to reset pan (error = %d)\n", errno); return -1; } @@ -898,7 +900,7 @@ control_s.id = control; control_s.value = 1; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ERROR: Unable to reset tilt (error = %d)\n", errno); return -1; } @@ -919,7 +921,7 @@ control_s.id = control; control_s.value = 3; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ERROR: Unable to reset pan/tilt (error = %d)\n", errno); return -1; } @@ -938,7 +940,7 @@ return -1; control_s.id = control; control_s.value = inc; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ioctl pan updown control error\n"); return -1; } @@ -955,7 +957,7 @@ return -1; control_s.id = control; control_s.value = inc; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ioctl tiltupdown control error\n"); return -1; } @@ -984,7 +986,7 @@ control_s[1].id = t_control; control_s[1].value = inc_t; - if ((err = ioctl(vd->fd, VIDIOC_S_EXT_CTRLS, &control_s_array)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_EXT_CTRLS, &control_s_array)) < 0) { printf("ioctl pan-tilt updown control error\n"); return -1; } @@ -1017,7 +1019,7 @@ pan.s16.tilt = 0; control_s.value = pan.value ; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ioctl pan updown control error\n"); return -1; } @@ -1038,7 +1040,7 @@ pan.s16.tilt = inc; control_s.value = pan.value; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ioctl tiltupdown control error\n"); return -1; } @@ -1057,7 +1059,7 @@ control_s.value = flt; - if ((err = ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { + if ((err = v4l2_ioctl(vd->fd, VIDIOC_S_CTRL, &control_s)) < 0) { printf("ioctl set_light_frequency_filter error\n"); return -1; } @@ -1074,7 +1076,7 @@ fival.width = width; fival.height = height; printf("\tTime interval between frame: "); - while ((ret = ioctl(dev, VIDIOC_ENUM_FRAMEINTERVALS, &fival)) == 0) { + while ((ret = v4l2_ioctl(dev, VIDIOC_ENUM_FRAMEINTERVALS, &fival)) == 0) { if (fival.type == V4L2_FRMIVAL_TYPE_DISCRETE) { printf("%u/%u, ", fival.discrete.numerator, fival.discrete.denominator); @@ -1109,7 +1111,7 @@ memset(&fsize, 0, sizeof(fsize)); fsize.index = 0; fsize.pixel_format = pixfmt; - while ((ret = ioctl(dev, VIDIOC_ENUM_FRAMESIZES, &fsize)) == 0) { + while ((ret = v4l2_ioctl(dev, VIDIOC_ENUM_FRAMESIZES, &fsize)) == 0) { if (fsize.type == V4L2_FRMSIZE_TYPE_DISCRETE) { printf("{ discrete: width = %u, height = %u }\n", fsize.discrete.width, fsize.discrete.height); @@ -1152,7 +1154,7 @@ memset(&fmt, 0, sizeof(fmt)); fmt.index = 0; fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - while ((ret = ioctl(dev, VIDIOC_ENUM_FMT, &fmt)) == 0) { + while ((ret = v4l2_ioctl(dev, VIDIOC_ENUM_FMT, &fmt)) == 0) { if(supported_formats == NULL) { printf("{ pixelformat = '%c%c%c%c', description = '%s' }\n", fmt.pixelformat & 0xFF, (fmt.pixelformat >> 8) & 0xFF, --- a/luvcview.c +++ b/luvcview.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include --- a/uvcvideo.h +++ b/uvcvideo.h @@ -2,7 +2,6 @@ #define _USB_VIDEO_H_ #include -#include #include "uvc_compat.h" debian/patches/series0000644000000000000000000000005411550271715012035 0ustar 01-uyvy.patch 02-v4l2.patch 03-libv4l.patch debian/patches/02-v4l2.patch0000644000000000000000000000045411550271743012654 0ustar --- v4l2uvc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/v4l2uvc.h +++ b/v4l2uvc.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "avilib.h" #include "uvcvideo.h" debian/patches/01-uyvy.patch0000644000000000000000000000456311550271740013102 0ustar --- luvcview.c | 8 ++++++-- v4l2uvc.c | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) --- a/luvcview.c +++ b/luvcview.c @@ -220,6 +220,7 @@ const char *videodevice = NULL; const char *mode = NULL; int format = V4L2_PIX_FMT_MJPEG; + int sdl_format = SDL_YUY2_OVERLAY; int i; int grabmethod = 1; int width = 640; @@ -266,6 +267,9 @@ if (strcasecmp(mode, "yuv") == 0 || strcasecmp(mode, "YUYV") == 0) { format = V4L2_PIX_FMT_YUYV; + } else if (strcasecmp(mode, "uyvy") == 0 || strcasecmp(mode, "UYVY") == 0) { + format = V4L2_PIX_FMT_UYVY; + sdl_format = SDL_UYVY_OVERLAY; } else if (strcasecmp(mode, "jpg") == 0 || strcasecmp(mode, "MJPG") == 0) { format = V4L2_PIX_FMT_MJPEG; } else { @@ -344,7 +348,7 @@ printf("-d /dev/videoX use videoX device\n"); printf("-g use read method for grab instead mmap\n"); printf("-w disable SDL hardware accel.\n"); - printf("-f choose video format (YUYV/yuv and MJPG/jpg are valid, MJPG is default)\n"); + printf("-f choose video format (YUYV/yuv, UYVY/uyvy and MJPG/jpg are valid, MJPG is default)\n"); printf("-i fps use specified frame rate\n"); printf("-s widthxheight use specified input size\n"); printf("-c enable raw frame capturing for the first frame\n"); @@ -448,7 +452,7 @@ overlay = SDL_CreateYUVOverlay(videoIn->width, videoIn->height + 32, - SDL_YUY2_OVERLAY, pscreen); + sdl_format, pscreen); p = (unsigned char *) overlay->pixels[0]; drect.x = 0; drect.y = 0; --- a/v4l2uvc.c +++ b/v4l2uvc.c @@ -158,6 +158,7 @@ 8) * 2); break; case V4L2_PIX_FMT_YUYV: + case V4L2_PIX_FMT_UYVY: vd->framebuffer = (unsigned char *) calloc(1, (size_t) vd->framesizeIn); break; @@ -393,7 +394,9 @@ requested_format_found = 1; break; } - if(device_formats[i] == V4L2_PIX_FMT_MJPEG || device_formats[i] == V4L2_PIX_FMT_YUYV) + if(device_formats[i] == V4L2_PIX_FMT_MJPEG || device_formats[i] == V4L2_PIX_FMT_YUYV + || device_formats[i] == V4L2_PIX_FMT_UYVY) + fallback_format = i; } if(requested_format_found) { @@ -672,6 +675,7 @@ printf("bytes in used %d\n", vd->buf.bytesused); break; case V4L2_PIX_FMT_YUYV: + case V4L2_PIX_FMT_UYVY: if (vd->buf.bytesused > vd->framesizeIn) memcpy(vd->framebuffer, vd->mem[vd->buf.index], (size_t) vd->framesizeIn); debian/copyright0000644000000000000000000000236211550271303011121 0ustar This package was debianized by Aurelien Jarno on Tue, 19 Jun 2007 17:21:43 +0200. It was downloaded from http://svn.quickcamteam.net/svn/luvcview/ Upstream Author: Michel Xhaard Laurent Pinchart Copyright: Copyright (C) 2005 2006 2007 2008 Laurent Pinchart && Michel Xhaard Copyright (C) 2003 2004 2005 2006 Michel Xhaard Copyright (C) 1999 Rainer Johanni Copyright (C) 2001-2002 Thomas Östreich License: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA On Debian systems, the complete text of the GNU General Public License can be found at /usr/share/common-licenses/GPL debian/source/0000755000000000000000000000000011550271561010471 5ustar debian/source/format0000644000000000000000000000001411550271561011677 0ustar 3.0 (quilt) debian/manpages0000644000000000000000000000002211550271303010673 0ustar debian/luvcview.1 debian/control0000644000000000000000000000075011745244203010575 0ustar Source: luvcview Maintainer: Aurelien Jarno Section: x11 Priority: optional Build-Depends: debhelper (>= 5), libsdl1.2-dev, libv4l-dev, pkg-config Standards-Version: 3.9.3 Homepage: http://luvcview.sourceforge.net Package: luvcview Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: USB Video Class grabber luvcview is a camera viewer for UVC based webcams. It includes an mjpeg decoder and is able to save the video stream as an AVI file. debian/compat0000644000000000000000000000000211550271303010361 0ustar 5