diff --git a/Makefile b/Makefile index a4c67453a3..25499724ef 100644 --- a/Makefile +++ b/Makefile @@ -43,8 +43,14 @@ EXTRALIBS+=-lmp3lame endif endif -ifeq ($(CONFIG_VORBIS),yes) -EXTRALIBS+=-lvorbis -lvorbisenc -logg +ifeq ($(CONFIG_LIBOGG),yes) +EXTRALIBS+= -logg +ifeq ($(CONFIG_LIBVORBIS),yes) +EXTRALIBS+= -lvorbis -lvorbisenc +endif +ifeq ($(CONFIG_LIBTHEORA),yes) +EXTRALIBS+= -ltheora +endif endif ifeq ($(CONFIG_FAAD),yes) diff --git a/configure b/configure index 0e21d327ea..cf865c8f9c 100755 --- a/configure +++ b/configure @@ -15,7 +15,9 @@ echo " --help print this message" echo " --prefix=PREFIX install in PREFIX [$prefix]" echo " --mandir=DIR man documentation in DIR [PREFIX/man]" echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]" -echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]" +echo " --enable-ogg enable ogg support via libogg [default=no]" +echo " --enable-vorbis enable vorbis support via libvorbis [default=no]" +echo " --enable-theora enable theora support via libtheora [default=no]" echo " --enable-faad enable faad support via libfaad [default=no]" echo " --enable-faadbin build faad support with runtime linking [default=no]" echo " --enable-faac enable faac support via libfaac [default=no]" @@ -149,7 +151,9 @@ dc1394="no" network="yes" zlib="yes" mp3lame="no" +ogg="no" vorbis="no" +theora="no" faad="no" faadbin="no" faac="no" @@ -410,8 +414,12 @@ for opt do ;; --enable-mp3lame) mp3lame="yes" ;; + --enable-ogg) ogg="yes" + ;; --enable-vorbis) vorbis="yes" ;; + --enable-theora) theora="yes" + ;; --enable-faad) faad="yes" ;; --enable-faadbin) faadbin="yes" @@ -461,6 +469,22 @@ for opt do esac done +if test "$theora" = "yes" ; then + if test "$ogg" = "no" ; then + echo "Ogg must be enabled to enable Theora" + fail="yes" + theora="no" + fi +fi + +if test "$vorbis" = "yes" ; then + if test "$ogg" = "no" ; then + echo "Ogg must be enabled to enable Vorbis" + fail="yes" + vorbis="no" + fi +fi + if test "$gpl" != "yes"; then if test "$pp" != "no" -o "$shared_pp" != "no"; then echo "The Postprocessing code is under GPL and --enable-gpl is not specified" @@ -1040,7 +1064,9 @@ fi echo "gprof enabled $gprof" echo "zlib enabled $zlib" echo "mp3lame enabled $mp3lame" +echo "ogg enabled $ogg" echo "vorbis enabled $vorbis" +echo "theora enabled $theora" echo "faad enabled $faad" echo "faadbin enabled $faadbin" echo "faac enabled $faac" @@ -1335,9 +1361,19 @@ if test "$mp3lame" = "yes" ; then echo "CONFIG_MP3LAME=yes" >> config.mak fi +if test "$ogg" = "yes" ; then + echo "#define CONFIG_LIBOGG 1" >> $TMPH + echo "CONFIG_LIBOGG=yes" >> config.mak +fi + if test "$vorbis" = "yes" ; then - echo "#define CONFIG_VORBIS 1" >> $TMPH - echo "CONFIG_VORBIS=yes" >> config.mak + echo "#define CONFIG_LIBVORBIS 1" >> $TMPH + echo "CONFIG_LIBVORBIS=yes" >> config.mak +fi + +if test "$theora" = "yes" ; then + echo "#define CONFIG_LIBTHEORA 1" >> $TMPH + echo "CONFIG_LIBTHEORA=yes" >> config.mak fi if test "$faad" = "yes" ; then diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 3b424d8c09..1df461711e 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -118,10 +118,17 @@ OBJS += mp3lameaudio.o EXTRALIBS += -lmp3lame endif -ifeq ($(CONFIG_VORBIS),yes) +ifeq ($(CONFIG_LIBOGG),yes) +EXTRALIBS += -logg +ifeq ($(CONFIG_LIBVORBIS),yes) OBJS += oggvorbis.o EXTRALIBS += -lvorbis -lvorbisenc endif +ifeq ($(CONFIG_LIBTHEORA), yes) +OBJS += oggtheora.o +EXTRALIBS += -ltheora +endif +endif ifeq ($(TARGET_GPROF),yes) CFLAGS+=-p diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index b7a05bd26d..1eea98a743 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -45,10 +45,14 @@ void avcodec_register_all(void) #ifdef CONFIG_MP3LAME register_avcodec(&mp3lame_encoder); #endif -#ifdef CONFIG_VORBIS +#ifdef CONFIG_LIBVORBIS register_avcodec(&oggvorbis_encoder); register_avcodec(&oggvorbis_decoder); #endif +#ifdef CONFIG_LIBTHEORA + register_avcodec(&oggtheora_encoder); + register_avcodec(&oggtheora_decoder); +#endif #ifdef CONFIG_FAAC register_avcodec(&faac_encoder); #endif diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 1ff8363774..2a02473928 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -165,6 +165,8 @@ enum CodecID { CODEC_ID_MP3ADU, CODEC_ID_MP3ON4, + CODEC_ID_OGGTHEORA= 0x16000, + CODEC_ID_MPEG2TS= 0x20000, /* _FAKE_ codec to indicate a raw MPEG2 transport stream (only used by libavformat) */ }; @@ -1877,6 +1879,7 @@ extern AVCodec ac3_encoder; extern AVCodec mp2_encoder; extern AVCodec mp3lame_encoder; extern AVCodec oggvorbis_encoder; +extern AVCodec oggtheora_encoder; extern AVCodec faac_encoder; extern AVCodec xvid_encoder; extern AVCodec mpeg1video_encoder; @@ -1954,6 +1957,7 @@ extern AVCodec mace6_decoder; extern AVCodec huffyuv_decoder; extern AVCodec ffvhuff_decoder; extern AVCodec oggvorbis_decoder; +extern AVCodec oggtheora_decoder; extern AVCodec cyuv_decoder; extern AVCodec h264_decoder; extern AVCodec indeo3_decoder; diff --git a/libavformat/Makefile b/libavformat/Makefile index d41aabbabe..5ecd750f5a 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -67,7 +67,7 @@ OBJS+= barpainet.o endif endif -ifeq ($(CONFIG_VORBIS),yes) +ifeq ($(CONFIG_LIBOGG),yes) OBJS+= ogg.o endif diff --git a/libavformat/allformats.c b/libavformat/allformats.c index fd5877c905..bc7eff5066 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -82,7 +82,7 @@ void av_register_all(void) #endif yuv4mpeg_init(); -#ifdef CONFIG_VORBIS +#ifdef CONFIG_LIBOGG ogg_init(); #endif diff --git a/libavformat/nut.c b/libavformat/nut.c index 46fbee8aee..f43797582d 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -1433,7 +1433,7 @@ static AVOutputFormat nut_oformat = { "video/x-nut", "nut", sizeof(NUTContext), -#ifdef CONFIG_VORBIS +#ifdef CONFIG_LIBVORBIS CODEC_ID_VORBIS, #elif defined(CONFIG_MP3LAME) CODEC_ID_MP3,