From 657fff36d7b2ea46b1dfe5bd5c21c4395f28b245 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 25 Jul 2010 20:12:44 +0300 Subject: [PATCH] Remove support for V4L version 1 --- configure.ac | 36 - modules/access/Modules.am | 1 - modules/access/v4l.c | 1316 ------------------------------- modules/access/videodev_mjpeg.h | 139 ---- po/POTFILES.in | 2 - 5 files changed, 1494 deletions(-) delete mode 100644 modules/access/v4l.c delete mode 100644 modules/access/videodev_mjpeg.h diff --git a/configure.ac b/configure.ac index 9099ca8eb1..9a22804a96 100644 --- a/configure.ac +++ b/configure.ac @@ -2126,42 +2126,6 @@ then fi -dnl -dnl Video4Linux plugin -dnl -AC_ARG_ENABLE(v4l, - [ --enable-v4l Video4Linux input support (default disabled)]) -if test "${enable_v4l}" = "yes" -then - AC_ARG_WITH(v4l, - [ --with-v4l=PATH path to a v4l-enabled kernel tree],[],[]) - if test "${with_v4l}" != "no" -a -n "${with_v4l}" - then - VLC_ADD_CPPFLAGS([v4l],[-I${with_v4l}/include]) - fi - - CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_v4l}" - AC_CHECK_HEADERS(linux/videodev.h, [ - VLC_ADD_PLUGIN([v4l]) - ],[]) - CPPFLAGS="${CPPFLAGS_save}" -fi - -dnl -dnl libv4l1 support for video4linux. -dnl -AC_ARG_ENABLE( libv4l, - [ --enable-libv4l Libv4l Video4Linux support (default enabled)]) -if test "${enable_libv4l}" != "no" -a "${enable_v4l}" != "no" -then - PKG_CHECK_MODULES( LIBV4L, libv4l1, [ - VLC_ADD_LDFLAGS([v4l],[${LIBV4L_LIBS}]) - VLC_ADD_CFLAGS([v4l],[${LIBV4L_CFLAGS}]) - AC_DEFINE(HAVE_LIBV4L1, 1, Define if libv4l is available)], - AC_MSG_WARN([LibV4L support disabled because libv4l development headers were not found]) - ) -fi - dnl dnl Video4Linux2 plugin dnl diff --git a/modules/access/Modules.am b/modules/access/Modules.am index 12f8ebbf7d..7aa0b9967b 100644 --- a/modules/access/Modules.am +++ b/modules/access/Modules.am @@ -35,7 +35,6 @@ SOURCES_dvdnav = dvdnav.c SOURCES_dvdread = dvdread.c SOURCES_dc1394 = dc1394.c SOURCES_pvr = pvr.c videodev2.h -SOURCES_v4l = v4l.c videodev_mjpeg.h SOURCES_v4l2 = v4l2.c SOURCES_qtcapture = qtcapture.m SOURCES_cdda = \ diff --git a/modules/access/v4l.c b/modules/access/v4l.c deleted file mode 100644 index fb866eaa49..0000000000 --- a/modules/access/v4l.c +++ /dev/null @@ -1,1316 +0,0 @@ -/***************************************************************************** - * v4l.c : Video4Linux input module for vlc - ***************************************************************************** - * Copyright (C) 2002-2004 the VideoLAN team - * $Id$ - * - * Author: Laurent Aimar - * Paul Forgey - * Gildas Bazin - * Benjamin Pracht - * - * 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 Street, Fifth Floor, Boston MA 02110-1301, USA. - *****************************************************************************/ - -/***************************************************************************** - * Preamble - *****************************************************************************/ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/* From GStreamer's v4l plugin: - * Because of some really cool feature in video4linux1, also known as - * 'not including sys/types.h and sys/time.h', we had to include it - * ourselves. In all their intelligence, these people decided to fix - * this in the next version (video4linux2) in such a cool way that it - * breaks all compilations of old stuff... - * The real problem is actually that linux/time.h doesn't use proper - * macro checks before defining types like struct timeval. The proper - * fix here is to either fuck the kernel header (which is what we do - * by defining _LINUX_TIME_H, an innocent little hack) or by fixing it - * upstream, which I'll consider doing later on. If you get compiler - * errors here, check your linux/time.h && sys/time.h header setup. -*/ -#define _LINUX_TIME_H - -#include -#include "videodev_mjpeg.h" - -#ifdef HAVE_LIBV4L1 -#include -#endif -/***************************************************************************** - * Module descriptior - *****************************************************************************/ -static int Open ( vlc_object_t * ); -static void Close( vlc_object_t * ); - -#define CACHING_TEXT N_("Caching value in ms") -#define CACHING_LONGTEXT N_( \ - "Caching value for V4L captures. This " \ - "value should be set in milliseconds." ) -#define VDEV_TEXT N_("Video device name") -#define VDEV_LONGTEXT N_( \ - "Name of the video device to use. " \ - "If you don't specify anything, no video device will be used.") -#define CHROMA_TEXT N_("Video input chroma format") -#define CHROMA_LONGTEXT N_( \ - "Force the Video4Linux video device to use a specific chroma format " \ - "(eg. I420 (default), RV24, etc.)") -#define FREQUENCY_TEXT N_( "Frequency" ) -#define FREQUENCY_LONGTEXT N_( \ - "Frequency to capture (in kHz), if applicable." ) -#define CHANNEL_TEXT N_( "Channel" ) -#define CHANNEL_LONGTEXT N_( \ - "Channel of the card to use (Usually, 0 = tuner, " \ - "1 = composite, 2 = svideo)." ) -#define NORM_TEXT N_( "Norm" ) -#define NORM_LONGTEXT N_( \ - "Norm of the stream (Automatic, SECAM, PAL, or NTSC)." ) -#define AUDIO_TEXT N_( "Audio Channel" ) -#define AUDIO_LONGTEXT N_( \ - "Audio Channel to use, if there are several audio inputs." ) -#define WIDTH_TEXT N_( "Width" ) -#define WIDTH_LONGTEXT N_( "Width of the stream to capture " \ - "(-1 for autodetect)." ) -#define HEIGHT_TEXT N_( "Height" ) -#define HEIGHT_LONGTEXT N_( "Height of the stream to capture " \ - "(-1 for autodetect)." ) -#define BRIGHTNESS_TEXT N_( "Brightness" ) -#define BRIGHTNESS_LONGTEXT N_( \ - "Brightness of the video input." ) -#define HUE_TEXT N_( "Hue" ) -#define HUE_LONGTEXT N_( \ - "Hue of the video input." ) -#define COLOUR_TEXT N_( "Color" ) -#define COLOUR_LONGTEXT N_( \ - "Color of the video input." ) -#define CONTRAST_TEXT N_( "Contrast" ) -#define CONTRAST_LONGTEXT N_( \ - "Contrast of the video input." ) -#define TUNER_TEXT N_( "Tuner" ) -#define TUNER_LONGTEXT N_( "Tuner to use, if there are several ones." ) -#define MJPEG_TEXT N_( "MJPEG" ) -#define MJPEG_LONGTEXT N_( \ - "Set this option if the capture device outputs MJPEG" ) -#define DECIMATION_TEXT N_( "Decimation" ) -#define DECIMATION_LONGTEXT N_( \ - "Decimation level for MJPEG streams" ) -#define QUALITY_TEXT N_( "Quality" ) -#define QUALITY_LONGTEXT N_( "Quality of the stream." ) -#define FPS_TEXT N_( "Framerate" ) -#define FPS_LONGTEXT N_( "Framerate to capture, if applicable " \ - "(-1 for autodetect)." ) - -#define AUDIO_DEPRECATED_ERROR N_( \ - "Alsa or OSS audio capture in the v4l access is deprecated. " \ - "please use 'v4l:/""/ :input-slave=alsa:/""/' or " \ - "'v4l:/""/ :input-slave=oss:/""/' instead." ) - -static const int i_norm_list[] = - { VIDEO_MODE_AUTO, VIDEO_MODE_SECAM, VIDEO_MODE_PAL, VIDEO_MODE_NTSC }; -static const char *const psz_norm_list_text[] = - { N_("Automatic"), N_("SECAM"), N_("PAL"), N_("NTSC") }; - -#define V4L_DEFAULT "/dev/video" - -vlc_module_begin () - set_shortname( N_("Video4Linux") ) - set_description( N_("Video4Linux input") ) - set_category( CAT_INPUT ) - set_subcategory( SUBCAT_INPUT_ACCESS ) - - add_integer( "v4l-caching", DEFAULT_PTS_DELAY / 1000, NULL, - CACHING_TEXT, CACHING_LONGTEXT, true ) - add_obsolete_string( "v4l-vdev" ); - add_obsolete_string( "v4l-adev" ); - add_string( "v4l-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT, - true ) - add_float( "v4l-fps", -1.0, NULL, FPS_TEXT, FPS_LONGTEXT, true ) - add_obsolete_integer( "v4l-samplerate" ); - add_integer( "v4l-channel", 0, NULL, CHANNEL_TEXT, CHANNEL_LONGTEXT, - true ) - add_integer( "v4l-tuner", -1, NULL, TUNER_TEXT, TUNER_LONGTEXT, true ) - add_integer( "v4l-norm", VIDEO_MODE_AUTO, NULL, NORM_TEXT, NORM_LONGTEXT, - false ) - change_integer_list( i_norm_list, psz_norm_list_text, NULL ); - add_integer( "v4l-frequency", -1, NULL, FREQUENCY_TEXT, FREQUENCY_LONGTEXT, - false ) - add_integer( "v4l-audio", -1, NULL, AUDIO_TEXT, AUDIO_LONGTEXT, true ) - add_obsolete_bool( "v4l-stereo" ); - add_integer( "v4l-width", 0, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, true ) - add_integer( "v4l-height", 0, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, - true ) - add_integer( "v4l-brightness", -1, NULL, BRIGHTNESS_TEXT, - BRIGHTNESS_LONGTEXT, true ) - add_integer( "v4l-colour", -1, NULL, COLOUR_TEXT, COLOUR_LONGTEXT, - true ) - add_integer( "v4l-hue", -1, NULL, HUE_TEXT, HUE_LONGTEXT, true ) - add_integer( "v4l-contrast", -1, NULL, CONTRAST_TEXT, CONTRAST_LONGTEXT, - true ) - add_bool( "v4l-mjpeg", false, NULL, MJPEG_TEXT, MJPEG_LONGTEXT, - true ) - add_integer( "v4l-decimation", 1, NULL, DECIMATION_TEXT, - DECIMATION_LONGTEXT, true ) - add_integer( "v4l-quality", 100, NULL, QUALITY_TEXT, QUALITY_LONGTEXT, - true ) - - add_shortcut( "v4l" ) - set_capability( "access_demux", 10 ) - set_callbacks( Open, Close ) -vlc_module_end () - -/***************************************************************************** - * Access: local prototypes - *****************************************************************************/ -static int Demux ( demux_t * ); -static int Control( demux_t *, int, va_list ); - -static void ParseMRL ( demux_t * ); -static int OpenVideoDev( demux_t *, char * ); -static block_t *GrabVideo( demux_t * ); - -#define MJPEG_BUFFER_SIZE (256*1024) - -struct quicktime_mjpeg_app1 -{ - uint32_t i_reserved; /* set to 0 */ - uint32_t i_tag; /* 'mjpg' */ - uint32_t i_field_size; /* offset following EOI */ - uint32_t i_padded_field_size; /* offset following EOI+pad */ - uint32_t i_next_field; /* offset to next field */ - uint32_t i_DQT_offset; - uint32_t i_DHT_offset; - uint32_t i_SOF_offset; - uint32_t i_SOS_offset; - uint32_t i_data_offset; /* following SOS marker data */ -}; - -static const struct -{ - int i_v4l; - vlc_fourcc_t i_fourcc; - -} v4lchroma_to_fourcc[] = -{ - { VIDEO_PALETTE_GREY, VLC_CODEC_GREY }, - { VIDEO_PALETTE_HI240, VLC_FOURCC( 'I', '2', '4', '0' ) }, - { VIDEO_PALETTE_RGB565, VLC_CODEC_RGB16 }, - { VIDEO_PALETTE_RGB555, VLC_CODEC_RGB15 }, - { VIDEO_PALETTE_RGB24, VLC_CODEC_RGB24 }, - { VIDEO_PALETTE_RGB32, VLC_CODEC_RGB32 }, - { VIDEO_PALETTE_YUV422, VLC_CODEC_YUYV }, - { VIDEO_PALETTE_YUYV, VLC_CODEC_YUYV }, - { VIDEO_PALETTE_UYVY, VLC_CODEC_UYVY }, - { VIDEO_PALETTE_YUV420, VLC_FOURCC( 'I', '4', '2', 'N' ) }, - { VIDEO_PALETTE_YUV411, VLC_FOURCC( 'I', '4', '1', 'N' ) }, - { VIDEO_PALETTE_RAW, VLC_FOURCC( 'G', 'R', 'A', 'W' ) }, - { VIDEO_PALETTE_YUV422P, VLC_CODEC_I422 }, - { VIDEO_PALETTE_YUV420P, VLC_CODEC_I420 }, - { VIDEO_PALETTE_YUV411P, VLC_CODEC_I411 }, - { 0, 0 } -}; - -struct demux_sys_t -{ - /* Devices */ - char *psz_device; /* Main device from MRL */ - int i_fd; - - /* Video properties */ - picture_t pic; - - int i_fourcc; - int i_channel; - int i_audio; - int i_norm; - int i_tuner; - int i_frequency; - int i_width; - int i_height; - - int i_brightness; - int i_hue; - int i_colour; - int i_contrast; - - float f_fps; /* <= 0.0 mean to grab at full rate */ - mtime_t i_video_pts; /* only used when f_fps > 0 */ - - bool b_mjpeg; - int i_decimation; - int i_quality; - - struct video_capability vid_cap; - struct video_mbuf vid_mbuf; - struct mjpeg_requestbuffers mjpeg_buffers; - - uint8_t *p_video_mmap; - int i_frame_pos; - - struct video_mmap vid_mmap; - struct video_picture vid_picture; - - int i_video_frame_size; - es_out_id_t *p_es; -}; - -#ifndef HAVE_LIBV4L1 -# define v4l1_close close -# define v4l1_ioctl ioctl -# define v4l1_mmap mmap -# define v4l1_munmap munmap -# define v4l1_open vlc_open -#endif - -/***************************************************************************** - * Open: opens v4l device - ***************************************************************************** - * - * url: