diff options
59 files changed, 1037 insertions, 720 deletions
@@ -1,10 +1,25 @@ +*~ *.o +*.lo +*.la *.d *.so *.so.0 +*.so.1 *.pc *.a +*.tar.* +*.spec +.libs +.deps +config.h config.log config.status Makefile +Makefile.in configure +aclocal.m4 +autom4te.cache +build-aux +libtool +stamp-h1 @@ -1,30 +1,25 @@ Requirements: ------------- -* make and a c and c++ compiler -* optionally qt3 ot qt4 for building qv4l2 -* optionally libsysfs for building v4l2-sysfs-path - +* make and a C and C++ compiler +* optionally libjpeg v6 or later +* optionally Qt4 for building qv4l2 Building: --------- -Before building decide under which PREFIX you wish to install -(the default is /usr/local), and if you want the libraries to be installed -under a different directory then $PREFIX/lib for example $PREFIX/lib64. - -To build execute "make" specifying the desired installation prefix -and (optionally) the desired libdir, for example: -make PREFIX=/usr LIBDIR=/usr/lib64 +If you checked out the source repository you need to install the autotools +environment first. Then type "autoreconf -vfi" to generate the configure +script. +Then execute "configure" with any desired options. You can get a summary via +the --help option. +After configuration simply type "make" to start the build process. Installing: ----------- -To install do "make install", and again specify the desired PREFIX and -LIBDIR, note that it is important to specify the same PREFIX and LIBDIR -as used when building, for example: -make install PREFIX=/usr LIBDIR=/usr/lib64 +To install do "make install". The configured paths will be used. Note that v4l-utils' "make install" supports DESTDIR for installing into a build root for example: -make install PREFIX=/usr LIBDIR=/usr/lib64 DESTDIR=/mnt/sysimage +make install DESTDIR=/mnt/sysimage diff --git a/Make.rules.in b/Make.rules.in deleted file mode 100644 index 66225013..00000000 --- a/Make.rules.in +++ /dev/null @@ -1,38 +0,0 @@ -# These ones can be overriden from the cmdline - -CFLAGS := -g -O1 -CFLAGS += -Wall -Wpointer-arith -CXXFLAGS := $(CFLAGS) -CFLAGS += -Wstrict-prototypes -Wmissing-prototypes - -PREFIX = /usr/local -LIBDIR = $(PREFIX)/lib -# subdir below LIBDIR in which to install the libv4lx libc wrappers -LIBV4L1SUBDIR = $(LIBDIR)/@libv4l1subdir@ -LIBV4L2SUBDIR = $(LIBDIR)/@libv4l2subdir@ -LIBV4LCONVERTSUBDIR = $(LIBDIR)/@libv4lconvertsubdir@ -MANDIR = $(PREFIX)/share/man - -# These ones should not be overriden from the cmdline - -# Note the -I../.. this assumes all sources live in a 2 level dir hierarchy! -override CPPFLAGS += -I../../include -I../../lib/include -D_GNU_SOURCE -DV4L_UTILS_VERSION='"$(V4L_UTILS_VERSION)"' -override LDFLAGS += -L../../lib/libv4l1 -L../../lib/libv4l2 -L../../lib/libv4lconvert - -# And last various rules - -%.o: %.c - $(CC) -Wp,-MMD,"$*.d",-MQ,"$@",-MP -c $(CPPFLAGS) $(CFLAGS) -o $@ $< - -%.o: %.cpp - $(CXX) -Wp,-MMD,"$*.d",-MQ,"$@",-MP -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $< - -%.so: - $(CC) -shared $(LDFLAGS) -Wl,-soname,$@.$(LIB_RELEASE) -o $@.$(LIB_RELEASE) $^ $(LIBS_$*) - ln -f -s $@.$(LIB_RELEASE) $@ - -%.a: - $(AR) cqs $@ $^ - -clean:: - rm -f core core.[0123456789]* *~ *.o *.d *.a *.so* DEADJOE *.orig *.rej $(TARGETS) diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..58a44dec --- /dev/null +++ b/Makefile.am @@ -0,0 +1,47 @@ +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = \ + lib/libv4lconvert \ + lib/libv4l2 \ + lib/libv4l1 + +if WITH_V4LUTILS +SUBDIRS += \ + utils/libv4l2util \ + utils/libmedia_dev \ + utils/decode_tm6000 \ + utils/dvb \ + utils/keytable \ + utils/rds \ + utils/v4l2-compliance \ + utils/v4l2-ctl \ + utils/v4l2-dbg \ + utils/v4l2-sysfs-path \ + utils/xc3028-firmware + +if BUILD_QT +SUBDIRS += utils/qv4l2 +endif +endif + +EXTRA_DIST = contrib include README.lib README.lib-multi-threading + +# custom targets + +sync-with-kernel: + @if [ ! -f $(KERNEL_DIR)/include/linux/videodev2.h -o \ + ! -f $(KERNEL_DIR)/include/linux/ivtv.h -o \ + ! -f $(KERNEL_DIR)/include/media/v4l2-chip-ident.h ]; then \ + echo "Error you must set KERNEL_DIR to point to an extracted kernel source dir"; \ + exit 1; \ + fi + cp -a $(KERNEL_DIR)/include/linux/videodev2.h $(top_srcdir)/include/linux + cp -a $(KERNEL_DIR)/include/linux/ivtv.h $(top_srcdir)/include/linux + cp -a $(KERNEL_DIR)/include/media/v4l2-chip-ident.h $(top_srcdir)/include/media + + $(MAKE) -C utils/keytable $@ + $(MAKE) -C utils/v4l2-dbg $@ + $(MAKE) -C utils/xc3028-firmware $@ + $(MAKE) -C utils/dvb $@ + diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index 720d8e99..00000000 --- a/Makefile.in +++ /dev/null @@ -1,67 +0,0 @@ -CC = @CC@ -CXX = @CXX@ -V4L_UTILS_VERSION = @V4L_UTILS_VERSION@ -CFLAGS = @CFLAGS@ -WITH_LIBV4L = @WITH_LIBV4L@ -WITH_V4LUTILS = @WITH_V4LUTILS@ - -LIBV4L_ARGS= -ifeq ($(WITH_LIBV4L),no) -ifeq ($(WITH_V4LUTILS),yes) - LIBV4L_ARGS="LINKTYPE=static" -endif -endif - -all: - ifeq ($(WITH_LIBV4L),yes) - echo with Libv4l $(LIBV4L_ARGS) - $(MAKE) -C lib $(LIBV4L_ARGS) $@ - else ifeq ($(WITH_V4LUTILS),yes) - echo with Libv4l static - $(MAKE) -C lib $(LIBV4L_ARGS) $@ - endif - ifeq ($(WITH_V4LUTILS),yes) - $(MAKE) -C utils $(LIBV4L_ARGS) $@ - endif - -install: - ifeq ($(WITH_LIBV4L),yes) - $(MAKE) -C lib $@ - endif - ifeq ($(WITH_V4LUTILS),yes) - $(MAKE) -C utils $@ - endif - -sync-with-kernel: - @if [ ! -f $(KERNEL_DIR)/include/linux/videodev2.h -o \ - ! -f $(KERNEL_DIR)/include/linux/ivtv.h -o \ - ! -f $(KERNEL_DIR)/include/media/v4l2-chip-ident.h ]; then \ - echo "Error you must set KERNEL_DIR to point to an extracted kernel source dir"; \ - exit 1; \ - fi - cp -a $(KERNEL_DIR)/include/linux/videodev2.h include/linux - cp -a $(KERNEL_DIR)/include/linux/ivtv.h include/linux - cp -a $(KERNEL_DIR)/include/media/v4l2-chip-ident.h include/media - $(MAKE) -C utils $@ - -clean:: - rm -f include/*/*~ - $(MAKE) -C lib $@ - $(MAKE) -C utils $@ - -tag: - @git tag -a -m "Tag as v4l-utils-$(V4L_UTILS_VERSION)" v4l-utils-$(V4L_UTILS_VERSION) - @echo "Tagged as v4l-utils-$(V4L_UTILS_VERSION)" - -archive-no-tag: - @git archive --format=tar --prefix=v4l-utils-$(V4L_UTILS_VERSION)/ v4l-utils-$(V4L_UTILS_VERSION) > v4l-utils-$(V4L_UTILS_VERSION).tar - @bzip2 -f v4l-utils-$(V4L_UTILS_VERSION).tar - -archive: clean tag archive-no-tag - -export: clean - tar --transform s/^\./v4l-utils-$(V4L_UTILS_VERSION)/g \ - --exclude=.git -jcvf \ - /tmp/v4l-utils-$(V4L_UTILS_VERSION).tar.bz2 . - -include Make.rules diff --git a/config.h.in b/config.h.in new file mode 100644 index 00000000..9202d65b --- /dev/null +++ b/config.h.in @@ -0,0 +1,80 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* whether we use libjpeg */ +#undef HAVE_JPEG + +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* libv4l1 private lib directory */ +#undef LIBV4L1_PRIV_DIR + +/* libv4l2 plugin directory */ +#undef LIBV4L2_PLUGIN_DIR + +/* libv4l2 private lib directory */ +#undef LIBV4L2_PRIV_DIR + +/* libv4lconvert private lib directory */ +#undef LIBV4LCONVERT_PRIV_DIR + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* v4l-utils version string */ +#undef V4L_UTILS_VERSION + +/* Version number of package */ +#undef VERSION diff --git a/configure.ac b/configure.ac new file mode 100644 index 00000000..48428d14 --- /dev/null +++ b/configure.ac @@ -0,0 +1,149 @@ +# -*- Autoconf -*- + +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) +AC_INIT([v4l-utils],[0.9.0-test]) + +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([lib/libv4l2/libv4l2.c]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([Makefile + lib/libv4lconvert/Makefile + lib/libv4l2/Makefile + lib/libv4l1/Makefile + + utils/libv4l2util/Makefile + utils/libmedia_dev/Makefile + utils/decode_tm6000/Makefile + utils/dvb/Makefile + utils/keytable/Makefile + utils/rds/Makefile + utils/v4l2-compliance/Makefile + utils/v4l2-ctl/Makefile + utils/v4l2-dbg/Makefile + utils/v4l2-sysfs-path/Makefile + utils/xc3028-firmware/Makefile + utils/qv4l2/Makefile + + v4l-utils.spec + lib/libv4lconvert/libv4lconvert.pc + lib/libv4l1/libv4l1.pc + lib/libv4l2/libv4l2.pc +]) + +AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2 -Wno-portability]) # 1.10 is needed for target_LIBTOOLFLAGS + +AM_MAINTAINER_MODE + +# Checks for programs. +AC_PROG_CXX +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_LIBTOOL + +# sync-with-kernel and keytable install could make use of them +#AC_PROG_GREP +#AC_PROG_SED +#AC_PROG_MKDIR_P + +# Checks for dependencies + +AC_ARG_WITH([jpeg], + AS_HELP_STRING([--without-jpeg], [Do not use jpeg library]), + [], + [with_jpeg=yes]) + +AS_IF([test "x$with_jpeg" != xno], + [AC_CHECK_HEADER([jpeglib.h], + [AC_CHECK_LIB([jpeg], + [jpeg_read_header], + [have_jpeg=: + JPEG_LIBS="-ljpeg" + AC_DEFINE([HAVE_JPEG],[1],[whether we use libjpeg])], + [AC_MSG_ERROR(cannot find libjpeg (v6 or later required))])], + [AC_MSG_ERROR(cannot find jpeglib.h)])]) + +AM_CONDITIONAL([HAVE_JPEG], [$have_jpeg]) + +PKG_CHECK_MODULES(QT, [QtCore >= 4.4 QtGui >= 4.4], [qt_pkgconfig=true], [qt_pkgconfig=false]) +if test "x$qt_pkgconfig" = "xtrue"; then + AC_SUBST(QT_CFLAGS) + AC_SUBST(QT_LIBS) + MOC=`$PKG_CONFIG --variable=moc_location QtCore` + UIC=`$PKG_CONFIG --variable=uic_location QtCore` + AC_SUBST(MOC) + AC_SUBST(UIC) +else + AC_MSG_WARN(qv4l2 will not be built) +fi + +AM_CONDITIONAL(BUILD_QT, [test ${qt_pkgconfig} = true]) +AC_SUBST([JPEG_LIBS]) + +# directories + +AC_ARG_WITH(libv4l1subdir, AS_HELP_STRING(--with-libv4l1subdir=DIR,set libv4l1 library subdir [default=libv4l]), + libv4l1subdir=$withval, libv4l1subdir="libv4l") + +AC_ARG_WITH(libv4l2subdir, AS_HELP_STRING(--with-libv4l2subdir=DIR,set libv4l2 library subdir [default=libv4l]), + libv4l2subdir=$withval, libv4l2subdir="libv4l") + +AC_ARG_WITH(libv4lconvertsubdir, AS_HELP_STRING(--with-libv4lconvertsubdir=DIR,set libv4lconvert library subdir [default=libv4l]), + libv4lconvertsubdir=$withval, libv4lconvertsubdir="libv4l") + +libv4l1privdir="$libdir/$libv4l1subdir" +libv4l2privdir="$libdir/$libv4l2subdir" +libv4l2plugindir="$libv4l2privdir/plugins" +libv4lconvertprivdir="$libdir/$libv4lconvertsubdir" + +rootetcdir="/etc" +rootlibdir="/lib" +pkgconfigdir="$libdir/pkgconfig" + +AC_SUBST(libv4l1privdir) +AC_SUBST(libv4l2privdir) +AC_SUBST(libv4l2plugindir) +AC_SUBST(libv4lconvertprivdir) +AC_SUBST(rootetcdir) +AC_SUBST(rootlibdir) +AC_SUBST(pkgconfigdir) + +AC_DEFINE_UNQUOTED([V4L_UTILS_VERSION], ["$PACKAGE_VERSION"], [v4l-utils version string]) +AC_DEFINE_DIR([LIBV4L1_PRIV_DIR], [libv4l1privdir], [libv4l1 private lib directory]) +AC_DEFINE_DIR([LIBV4L2_PRIV_DIR], [libv4l2privdir], [libv4l2 private lib directory]) +AC_DEFINE_DIR([LIBV4L2_PLUGIN_DIR], [libv4l2plugindir], [libv4l2 plugin directory]) +AC_DEFINE_DIR([LIBV4LCONVERT_PRIV_DIR], [libv4lconvertprivdir], [libv4lconvert private lib directory]) + +# options + +AC_ARG_ENABLE(libv4l, + [ --disable-libv4l disable dynamic libv4l compilation], + [case "${enableval}" in + yes | no ) with_libv4l="${enableval}" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-libv4l) ;; + esac], + [with_libv4l="yes"] +) + +AC_ARG_ENABLE(v4l-utils, + [ --disable-v4l-utils disable v4l-utils compilation], + [case "${enableval}" in + yes | no ) with_v4lutils="${enableval}" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-v4l-utils) ;; + esac], + [with_v4lutils="yes"] +) + +AM_CONDITIONAL([WITH_LIBV4L], [test x$with_libv4l = xyes]) +AM_CONDITIONAL([WITH_V4LUTILS], [test x$with_v4lutils = xyes]) + +# append -static to libtool compile and link command to enforce static libs +AS_IF([test x$with_libv4l != xyes], [AC_SUBST([ENFORCE_LIBV4L_STATIC], ["-static"])]) + +# misc + +CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_srcdir)/lib/include -Wall -Wpointer-arith -D_GNU_SOURCE $CPPFLAGS" + +AC_OUTPUT diff --git a/configure.in b/configure.in deleted file mode 100644 index 7292bee2..00000000 --- a/configure.in +++ /dev/null @@ -1,58 +0,0 @@ -AC_INIT(v4l-utils.spec.in) - -V4L_UTILS_VERSION=0.9.0-test - -dnl --------------------------------------------------------------------- -dnl Checks for programs. -AC_PROG_CC -AC_PROG_CXX -AC_LANG_C -AC_PROG_MAKE_SET -AC_HEADER_STDC - -dnl --------------------------------------------------------------------- -dnl Directories - -AC_ARG_WITH(libv4l1subdir, AC_HELP_STRING([--with-libv4l1subdir=DIR], [set libv4l1 library subdir [default=libv4l]]), - libv4l1subdir=$withval, libv4l1subdir="libv4l") - -AC_ARG_WITH(libv4l2subdir, AC_HELP_STRING([--with-libv4l2subdir=DIR], [set libv4l2 library subdir [default=libv4l]]), - libv4l2subdir=$withval, libv4l2subdir="libv4l") - -AC_ARG_WITH(libv4lconvertsubdir, AC_HELP_STRING([--with-libv4lconvertsubdir=DIR], [set libv4lconvert library subdir [default=libv4l]]), - libv4lconvertsubdir=$withval, libv4lconvertsubdir="libv4l") - -dnl --------------------------------------------------------------------- -dnl Options - -AC_ARG_ENABLE(libv4l, - [ --disable-libv4l disable dynamic libv4l compilation], - [case "${enableval}" in - yes | no ) WITH_LIBV4L="${enableval}" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-ctemplate) ;; - esac], - [WITH_LIBV4L="yes"] -) - -AC_ARG_ENABLE(v4l-utils, - [ --disable-v4l-utils disable v4l-utils compilation], - [case "${enableval}" in - yes | no ) WITH_V4LUTILS="${enableval}" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-ctemplate) ;; - esac], - [WITH_V4LUTILS="yes"] -) - -dnl --------------------------------------------------------------------- -dnl Substitute vars -AC_SUBST(V4L_UTILS_VERSION) -AC_SUBST(WITH_LIBV4L) -AC_SUBST(WITH_V4LUTILS) -AC_SUBST(libv4l1subdir) -AC_SUBST(libv4l2subdir) -AC_SUBST(libv4lconvertsubdir) - -dnl --------------------------------------------------------------------- -dnl read Makefile.in and write Makefile -AC_OUTPUT(Makefile) -AC_OUTPUT(Make.rules) diff --git a/contrib/test/Makefile b/contrib/test/Makefile deleted file mode 100644 index 711a014c..00000000 --- a/contrib/test/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -TARGETS = ioctl-test \ - sliced-vbi-test \ - sliced-vbi-detect \ - vbi-test \ - v4lgrab \ - v4l2grab \ - driver-test \ - pixfmt-test \ - stress-buffer \ - capture-example - -all: $(TARGETS) - --include *.d - -install: - -../../utils/libv4l2util/libv4l2util.a: ../../utils/libv4l2util/v4l2_driver.c ../../utils/libv4l2util/frequencies.c - $(MAKE) -C ../../utils/libv4l2util libv4l2util.a - -../../lib/libv4l2/libv4l2.so: - $(MAKE) -C ../../lib - -driver-test: driver-test.o ../../utils/libv4l2util/libv4l2util.a - $(CC) $(LDFLAGS) -o $@ $^ - -pixfmt-test: pixfmt-test.o - $(CC) $(LDFLAGS) -o $@ $^ -lX11 - -v4l2grab: v4l2grab.o - $(CC) $(LDFLAGS) -o $@ $^ -L../../lib/libv4l2 -L../../lib/libv4lconvert -ldl -ljpeg -lrt -lm -lv4l2 -lv4lconvert - -ioctl-test: ioctl-test.o - $(CC) $(LDFLAGS) -o $@ $^ - -sliced-vbi-test: sliced-vbi-test.o - $(CC) $(LDFLAGS) -o $@ $^ - -sliced-vbi-detect: sliced-vbi-detect.o - $(CC) $(LDFLAGS) -o $@ $^ - -vbi-test: vbi-test.o - $(CC) $(LDFLAGS) -o $@ $^ - -v4lgrab: v4lgrab.o - $(CC) $(LDFLAGS) -o $@ $^ - -stress-buffer: stress-buffer.o - $(CC) $(LDFLAGS) -o $@ $^ - -capture-example: capture-example.o - $(CC) $(LDFLAGS) -o $@ $^ - -include ../../Make.rules diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h new file mode 100644 index 00000000..610e6b05 --- /dev/null +++ b/include/linux/dvb/audio.h @@ -0,0 +1,136 @@ +/* + * audio.h + * + * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de> + * & Marcus Metzler <marcus@convergence.de> + * for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Lesser Public License + * as published by the Free Software Foundation; either version 2.1 + * 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 Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _DVBAUDIO_H_ +#define _DVBAUDIO_H_ + +#include <stdint.h> + + +typedef enum { + AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */ + AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */ +} audio_stream_source_t; + + +typedef enum { + AUDIO_STOPPED, /* Device is stopped */ + AUDIO_PLAYING, /* Device is currently playing */ + AUDIO_PAUSED /* Device is paused */ +} audio_play_state_t; + + +typedef enum { + AUDIO_STEREO, + AUDIO_MONO_LEFT, + AUDIO_MONO_RIGHT, + AUDIO_MONO, + AUDIO_STEREO_SWAPPED +} audio_channel_select_t; + + +typedef struct audio_mixer { + unsigned int volume_left; + unsigned int volume_right; + // what else do we need? bass, pass-through, ... +} audio_mixer_t; + + +typedef struct audio_status { + int AV_sync_state; /* sync audio and video? */ + int mute_state; /* audio is muted */ + audio_play_state_t play_state; /* current playback state */ + audio_stream_source_t stream_source; /* current stream source */ + audio_channel_select_t channel_select; /* currently selected channel */ + int bypass_mode; /* pass on audio data to */ + audio_mixer_t mixer_state; /* current mixer state */ +} audio_status_t; /* separate decoder hardware */ + + +typedef +struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */ + int vocal1; /* into left and right t at 70% each */ + int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/ + int melody; /* mixed into the left channel and */ + /* Vocal2 into the right channel at 100% each. */ + /* if Melody is non-zero, the melody channel gets mixed*/ +} audio_karaoke_t; /* into left and right */ + + +typedef uint16_t audio_attributes_t; +/* bits: descr. */ +/* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */ +/* 12 multichannel extension */ +/* 11-10 audio type (0=not spec, 1=language included) */ +/* 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */ +/* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */ +/* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */ +/* 2- 0 number of audio channels (n+1 channels) */ + + +/* for GET_CAPABILITIES and SET_FORMAT, the latter should only set one bit */ +#define AUDIO_CAP_DTS 1 +#define AUDIO_CAP_LPCM 2 +#define AUDIO_CAP_MP1 4 +#define AUDIO_CAP_MP2 8 +#define AUDIO_CAP_MP3 16 +#define AUDIO_CAP_AAC 32 +#define AUDIO_CAP_OGG 64 +#define AUDIO_CAP_SDDS 128 +#define AUDIO_CAP_AC3 256 + +#define AUDIO_STOP _IO('o', 1) +#define AUDIO_PLAY _IO('o', 2) +#define AUDIO_PAUSE _IO('o', 3) +#define AUDIO_CONTINUE _IO('o', 4) +#define AUDIO_SELECT_SOURCE _IO('o', 5) +#define AUDIO_SET_MUTE _IO('o', 6) +#define AUDIO_SET_AV_SYNC _IO('o', 7) +#define AUDIO_SET_BYPASS_MODE _IO('o', 8) +#define AUDIO_CHANNEL_SELECT _IO('o', 9) +#define AUDIO_GET_STATUS _IOR('o', 10, audio_status_t) + +#define AUDIO_GET_CAPABILITIES _IOR('o', 11, unsigned int) +#define AUDIO_CLEAR_BUFFER _IO('o', 12) +#define AUDIO_SET_ID _IO('o', 13) +#define AUDIO_SET_MIXER _IOW('o', 14, audio_mixer_t) +#define AUDIO_SET_STREAMTYPE _IO('o', 15) +#define AUDIO_SET_EXT_ID _IO('o', 16) +#define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audio_attributes_t) +#define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t) + +/** + * AUDIO_GET_PTS + * + * Read the 33 bit presentation time stamp as defined + * in ITU T-REC-H.222.0 / ISO/IEC 13818-1. + * + * The PTS should belong to the currently played + * frame if possible, but may also be a value close to it + * like the PTS of the last decoded frame or the last PTS + * extracted by the PES parser. + */ +#define AUDIO_GET_PTS _IOR('o', 19, __u64) +#define AUDIO_BILINGUAL_CHANNEL_SELECT _IO('o', 20) + +#endif /* _DVBAUDIO_H_ */ diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h new file mode 100644 index 00000000..a5de1f30 --- /dev/null +++ b/include/linux/dvb/video.h @@ -0,0 +1,274 @@ +/* + * video.h + * + * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de> + * & Ralph Metzler <ralph@convergence.de> + * for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * 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 Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _DVBVIDEO_H_ +#define _DVBVIDEO_H_ + + +#include <asm/types.h> +#include <stdint.h> +#include <time.h> + + +typedef enum { + VIDEO_FORMAT_4_3, /* Select 4:3 format */ + VIDEO_FORMAT_16_9, /* Select 16:9 format. */ + VIDEO_FORMAT_221_1 /* 2.21:1 */ +} video_format_t; + + +typedef enum { + VIDEO_SYSTEM_PAL, + VIDEO_SYSTEM_NTSC, + VIDEO_SYSTEM_PALN, + VIDEO_SYSTEM_PALNc, + VIDEO_SYSTEM_PALM, + VIDEO_SYSTEM_NTSC60, + VIDEO_SYSTEM_PAL60, + VIDEO_SYSTEM_PALM60 +} video_system_t; + + +typedef enum { + VIDEO_PAN_SCAN, /* use pan and scan format */ + VIDEO_LETTER_BOX, /* use letterbox format */ + VIDEO_CENTER_CUT_OUT /* use center cut out format */ +} video_displayformat_t; + +typedef struct { + int w; + int h; + video_format_t aspect_ratio; +} video_size_t; + +typedef enum { + VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */ + VIDEO_SOURCE_MEMORY /* If this source is selected, the stream + comes from the user through the write + system call */ +} video_stream_source_t; + + +typedef enum { + VIDEO_STOPPED, /* Video is stopped */ + VIDEO_PLAYING, /* Video is currently playing */ + VIDEO_FREEZED /* Video is freezed */ +} video_play_state_t; + + +/* Decoder commands */ +#define VIDEO_CMD_PLAY (0) +#define VIDEO_CMD_STOP (1) +#define VIDEO_CMD_FREEZE (2) +#define VIDEO_CMD_CONTINUE (3) + +/* Flags for VIDEO_CMD_FREEZE */ +#define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0) + +/* Flags for VIDEO_CMD_STOP */ +#define VIDEO_CMD_STOP_TO_BLACK (1 << 0) +#define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1) + +/* Play input formats: */ +/* The decoder has no special format requirements */ +#define VIDEO_PLAY_FMT_NONE (0) +/* The decoder requires full GOPs */ +#define VIDEO_PLAY_FMT_GOP (1) + +/* The structure must be zeroed before use by the application + This ensures it can be extended safely in the future. */ +struct video_command { + __u32 cmd; + __u32 flags; + union { + struct { + __u64 pts; + } stop; + + struct { + /* 0 or 1000 specifies normal speed, + 1 specifies forward single stepping, + -1 specifies backward single stepping, + >1: playback at speed/1000 of the normal speed, + <-1: reverse playback at (-speed/1000) of the normal speed. */ + __s32 speed; + __u32 format; + } play; + + struct { + __u32 data[16]; + } raw; + }; +}; + +/* FIELD_UNKNOWN can be used if the hardware does not know whether + the Vsync is for an odd, even or progressive (i.e. non-interlaced) + field. */ +#define VIDEO_VSYNC_FIELD_UNKNOWN (0) +#define VIDEO_VSYNC_FIELD_ODD (1) +#define VIDEO_VSYNC_FIELD_EVEN (2) +#define VIDEO_VSYNC_FIELD_PROGRESSIVE (3) + +struct video_event { + int32_t type; +#define VIDEO_EVENT_SIZE_CHANGED 1 +#define VIDEO_EVENT_FRAME_RATE_CHANGED 2 +#define VIDEO_EVENT_DECODER_STOPPED 3 +#define VIDEO_EVENT_VSYNC 4 + time_t timestamp; + union { + video_size_t size; + unsigned int frame_rate; /* in frames per 1000sec */ + unsigned char vsync_field; /* unknown/odd/even/progressive */ + } u; +}; + + +struct video_status { + int video_blank; /* blank video on freeze? */ + video_play_state_t play_state; /* current state of playback */ + video_stream_source_t stream_source; /* current source (demux/memory) */ + video_format_t video_format; /* current aspect ratio of stream*/ + video_displayformat_t display_format;/* selected cropping mode */ +}; + + +struct video_still_picture { + char *iFrame; /* pointer to a single iframe in memory */ + int32_t size; +}; + + +typedef +struct video_highlight { + int active; /* 1=show highlight, 0=hide highlight */ + uint8_t contrast1; /* 7- 4 Pattern pixel contrast */ + /* 3- 0 Background pixel contrast */ + uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */ + /* 3- 0 Emphasis pixel-1 contrast */ + uint8_t color1; /* 7- 4 Pattern pixel color */ + /* 3- 0 Background pixel color */ + uint8_t color2; /* 7- 4 Emphasis pixel-2 color */ + /* 3- 0 Emphasis pixel-1 color */ + uint32_t ypos; /* 23-22 auto action mode */ + /* 21-12 start y */ + /* 9- 0 end y */ + uint32_t xpos; /* 23-22 button color number */ + /* 21-12 start x */ + /* 9- 0 end x */ +} video_highlight_t; + + +typedef struct video_spu { + int active; + int stream_id; +} video_spu_t; + + +typedef struct video_spu_palette { /* SPU Palette information */ + int length; + uint8_t *palette; +} video_spu_palette_t; + + +typedef struct video_navi_pack { + int length; /* 0 ... 1024 */ + uint8_t data[1024]; +} video_navi_pack_t; + + +typedef uint16_t video_attributes_t; +/* bits: descr. */ +/* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */ +/* 13-12 TV system (0=525/60, 1=625/50) */ +/* 11-10 Aspect ratio (0=4:3, 3=16:9) */ +/* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */ +/* 7 line 21-1 data present in GOP (1=yes, 0=no) */ +/* 6 line 21-2 data present in GOP (1=yes, 0=no) */ +/* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */ +/* 2 source letterboxed (1=yes, 0=no) */ +/* 0 film/camera mode (0=camera, 1=film (625/50 only)) */ + + +/* bit definitions for capabilities: */ +/* can the hardware decode MPEG1 and/or MPEG2? */ +#define VIDEO_CAP_MPEG1 1 +#define VIDEO_CAP_MPEG2 2 +/* can you send a system and/or program stream to video device? + (you still have to open the video and the audio device but only + send the stream to the video device) */ +#define VIDEO_CAP_SYS 4 +#define VIDEO_CAP_PROG 8 +/* can the driver also handle SPU, NAVI and CSS encoded data? + (CSS API is not present yet) */ +#define VIDEO_CAP_SPU 16 +#define VIDEO_CAP_NAVI 32 +#define VIDEO_CAP_CSS 64 + + +#define VIDEO_STOP _IO('o', 21) +#define VIDEO_PLAY _IO('o', 22) +#define VIDEO_FREEZE _IO('o', 23) +#define VIDEO_CONTINUE _IO('o', 24) +#define VIDEO_SELECT_SOURCE _IO('o', 25) +#define VIDEO_SET_BLANK _IO('o', 26) +#define VIDEO_GET_STATUS _IOR('o', 27, struct video_status) +#define VIDEO_GET_EVENT _IOR('o', 28, struct video_event) +#define VIDEO_SET_DISPLAY_FORMAT _IO('o', 29) +#define VIDEO_STILLPICTURE _IOW('o', 30, struct video_still_picture) +#define VIDEO_FAST_FORWARD _IO('o', 31) +#define VIDEO_SLOWMOTION _IO('o', 32) +#define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int) +#define VIDEO_CLEAR_BUFFER _IO('o', 34) +#define VIDEO_SET_ID _IO('o', 35) +#define VIDEO_SET_STREAMTYPE _IO('o', 36) +#define VIDEO_SET_FORMAT _IO('o', 37) +#define VIDEO_SET_SYSTEM _IO('o', 38) +#define VIDEO_SET_HIGHLIGHT _IOW('o', 39, video_highlight_t) +#define VIDEO_SET_SPU _IOW('o', 50, video_spu_t) +#define VIDEO_SET_SPU_PALETTE _IOW('o', 51, video_spu_palette_t) +#define VIDEO_GET_NAVI _IOR('o', 52, video_navi_pack_t) +#define VIDEO_SET_ATTRIBUTES _IO('o', 53) +#define VIDEO_GET_SIZE _IOR('o', 55, video_size_t) +#define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int) + +/** + * VIDEO_GET_PTS + * + * Read the 33 bit presentation time stamp as defined + * in ITU T-REC-H.222.0 / ISO/IEC 13818-1. + * + * The PTS should belong to the currently played + * frame if possible, but may also be a value close to it + * like the PTS of the last decoded frame or the last PTS + * extracted by the PES parser. + */ +#define VIDEO_GET_PTS _IOR('o', 57, __u64) + +/* Read the number of displayed frames since the decoder was started */ +#define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64) + +#define VIDEO_COMMAND _IOWR('o', 59, struct video_command) +#define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command) + +#endif /*_DVBVIDEO_H_*/ diff --git a/lib/Makefile b/lib/Makefile deleted file mode 100644 index a61c9eaf..00000000 --- a/lib/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -all install: - $(MAKE) -C libv4lconvert $@ - $(MAKE) -C libv4l2 $@ - $(MAKE) -C libv4l1 $@ - -clean:: - rm -f include/*~ - $(MAKE) -C libv4lconvert $@ - $(MAKE) -C libv4l2 $@ - $(MAKE) -C libv4l1 $@ - -include ../Make.rules diff --git a/lib/libv4l1/Makefile b/lib/libv4l1/Makefile deleted file mode 100644 index 5ea35319..00000000 --- a/lib/libv4l1/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -override CPPFLAGS += -I../include -fvisibility=hidden - -LIBS_libv4l1 = -lpthread - -V4L1_OBJS = libv4l1.o log.o -V4L1COMPAT = v4l1compat.so -V4L1COMPAT_O = v4l1compat.o libv4l1.so -TARGETS = $(V4L1_LIB) libv4l1.pc -INCLUDES = ../include/libv4l1.h ../include/libv4l1-videodev.h - -ifeq ($(LINKTYPE),static) -V4L1_LIB = libv4l1.a -V4L1_DEPS = $(V4L1_OBJS) -else -V4L1_LIB = libv4l1.so -V4L1_DEPS += $(V4L1_OBJS) ../libv4l2/libv4l2.so -TARGETS += $(V4L1COMPAT) -override CPPFLAGS += -fPIC -endif - -# This is the soname version -LIB_RELEASE = 0 - -all: $(TARGETS) - --include $(V4L1_OBJS:.o=.d) - -$(V4L1_LIB): $(V4L1_DEPS) - -$(V4L1COMPAT): $(V4L1COMPAT_O) $(V4L1_LIB) - -libv4l1.pc: - @echo prefix=$(PREFIX) > libv4l1.pc - @echo libdir=$(LIBDIR) >> libv4l1.pc - @echo >> libv4l1.pc - @echo 'Name: libv4l1' >> libv4l1.pc - @echo 'Description: v4l1 compatibility library' >> libv4l1.pc - @echo 'Version: '$(V4L_UTILS_VERSION) >> libv4l1.pc - @echo 'Requires.private: libv4l2' >> libv4l1.pc - @echo 'Libs: -L$${libdir} -lv4l1' >> libv4l1.pc - @echo 'Libs.private: '$(LIBS_libv4l1) >> libv4l1.pc - @echo 'Cflags: -I$${prefix}/include' >> libv4l1.pc - -install: all - mkdir -p $(DESTDIR)$(PREFIX)/include - install -p -m 644 $(INCLUDES) $(DESTDIR)$(PREFIX)/include -ifeq ($(LINKTYPE),static) - mkdir -p $(DESTDIR)$(LIBDIR) - install -m 644 $(V4L1_LIB) $(DESTDIR)$(LIBDIR) -else - mkdir -p $(DESTDIR)$(LIBV4L1SUBDIR) - install -m 755 $(V4L1_LIB).$(LIB_RELEASE) $(DESTDIR)$(LIBDIR) - cd $(DESTDIR)$(LIBDIR) && \ - ln -f -s $(V4L1_LIB).$(LIB_RELEASE) $(V4L1_LIB) - install -m 755 $(V4L1COMPAT).$(LIB_RELEASE) \ - $(DESTDIR)$(LIBV4L1SUBDIR)/$(V4L1COMPAT) -endif - mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig - install -m 644 libv4l1.pc $(DESTDIR)$(LIBDIR)/pkgconfig - -include ../../Make.rules diff --git a/lib/libv4l1/Makefile.am b/lib/libv4l1/Makefile.am new file mode 100644 index 00000000..321789c8 --- /dev/null +++ b/lib/libv4l1/Makefile.am @@ -0,0 +1,21 @@ +if WITH_LIBV4L +lib_LTLIBRARIES = libv4l1.la +include_HEADERS = ../include/libv4l1.h ../include/libv4l1-videodev.h +libv4l1priv_LTLIBRARIES = v4l1compat.la +pkgconfig_DATA = libv4l1.pc +else +noinst_LTLIBRARIES = libv4l1.la +endif + +libv4l1_la_SOURCES = libv4l1.c log.c libv4l1-priv.h +libv4l1_la_CPPFLAGS = -fvisibility=hidden $(ENFORCE_LIBV4L_STATIC) +libv4l1_la_LDFLAGS = -version-info 0 -lpthread $(ENFORCE_LIBV4L_STATIC) +libv4l1_la_LIBADD = ../libv4l2/libv4l2.la + +v4l1compat_la_SOURCES = v4l1compat.c + +v4l1compat_la_LIBADD = libv4l1.la +v4l1compat_la_LDFLAGS = -avoid-version -module -shared -export-dynamic +v4l1compat_la_LIBTOOLFLAGS = --tag=disable-static + +EXTRA_DIST = libv4l1-kernelcode-license.txt diff --git a/lib/libv4l1/libv4l1.pc.in b/lib/libv4l1/libv4l1.pc.in new file mode 100644 index 00000000..b4d74537 --- /dev/null +++ b/lib/libv4l1/libv4l1.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ +libdir=@libdir@ + +Name: libv4l1 +Description: v4l1 compatibility library +Version: @PACKAGE_VERSION@ +Requires.private: libv4l2 +Libs: -L${libdir} -lv4l1 +Libs.private: -lpthread +Cflags: -I${includedir} diff --git a/lib/libv4l2/Makefile b/lib/libv4l2/Makefile deleted file mode 100644 index aadd7bc7..00000000 --- a/lib/libv4l2/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -override CPPFLAGS += -I../include -fvisibility=hidden - -LIBS_libv4l2 = -lpthread -ldl - -V4L2_OBJS = libv4l2.o v4l2-plugin.o log.o -V4L2CONVERT = v4l2convert.so -V4L2CONVERT_O = v4l2convert.o libv4l2.so -TARGETS = $(V4L2_LIB) libv4l2.pc -INCLUDES = ../include/libv4l2.h ../include/libv4l2-plugin.h - -ifeq ($(LINKTYPE),static) -V4L2_LIB = libv4l2.a -V4L2_DEPS = $(V4L2_OBJS) -else -V4L2_LIB = libv4l2.so -V4L2_DEPS += $(V4L2_OBJS) ../libv4lconvert/libv4lconvert.so -TARGETS += $(V4L2CONVERT) -override CPPFLAGS += -fPIC -endif - -override CPPFLAGS += -DLIBDIR='"$(LIBDIR)"' - -# This is the soname version -LIB_RELEASE = 0 - -all: $(TARGETS) - --include $(V4L2_OBJS:.o=.d) - -$(V4L2_LIB): $(V4L2_DEPS) - -$(V4L2CONVERT): $(V4L2CONVERT_O) $(V4L2_LIB) - -libv4l2.pc: - @echo prefix=$(PREFIX) > libv4l2.pc - @echo libdir=$(LIBDIR) >> libv4l2.pc - @echo >> libv4l2.pc - @echo 'Name: libv4l2' >> libv4l2.pc - @echo 'Description: v4l2 device access library' >> libv4l2.pc - @echo 'Version: '$(V4L_UTILS_VERSION) >> libv4l2.pc - @echo 'Requires.private: libv4lconvert' >> libv4l2.pc - @echo 'Libs: -L$${libdir} -lv4l2' >> libv4l2.pc - @echo 'Libs.private: '$(LIBS_libv4l2) >> libv4l2.pc - @echo 'Cflags: -I$${prefix}/include' >> libv4l2.pc - -install: all - mkdir -p $(DESTDIR)$(PREFIX)/include - install -p -m 644 $(INCLUDES) $(DESTDIR)$(PREFIX)/include -ifeq ($(LINKTYPE),static) - mkdir -p $(DESTDIR)$(LIBDIR) - install -m 644 $(V4L2_LIB) $(DESTDIR)$(LIBDIR) -else - mkdir -p $(DESTDIR)$(LIBV4L2SUBDIR) - install -m 755 $(V4L2_LIB).$(LIB_RELEASE) $(DESTDIR)$(LIBDIR) - cd $(DESTDIR)$(LIBDIR) && \ - ln -f -s $(V4L2_LIB).$(LIB_RELEASE) $(V4L2_LIB) - install -m 755 $(V4L2CONVERT).$(LIB_RELEASE) \ - $(DESTDIR)$(LIBV4L2SUBDIR)/$(V4L2CONVERT) -endif - mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig - install -m 644 libv4l2.pc $(DESTDIR)$(LIBDIR)/pkgconfig - -include ../../Make.rules diff --git a/lib/libv4l2/Makefile.am b/lib/libv4l2/Makefile.am new file mode 100644 index 00000000..facf2ab4 --- /dev/null +++ b/lib/libv4l2/Makefile.am @@ -0,0 +1,18 @@ +if WITH_LIBV4L +lib_LTLIBRARIES = libv4l2.la +include_HEADERS = ../include/libv4l2.h ../include/libv4l2-plugin.h +libv4l2priv_LTLIBRARIES = v4l2convert.la +pkgconfig_DATA = libv4l2.pc +else +noinst_LTLIBRARIES = libv4l2.la +endif + +libv4l2_la_SOURCES = libv4l2.c v4l2-plugin.c log.c libv4l2-priv.h +libv4l2_la_CPPFLAGS = -fvisibility=hidden $(ENFORCE_LIBV4L_STATIC) +libv4l2_la_LDFLAGS = -version-info 0 -lpthread -ldl $(ENFORCE_LIBV4L_STATIC) +libv4l2_la_LIBADD = ../libv4lconvert/libv4lconvert.la + +v4l2convert_la_SOURCES = v4l2convert.c +v4l2convert_la_LIBADD = libv4l2.la +v4l2convert_la_LDFLAGS = -avoid-version -module -shared -export-dynamic +v4l2convert_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/lib/libv4l2/libv4l2.pc.in b/lib/libv4l2/libv4l2.pc.in new file mode 100644 index 00000000..37ba4fe5 --- /dev/null +++ b/lib/libv4l2/libv4l2.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ +libdir=@libdir@ + +Name: libv4l2 +Description: v4l2 device access library +Version: @PACKAGE_VERSION@ +Requires.private: libv4lconvert +Libs: -L${libdir} -lv4l2 +Libs.private: -lpthread +Cflags: -I${includedir} diff --git a/lib/libv4l2/v4l2-plugin.c b/lib/libv4l2/v4l2-plugin.c index 0b74d2e6..2e093c6a 100644 --- a/lib/libv4l2/v4l2-plugin.c +++ b/lib/libv4l2/v4l2-plugin.c @@ -16,6 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <config.h> #include <stdarg.h> #include <dlfcn.h> #include <fcntl.h> @@ -45,7 +46,7 @@ and if it was not then v4l2_* functions proceed with their usual behavior. */ -#define PLUGINS_PATTERN LIBDIR "/libv4l/plugins/*.so" +#define PLUGINS_PATTERN LIBV4L2_PLUGIN_DIR "/*.so" static void *dev_init(int fd) { diff --git a/lib/libv4lconvert/Makefile b/lib/libv4lconvert/Makefile deleted file mode 100644 index 7826438b..00000000 --- a/lib/libv4lconvert/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -override CPPFLAGS += -I../include -fvisibility=hidden - -LIBS_libv4lconvert = -lrt -lm -ljpeg - -ifeq ($(LINKTYPE),static) -CONVERT_LIB = libv4lconvert.a -else -CONVERT_LIB = libv4lconvert.so -override CPPFLAGS += -fPIC -endif - -CONVERT_OBJS = libv4lconvert.o tinyjpeg.o sn9c10x.o sn9c20x.o pac207.o \ - jl2005bcd.o \ - mr97310a.o flip.o crop.o jidctflt.o spca561-decompress.o \ - rgbyuv.o sn9c2028-decomp.o spca501.o sq905c.o bayer.o hm12.o \ - stv0680.o cpia1.o se401.o jpgl.o jpeg.o jpeg_memsrcdest.o \ - control/libv4lcontrol.o processing/libv4lprocessing.o \ - processing/whitebalance.o processing/autogain.o \ - processing/gamma.o helper.o -TARGETS = $(CONVERT_LIB) libv4lconvert.pc ov511-decomp ov518-decomp -INCLUDES = ../include/libv4lconvert.h - -override CPPFLAGS += -DLIBV4LCONVERTSUBDIR=\"$(LIBV4LCONVERTSUBDIR)\" - -# This is the soname version -LIB_RELEASE = 1 - -all: $(TARGETS) - --include $(CONVERT_OBJS:.o=.d) - -$(CONVERT_LIB): $(CONVERT_OBJS) - -libv4lconvert.pc: - @echo prefix=$(PREFIX) > libv4lconvert.pc - @echo libdir=$(LIBDIR) >> libv4lconvert.pc - @echo >> libv4lconvert.pc - @echo 'Name: libv4lconvert' >> libv4lconvert.pc - @echo 'Description: v4l format conversion library' >> libv4lconvert.pc - @echo 'Version: '$(V4L_UTILS_VERSION) >> libv4lconvert.pc - @echo 'Libs: -L$${libdir} -lv4lconvert' >> libv4lconvert.pc - @echo 'Libs.private: '$(LIBS_libv4lconvert) >> libv4lconvert.pc - @echo 'Cflags: -I$${prefix}/include' >> libv4lconvert.pc - -install: all - mkdir -p $(DESTDIR)$(PREFIX)/include - install -p -m 644 $(INCLUDES) $(DESTDIR)$(PREFIX)/include - mkdir -p $(DESTDIR)$(LIBV4LCONVERTSUBDIR) -ifeq ($(LINKTYPE),static) - install -m 644 $(CONVERT_LIB) $(DESTDIR)$(LIBDIR) -else - install -m 755 $(CONVERT_LIB).$(LIB_RELEASE) $(DESTDIR)$(LIBDIR) - cd $(DESTDIR)$(LIBDIR) && \ - ln -f -s $(CONVERT_LIB).$(LIB_RELEASE) $(CONVERT_LIB) -endif - install -m 755 *-decomp $(DESTDIR)$(LIBV4LCONVERTSUBDIR) - mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig - install -m 644 libv4lconvert.pc $(DESTDIR)$(LIBDIR)/pkgconfig - -clean:: - rm -f */*~ */*.o */*.d */*.orig */*.rej */DEADJOE - -ov511-decomp: ov511-decomp.o -ov518-decomp: ov518-decomp.o - -include ../../Make.rules diff --git a/lib/libv4lconvert/Makefile.am b/lib/libv4lconvert/Makefile.am new file mode 100644 index 00000000..3744cc31 --- /dev/null +++ b/lib/libv4lconvert/Makefile.am @@ -0,0 +1,29 @@ +if WITH_LIBV4L +lib_LTLIBRARIES = libv4lconvert.la +libv4lconvertpriv_PROGRAMS = ov511-decomp ov518-decomp +include_HEADERS = ../include/libv4lconvert.h +pkgconfig_DATA = libv4lconvert.pc +else +noinst_LTLIBRARIES = libv4lconvert.la +endif + +libv4lconvert_la_SOURCES = \ + libv4lconvert.c tinyjpeg.c sn9c10x.c sn9c20x.c pac207.c mr97310a.c \ + flip.c crop.c jidctflt.c spca561-decompress.c \ + rgbyuv.c sn9c2028-decomp.c spca501.c sq905c.c bayer.c hm12.c \ + stv0680.c cpia1.c se401.c jpgl.c jpeg.c jl2005bcd.c \ + control/libv4lcontrol.c control/libv4lcontrol.h control/libv4lcontrol-priv.h \ + processing/libv4lprocessing.c processing/whitebalance.c processing/autogain.c \ + processing/gamma.c processing/libv4lprocessing.h processing/libv4lprocessing-priv.h \ + helper.c helper-funcs.h libv4lconvert-priv.h libv4lsyscall-priv.h \ + tinyjpeg.h tinyjpeg-internal.h +if HAVE_JPEG +libv4lconvert_la_SOURCES += jpeg_memsrcdest.c jpeg_memsrcdest.h +endif +libv4lconvert_la_CPPFLAGS = -fvisibility=hidden $(ENFORCE_LIBV4L_STATIC) +libv4lconvert_la_LDFLAGS = -version-info 1 -lrt -lm $(JPEG_LIBS) $(ENFORCE_LIBV4L_STATIC) + +ov511_decomp_SOURCES = ov511-decomp.c + +ov518_decomp_SOURCES = ov518-decomp.c + diff --git a/lib/libv4lconvert/jpeg.c b/lib/libv4lconvert/jpeg.c index c7e20ccd..e088a908 100644 --- a/lib/libv4lconvert/jpeg.c +++ b/lib/libv4lconvert/jpeg.c @@ -16,10 +16,13 @@ # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ +#include <config.h> #include <errno.h> #include <stdlib.h> #include "libv4lconvert-priv.h" +#ifdef HAVE_JPEG #include "jpeg_memsrcdest.h" +#endif int v4lconvert_decode_jpeg_tinyjpeg(struct v4lconvert_data *data, unsigned char *src, int src_size, unsigned char *dest, @@ -107,6 +110,8 @@ int v4lconvert_decode_jpeg_tinyjpeg(struct v4lconvert_data *data, return 0; } +#ifdef HAVE_JPEG + static void jerr_error_exit(j_common_ptr cinfo) { struct v4lconvert_data *data = cinfo->client_data; @@ -405,3 +410,5 @@ int v4lconvert_decode_jpeg_libjpeg(struct v4lconvert_data *data, return result; } + +#endif // HAVE_JPEG diff --git a/lib/libv4lconvert/libv4lconvert-priv.h b/lib/libv4lconvert/libv4lconvert-priv.h index 98523193..dc1fea02 100644 --- a/lib/libv4lconvert/libv4lconvert-priv.h +++ b/lib/libv4lconvert/libv4lconvert-priv.h @@ -19,10 +19,13 @@ #ifndef __LIBV4LCONVERT_PRIV_H #define __LIBV4LCONVERT_PRIV_H +#include <config.h> #include <stdio.h> #include <stdint.h> #include <sys/types.h> +#ifdef HAVE_JPEG #include <jpeglib.h> +#endif #include <setjmp.h> #include "libv4lconvert.h" #include "control/libv4lcontrol.h" @@ -50,11 +53,13 @@ struct v4lconvert_data { int64_t supported_src_formats; /* bitfield */ char error_msg[V4LCONVERT_ERROR_MSG_SIZE]; struct jdec_private *tinyjpeg; +#ifdef HAVE_JPEG struct jpeg_error_mgr jerr; int jerr_errno; jmp_buf jerr_jmp_state; struct jpeg_decompress_struct cinfo; int cinfo_initialized; +#endif // HAVE_JPEG struct v4l2_frmsizeenum framesizes[V4LCONVERT_MAX_FRAMESIZES]; unsigned int no_framesizes; int bandwidth; diff --git a/lib/libv4lconvert/libv4lconvert.c b/lib/libv4lconvert/libv4lconvert.c index da146bc8..d2b069b0 100644 --- a/lib/libv4lconvert/libv4lconvert.c +++ b/lib/libv4lconvert/libv4lconvert.c @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ +#include <config.h> #include <errno.h> #include <string.h> #include <stdlib.h> @@ -195,8 +196,10 @@ void v4lconvert_destroy(struct v4lconvert_data *data) tinyjpeg_set_components(data->tinyjpeg, comps, 3); tinyjpeg_free(data->tinyjpeg); } +#ifdef HAVE_JPEG if (data->cinfo_initialized) jpeg_destroy_decompress(&data->cinfo); +#endif // HAVE_JPEG v4lconvert_helper_cleanup(data); free(data->convert1_buf); free(data->convert2_buf); @@ -646,10 +649,13 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data *data, /* JPG and variants */ case V4L2_PIX_FMT_MJPEG: case V4L2_PIX_FMT_JPEG: +#ifdef HAVE_JPEG if (data->flags & V4LCONVERT_USE_TINYJPEG) { +#endif // HAVE_JPEG result = v4lconvert_decode_jpeg_tinyjpeg(data, src, src_size, dest, fmt, dest_pix_fmt, 0); +#ifdef HAVE_JPEG } else { result = v4lconvert_decode_jpeg_libjpeg(data, src, src_size, dest, @@ -664,6 +670,7 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data *data, fmt, dest_pix_fmt, 0); } } +#endif // HAVE_JPEG break; case V4L2_PIX_FMT_PJPG: result = v4lconvert_decode_jpeg_tinyjpeg(data, src, src_size, @@ -736,7 +743,7 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data *data, } break; case V4L2_PIX_FMT_OV511: - if (v4lconvert_helper_decompress(data, LIBV4LCONVERTSUBDIR "/ov511-decomp", + if (v4lconvert_helper_decompress(data, LIBV4LCONVERT_PRIV_DIR "/ov511-decomp", src, src_size, d, d_size, width, height, yvu)) { /* Corrupt frame, better get another one */ errno = EAGAIN; @@ -744,7 +751,7 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data *data, } break; case V4L2_PIX_FMT_OV518: - if (v4lconvert_helper_decompress(data, LIBV4LCONVERTSUBDIR "/ov518-decomp", + if (v4lconvert_helper_decompress(data, LIBV4LCONVERT_PRIV_DIR "/ov518-decomp", src, src_size, d, d_size, width, height, yvu)) { /* Corrupt frame, better get another one */ errno = EAGAIN; diff --git a/lib/libv4lconvert/libv4lconvert.pc.in b/lib/libv4lconvert/libv4lconvert.pc.in new file mode 100644 index 00000000..2b65d8b8 --- /dev/null +++ b/lib/libv4lconvert/libv4lconvert.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ +libdir=@libdir@ + +Name: libv4lconvert +Description: v4l format conversion library +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lv4lconvert +Libs.private: -lrt -lm @JPEG_LIBS@ +Cflags: -I${includedir} diff --git a/m4/ac_define_dir.m4 b/m4/ac_define_dir.m4 new file mode 100644 index 00000000..e15cea2c --- /dev/null +++ b/m4/ac_define_dir.m4 @@ -0,0 +1,34 @@ +dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) +dnl +dnl This macro sets VARNAME to the expansion of the DIR variable, +dnl taking care of fixing up ${prefix} and such. +dnl +dnl VARNAME is then offered as both an output variable and a C +dnl preprocessor symbol. +dnl +dnl Example: +dnl +dnl AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) +dnl +dnl @category Misc +dnl @author Stepan Kasal <kasal@ucw.cz> +dnl @author Andreas Schwab <schwab@suse.de> +dnl @author Guido U. Draheim <guidod@gmx.de> +dnl @author Alexandre Oliva +dnl @version 2006-10-13 +dnl @license AllPermissive + +AC_DEFUN([AC_DEFINE_DIR], [ + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix +dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn +dnl refers to ${prefix}. Thus we have to use `eval' twice. + eval ac_define_dir="\"[$]$2\"" + eval ac_define_dir="\"$ac_define_dir\"" + AC_SUBST($1, "$ac_define_dir") + AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE +]) diff --git a/makefile b/makefile deleted file mode 100644 index d43baeef..00000000 --- a/makefile +++ /dev/null @@ -1,23 +0,0 @@ -.PHONY: default configure distclean - -ifeq ($(wildcard configure),) -default: configure -else -default: all -endif - -configure: - @set -ex; autoconf - @rm -rf autom4te.cache - @echo "*** You should now run ./configure or make ***" -distclean: - -$(MAKE) -f Makefile clean - -rm Makefile Make.rules configure config.h v4l-utils.spec - --include Makefile - -ifeq ($(wildcard Makefile),) -all: - ./configure - @$(MAKE) -f Makefile all -endif diff --git a/utils/Makefile b/utils/Makefile deleted file mode 100644 index 014b82df..00000000 --- a/utils/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -SUBDIRS=libv4l2util libmedia_dev decode_tm6000 keytable rds v4l2-compliance v4l2-ctl v4l2-dbg v4l2-sysfs-path xc3028-firmware dvb - -all install: - @for i in $(SUBDIRS); do \ - $(MAKE) -C $$i $@ || exit 1; \ - done - - # Test whether qmake is installed, and whether it is for qt4. - @if which qmake-qt4 >/dev/null 2>&1; then \ - QMAKE=qmake-qt4; \ - else \ - QMAKE=qmake; \ - fi; \ - if which $$QMAKE >/dev/null 2>&1; then \ - if $$QMAKE --version 2>&1 | grep '4\.[0-9][0-9]*\.[0-9][0-9]*' >/dev/null; then \ - if [ ! -f qv4l2/Makefile ]; then \ - (cd qv4l2 && $$QMAKE) || exit 1; \ - fi; \ - $(MAKE) -C qv4l2 -f Makefile.install $@; \ - fi \ - fi - -sync-with-kernel: - $(MAKE) -C keytable $@ - $(MAKE) -C v4l2-dbg $@ - $(MAKE) -C xc3028-firmware $@ - -clean:: - @for i in $(SUBDIRS); do \ - $(MAKE) -C $$i $@; \ - done - $(MAKE) -C v4l2-sysfs-path $@ - if [ -f qv4l2/Makefile ]; then $(MAKE) -C qv4l2 $@; fi - rm -f qv4l2/Makefile qv4l2/qv4l2 - -include ../Make.rules diff --git a/utils/decode_tm6000/Makefile b/utils/decode_tm6000/Makefile deleted file mode 100644 index 3a0da79e..00000000 --- a/utils/decode_tm6000/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -TARGETS = decode_tm6000 - -all: $(TARGETS) - --include *.d - -decode_tm6000: decode_tm6000.o ../libv4l2util/libv4l2util.a - $(CC) $(LDFLAGS) -o $@ $^ - -install: $(TARGETS) - mkdir -p $(DESTDIR)$(PREFIX)/bin - install -m 755 $(TARGETS) $(DESTDIR)$(PREFIX)/bin - -include ../../Make.rules diff --git a/utils/decode_tm6000/Makefile.am b/utils/decode_tm6000/Makefile.am new file mode 100644 index 00000000..bc99bcfb --- /dev/null +++ b/utils/decode_tm6000/Makefile.am @@ -0,0 +1,3 @@ +bin_PROGRAMS = decode_tm6000 +decode_tm6000_SOURCES = decode_tm6000.c +decode_tm6000_LDADD = ../libv4l2util/libv4l2util.la diff --git a/utils/dvb/.gitignore b/utils/dvb/.gitignore new file mode 100644 index 00000000..36060a85 --- /dev/null +++ b/utils/dvb/.gitignore @@ -0,0 +1,4 @@ +dvb-fe-tool +dvb-format-convert +dvbv5-scan +dvbv5-zap diff --git a/utils/dvb/Makefile b/utils/dvb/Makefile deleted file mode 100644 index 534a292c..00000000 --- a/utils/dvb/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -TARGETS = dvb-fe-tool dvbv5-zap dvbv5-scan dvb-format-convert - -all: $(TARGETS) - --include *.d - -dvb-fe-tool: dvb-fe-tool.o dvb-fe.o libsat.o -dvbv5-zap: dvbv5-zap.o dvb-fe.o dvb-demux.o dvb-file.o \ - dvb-zap-format.o dvb-legacy-channel-format.o \ - libsat.o -dvbv5-scan: dvbv5-scan.o dvb-fe.o dvb-demux.o dvb-file.o \ - dvb-zap-format.o dvb-legacy-channel-format.o \ - parse_string.o descriptors.o libscan.o \ - libsat.o - -dvb-format-convert: dvb-format-convert.o dvb-file.o \ - dvb-zap-format.o dvb-legacy-channel-format.o \ - dvb-fe.o libsat.o - - - $(CC) $(LDFLAGS) -o $@ $^ - -dvb-v5.h: - ./gen_dvb_structs.pl $(KERNEL_DIR)/include/ - -include ../../Make.rules - -install: $(TARGETS) - mkdir -p $(DESTDIR)$(PREFIX)/bin - install -m 755 $(TARGETS) $(DESTDIR)$(PREFIX)/bin diff --git a/utils/dvb/Makefile.am b/utils/dvb/Makefile.am new file mode 100644 index 00000000..dae7b3f4 --- /dev/null +++ b/utils/dvb/Makefile.am @@ -0,0 +1,33 @@ +bin_PROGRAMS = dvb-fe-tool dvbv5-zap dvbv5-scan dvb-format-convert +noinst_LTLIBRARIES = libdvbv5.la + +libdvbv5_la_SOURCES = \ + dvb-demux.c dvb-demux.h \ + dvb-fe.c dvb-fe.h \ + dvb-file.c dvb-file.h \ + dvb_frontend.h dvb-v5.h dvb-v5-std.h \ + dvb-legacy-channel-format.c \ + dvb-zap-format.c \ + descriptors.c descriptors.h \ + libsat.c libsat.h \ + libscan.c libscan.h \ + parse_string.c parse_string.h +libdvbv5_la_CPPFLAGS = -static +libdvbv5_la_LDFLAGS = -static + +dvb_fe_tool_SOURCES = dvb-fe-tool.c +dvb_fe_tool_LDADD = libdvbv5.la + +dvbv5_zap_SOURCES = dvbv5-zap.c +dvbv5_zap_LDADD = libdvbv5.la + +dvbv5_scan_SOURCES = dvbv5-scan.c +dvbv5_scan_LDADD = libdvbv5.la + +dvb_format_convert_SOURCES = dvb-format-convert.c +dvb_format_convert_LDADD = libdvbv5.la + +EXTRA_DIST = README gen_dvb_structs.pl + +sync-with-kernel: + ./gen_dvb_structs.pl $(KERNEL_DIR)/include/ diff --git a/utils/dvb/dvb-fe-tool.c b/utils/dvb/dvb-fe-tool.c index 4ae2f722..18c2988d 100644 --- a/utils/dvb/dvb-fe-tool.c +++ b/utils/dvb/dvb-fe-tool.c @@ -3,6 +3,7 @@ */ #include "dvb-fe.h" +#include <config.h> #include <argp.h> #include <stdlib.h> #include <stdio.h> diff --git a/utils/dvb/dvbv5-scan.c b/utils/dvb/dvbv5-scan.c index 030d153f..e5105539 100644 --- a/utils/dvb/dvbv5-scan.c +++ b/utils/dvb/dvbv5-scan.c @@ -40,6 +40,8 @@ #include <sys/time.h> #include <argp.h> +#include <config.h> + #include <linux/dvb/dmx.h> #include "dvb-file.h" #include "dvb-demux.h" diff --git a/utils/dvb/dvbv5-zap.c b/utils/dvb/dvbv5-zap.c index 739362b0..e468ded9 100644 --- a/utils/dvb/dvbv5-zap.c +++ b/utils/dvb/dvbv5-zap.c @@ -37,6 +37,8 @@ #include <signal.h> #include <argp.h> +#include <config.h> + #include <linux/dvb/dmx.h> #include "dvb-file.h" #include "dvb-demux.h" diff --git a/utils/keytable/Makefile b/utils/keytable/Makefile deleted file mode 100644 index e093280b..00000000 --- a/utils/keytable/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -TARGETS = ir-keytable - -all: $(TARGETS) - --include *.d - -ir-keytable: keytable.o - $(CC) $(LDFLAGS) -o $@ $^ - -keytable.o: keytable.c parse.h - -sync-with-kernel: - @if [ ! -f $(KERNEL_DIR)/include/linux/input.h ]; then \ - echo "Error you must set KERNEL_DIR to point to an extracted kernel source dir"; \ - exit 1; \ - fi - @echo generating parse.h - @printf "struct parse_key {\n\tchar *name;\n\tunsigned int value;\n} " >parse.h - @printf "keynames[] = {\n" >>parse.h - - @more $(KERNEL_DIR)/include/linux/input.h |perl -n \ - -e 'if (m/^\#define\s+(KEY_[^\s]+)\s+(0x[\d\w]+|[\d]+)/) ' \ - -e '{ printf "\t{\"%s\", %s},\n",$$1,$$2; }' \ - -e 'if (m/^\#define\s+(BTN_[^\s]+)\s+(0x[\d\w]+|[\d]+)/) ' \ - -e '{ printf "\t{\"%s\", %s},\n",$$1,$$2; }' \ - >> parse.h - @printf "\t{ NULL, 0}\n};\n" >>parse.h - - @-mkdir -p rc_keymaps - @-rm rc_keymaps/* - @echo storing existing keymaps at rc_keymaps/ - @./gen_keytables.pl $(KERNEL_DIR); - -install: $(TARGETS) - mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)/etc - install -m 755 $(TARGETS) $(DESTDIR)$(PREFIX)/bin - install -m 644 -p rc_maps.cfg $(DESTDIR)/etc - install -m 755 -d $(DESTDIR)/etc/rc_keymaps - install -m 644 -p rc_keymaps/* $(DESTDIR)/etc/rc_keymaps - install -m 755 -d $(DESTDIR)/lib/udev/rules.d - install -m 644 -p 70-infrared.rules $(DESTDIR)/lib/udev/rules.d - install -m 755 -d $(DESTDIR)$(MANDIR)/man1 - install -m 644 -p ir-keytable.1 $(DESTDIR)$(MANDIR)/man1 - -include ../../Make.rules diff --git a/utils/keytable/Makefile.am b/utils/keytable/Makefile.am new file mode 100644 index 00000000..18db9b5e --- /dev/null +++ b/utils/keytable/Makefile.am @@ -0,0 +1,35 @@ +udevrulesdir="/lib/udev/rules.d" +rootetcdir="/etc" + +bin_PROGRAMS = ir-keytable +man_MANS = ir-keytable.1 +nobase_rootetc_DATA = rc_maps.cfg $(srcdir)/rc_keymaps/* +udevrules_DATA = 70-infrared.rules + +ir_keytable_SOURCES = keytable.c parse.h + +EXTRA_DIST = 70-infrared.rules rc_keymaps gen_keytables.pl ir-keytable.1 rc_maps.cfg + +# custom target + +sync-with-kernel: + @if [ ! -f $(KERNEL_DIR)/include/linux/input.h ]; then \ + echo "Error you must set KERNEL_DIR to point to an extracted kernel source dir"; \ + exit 1; \ + fi + @echo generating $(srcdir)/parse.h + @printf "struct parse_key {\n\tchar *name;\n\tunsigned int value;\n} " > $(srcdir)/parse.h + @printf "keynames[] = {\n" >> $(srcdir)/parse.h + + @more $(KERNEL_DIR)/include/linux/input.h | perl -n \ + -e 'if (m/^\#define\s+(KEY_[^\s]+)\s+(0x[\d\w]+|[\d]+)/) ' \ + -e '{ printf "\t{\"%s\", %s},\n",$$1,$$2; }' \ + -e 'if (m/^\#define\s+(BTN_[^\s]+)\s+(0x[\d\w]+|[\d]+)/) ' \ + -e '{ printf "\t{\"%s\", %s},\n",$$1,$$2; }' \ + >> $(srcdir)/parse.h + @printf "\t{ NULL, 0}\n};\n" >> $(srcdir)/parse.h + + @-mkdir -p $(srcdir)/rc_keymaps + @-rm $(srcdir)/rc_keymaps/* + @echo storing existing keymaps at $(srcdir)/rc_keymaps/ + @cd $(srcdir) && ./gen_keytables.pl $(KERNEL_DIR); diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c index 2dc8e667..93609d22 100644 --- a/utils/keytable/keytable.c +++ b/utils/keytable/keytable.c @@ -12,6 +12,7 @@ GNU General Public License for more details. */ +#include <config.h> #include <ctype.h> #include <errno.h> #include <fcntl.h> diff --git a/utils/libmedia_dev/Makefile b/utils/libmedia_dev/Makefile deleted file mode 100644 index d70bde94..00000000 --- a/utils/libmedia_dev/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -OBJS = get_media_devices.o -TARGETS = libmedia_dev.a -INCLUDES = get_media_devices.h - -all: $(TARGETS) - --include $(OBJS:.o=.d) - -libmedia_dev.a: $(OBJS) - -install: $(TARGETS) -# mkdir -p $(DESTDIR)$(PREFIX)/include -# install -p -m 644 $(INCLUDES) $(DESTDIR)$(PREFIX)/include -# mkdir -p $(DESTDIR)$(LIBDIR) -# install -m 644 $(TARGETS) $(DESTDIR)$(LIBDIR) - -include ../../Make.rules diff --git a/utils/libmedia_dev/Makefile.am b/utils/libmedia_dev/Makefile.am new file mode 100644 index 00000000..3796efbd --- /dev/null +++ b/utils/libmedia_dev/Makefile.am @@ -0,0 +1,7 @@ +noinst_LTLIBRARIES = libmedia_dev.la + +libmedia_dev_la_SOURCES = get_media_devices.c get_media_devices.h +libmedia_dev_la_CPPFLAGS = -static +libmedia_dev_la_LDFLAGS = -static + +EXTRA_DIST = README diff --git a/utils/libv4l2util/Makefile b/utils/libv4l2util/Makefile deleted file mode 100644 index 39f8458c..00000000 --- a/utils/libv4l2util/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -OBJS = frequencies.o v4l2_driver.o -TARGETS = libv4l2util.a - -all: $(TARGETS) - --include $(OBJS:.o=.d) - -libv4l2util.a: $(OBJS) - -install: $(TARGETS) - -include ../../Make.rules diff --git a/utils/libv4l2util/Makefile.am b/utils/libv4l2util/Makefile.am new file mode 100644 index 00000000..eb11017a --- /dev/null +++ b/utils/libv4l2util/Makefile.am @@ -0,0 +1,7 @@ +noinst_LTLIBRARIES = libv4l2util.la + +libv4l2util_la_SOURCES = frequencies.c v4l2_driver.c v4l2_driver.h libv4l2util.h +libv4l2util_la_CPPFLAGS = -static +libv4l2util_la_LDFLAGS = -static + +EXTRA_DIST = TODO diff --git a/utils/qv4l2/Makefile.am b/utils/qv4l2/Makefile.am new file mode 100644 index 00000000..cb38fe6b --- /dev/null +++ b/utils/qv4l2/Makefile.am @@ -0,0 +1,35 @@ +bin_PROGRAMS = qv4l2 + +qv4l2_SOURCES = qv4l2.cpp general-tab.cpp ctrl-tab.cpp v4l2-api.cpp capture-win.cpp \ + qv4l2.h capture-win.h general-tab.h v4l2-api.h +nodist_qv4l2_SOURCES = moc_qv4l2.cpp moc_general-tab.cpp moc_capture-win.cpp qrc_qv4l2.cpp +qv4l2_LDADD = ../../lib/libv4l2/libv4l2.la ../../lib/libv4lconvert/libv4lconvert.la ../libv4l2util/libv4l2util.la +qv4l2_CPPFLAGS = $(QT_CFLAGS) +qv4l2_LDFLAGS = $(QT_LIBS) + +EXTRA_DIST = exit.png fileopen.png qv4l2_24x24.png qv4l2_64x64.png qv4l2.png qv4l2.svg video-television.png \ + fileclose.png qv4l2_16x16.png qv4l2_32x32.png qv4l2.desktop qv4l2.qrc record.png qv4l2.pro + +clean-local: + -rm -vf moc_*.cpp qrc_*.cpp qrc_*.o ui_*.h + +# Call the moc preprocessor +moc_%.cpp : %.h + $(MOC) -o $@ $< + +# Call the Qt resource compiler +qrc_%.cpp: %.qrc + rcc -name qv4l2 -o $@ $< + +# Call the Qt ui compiler +ui_%.h: %.ui + $(UIC) -o $@ $< + +install-data-local: + $(INSTALL_DATA) -D -p "$(srcdir)/qv4l2.desktop" "$(DESTDIR)$(datadir)/applications/qv4l2.desktop" + $(INSTALL_DATA) -D -p "$(srcdir)/qv4l2_16x16.png" "$(DESTDIR)$(datadir)/icons/hicolor/16x16/apps/qv4l2.png" + $(INSTALL_DATA) -D -p "$(srcdir)/qv4l2_24x24.png" "$(DESTDIR)$(datadir)/icons/hicolor/24x24/apps/qv4l2.png" + $(INSTALL_DATA) -D -p "$(srcdir)/qv4l2_32x32.png" "$(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/qv4l2.png" + $(INSTALL_DATA) -D -p "$(srcdir)/qv4l2_64x64.png" "$(DESTDIR)$(datadir)/icons/hicolor/64x64/apps/qv4l2.png" + $(INSTALL_DATA) -D -p "$(srcdir)/qv4l2.svg" "$(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/qv4l2.svg" + diff --git a/utils/qv4l2/Makefile.install b/utils/qv4l2/Makefile.install deleted file mode 100644 index cdfda201..00000000 --- a/utils/qv4l2/Makefile.install +++ /dev/null @@ -1,14 +0,0 @@ -all:: - $(MAKE) $@ - -install:: all - mkdir -p $(DESTDIR)$(PREFIX)/bin - install -m 755 qv4l2 $(DESTDIR)$(PREFIX)/bin - install -m 644 -D -p qv4l2.desktop "$(DESTDIR)$(PREFIX)/share/applications/qv4l2.desktop" - install -m 644 -D -p qv4l2_16x16.png "$(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/qv4l2.png" - install -m 644 -D -p qv4l2_24x24.png "$(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/qv4l2.png" - install -m 644 -D -p qv4l2_32x32.png "$(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/qv4l2.png" - install -m 644 -D -p qv4l2_64x64.png "$(DESTDIR)$(PREFIX)/share/icons/hicolor/64x64/apps/qv4l2.png" - install -m 644 -D -p qv4l2.svg "$(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/qv4l2.svg" - -include ../../Make.rules diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp index 21ed2d9d..939bcde8 100644 --- a/utils/qv4l2/general-tab.cpp +++ b/utils/qv4l2/general-tab.cpp @@ -19,7 +19,7 @@ #include "general-tab.h" -#include <libv4l2util.h> +#include "../libv4l2util/libv4l2util.h" #include <QSpinBox> #include <QComboBox> diff --git a/utils/rds/Makefile b/utils/rds/Makefile deleted file mode 100644 index 17b4bd4e..00000000 --- a/utils/rds/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -TARGETS = rds-saa6588 - -all: $(TARGETS) - --include *.d - -rds-saa6588: rds-saa6588.o - $(CC) $(LDFLAGS) -o $@ $^ - -install: - -include ../../Make.rules diff --git a/utils/rds/Makefile.am b/utils/rds/Makefile.am new file mode 100644 index 00000000..a551d9fb --- /dev/null +++ b/utils/rds/Makefile.am @@ -0,0 +1,3 @@ +noinst_PROGRAMS = rds-saa6588 + +rds_saa6588_SOURCES = rds-saa6588.c diff --git a/utils/v4l2-compliance/Makefile b/utils/v4l2-compliance/Makefile deleted file mode 100644 index 7ba874a6..00000000 --- a/utils/v4l2-compliance/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -TARGETS = v4l2-compliance - -all: $(TARGETS) - --include *.d - -v4l2-compliance: v4l2-compliance.o v4l2-test-debug.o v4l2-test-input-output.o \ - v4l2-test-controls.o v4l2-test-io-config.o v4l2-test-formats.o - $(CXX) $(LDFLAGS) -o $@ $^ -ldl -ljpeg -lv4l2 -lv4lconvert -lrt - -install: $(TARGETS) - mkdir -p $(DESTDIR)$(PREFIX)/bin - install -m 755 $(TARGETS) $(DESTDIR)$(PREFIX)/bin - -include ../../Make.rules diff --git a/utils/v4l2-compliance/Makefile.am b/utils/v4l2-compliance/Makefile.am new file mode 100644 index 00000000..2f4d8bb7 --- /dev/null +++ b/utils/v4l2-compliance/Makefile.am @@ -0,0 +1,5 @@ +bin_PROGRAMS = v4l2-compliance +v4l2_compliance_SOURCES = v4l2-compliance.cpp v4l2-test-debug.cpp v4l2-test-input-output.cpp v4l2-test-controls.cpp v4l2-test-io-config.cpp v4l2-test-formats.cpp v4l2-compliance.h +v4l2_compliance_LDADD = ../../lib/libv4l2/libv4l2.la + +EXTRA_DIST = fixme.txt diff --git a/utils/v4l2-ctl/Makefile b/utils/v4l2-ctl/Makefile deleted file mode 100644 index 4a2e0ae3..00000000 --- a/utils/v4l2-ctl/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -override CPPFLAGS += -DV4L_UTILS_VERSION=\"$(V4L_UTILS_VERSION)\" - -TARGETS = cx18-ctl ivtv-ctl v4l2-ctl - -all: $(TARGETS) - --include *.d - -cx18-ctl: cx18-ctl.o - $(CC) $(LDFLAGS) -o $@ $^ - -ivtv-ctl: ivtv-ctl.o - $(CC) $(LDFLAGS) -o $@ $^ -lm - -v4l2-ctl: v4l2-ctl.o - $(CXX) $(LDFLAGS) -o $@ $^ -ldl -ljpeg -lv4l2 -lv4lconvert -lrt - -install: $(TARGETS) - mkdir -p $(DESTDIR)$(PREFIX)/bin - install -m 755 $(TARGETS) $(DESTDIR)$(PREFIX)/bin - -include ../../Make.rules diff --git a/utils/v4l2-ctl/Makefile.am b/utils/v4l2-ctl/Makefile.am new file mode 100644 index 00000000..2818810d --- /dev/null +++ b/utils/v4l2-ctl/Makefile.am @@ -0,0 +1,9 @@ +bin_PROGRAMS = cx18-ctl ivtv-ctl v4l2-ctl + +cx18_ctl_SOURCES = cx18-ctl.c + +ivtv_ctl_SOURCES = ivtv-ctl.c +ivtv_ctl_LDFLAGS = -lm + +v4l2_ctl_SOURCES = v4l2-ctl.cpp +v4l2_ctl_LDADD = ../../lib/libv4l2/libv4l2.la diff --git a/utils/v4l2-ctl/cx18-ctl.c b/utils/v4l2-ctl/cx18-ctl.c index 822fbbbd..761cb0a4 100644 --- a/utils/v4l2-ctl/cx18-ctl.c +++ b/utils/v4l2-ctl/cx18-ctl.c @@ -19,6 +19,7 @@ Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ +#include <config.h> #include <unistd.h> #include <features.h> /* Uses _GNU_SOURCE to define getsubopt in stdlib.h */ #include <stdlib.h> diff --git a/utils/v4l2-dbg/Makefile b/utils/v4l2-dbg/Makefile.am index b12fb843..336aa132 100644 --- a/utils/v4l2-dbg/Makefile +++ b/utils/v4l2-dbg/Makefile.am @@ -1,23 +1,13 @@ -TARGETS = v4l2-dbg +sbin_PROGRAMS = v4l2-dbg +v4l2_dbg_SOURCES = v4l2-dbg.cpp v4l2-chipids.cpp v4l2-dbg-ac97.h v4l2-dbg-bttv.h v4l2-dbg-em28xx.h v4l2-dbg.h v4l2-dbg-micron.h v4l2-dbg-saa7134.h v4l2-dbg-tvp5150.h -all: $(TARGETS) - --include *.d - -v4l2-dbg: v4l2-dbg.o v4l2-chipids.o - $(CXX) $(LDFLAGS) -o $@ $^ +# custom targets sync-with-kernel: @if [ ! -f $(KERNEL_DIR)/include/media/v4l2-chip-ident.h ]; then \ echo "Error you must set KERNEL_DIR to point to an extracted kernel source dir"; \ exit 1; \ fi - @echo "struct chipid { const char *name; unsigned id; } chipids[] = {" > v4l2-chipids.cpp - @grep V4L2_IDENT_ $(KERNEL_DIR)/include/media/v4l2-chip-ident.h | sed -e 's/.*V4L2_IDENT_\([0-9A-Z_]*\)[^=]*=[^0-9]*\([0-9]*\).*/{ "\1", \2 },/' | tr A-Z a-z >> v4l2-chipids.cpp - @echo "{ 0, 0 }};" >> v4l2-chipids.cpp - -install: $(TARGETS) - mkdir -p $(DESTDIR)$(PREFIX)/sbin - install -m 755 $(TARGETS) $(DESTDIR)$(PREFIX)/sbin - -include ../../Make.rules + @echo "struct chipid { const char *name; unsigned id; } chipids[] = {" > $(srcdir)/v4l2-chipids.cpp + @grep V4L2_IDENT_ $(KERNEL_DIR)/include/media/v4l2-chip-ident.h | sed -e 's/.*V4L2_IDENT_\([0-9A-Z_]*\)[^=]*=[^0-9]*\([0-9]*\).*/{ "\1", \2 },/' | tr A-Z a-z >> $(srcdir)/v4l2-chipids.cpp + @echo "{ 0, 0 }};" >> $(srcdir)/v4l2-chipids.cpp diff --git a/utils/v4l2-sysfs-path/Makefile b/utils/v4l2-sysfs-path/Makefile deleted file mode 100644 index 8c1937b1..00000000 --- a/utils/v4l2-sysfs-path/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -TARGETS = v4l2-sysfs-path - -all: $(TARGETS) - --include *.d - -v4l2-sysfs-path: v4l2-sysfs-path.o ../libmedia_dev/libmedia_dev.a - $(CC) $(LDFLAGS) -o $@ $^ - -install: $(TARGETS) - mkdir -p $(DESTDIR)$(PREFIX)/bin - install -m 755 $(TARGETS) $(DESTDIR)$(PREFIX)/bin - -include ../../Make.rules diff --git a/utils/v4l2-sysfs-path/Makefile.am b/utils/v4l2-sysfs-path/Makefile.am new file mode 100644 index 00000000..2d36e755 --- /dev/null +++ b/utils/v4l2-sysfs-path/Makefile.am @@ -0,0 +1,3 @@ +bin_PROGRAMS = v4l2-sysfs-path +v4l2_sysfs_path_SOURCES = v4l2-sysfs-path.c +v4l2_sysfs_path_LDADD = ../libmedia_dev/libmedia_dev.la diff --git a/utils/v4l2-sysfs-path/v4l2-sysfs-path.c b/utils/v4l2-sysfs-path/v4l2-sysfs-path.c index abb6b86e..381fe5a4 100644 --- a/utils/v4l2-sysfs-path/v4l2-sysfs-path.c +++ b/utils/v4l2-sysfs-path/v4l2-sysfs-path.c @@ -24,6 +24,7 @@ * Mauro Carvalho Chehab <mchehab@redhat.com> */ +#include <config.h> #include "../libmedia_dev/get_media_devices.h" #include <stdio.h> #include <argp.h> diff --git a/utils/xc3028-firmware/Makefile b/utils/xc3028-firmware/Makefile.am index 49b38813..669db4b0 100644 --- a/utils/xc3028-firmware/Makefile +++ b/utils/xc3028-firmware/Makefile.am @@ -1,19 +1,14 @@ -TARGETS = firmware-tool +noinst_PROGRAMS = firmware-tool -all: $(TARGETS) +firmware_tool_SOURCES = firmware-tool.c standards.c extract_head.h standards.h tuner-xc2028-types.h --include *.d +EXTRA_DIST = README -firmware-tool: firmware-tool.o standards.o - $(CC) $(LDFLAGS) -o $@ $^ +# custom targets sync-with-kernel: @if [ ! -f $(KERNEL_DIR)/drivers/media/common/tuners/tuner-xc2028-types.h ]; then \ echo "Error you must set KERNEL_DIR to point to an extracted kernel source dir"; \ exit 1; \ fi - cp -a $(KERNEL_DIR)/drivers/media/common/tuners/tuner-xc2028-types.h . - -install: - -include ../../Make.rules + cp -a $(KERNEL_DIR)/drivers/media/common/tuners/tuner-xc2028-types.h $(srcdir)/ diff --git a/v4l-utils.spec.in b/v4l-utils.spec.in index c37780f7..3b6aaded 100644 --- a/v4l-utils.spec.in +++ b/v4l-utils.spec.in @@ -1,5 +1,5 @@ Name: v4l-utils -Version: @@V4L_UTILS_VERSION@@ +Version: @PACKAGE_VERSION@ Release: 1%{?dist} Summary: Utilities for video4linux and DVB devices Group: Applications/System |