aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2002-06-11 13:41:41 +0000
committerFabrice Bellard <fabrice@bellard.org>2002-06-11 13:41:41 +0000
commit771b9a7045c2ceddf4c862f0ef30077c9b74e3fa (patch)
tree4b71c9e1a85661512b436a7d2f23cf587e3023a6
parentd01fe86dac79675da32ee637fc5ee8032b9b5fbf (diff)
downloadffmpeg-771b9a7045c2ceddf4c862f0ef30077c9b74e3fa.tar.gz
put codec registering in another file so that the user can install the codecs he wants
Originally committed as revision 685 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/allcodecs.c90
1 files changed, 90 insertions, 0 deletions
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
new file mode 100644
index 0000000000..7ffddb534e
--- /dev/null
+++ b/libavcodec/allcodecs.c
@@ -0,0 +1,90 @@
+/*
+ * Utils for libavcodec
+ * Copyright (c) 2002 Fabrice Bellard.
+ *
+ * This library 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 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include "avcodec.h"
+
+/* If you do not call this function, then you can select exactly which
+ formats you want to support */
+
+/**
+ * simple call to register all the codecs.
+ */
+void avcodec_register_all(void)
+{
+ static int inited = 0;
+
+ if (inited != 0)
+ return;
+ inited = 1;
+
+ /* encoders */
+#ifdef CONFIG_ENCODERS
+ register_avcodec(&ac3_encoder);
+ register_avcodec(&mp2_encoder);
+#ifdef CONFIG_MP3LAME
+ register_avcodec(&mp3lame_encoder);
+#endif
+ register_avcodec(&mpeg1video_encoder);
+ register_avcodec(&h263_encoder);
+ register_avcodec(&h263p_encoder);
+ register_avcodec(&rv10_encoder);
+ register_avcodec(&mjpeg_encoder);
+ register_avcodec(&mpeg4_encoder);
+ register_avcodec(&msmpeg4v1_encoder);
+ register_avcodec(&msmpeg4v2_encoder);
+ register_avcodec(&msmpeg4v3_encoder);
+#endif /* CONFIG_ENCODERS */
+ register_avcodec(&rawvideo_codec);
+
+ /* decoders */
+#ifdef CONFIG_DECODERS
+ register_avcodec(&h263_decoder);
+ register_avcodec(&mpeg4_decoder);
+ register_avcodec(&msmpeg4v1_decoder);
+ register_avcodec(&msmpeg4v2_decoder);
+ register_avcodec(&msmpeg4v3_decoder);
+ register_avcodec(&wmv1_decoder);
+ register_avcodec(&mpeg_decoder);
+ register_avcodec(&h263i_decoder);
+ register_avcodec(&rv10_decoder);
+ register_avcodec(&mjpeg_decoder);
+ register_avcodec(&mp2_decoder);
+ register_avcodec(&mp3_decoder);
+#ifdef CONFIG_AC3
+ register_avcodec(&ac3_decoder);
+#endif
+#endif /* CONFIG_DECODERS */
+
+ /* pcm codecs */
+
+#define PCM_CODEC(id, name) \
+ register_avcodec(& name ## _encoder); \
+ register_avcodec(& name ## _decoder); \
+
+PCM_CODEC(CODEC_ID_PCM_S16LE, pcm_s16le);
+PCM_CODEC(CODEC_ID_PCM_S16BE, pcm_s16be);
+PCM_CODEC(CODEC_ID_PCM_U16LE, pcm_u16le);
+PCM_CODEC(CODEC_ID_PCM_U16BE, pcm_u16be);
+PCM_CODEC(CODEC_ID_PCM_S8, pcm_s8);
+PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8);
+PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw);
+PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw);
+
+#undef PCM_CODEC
+}
+