diff --git a/configure b/configure index 7757f60dc5..ccc04416b9 100755 --- a/configure +++ b/configure @@ -74,6 +74,7 @@ echo " --disable-debug disable debugging symbols" echo " --disable-opts disable compiler optimizations" echo " --disable-mpegaudio-hp faster (but less accurate)" echo " MPEG audio decoding [default=no]" +echo " --disable-protocols disable I/O protocols support [default=no]" echo " --disable-ffserver disable ffserver build" echo " --disable-ffplay disable ffplay build" echo " --enable-small optimize for size instead of speed" @@ -220,6 +221,7 @@ mpegaudio_hp="yes" SHFLAGS='-shared -Wl,-soname,$@.$(LIBMAJOR)' netserver="no" need_inet_aton="no" +protocols="yes" ffserver="yes" ffplay="yes" LIBOBJFLAGS="" @@ -551,6 +553,8 @@ for opt do ;; --disable-mpegaudio-hp) mpegaudio_hp="no" ;; + --disable-protocols) protocols="no"; network="no"; ffserver="no" + ;; --disable-ffserver) ffserver="no" ;; --disable-ffplay) ffplay="no" @@ -587,7 +591,7 @@ for opt do ;; --disable-decoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*decoder//g'`" ;; - --disable-muxers) muxers="no" + --disable-muxers) muxers="no"; ffserver="no" ;; --disable-demuxers) demuxers="no" ;; @@ -1731,6 +1735,11 @@ if test "$simpleidct" = "yes" ; then echo "#define SIMPLE_IDCT 1" >> $TMPH fi +if test "$protocols" = "yes" ; then + echo "#define CONFIG_PROTOCOLS 1" >> $TMPH + echo "CONFIG_PROTOCOLS=yes" >> config.mak +fi + if test "$ffserver" = "yes" ; then echo "#define CONFIG_FFSERVER 1" >> $TMPH echo "CONFIG_FFSERVER=yes" >> config.mak diff --git a/libavformat/Makefile b/libavformat/Makefile index 947a93acc3..bac04d6f8e 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -11,13 +11,20 @@ CFLAGS=$(OPTFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavutil -I$(SRC_PATH)/liba OBJS= utils.o cutils.o os_support.o allformats.o PPOBJS= -# mux and demuxes +# demuxers OBJS+=mpeg.o mpegts.o mpegtsenc.o ffm.o crc.o img.o img2.o raw.o rm.o \ avienc.o avidec.o wav.o mmf.o swf.o au.o gif.o mov.o mpjpeg.o dv.o \ - yuv4mpeg.o 4xm.o flvenc.o flvdec.o movenc.o psxstr.o idroq.o ipmovie.o \ + yuv4mpeg.o 4xm.o flvdec.o psxstr.o idroq.o ipmovie.o \ nut.o wc3movie.o mp3.o westwood.o segafilm.o idcin.o flic.o \ - sierravmd.o matroska.o sol.o electronicarts.o nsvdec.o asf.o asf-enc.o \ + sierravmd.o matroska.o sol.o electronicarts.o nsvdec.o asf.o \ ogg2.o oggparsevorbis.o oggparsetheora.o oggparseflac.o daud.o + +# muxers +ifeq ($(CONFIG_MUXERS),yes) +OBJS+= flvenc.o movenc.o asf-enc.o +endif + + AMROBJS= ifeq ($(AMR_NB),yes) AMROBJS= amr.o @@ -32,8 +39,6 @@ OBJS+= $(AMROBJS) # image formats OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o -# file I/O -OBJS+= avio.o aviobuf.o file.o OBJS+= framehook.o ifeq ($(CONFIG_VIDEO4LINUX),yes) @@ -62,6 +67,11 @@ ifeq ($(CONFIG_AUDIO_BEOS),yes) PPOBJS+= beosaudio.o endif +# protocols I/O +OBJS+= avio.o aviobuf.o + +ifeq ($(CONFIG_PROTOCOLS),yes) +OBJS+= file.o ifeq ($(CONFIG_NETWORK),yes) OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o # BeOS and Darwin network stuff @@ -69,6 +79,7 @@ ifeq ($(NEED_INET_ATON),yes) OBJS+= barpainet.o endif endif +endif ifeq ($(CONFIG_LIBOGG),yes) OBJS+= ogg.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index e82f65841c..ce2d6911b3 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -130,6 +130,7 @@ void av_register_all(void) // av_register_image_format(&sgi_image_format); heap corruption, dont enable #endif //CONFIG_MUXERS +#ifdef CONFIG_PROTOCOLS /* file protocols */ register_protocol(&file_protocol); register_protocol(&pipe_protocol); @@ -141,4 +142,5 @@ void av_register_all(void) register_protocol(&tcp_protocol); register_protocol(&http_protocol); #endif +#endif } diff --git a/libavformat/avio.c b/libavformat/avio.c index 4f96b654a4..36032c0fb7 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -100,7 +100,7 @@ int url_read(URLContext *h, unsigned char *buf, int size) return ret; } -#ifdef CONFIG_MUXERS +#if defined(CONFIG_MUXERS) || defined(CONFIG_PROTOCOLS) int url_write(URLContext *h, unsigned char *buf, int size) { int ret; @@ -112,7 +112,7 @@ int url_write(URLContext *h, unsigned char *buf, int size) ret = h->prot->url_write(h, buf, size); return ret; } -#endif //CONFIG_MUXERS +#endif //CONFIG_MUXERS || CONFIG_PROTOCOLS offset_t url_seek(URLContext *h, offset_t pos, int whence) { diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index b1bc45b73d..2a2fa1d04d 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -53,8 +53,6 @@ int init_put_byte(ByteIOContext *s, return 0; } - -#ifdef CONFIG_MUXERS static void flush_buffer(ByteIOContext *s) { if (s->buf_ptr > s->buffer) { @@ -104,7 +102,6 @@ void put_flush_packet(ByteIOContext *s) flush_buffer(s); s->must_flush = 0; } -#endif //CONFIG_MUXERS offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence) { @@ -193,7 +190,7 @@ int url_ferror(ByteIOContext *s) return s->error; } -#ifdef CONFIG_MUXERS +#if defined(CONFIG_MUXERS) || defined(CONFIG_PROTOCOLS) void put_le32(ByteIOContext *s, unsigned int val) { put_byte(s, val); @@ -254,7 +251,7 @@ void put_tag(ByteIOContext *s, const char *tag) put_byte(s, *tag++); } } -#endif //CONFIG_MUXERS +#endif //CONFIG_MUXERS || CONFIG_PROTOCOLS /* Input stream */ diff --git a/libavformat/ffm.c b/libavformat/ffm.c index db9c2c7fd7..987bc828cc 100644 --- a/libavformat/ffm.c +++ b/libavformat/ffm.c @@ -706,6 +706,7 @@ static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, in return 0; } +#ifdef CONFIG_FFSERVER offset_t ffm_read_write_index(int fd) { uint8_t buf[8]; @@ -737,6 +738,7 @@ void ffm_set_write_index(AVFormatContext *s, offset_t pos, offset_t file_size) ffm->write_index = pos; ffm->file_size = file_size; } +#endif // CONFIG_FFSERVER static int ffm_read_close(AVFormatContext *s) {