From ab715d2e8eb29998b60fa3bbc1ad95441cfb69b3 Mon Sep 17 00:00:00 2001 From: Thierry MERLE Date: Sun, 6 Jul 2008 14:07:34 +0200 Subject: v4l2-library: libv4l-sync-with-0.3.3-release From: Hans de Goede * Add open64 and mmap64 wrappers to the LD_PRELOAD wrapper libs, so that they also work for applications compiled with FILE_OFFSET_BITS=64, this fixes using them with v4l-info * While looking at xawtv in general, found a few bugs in xawtv itself, added a patch to fix those to the appl-patches dir * Talking about the appl-patches dir, restore that as it accidentally got dropped from 0.3.2 * Be more verbose in various places when it comes to logging (esp errors) * Change v4lconvert_enum_fmt code a bit, so that it is easier to add more supported destination formats to libv4lconvert * Don't return -EINVAL from try_fmt when we cannot convert because the cam doesn't have any formats we know. Instead just return as format whatever the cam returns from try_fmt, this new behavior is compliant with the v4l2 api as documented Signed-off-by: Hans de Goede Signed-off-by: Thierry MERLE --- .../libv4l/appl-patches/camorama-0.19-fixes.patch | 90 ++++++ .../libv4l/appl-patches/vlc-0.8.6-libv4l1.patch | 319 +++++++++++++++++++++ .../lib/libv4l/appl-patches/xawtv-3.95-fixes.patch | 29 ++ 3 files changed, 438 insertions(+) create mode 100644 v4l2-apps/lib/libv4l/appl-patches/camorama-0.19-fixes.patch create mode 100644 v4l2-apps/lib/libv4l/appl-patches/vlc-0.8.6-libv4l1.patch create mode 100644 v4l2-apps/lib/libv4l/appl-patches/xawtv-3.95-fixes.patch (limited to 'v4l2-apps/lib/libv4l/appl-patches') diff --git a/v4l2-apps/lib/libv4l/appl-patches/camorama-0.19-fixes.patch b/v4l2-apps/lib/libv4l/appl-patches/camorama-0.19-fixes.patch new file mode 100644 index 000000000..1e1333575 --- /dev/null +++ b/v4l2-apps/lib/libv4l/appl-patches/camorama-0.19-fixes.patch @@ -0,0 +1,90 @@ +--- camorama-0.19/src/callbacks.c 2007-09-16 15:36:55.000000000 +0200 ++++ camorama-0.19.new/src/callbacks.c 2008-06-29 22:22:44.000000000 +0200 +@@ -387,9 +387,6 @@ + } + } + +- cam->pixmap = gdk_pixmap_new (NULL, cam->x, cam->y, cam->desk_depth); +- gtk_widget_set_size_request (glade_xml_get_widget (cam->xml, "da"), +- cam->x, cam->y); + + /* + * if(cam->read == FALSE) { +@@ -441,6 +438,11 @@ + * * } + */ + get_win_info (cam); ++ ++ cam->pixmap = gdk_pixmap_new (NULL, cam->x, cam->y, cam->desk_depth); ++ gtk_widget_set_size_request (glade_xml_get_widget (cam->xml, "da"), ++ cam->x, cam->y); ++ + frame = 0; + gtk_window_resize (GTK_WINDOW + (glade_xml_get_widget (cam->xml, "main_window")), 320, +@@ -520,8 +522,14 @@ + gtk_widget_show (about); + } + ++void ++camorama_filter_color_filter(void* filter, guchar *image, int x, int y, int depth); ++ + static void + apply_filters(cam* cam) { ++ /* v4l has reverse rgb order from what camora expect so call the color ++ filter to fix things up before running the user selected filters */ ++ camorama_filter_color_filter(NULL, cam->pic_buf, cam->x, cam->y, cam->depth); + camorama_filter_chain_apply(cam->filter_chain, cam->pic_buf, cam->x, cam->y, cam->depth); + #warning "FIXME: enable the threshold channel filter" + // if((effect_mask & CAMORAMA_FILTER_THRESHOLD_CHANNEL) != 0) +--- camorama-0.19/src/filter.c 2007-09-16 14:48:50.000000000 +0200 ++++ camorama-0.19.new/src/filter.c 2008-06-29 22:11:42.000000000 +0200 +@@ -151,12 +151,12 @@ + static void + camorama_filter_color_init(CamoramaFilterColor* self) {} + +-static void ++void + camorama_filter_color_filter(CamoramaFilterColor* filter, guchar *image, int x, int y, int depth) { + int i; + char tmp; + i = x * y; +- while (--i) { ++ while (i--) { + tmp = image[0]; + image[0] = image[2]; + image[2] = tmp; +--- camorama-0.19/src/main.c 2007-09-16 15:36:55.000000000 +0200 ++++ camorama-0.19.new/src/main.c 2008-06-29 22:20:04.000000000 +0200 +@@ -224,8 +224,7 @@ + + /* get picture attributes */ + get_pic_info (cam); +-// set_pic_info(cam); +- /* set_pic_info(cam); */ ++ set_pic_info (cam); + cam->contrast = cam->vid_pic.contrast; + cam->brightness = cam->vid_pic.brightness; + cam->colour = cam->vid_pic.colour; +--- camorama-0.19/src/v4l.c 2007-09-16 14:48:05.000000000 +0200 ++++ camorama-0.19.new/src/v4l.c 2008-06-29 22:20:23.000000000 +0200 +@@ -158,8 +158,8 @@ + if(cam->debug) { + g_message("SET PIC"); + } +- //cam->vid_pic.palette = VIDEO_PALETTE_RGB24; +- //cam->vid_pic.depth = 24; ++ cam->vid_pic.palette = VIDEO_PALETTE_RGB24; ++ cam->vid_pic.depth = 24; + //cam->vid_pic.palette = VIDEO_PALETTE_YUV420P; + if(ioctl(cam->dev, VIDIOCSPICT, &cam->vid_pic) == -1) { + if(cam->debug) { +@@ -232,6 +232,8 @@ + exit(0); + } + ++ cam->x = cam->vid_win.width; ++ cam->y = cam->vid_win.height; + } + + void set_buffer(cam * cam) diff --git a/v4l2-apps/lib/libv4l/appl-patches/vlc-0.8.6-libv4l1.patch b/v4l2-apps/lib/libv4l/appl-patches/vlc-0.8.6-libv4l1.patch new file mode 100644 index 000000000..132549b55 --- /dev/null +++ b/v4l2-apps/lib/libv4l/appl-patches/vlc-0.8.6-libv4l1.patch @@ -0,0 +1,319 @@ +diff -up vlc-0.8.6f/modules/access/v4l/Makefile.am~ vlc-0.8.6f/modules/access/v4l/Makefile.am +--- vlc-0.8.6f/modules/access/v4l/Makefile.am~ 2008-06-29 17:14:11.000000000 +0200 ++++ vlc-0.8.6f/modules/access/v4l/Makefile.am 2008-06-29 17:16:39.000000000 +0200 +@@ -100,7 +100,7 @@ libv4l_plugin_la_CXXFLAGS = `$(VLC_CONFI + libv4l_plugin_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags plugin v4l` + libv4l_plugin_la_LDFLAGS = `$(VLC_CONFIG) --libs plugin v4l` \ + -rpath '$(libvlcdir)' -avoid-version -module -shrext $(LIBEXT) +-libv4l_plugin_la_LIBADD = $(LTLIBVLC) ++libv4l_plugin_la_LIBADD = $(LTLIBVLC) -lv4l1 + + libv4l_a_SOURCES = $(SOURCES_v4l) + libv4l_builtin_la_SOURCES = $(SOURCES_v4l) +diff -up vlc-0.8.6f/modules/access/v4l/Makefile.in~ vlc-0.8.6f/modules/access/v4l/Makefile.in +--- vlc-0.8.6f/modules/access/v4l/Makefile.in~ 2008-06-29 17:16:22.000000000 +0200 ++++ vlc-0.8.6f/modules/access/v4l/Makefile.in 2008-06-29 17:16:42.000000000 +0200 +@@ -390,7 +390,7 @@ libv4l_plugin_la_OBJCFLAGS = `$(VLC_CONF + libv4l_plugin_la_LDFLAGS = `$(VLC_CONFIG) --libs plugin v4l` \ + -rpath '$(libvlcdir)' -avoid-version -module -shrext $(LIBEXT) + +-libv4l_plugin_la_LIBADD = $(LTLIBVLC) ++libv4l_plugin_la_LIBADD = $(LTLIBVLC) -lv4l1 + libv4l_a_SOURCES = $(SOURCES_v4l) + libv4l_builtin_la_SOURCES = $(SOURCES_v4l) + libv4l_a_CFLAGS = `$(VLC_CONFIG) --cflags builtin pic v4l` +diff -up vlc-0.8.6f/modules/access/v4l/v4l.c~ vlc-0.8.6f/modules/access/v4l/v4l.c +--- vlc-0.8.6f/modules/access/v4l/v4l.c~ 2008-06-29 17:13:30.000000000 +0200 ++++ vlc-0.8.6f/modules/access/v4l/v4l.c 2008-06-29 17:13:30.000000000 +0200 +@@ -64,6 +64,9 @@ + + #include + ++#include ++ ++ + /***************************************************************************** + * Module descriptior + *****************************************************************************/ +@@ -546,23 +549,23 @@ static void Close( vlc_object_t *p_this + if( p_sys->psz_device ) free( p_sys->psz_device ); + if( p_sys->psz_vdev ) free( p_sys->psz_vdev ); + if( p_sys->psz_adev ) free( p_sys->psz_adev ); +- if( p_sys->fd_video >= 0 ) close( p_sys->fd_video ); ++ if( p_sys->fd_video >= 0 ) v4l1_close( p_sys->fd_video ); + if( p_sys->fd_audio >= 0 ) close( p_sys->fd_audio ); + if( p_sys->p_block_audio ) block_Release( p_sys->p_block_audio ); + + if( p_sys->b_mjpeg ) + { + int i_noframe = -1; +- ioctl( p_sys->fd_video, MJPIOC_QBUF_CAPT, &i_noframe ); ++ v4l1_ioctl( p_sys->fd_video, MJPIOC_QBUF_CAPT, &i_noframe ); + } + + if( p_sys->p_video_mmap && p_sys->p_video_mmap != MAP_FAILED ) + { + if( p_sys->b_mjpeg ) +- munmap( p_sys->p_video_mmap, p_sys->mjpeg_buffers.size * ++ v4l1_munmap( p_sys->p_video_mmap, p_sys->mjpeg_buffers.size * + p_sys->mjpeg_buffers.count ); + else +- munmap( p_sys->p_video_mmap, p_sys->vid_mbuf.size ); ++ v4l1_munmap( p_sys->p_video_mmap, p_sys->vid_mbuf.size ); + } + + free( p_sys ); +@@ -875,13 +878,13 @@ static int OpenVideoDev( demux_t *p_demu + struct mjpeg_params mjpeg; + int i; + +- if( ( i_fd = open( psz_device, O_RDWR ) ) < 0 ) ++ if( ( i_fd = v4l1_open( psz_device, O_RDWR ) ) < 0 ) + { + msg_Err( p_demux, "cannot open device (%s)", strerror( errno ) ); + goto vdev_failed; + } + +- if( ioctl( i_fd, VIDIOCGCAP, &p_sys->vid_cap ) < 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCGCAP, &p_sys->vid_cap ) < 0 ) + { + msg_Err( p_demux, "cannot get capabilities (%s)", strerror( errno ) ); + goto vdev_failed; +@@ -926,7 +929,7 @@ static int OpenVideoDev( demux_t *p_demu + } + + vid_channel.channel = p_sys->i_channel; +- if( ioctl( i_fd, VIDIOCGCHAN, &vid_channel ) < 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCGCHAN, &vid_channel ) < 0 ) + { + msg_Err( p_demux, "cannot get channel infos (%s)", + strerror( errno ) ); +@@ -944,7 +947,7 @@ static int OpenVideoDev( demux_t *p_demu + } + + vid_channel.norm = p_sys->i_norm; +- if( ioctl( i_fd, VIDIOCSCHAN, &vid_channel ) < 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCSCHAN, &vid_channel ) < 0 ) + { + msg_Err( p_demux, "cannot set channel (%s)", strerror( errno ) ); + goto vdev_failed; +@@ -959,7 +962,7 @@ static int OpenVideoDev( demux_t *p_demu + if( p_sys->i_tuner >= 0 ) + { + vid_tuner.tuner = p_sys->i_tuner; +- if( ioctl( i_fd, VIDIOCGTUNER, &vid_tuner ) < 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCGTUNER, &vid_tuner ) < 0 ) + { + msg_Err( p_demux, "cannot get tuner (%s)", strerror( errno ) ); + goto vdev_failed; +@@ -974,7 +977,7 @@ static int OpenVideoDev( demux_t *p_demu + + /* FIXME FIXME to be checked FIXME FIXME */ + //vid_tuner.mode = p_sys->i_norm; +- if( ioctl( i_fd, VIDIOCSTUNER, &vid_tuner ) < 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCSTUNER, &vid_tuner ) < 0 ) + { + msg_Err( p_demux, "cannot set tuner (%s)", strerror( errno ) ); + goto vdev_failed; +@@ -990,7 +993,7 @@ static int OpenVideoDev( demux_t *p_demu + if( p_sys->i_frequency >= 0 ) + { + int driver_frequency = p_sys->i_frequency * 16 /1000; +- if( ioctl( i_fd, VIDIOCSFREQ, &driver_frequency ) < 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCSFREQ, &driver_frequency ) < 0 ) + { + msg_Err( p_demux, "cannot set frequency (%s)", + strerror( errno ) ); +@@ -1010,7 +1013,7 @@ static int OpenVideoDev( demux_t *p_demu + if( p_sys->i_audio >= 0 ) + { + vid_audio.audio = p_sys->i_audio; +- if( ioctl( i_fd, VIDIOCGAUDIO, &vid_audio ) < 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCGAUDIO, &vid_audio ) < 0 ) + { + msg_Err( p_demux, "cannot get audio (%s)", strerror( errno ) ); + goto vdev_failed; +@@ -1019,7 +1022,7 @@ static int OpenVideoDev( demux_t *p_demu + /* unmute audio */ + vid_audio.flags &= ~VIDEO_AUDIO_MUTE; + +- if( ioctl( i_fd, VIDIOCSAUDIO, &vid_audio ) < 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCSAUDIO, &vid_audio ) < 0 ) + { + msg_Err( p_demux, "cannot set audio (%s)", strerror( errno ) ); + goto vdev_failed; +@@ -1035,7 +1038,7 @@ static int OpenVideoDev( demux_t *p_demu + struct quicktime_mjpeg_app1 *p_app1; + int32_t i_offset; + +- if( ioctl( i_fd, MJPIOC_G_PARAMS, &mjpeg ) < 0 ) ++ if( v4l1_ioctl( i_fd, MJPIOC_G_PARAMS, &mjpeg ) < 0 ) + { + msg_Err( p_demux, "cannot get mjpeg params (%s)", + strerror( errno ) ); +@@ -1086,7 +1089,7 @@ static int OpenVideoDev( demux_t *p_demu + * optional. They will be present in the output. */ + mjpeg.jpeg_markers = JPEG_MARKER_DHT | JPEG_MARKER_DQT; + +- if( ioctl( i_fd, MJPIOC_S_PARAMS, &mjpeg ) < 0 ) ++ if( v4l1_ioctl( i_fd, MJPIOC_S_PARAMS, &mjpeg ) < 0 ) + { + msg_Err( p_demux, "cannot set mjpeg params (%s)", + strerror( errno ) ); +@@ -1103,7 +1106,7 @@ static int OpenVideoDev( demux_t *p_demu + { + struct video_window vid_win; + +- if( ioctl( i_fd, VIDIOCGWIN, &vid_win ) < 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCGWIN, &vid_win ) < 0 ) + { + msg_Err( p_demux, "cannot get win (%s)", strerror( errno ) ); + goto vdev_failed; +@@ -1130,7 +1133,7 @@ static int OpenVideoDev( demux_t *p_demu + if( !p_sys->b_mjpeg ) + { + /* set hue/color/.. */ +- if( ioctl( i_fd, VIDIOCGPICT, &p_sys->vid_picture ) == 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCGPICT, &p_sys->vid_picture ) == 0 ) + { + struct video_picture vid_picture = p_sys->vid_picture; + +@@ -1150,7 +1153,7 @@ static int OpenVideoDev( demux_t *p_demu + { + vid_picture.contrast = p_sys->i_contrast; + } +- if( ioctl( i_fd, VIDIOCSPICT, &vid_picture ) == 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCSPICT, &vid_picture ) == 0 ) + { + msg_Dbg( p_demux, "v4l device uses brightness: %d", + vid_picture.brightness ); +@@ -1164,7 +1167,7 @@ static int OpenVideoDev( demux_t *p_demu + } + + /* Find out video format used by device */ +- if( ioctl( i_fd, VIDIOCGPICT, &p_sys->vid_picture ) == 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCGPICT, &p_sys->vid_picture ) == 0 ) + { + struct video_picture vid_picture = p_sys->vid_picture; + char *psz; +@@ -1191,7 +1194,7 @@ static int OpenVideoDev( demux_t *p_demu + free( psz ); + + if( vid_picture.palette && +- !ioctl( i_fd, VIDIOCSPICT, &vid_picture ) ) ++ !v4l1_ioctl( i_fd, VIDIOCSPICT, &vid_picture ) ) + { + p_sys->vid_picture = vid_picture; + } +@@ -1199,14 +1202,14 @@ static int OpenVideoDev( demux_t *p_demu + { + /* Try to set the format to something easy to encode */ + vid_picture.palette = VIDEO_PALETTE_YUV420P; +- if( ioctl( i_fd, VIDIOCSPICT, &vid_picture ) == 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCSPICT, &vid_picture ) == 0 ) + { + p_sys->vid_picture = vid_picture; + } + else + { + vid_picture.palette = VIDEO_PALETTE_YUV422P; +- if( ioctl( i_fd, VIDIOCSPICT, &vid_picture ) == 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCSPICT, &vid_picture ) == 0 ) + { + p_sys->vid_picture = vid_picture; + } +@@ -1237,13 +1240,13 @@ static int OpenVideoDev( demux_t *p_demu + p_sys->mjpeg_buffers.count = 8; + p_sys->mjpeg_buffers.size = MJPEG_BUFFER_SIZE; + +- if( ioctl( i_fd, MJPIOC_REQBUFS, &p_sys->mjpeg_buffers ) < 0 ) ++ if( v4l1_ioctl( i_fd, MJPIOC_REQBUFS, &p_sys->mjpeg_buffers ) < 0 ) + { + msg_Err( p_demux, "mmap unsupported" ); + goto vdev_failed; + } + +- p_sys->p_video_mmap = mmap( 0, ++ p_sys->p_video_mmap = v4l1_mmap( 0, + p_sys->mjpeg_buffers.size * p_sys->mjpeg_buffers.count, + PROT_READ | PROT_WRITE, MAP_SHARED, i_fd, 0 ); + if( p_sys->p_video_mmap == MAP_FAILED ) +@@ -1258,7 +1261,7 @@ static int OpenVideoDev( demux_t *p_demu + /* queue up all the frames */ + for( i = 0; i < (int)p_sys->mjpeg_buffers.count; i++ ) + { +- if( ioctl( i_fd, MJPIOC_QBUF_CAPT, &i ) < 0 ) ++ if( v4l1_ioctl( i_fd, MJPIOC_QBUF_CAPT, &i ) < 0 ) + { + msg_Err( p_demux, "unable to queue frame" ); + goto vdev_failed; +@@ -1289,13 +1292,13 @@ static int OpenVideoDev( demux_t *p_demu + (char*)&p_sys->i_fourcc ); + + /* Allocate mmap buffer */ +- if( ioctl( i_fd, VIDIOCGMBUF, &p_sys->vid_mbuf ) < 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCGMBUF, &p_sys->vid_mbuf ) < 0 ) + { + msg_Err( p_demux, "mmap unsupported" ); + goto vdev_failed; + } + +- p_sys->p_video_mmap = mmap( 0, p_sys->vid_mbuf.size, ++ p_sys->p_video_mmap = v4l1_mmap( 0, p_sys->vid_mbuf.size, + PROT_READ|PROT_WRITE, MAP_SHARED, + i_fd, 0 ); + if( p_sys->p_video_mmap == MAP_FAILED ) +@@ -1310,7 +1313,7 @@ static int OpenVideoDev( demux_t *p_demu + p_sys->vid_mmap.width = p_sys->i_width; + p_sys->vid_mmap.height = p_sys->i_height; + p_sys->vid_mmap.format = p_sys->vid_picture.palette; +- if( ioctl( i_fd, VIDIOCMCAPTURE, &p_sys->vid_mmap ) < 0 ) ++ if( v4l1_ioctl( i_fd, VIDIOCMCAPTURE, &p_sys->vid_mmap ) < 0 ) + { + msg_Warn( p_demux, "%4.4s refused", (char*)&p_sys->i_fourcc ); + msg_Err( p_demux, "chroma selection failed" ); +@@ -1321,7 +1324,7 @@ static int OpenVideoDev( demux_t *p_demu + + vdev_failed: + +- if( i_fd >= 0 ) close( i_fd ); ++ if( i_fd >= 0 ) v4l1_close( i_fd ); + return -1; + } + +@@ -1431,7 +1434,7 @@ static uint8_t *GrabCapture( demux_t *p_ + + p_sys->vid_mmap.frame = (p_sys->i_frame_pos + 1) % p_sys->vid_mbuf.frames; + +- while( ioctl( p_sys->fd_video, VIDIOCMCAPTURE, &p_sys->vid_mmap ) < 0 ) ++ while( v4l1_ioctl( p_sys->fd_video, VIDIOCMCAPTURE, &p_sys->vid_mmap ) < 0 ) + { + if( errno != EAGAIN ) + { +@@ -1447,7 +1450,7 @@ static uint8_t *GrabCapture( demux_t *p_ + msg_Dbg( p_demux, "grab failed, trying again" ); + } + +- while( ioctl(p_sys->fd_video, VIDIOCSYNC, &p_sys->i_frame_pos) < 0 ) ++ while( v4l1_ioctl(p_sys->fd_video, VIDIOCSYNC, &p_sys->i_frame_pos) < 0 ) + { + if( errno != EAGAIN && errno != EINTR ) + { +@@ -1473,7 +1476,7 @@ static uint8_t *GrabMJPEG( demux_t *p_de + /* re-queue the last frame we sync'd */ + if( p_sys->i_frame_pos != -1 ) + { +- while( ioctl( p_sys->fd_video, MJPIOC_QBUF_CAPT, ++ while( v4l1_ioctl( p_sys->fd_video, MJPIOC_QBUF_CAPT, + &p_sys->i_frame_pos ) < 0 ) + { + if( errno != EAGAIN && errno != EINTR ) +@@ -1485,7 +1488,7 @@ static uint8_t *GrabMJPEG( demux_t *p_de + } + + /* sync on the next frame */ +- while( ioctl( p_sys->fd_video, MJPIOC_SYNC, &sync ) < 0 ) ++ while( v4l1_ioctl( p_sys->fd_video, MJPIOC_SYNC, &sync ) < 0 ) + { + if( errno != EAGAIN && errno != EINTR ) + { diff --git a/v4l2-apps/lib/libv4l/appl-patches/xawtv-3.95-fixes.patch b/v4l2-apps/lib/libv4l/appl-patches/xawtv-3.95-fixes.patch new file mode 100644 index 000000000..ccb077be0 --- /dev/null +++ b/v4l2-apps/lib/libv4l/appl-patches/xawtv-3.95-fixes.patch @@ -0,0 +1,29 @@ +--- xawtv-3.95/libng/plugins/drv0-v4l2.c 2005-02-11 18:56:24.000000000 +0100 ++++ xawtv-3.95.new/libng/plugins/drv0-v4l2.c 2008-07-05 21:12:37.000000000 +0200 +@@ -161,7 +161,7 @@ + #define PREFIX "ioctl: " + + static int +-xioctl(int fd, int cmd, void *arg, int mayfail) ++xioctl(int fd, unsigned long int cmd, void *arg, int mayfail) + { + int rc; + +@@ -768,6 +768,7 @@ + /* get it */ + memset(&buf,0,sizeof(buf)); + buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ buf.memory = V4L2_MEMORY_MMAP; + if (-1 == xioctl(h->fd,VIDIOC_DQBUF,&buf, 0)) + return -1; + h->waiton++; +@@ -813,8 +814,7 @@ + if (-1 == xioctl(h->fd, VIDIOC_QUERYBUF, &h->buf_v4l2[i], 0)) + return -1; + h->buf_me[i].fmt = h->fmt_me; +- h->buf_me[i].size = h->buf_me[i].fmt.bytesperline * +- h->buf_me[i].fmt.height; ++ h->buf_me[i].size = h->buf_v4l2[i].length; + h->buf_me[i].data = mmap(NULL, h->buf_v4l2[i].length, + PROT_READ | PROT_WRITE, MAP_SHARED, + h->fd, h->buf_v4l2[i].m.offset); -- cgit v1.2.3 From 4e748efa7677d0762f4b1738cd8869df5eb106b6 Mon Sep 17 00:00:00 2001 From: Thierry MERLE Date: Tue, 8 Jul 2008 07:01:45 +0200 Subject: v4l2-library: libv4l-really-sync-with-0.3.4.patch From: Hans de Goede * The mmap64 support in 0.3.3, has caused a bug in libv4l1 when running on 32 bit systems (who uses those now a days?), this bug caused v4l1 compatibility to not work at all, this release fixes this * Some apps (xawtv, kopete) use an ioctl wrapper internally for various reasons. This wrappers request argument is an int, but the real ioctl's request argument is an unsigned long. Passing the VIDIOC_xxx defines through to the wrapper, and then to the real ioctl, causes the request to get sign extended on 64 bit args. The kernel seems to ignore the upper 32 bits, causing the sign extension to not make a difference. libv4l now also ignores the upper 32 bits of the libv4lx_ioctl request argument on 64 bit archs * Add a bugfix patch for kopete in the appl-patches dir, currently it assumes that it got the width and height it asked for when doing a S_FMT, which is a wrong assumption Signed-off-by: Hans de Goede Signed-off-by: Thierry MERLE --- .../lib/libv4l/appl-patches/kdenetwork-4.0.85-kopete.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 v4l2-apps/lib/libv4l/appl-patches/kdenetwork-4.0.85-kopete.patch (limited to 'v4l2-apps/lib/libv4l/appl-patches') diff --git a/v4l2-apps/lib/libv4l/appl-patches/kdenetwork-4.0.85-kopete.patch b/v4l2-apps/lib/libv4l/appl-patches/kdenetwork-4.0.85-kopete.patch new file mode 100644 index 000000000..b187f05e4 --- /dev/null +++ b/v4l2-apps/lib/libv4l/appl-patches/kdenetwork-4.0.85-kopete.patch @@ -0,0 +1,12 @@ +diff -up kdenetwork-4.0.85/kopete/libkopete/avdevice/videodevice.cpp~ kdenetwork-4.0.85/kopete/libkopete/avdevice/videodevice.cpp +--- kdenetwork-4.0.85/kopete/libkopete/avdevice/videodevice.cpp~ 2008-07-07 22:40:56.000000000 +0200 ++++ kdenetwork-4.0.85/kopete/libkopete/avdevice/videodevice.cpp 2008-07-07 22:40:56.000000000 +0200 +@@ -679,6 +679,8 @@ kDebug() << "VIDIOC_S_FMT worked (" << e + if (fmt.fmt.pix.sizeimage < min) + fmt.fmt.pix.sizeimage = min; + m_buffer_size=fmt.fmt.pix.sizeimage ; ++ currentwidth = fmt.fmt.pix.width; ++ currentheight = fmt.fmt.pix.height; + } + break; + #endif -- cgit v1.2.3