diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-06-01 21:05:12 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-06-01 21:05:12 +0200 |
commit | f209e8b8ef44998a5ea20544bbb39aaeefa28086 (patch) | |
tree | 94f304d31e4c4bf3c1f7b0bee11cf8cceb05c15e | |
parent | 0f8f38c36c4a2c038b11c6c00a477695e0e1908a (diff) | |
download | xine-lib-f209e8b8ef44998a5ea20544bbb39aaeefa28086.tar.gz xine-lib-f209e8b8ef44998a5ea20544bbb39aaeefa28086.tar.bz2 |
Collapse the Ogg demuxer, and the Theora, Vorbis and Speex decoders in the same 'xiph' plugin.
As the three decoders requires Ogg support, and requires an Ogg demuxer to play, enabling any one of them will then enable the ogg demuxer.
The Ogg demuxer, on its own, needs to know which of the three formats are enabled, or it will not be able to properly decode them.
With this change, only one plugin will need to load and know about Xiph formats and libraries.
--HG--
rename : src/demuxers/demux_ogg.c => src/combined/xine_ogg_demuxer.c
rename : src/libxineadec/xine_speex_decoder.c => src/combined/xine_speex_decoder.c
rename : src/libxinevdec/xine_theora_decoder.c => src/combined/xine_theora_decoder.c
rename : src/libxineadec/xine_vorbis_decoder.c => src/combined/xine_vorbis_decoder.c
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | po/POTFILES.in | 2 | ||||
-rw-r--r-- | src/combined/Makefile.am | 26 | ||||
-rw-r--r-- | src/combined/xine_ogg_demuxer.c (renamed from src/demuxers/demux_ogg.c) | 29 | ||||
-rw-r--r-- | src/combined/xine_speex_decoder.c (renamed from src/libxineadec/xine_speex_decoder.c) | 10 | ||||
-rw-r--r-- | src/combined/xine_theora_decoder.c (renamed from src/libxinevdec/xine_theora_decoder.c) | 10 | ||||
-rw-r--r-- | src/combined/xine_vorbis_decoder.c (renamed from src/libxineadec/xine_vorbis_decoder.c) | 10 | ||||
-rw-r--r-- | src/demuxers/Makefile.am | 9 | ||||
-rw-r--r-- | src/libxineadec/Makefile.am | 18 | ||||
-rw-r--r-- | src/libxinevdec/Makefile.am | 8 |
10 files changed, 64 insertions, 60 deletions
@@ -26,6 +26,8 @@ xine-lib (1.1.90) (Unreleased) * Move modplug demuxing on its own plugin, this way binary distributions can make it optional, as it requires quite a bit of CPU time during initialisation, even for audio files that nothing have to do with modplug. + * Collapse the Ogg demuxer, and the Theora, Vorbis and Speex decoders in the + same 'xiph' plugin. xine-lib (1.1.7) (unreleased) * Support libdca (new name for libdts) by shuffling around the dts.h file. diff --git a/po/POTFILES.in b/po/POTFILES.in index 7962ea11a..52064f8c7 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -17,6 +17,7 @@ src/audio_out/audio_none_out.c src/audio_out/audio_oss_out.c src/audio_out/audio_pulse_out.c src/audio_out/audio_sun_out.c +src/combined/xine_ogg_demuxer.c src/demuxers/demux_asf.c src/demuxers/demux_avi.c src/demuxers/demux_film.c @@ -25,7 +26,6 @@ src/demuxers/demux_iff.c src/demuxers/demux_mpc.c src/demuxers/demux_mpeg_block.c src/demuxers/demux_mpeg_pes.c -src/demuxers/demux_ogg.c src/demuxers/demux_snd.c src/demuxers/demux_tta.c src/demuxers/demux_voc.c diff --git a/src/combined/Makefile.am b/src/combined/Makefile.am index cf88795ba..c1e590fd7 100644 --- a/src/combined/Makefile.am +++ b/src/combined/Makefile.am @@ -32,3 +32,29 @@ xineplug_nsf_la_SOURCES = nsf_decoder.c nsf_demuxer.c nsf_combined.c xineplug_nsf_la_LIBADD = $(XINE_LIB) $(top_builddir)/contrib/nosefart/libnosefart.la -lm xineplug_nsf_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing xineplug_nsf_la_CPPFLAGS = $(AM_CPPFLAGS) -DNSF_PLAYER -I$(top_srcdir)/contrib/nosefart -I$(top_srcdir)/src/demuxers + +xineplug_xiph_la_SOURCES = xine_ogg_demuxer.c +xineplug_xiph_la_LIBADD = $(XINE_LIB) +xineplug_xiph_la_CFLAGS = $(AM_CFLAGS) +xineplug_xiph_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/demuxers + +if ENABLE_VORBIS +xineplug_LTLIBRARIES += xineplug_xiph.la +xineplug_xiph_la_SOURCES += xine_vorbis_decoder.c +xineplug_xiph_la_LIBADD += $(VORBIS_LIBS) +xineplug_xiph_la_CFLAGS += $(VORBIS_CFLAGS) +endif + +if ENABLE_THEORA +xineplug_LTLIBRARIES += xineplug_xiph.la +xineplug_xiph_la_SOURCES += xine_theora_decoder.c +xineplug_xiph_la_LIBADD += $(THEORA_LIBS) +xineplug_xiph_la_CFLAGS += $(THEORA_CFLAGS) +endif + +if ENABLE_SPEEX +xineplug_LTLIBRARIES += xineplug_xiph.la +xineplug_xiph_la_SOURCES += xine_speex_decoder.c +xineplug_xiph_la_LIBADD += $(SPEEX_LIBS) +xineplug_xiph_la_CFLAGS += $(SPEEX_CFLAGS) +endif diff --git a/src/demuxers/demux_ogg.c b/src/combined/xine_ogg_demuxer.c index f868018af..56234723d 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/combined/xine_ogg_demuxer.c @@ -40,7 +40,10 @@ #include <inttypes.h> #include <ogg/ogg.h> + +#ifdef HAVE_VORBIS #include <vorbis/codec.h> +#endif #ifdef HAVE_SPEEX #include <speex/speex.h> @@ -416,6 +419,7 @@ static void ogg_handle_event (demux_ogg_t *this) { * to label audio and spu streams */ static void read_language_comment (demux_ogg_t *this, ogg_packet *op, int stream_num) { +#ifdef HAVE_VORBIS char **ptr; char *comment; vorbis_comment vc; @@ -439,6 +443,7 @@ static void read_language_comment (demux_ogg_t *this, ogg_packet *op, int stream } vorbis_comment_clear(&vc); vorbis_info_clear(&vi); +#endif } /* @@ -446,6 +451,7 @@ static void read_language_comment (demux_ogg_t *this, ogg_packet *op, int stream * to name parts of the videostream */ static void read_chapter_comment (demux_ogg_t *this, ogg_packet *op) { +#ifdef HAVE_VORBIS char **ptr; char *comment; vorbis_comment vc; @@ -512,6 +518,7 @@ static void read_chapter_comment (demux_ogg_t *this, ogg_packet *op) { } vorbis_comment_clear(&vc); vorbis_info_clear(&vi); +#endif } /* @@ -770,6 +777,7 @@ static void send_ogg_buf (demux_ogg_t *this, } static void decode_vorbis_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) { +#ifdef HAVE_VORBIS vorbis_info vi; vorbis_comment vc; @@ -803,6 +811,7 @@ static void decode_vorbis_header (demux_ogg_t *this, const int stream_num, ogg_p } vorbis_comment_clear(&vc); vorbis_info_clear(&vi); +#endif } static void decode_speex_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) { @@ -1295,7 +1304,11 @@ static void decode_anxdata_header (demux_ogg_t *this, const int stream_num, ogg_ /* what type of stream are we dealing with? */ if (!strncmp(content_type, "audio/x-vorbis", content_type_length)) { +#ifdef HAVE_VORBIS this->si[stream_num]->buf_types = BUF_AUDIO_VORBIS; +#else + this->si[stream_num]->buf_types = BUF_CONTROL_NOP; +#endif this->num_audio_streams++; } else if (!strncmp(content_type, "audio/x-speex", content_type_length)) { this->num_audio_streams++; @@ -2194,9 +2207,25 @@ static const demuxer_info_t demux_info_ogg = { 10 /* priority */ }; +extern const demuxer_info_t dec_info_vorbis; +void *vorbis_init_plugin (xine_t *xine, void *data); +extern const demuxer_info_t dec_info_speex; +void *speex_init_plugin (xine_t *xine, void *data); +extern const demuxer_info_t dec_info_theora; +void *theora_init_plugin (xine_t *xine, void *data); + const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ { PLUGIN_DEMUX, 26, "ogg", XINE_VERSION_CODE, &demux_info_ogg, ogg_init_class }, { PLUGIN_DEMUX, 26, "anx", XINE_VERSION_CODE, &demux_info_anx, anx_init_class }, +#ifdef HAVE_VORBIS + { PLUGIN_AUDIO_DECODER, 15, "vorbis", XINE_VERSION_CODE, &dec_info_vorbis, vorbis_init_plugin }, +#endif +#ifdef HAVE_SPEEX + { PLUGIN_AUDIO_DECODER, 15, "speex", XINE_VERSION_CODE, &dec_info_speex, speex_init_plugin }, +#endif +#ifdef HAVE_THEORA + { PLUGIN_VIDEO_DECODER, 18, "theora", XINE_VERSION_CODE, &dec_info_theora, theora_init_plugin }, +#endif { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxineadec/xine_speex_decoder.c b/src/combined/xine_speex_decoder.c index 034e726a6..a17de15d6 100644 --- a/src/libxineadec/xine_speex_decoder.c +++ b/src/combined/xine_speex_decoder.c @@ -389,7 +389,7 @@ static void dispose_class (audio_decoder_class_t *this) { free (this); } -static void *init_plugin (xine_t *xine, void *data) { +void *speex_init_plugin (xine_t *xine, void *data) { speex_class_t *this; @@ -407,13 +407,7 @@ static uint32_t audio_types[] = { BUF_AUDIO_SPEEX, 0 }; -static const decoder_info_t dec_info_audio = { +const decoder_info_t dec_info_speex = { audio_types, /* supported types */ 5 /* priority */ }; - -const plugin_info_t xine_plugin_info[] EXPORTED = { - /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 15, "speex", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, - { PLUGIN_NONE, 0, "", 0, NULL, NULL } -}; diff --git a/src/libxinevdec/xine_theora_decoder.c b/src/combined/xine_theora_decoder.c index 032f8800f..8dd997692 100644 --- a/src/libxinevdec/xine_theora_decoder.c +++ b/src/combined/xine_theora_decoder.c @@ -370,7 +370,7 @@ static void theora_dispose_class (video_decoder_class_t *this) { free (this); } -static void *init_plugin (xine_t *xine, void *data) { +void *theora_init_plugin (xine_t *xine, void *data) { /*initialize our plugin*/ theora_class_t *this; @@ -390,13 +390,7 @@ static void *init_plugin (xine_t *xine, void *data) { static uint32_t supported_types[] = { BUF_VIDEO_THEORA, 0 }; -static const decoder_info_t dec_info_video = { +const decoder_info_t dec_info_theora = { supported_types, /* supported types */ 5 /* priority */ }; - -const plugin_info_t xine_plugin_info[] EXPORTED = { - /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 18, "theora", XINE_VERSION_CODE, &dec_info_video, init_plugin }, - { PLUGIN_NONE, 0, "", 0, NULL, NULL } -}; diff --git a/src/libxineadec/xine_vorbis_decoder.c b/src/combined/xine_vorbis_decoder.c index 7fc1b9197..259ef40b0 100644 --- a/src/libxineadec/xine_vorbis_decoder.c +++ b/src/combined/xine_vorbis_decoder.c @@ -324,7 +324,7 @@ static void dispose_class (audio_decoder_class_t *this) { free (this); } -static void *init_plugin (xine_t *xine, void *data) { +void *vorbis_init_plugin (xine_t *xine, void *data) { vorbis_class_t *this; @@ -342,13 +342,7 @@ static uint32_t audio_types[] = { BUF_AUDIO_VORBIS, 0 }; -static const decoder_info_t dec_info_audio = { +const decoder_info_t dec_info_vorbis = { audio_types, /* supported types */ 5 /* priority */ }; - -const plugin_info_t xine_plugin_info[] EXPORTED = { - /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 15, "vorbis", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, - { PLUGIN_NONE, 0, "", 0, NULL, NULL } -}; diff --git a/src/demuxers/Makefile.am b/src/demuxers/Makefile.am index a2896abd3..1dec2eabf 100644 --- a/src/demuxers/Makefile.am +++ b/src/demuxers/Makefile.am @@ -12,10 +12,6 @@ xineinclude_HEADERS = demux.h noinst_HEADERS = asfheader.h qtpalette.h group_games.h group_audio.h id3.h ebml.h matroska.h iff.h flacutils.h -if ENABLE_VORBIS -ogg_module = xineplug_dmx_ogg.la -endif - if ENABLE_ASF asf_module = xineplug_dmx_asf.la endif @@ -33,7 +29,6 @@ image_module = xineplug_dmx_image.la endif xineplug_LTLIBRARIES = \ - $(ogg_module) \ $(asf_module) \ $(mng_module) \ $(image_module) \ @@ -59,10 +54,6 @@ xineplug_LTLIBRARIES = \ xineplug_dmx_iff.la \ xineplug_dmx_flv.la -xineplug_dmx_ogg_la_SOURCES = demux_ogg.c -xineplug_dmx_ogg_la_LIBADD = $(VORBIS_LIBS) $(SPEEX_LIBS) $(THEORA_LIBS) $(OGG_LIBS) $(XINE_LIB) -xineplug_dmx_ogg_la_CFLAGS = $(AM_CFLAGS) $(VORBIS_CFLAGS) $(SPEEX_CFLAGS) $(THEORA_CFLAGS) $(OGG_CFLAGS) - xineplug_dmx_avi_la_SOURCES = demux_avi.c xineplug_dmx_avi_la_LIBADD = $(XINE_LIB) diff --git a/src/libxineadec/Makefile.am b/src/libxineadec/Makefile.am index 82099d659..c552d9a08 100644 --- a/src/libxineadec/Makefile.am +++ b/src/libxineadec/Makefile.am @@ -5,14 +5,6 @@ AM_LDFLAGS = $(xineplug_ldflags) EXTRA_DIST = fooaudio.c -if ENABLE_VORBIS -vorbis_module = xineplug_decode_vorbis.la -endif - -if ENABLE_SPEEX -speex_module = xineplug_decode_speex.la -endif - if ENABLE_MUSEPACK musepack_module = xineplug_decode_mpc.la endif @@ -54,8 +46,6 @@ $(top_builddir)/contrib/gsm610/libgsm610.la: xineplug_LTLIBRARIES = \ xineplug_decode_gsm610.la \ xineplug_decode_lpcm.la \ - $(vorbis_module) \ - $(speex_module) \ $(musepack_module) \ $(dts_module) \ $(mad_module) \ @@ -69,14 +59,6 @@ xineplug_decode_gsm610_la_CPPFLAGS = -I$(top_srcdir)/contrib/gsm610 xineplug_decode_lpcm_la_SOURCES = xine_lpcm_decoder.c xineplug_decode_lpcm_la_LIBADD = $(XINE_LIB) -xineplug_decode_vorbis_la_SOURCES = xine_vorbis_decoder.c -xineplug_decode_vorbis_la_LIBADD = $(XINE_LIB) $(VORBIS_LIBS) $(OGG_LIBS) -xineplug_decode_vorbis_la_CFLAGS = $(AM_CFLAGS) $(VORBIS_CFLAGS) - -xineplug_decode_speex_la_SOURCES = xine_speex_decoder.c -xineplug_decode_speex_la_LIBADD = $(XINE_LIB) $(SPEEX_LIBS) -xineplug_decode_speex_la_CFLAGS = $(AM_CFLAGS) $(SPEEX_CFLAGS) - xineplug_decode_mpc_la_SOURCES = xine_musepack_decoder.c xineplug_decode_mpc_la_DEPENDENCIES = $(MPCDEC_DEPS) xineplug_decode_mpc_la_LIBADD = $(XINE_LIB) $(MPCDEC_LIBS) diff --git a/src/libxinevdec/Makefile.am b/src/libxinevdec/Makefile.am index 28a926a79..ac632dfd5 100644 --- a/src/libxinevdec/Makefile.am +++ b/src/libxinevdec/Makefile.am @@ -13,10 +13,6 @@ if ENABLE_GDK_PIXBUF gdkpixbuf_module = xineplug_decode_gdk_pixbuf.la endif -if ENABLE_THEORA -theora_module = xineplug_decode_theora.la -endif - xineplug_LTLIBRARIES = $(image_module) \ $(gdkpixbuf_module) \ $(theora_module) \ @@ -40,7 +36,3 @@ xineplug_decode_image_la_CFLAGS = $(AM_CFLAGS) $(WAND_CFLAGS) xineplug_decode_gdk_pixbuf_la_SOURCES = gdkpixbuf.c xineplug_decode_gdk_pixbuf_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS) $(GDK_PIXBUF_LIBS) xineplug_decode_gdk_pixbuf_la_CFLAGS = $(AM_CFLAGS) $(GDK_PIXBUF_CFLAGS) - -xineplug_decode_theora_la_SOURCES = xine_theora_decoder.c -xineplug_decode_theora_la_LIBADD = $(XINE_LIB) $(OGG_LIBS) $(THEORA_LIBS) -xineplug_decode_theora_la_CFLAGS = $(AM_CFLAGS) $(OGG_CFLAGS) $(THEORA_CFLAGS) |