From 38e54a75abf2dbf41773f584a0afc6492baa099a Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Mon, 29 Jun 2009 18:49:15 +0000 Subject: [PATCH] Make the configure script select the input/output devices using --enable-indev, --enable-outdev rather than --enable-demuxer, --enable-muxer as before, same for disabling them. Originally committed as revision 19293 to svn://svn.ffmpeg.org/ffmpeg/trunk --- configure | 50 +++++++++++++++++++++------------------- libavdevice/Makefile | 28 +++++++++++----------- libavdevice/alldevices.c | 32 ++++++++++++------------- libavdevice/oss_audio.c | 4 ++-- libavformat/Makefile | 2 +- 5 files changed, 59 insertions(+), 57 deletions(-) diff --git a/configure b/configure index 3eaa8f8c82..4a378ffc13 100755 --- a/configure +++ b/configure @@ -131,6 +131,8 @@ show_help(){ echo " --enable-protocol=NAME enable protocol NAME" echo " --disable-protocol=NAME disable protocol NAME" echo " --disable-protocols disable all protocols" + echo " --disable-indev=NAME disable input device NAME" + echo " --disable-outdev=NAME disable output device NAME" echo " --disable-indevs disable input devices" echo " --disable-outdevs disable output devices" echo " --disable-devices disable all devices" @@ -1141,38 +1143,38 @@ libxvid_encoder_deps="libxvid" # demuxers / muxers ac3_demuxer_deps="ac3_parser" -alsa_demuxer_deps="alsa_asoundlib_h snd_pcm_htimestamp" -alsa_demuxer_extralibs="-lasound" -alsa_muxer_deps="alsa_asoundlib_h" -alsa_muxer_extralibs="-lasound" -audio_beos_demuxer_deps="audio_beos" -audio_beos_demuxer_extralibs="-lmedia -lbe" -audio_beos_muxer_deps="audio_beos" -audio_beos_muxer_extralibs="-lmedia -lbe" +alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp" +alsa_indev_extralibs="-lasound" +alsa_outdev_deps="alsa_asoundlib_h" +alsa_outdev_extralibs="-lasound" +audio_beos_indev_deps="audio_beos" +audio_beos_indev_extralibs="-lmedia -lbe" +audio_beos_outdev_deps="audio_beos" +audio_beos_outdev_extralibs="-lmedia -lbe" avisynth_demuxer_deps="avisynth" -bktr_demuxer_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h" +bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h" dirac_demuxer_deps="dirac_parser" -dv1394_demuxer_deps="dv1394 dv_demuxer" -jack_demuxer_deps="jack_jack_h" -jack_demuxer_extralibs="-ljack" -libdc1394_demuxer_deps="libdc1394" +dv1394_indev_deps="dv1394 dv_demuxer" +jack_indev_deps="jack_jack_h" +jack_indev_extralibs="-ljack" +libdc1394_indev_deps="libdc1394" libnut_demuxer_deps="libnut" libnut_muxer_deps="libnut" matroska_demuxer_suggest="zlib bzlib" mov_demuxer_suggest="zlib" mp3_demuxer_deps="mpegaudio_parser" -oss_demuxer_deps_any="soundcard_h sys_soundcard_h" -oss_muxer_deps_any="soundcard_h sys_soundcard_h" +oss_indev_deps_any="soundcard_h sys_soundcard_h" +oss_outdev_deps_any="soundcard_h sys_soundcard_h" redir_demuxer_deps="network" rtp_muxer_deps="network rtp_protocol" rtsp_demuxer_deps="sdp_demuxer" sdp_demuxer_deps="rtp_protocol mpegts_demuxer" -v4l_demuxer_deps="linux_videodev_h" -v4l2_demuxer_deps_any="linux_videodev2_h sys_videoio_h" -vfwcap_demuxer_deps="capCreateCaptureWindow" -vfwcap_demuxer_extralibs="-lvfw32" -x11_grab_device_demuxer_deps="x11grab XShmCreateImage" -x11_grab_device_demuxer_extralibs="-lX11 -lXext" +v4l_indev_deps="linux_videodev_h" +v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h" +vfwcap_indev_deps="capCreateCaptureWindow" +vfwcap_indev_extralibs="-lvfw32" +x11_grab_device_indev_deps="x11grab XShmCreateImage" +x11_grab_device_indev_extralibs="-lX11 -lXext" # protocols gopher_protocol_deps="network" @@ -1296,8 +1298,8 @@ PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c) BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c) MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c) DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c) -OUTDEV_LIST=$(find_things muxer _MUX libavdevice/alldevices.c) -INDEV_LIST=$(find_things demuxer DEMUX libavdevice/alldevices.c) +OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c) +INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c) PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c) FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c) @@ -1343,7 +1345,7 @@ for opt do --enable-*=*|--disable-*=*) eval $(echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/') case "$thing" in - encoder|decoder|hwaccel|muxer|demuxer|parser|bsf|protocol|filter) $action ${optval}_${thing} ;; + encoder|decoder|hwaccel|muxer|demuxer|indev|outdev|parser|bsf|protocol|filter) $action ${optval}_${thing} ;; *) die_unknown "$opt" ;; esac ;; diff --git a/libavdevice/Makefile b/libavdevice/Makefile index b769d16c76..75607aa2e1 100644 --- a/libavdevice/Makefile +++ b/libavdevice/Makefile @@ -8,22 +8,22 @@ HEADERS = avdevice.h OBJS = alldevices.o # input/output devices -OBJS-$(CONFIG_ALSA_DEMUXER) += alsa-audio-common.o alsa-audio-dec.o -OBJS-$(CONFIG_ALSA_MUXER) += alsa-audio-common.o alsa-audio-enc.o -OBJS-$(CONFIG_BKTR_DEMUXER) += bktr.o -OBJS-$(CONFIG_DV1394_DEMUXER) += dv1394.o -OBJS-$(CONFIG_JACK_DEMUXER) += jack_audio.o -OBJS-$(CONFIG_OSS_DEMUXER) += oss_audio.o -OBJS-$(CONFIG_OSS_MUXER) += oss_audio.o -OBJS-$(CONFIG_V4L2_DEMUXER) += v4l2.o -OBJS-$(CONFIG_V4L_DEMUXER) += v4l.o -OBJS-$(CONFIG_VFWCAP_DEMUXER) += vfwcap.o -OBJS-$(CONFIG_X11_GRAB_DEVICE_DEMUXER) += x11grab.o +OBJS-$(CONFIG_ALSA_INDEV) += alsa-audio-common.o alsa-audio-dec.o +OBJS-$(CONFIG_ALSA_OUTDEV) += alsa-audio-common.o alsa-audio-enc.o +OBJS-$(CONFIG_BKTR_INDEV) += bktr.o +OBJS-$(CONFIG_DV1394_INDEV) += dv1394.o +OBJS-$(CONFIG_JACK_INDEV) += jack_audio.o +OBJS-$(CONFIG_OSS_INDEV) += oss_audio.o +OBJS-$(CONFIG_OSS_OUTDEV) += oss_audio.o +OBJS-$(CONFIG_V4L2_INDEV) += v4l2.o +OBJS-$(CONFIG_V4L_INDEV) += v4l.o +OBJS-$(CONFIG_VFWCAP_INDEV) += vfwcap.o +OBJS-$(CONFIG_X11_GRAB_DEVICE_INDEV) += x11grab.o # external libraries -OBJS-$(CONFIG_LIBDC1394_DEMUXER) += libdc1394.o +OBJS-$(CONFIG_LIBDC1394_INDEV) += libdc1394.o -OBJS-$(CONFIG_AUDIO_BEOS_DEMUXER) += beosaudio.o -OBJS-$(CONFIG_AUDIO_BEOS_MUXER) += beosaudio.o +OBJS-$(CONFIG_AUDIO_BEOS_INDEV) += beosaudio.o +OBJS-$(CONFIG_AUDIO_BEOS_OUTDEV) += beosaudio.o include $(SUBDIR)../subdir.mak diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c index 7efc42a897..1947eee88f 100644 --- a/libavdevice/alldevices.c +++ b/libavdevice/alldevices.c @@ -27,13 +27,13 @@ unsigned avdevice_version(void) return LIBAVDEVICE_VERSION_INT; } -#define REGISTER_MUXER(X,x) { \ +#define REGISTER_OUTDEV(X,x) { \ extern AVOutputFormat x##_muxer; \ - if(CONFIG_##X##_MUXER) av_register_output_format(&x##_muxer); } -#define REGISTER_DEMUXER(X,x) { \ + if(CONFIG_##X##_OUTDEV) av_register_output_format(&x##_muxer); } +#define REGISTER_INDEV(X,x) { \ extern AVInputFormat x##_demuxer; \ - if(CONFIG_##X##_DEMUXER) av_register_input_format(&x##_demuxer); } -#define REGISTER_MUXDEMUX(X,x) REGISTER_MUXER(X,x); REGISTER_DEMUXER(X,x) + if(CONFIG_##X##_INDEV) av_register_input_format(&x##_demuxer); } +#define REGISTER_INOUTDEV(X,x) REGISTER_OUTDEV(X,x); REGISTER_INDEV(X,x) void avdevice_register_all(void) { @@ -44,17 +44,17 @@ void avdevice_register_all(void) initialized = 1; /* devices */ - REGISTER_MUXDEMUX (ALSA, alsa); - REGISTER_MUXDEMUX (AUDIO_BEOS, audio_beos); - REGISTER_DEMUXER (BKTR, bktr); - REGISTER_DEMUXER (DV1394, dv1394); - REGISTER_DEMUXER (JACK, jack); - REGISTER_MUXDEMUX (OSS, oss); - REGISTER_DEMUXER (V4L2, v4l2); - REGISTER_DEMUXER (V4L, v4l); - REGISTER_DEMUXER (VFWCAP, vfwcap); - REGISTER_DEMUXER (X11_GRAB_DEVICE, x11_grab_device); + REGISTER_INOUTDEV (ALSA, alsa); + REGISTER_INOUTDEV (AUDIO_BEOS, audio_beos); + REGISTER_INDEV (BKTR, bktr); + REGISTER_INDEV (DV1394, dv1394); + REGISTER_INDEV (JACK, jack); + REGISTER_INOUTDEV (OSS, oss); + REGISTER_INDEV (V4L2, v4l2); + REGISTER_INDEV (V4L, v4l); + REGISTER_INDEV (VFWCAP, vfwcap); + REGISTER_INDEV (X11_GRAB_DEVICE, x11_grab_device); /* external libraries */ - REGISTER_DEMUXER (LIBDC1394, libdc1394); + REGISTER_INDEV (LIBDC1394, libdc1394); } diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c index 8f3e678db0..a89c39ac05 100644 --- a/libavdevice/oss_audio.c +++ b/libavdevice/oss_audio.c @@ -312,7 +312,7 @@ static int audio_read_close(AVFormatContext *s1) return 0; } -#if CONFIG_OSS_DEMUXER +#if CONFIG_OSS_INDEV AVInputFormat oss_demuxer = { "oss", NULL_IF_CONFIG_SMALL("Open Sound System capture"), @@ -325,7 +325,7 @@ AVInputFormat oss_demuxer = { }; #endif -#if CONFIG_OSS_MUXER +#if CONFIG_OSS_OUTDEV AVOutputFormat oss_muxer = { "oss", NULL_IF_CONFIG_SMALL("Open Sound System playback"), diff --git a/libavformat/Makefile b/libavformat/Makefile index 8973bef42a..8e8a869043 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -251,7 +251,7 @@ OBJS-$(CONFIG_TCP_PROTOCOL) += tcp.o OBJS-$(CONFIG_UDP_PROTOCOL) += udp.o # libavdevice dependencies -OBJS-$(CONFIG_JACK_DEMUXER) += timefilter.o +OBJS-$(CONFIG_JACK_INDEV) += timefilter.o EXAMPLES = output TESTPROGS = timefilter