06479d58bcb0170a2d2666ac4979a549eb6b9fcb
[libav.git] / libavformat / allformats.c
1 /*
2 * Register all the formats and protocols
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21 #include "avformat.h"
22 #include "allformats.h"
23
24 #define REGISTER_MUXER(X,x) \
25 if(ENABLE_##X##_MUXER) av_register_output_format(&x##_muxer)
26 #define REGISTER_DEMUXER(X,x) \
27 if(ENABLE_##X##_DEMUXER) av_register_input_format(&x##_demuxer)
28 #define REGISTER_MUXDEMUX(X,x) REGISTER_MUXER(X,x); REGISTER_DEMUXER(X,x)
29
30 /* If you do not call this function, then you can select exactly which
31 formats you want to support */
32
33 /**
34 * Initialize libavcodec and register all the codecs and formats.
35 */
36 void av_register_all(void)
37 {
38 static int inited = 0;
39
40 if (inited != 0)
41 return;
42 inited = 1;
43
44 avcodec_init();
45 avcodec_register_all();
46
47 REGISTER_DEMUXER (AAC, aac);
48 REGISTER_MUXDEMUX(AC3, ac3);
49 REGISTER_MUXER (ADTS, adts);
50 REGISTER_MUXDEMUX(AIFF, aiff);
51 REGISTER_MUXDEMUX(AMR, amr);
52 REGISTER_MUXDEMUX(ASF, asf);
53 REGISTER_MUXER (ASF_STREAM, asf_stream);
54 REGISTER_MUXDEMUX(AU, au);
55 #if defined(CONFIG_AUDIO_OSS) || defined(CONFIG_AUDIO_BEOS)
56 REGISTER_MUXDEMUX(AUDIO, audio);
57 #endif
58 REGISTER_MUXDEMUX(AVI, avi);
59 #ifdef CONFIG_AVISYNTH
60 av_register_input_format(&avisynth_demuxer);
61 #endif
62 REGISTER_DEMUXER (AVS, avs);
63 REGISTER_MUXER (CRC, crc);
64 REGISTER_DEMUXER (DAUD, daud);
65 #ifdef CONFIG_DC1394
66 REGISTER_DEMUXER (DC1394, dc1394);
67 #endif
68 REGISTER_DEMUXER (DSICIN, dsicin);
69 REGISTER_DEMUXER (DTS, dts);
70 REGISTER_MUXDEMUX(DV, dv);
71 #ifdef CONFIG_DV1394
72 REGISTER_DEMUXER (DV1394, dv1394);
73 #endif
74 REGISTER_DEMUXER (EA, ea);
75 REGISTER_MUXDEMUX(FFM, ffm);
76 REGISTER_MUXDEMUX(FLAC, flac);
77 REGISTER_DEMUXER (FLIC, flic);
78 REGISTER_MUXDEMUX(FLV, flv);
79 REGISTER_DEMUXER (FOURXM, fourxm);
80 REGISTER_MUXER (FRAMECRC, framecrc);
81 REGISTER_MUXDEMUX(GIF, gif);
82 REGISTER_DEMUXER (GXF, gxf);
83 #ifdef CONFIG_GPL
84 REGISTER_MUXER (GXF, gxf);
85 #endif
86 REGISTER_MUXDEMUX(H261, h261);
87 REGISTER_MUXDEMUX(H263, h263);
88 REGISTER_MUXDEMUX(H264, h264);
89 REGISTER_DEMUXER (IDCIN, idcin);
90 REGISTER_MUXDEMUX(IMAGE2, image2);
91 REGISTER_MUXDEMUX(IMAGE2PIPE, image2pipe);
92 REGISTER_DEMUXER (INGENIENT, ingenient);
93 REGISTER_DEMUXER (IPMOVIE, ipmovie);
94 REGISTER_MUXDEMUX(M4V, m4v);
95 REGISTER_DEMUXER (MATROSKA, matroska);
96 REGISTER_MUXDEMUX(MJPEG, mjpeg);
97 REGISTER_DEMUXER (MM, mm);
98 REGISTER_MUXDEMUX(MMF, mmf);
99 REGISTER_MUXDEMUX(MOV, mov);
100 REGISTER_MUXER (MP2, mp2);
101 REGISTER_MUXDEMUX(MP3, mp3);
102 REGISTER_MUXER (MP4, mp4);
103 REGISTER_DEMUXER (MPC, mpc);
104 REGISTER_MUXER (MPEG1SYSTEM, mpeg1system);
105 REGISTER_MUXER (MPEG1VCD, mpeg1vcd);
106 REGISTER_MUXER (MPEG1VIDEO, mpeg1video);
107 REGISTER_MUXER (MPEG2DVD, mpeg2dvd);
108 REGISTER_MUXER (MPEG2SVCD, mpeg2svcd);
109 REGISTER_MUXER (MPEG2VIDEO, mpeg2video);
110 REGISTER_MUXER (MPEG2VOB, mpeg2vob);
111 REGISTER_DEMUXER (MPEGPS, mpegps);
112 REGISTER_MUXDEMUX(MPEGTS, mpegts);
113 REGISTER_DEMUXER (MPEGVIDEO, mpegvideo);
114 REGISTER_MUXER (MPJPEG, mpjpeg);
115 REGISTER_DEMUXER (MTV, mtv);
116 REGISTER_DEMUXER (MXF, mxf);
117 REGISTER_DEMUXER (NSV, nsv);
118 REGISTER_MUXER (NULL, null);
119 REGISTER_DEMUXER (NUT, nut);
120 #ifdef CONFIG_LIBNUT
121 REGISTER_MUXER (NUT, nut);
122 #endif
123 REGISTER_DEMUXER (NUV, nuv);
124 REGISTER_DEMUXER (OGG, ogg);
125 #ifdef CONFIG_LIBOGG
126 REGISTER_MUXER (OGG, ogg);
127 #endif
128 REGISTER_MUXDEMUX(PCM_ALAW, pcm_alaw);
129 REGISTER_MUXDEMUX(PCM_MULAW, pcm_mulaw);
130 REGISTER_MUXDEMUX(PCM_S16BE, pcm_s16be);
131 REGISTER_MUXDEMUX(PCM_S16LE, pcm_s16le);
132 REGISTER_MUXDEMUX(PCM_S8, pcm_s8);
133 REGISTER_MUXDEMUX(PCM_U16BE, pcm_u16be);
134 REGISTER_MUXDEMUX(PCM_U16LE, pcm_u16le);
135 REGISTER_MUXDEMUX(PCM_U8, pcm_u8);
136 REGISTER_MUXER (PSP, psp);
137 REGISTER_MUXDEMUX(RAWVIDEO, rawvideo);
138 REGISTER_MUXDEMUX(RM, rm);
139 REGISTER_DEMUXER (ROQ, roq);
140 #ifdef CONFIG_NETWORK
141 REGISTER_DEMUXER (REDIR, redir);
142 REGISTER_MUXER (RTP, rtp);
143 REGISTER_DEMUXER (RTSP, rtsp);
144 REGISTER_DEMUXER (SDP, sdp);
145 av_register_rtp_dynamic_payload_handlers();
146 #endif
147 REGISTER_DEMUXER (SEGAFILM, segafilm);
148 REGISTER_DEMUXER (SHORTEN, shorten);
149 REGISTER_DEMUXER (SMACKER, smacker);
150 REGISTER_DEMUXER (SOL, sol);
151 REGISTER_DEMUXER (STR, str);
152 REGISTER_MUXDEMUX(SWF, swf);
153 REGISTER_MUXER (TG2, tg2);
154 REGISTER_MUXER (TGP, tgp);
155 REGISTER_DEMUXER (TIERTEXSEQ, tiertexseq);
156 REGISTER_DEMUXER (TTA, tta);
157 #ifdef CONFIG_VIDEO4LINUX2
158 REGISTER_DEMUXER (V4L2, v4l2);
159 #endif
160 #if defined(CONFIG_VIDEO4LINUX) || defined(CONFIG_BKTR)
161 REGISTER_DEMUXER (VIDEO_GRAB_DEVICE, video_grab_device);
162 #endif
163 REGISTER_DEMUXER (VMD, vmd);
164 REGISTER_MUXDEMUX(VOC, voc);
165 REGISTER_MUXDEMUX(WAV, wav);
166 REGISTER_DEMUXER (WC3, wc3);
167 REGISTER_DEMUXER (WSAUD, wsaud);
168 REGISTER_DEMUXER (WSVQA, wsvqa);
169 REGISTER_DEMUXER (WV, wv);
170 #ifdef CONFIG_X11GRAB
171 REGISTER_DEMUXER (X11_GRAB_DEVICE, x11_grab_device);
172 #endif
173 REGISTER_MUXDEMUX(YUV4MPEGPIPE, yuv4mpegpipe);
174
175 #ifdef CONFIG_PROTOCOLS
176 /* file protocols */
177 register_protocol(&file_protocol);
178 register_protocol(&pipe_protocol);
179 #ifdef CONFIG_NETWORK
180 register_protocol(&udp_protocol);
181 register_protocol(&rtp_protocol);
182 register_protocol(&tcp_protocol);
183 register_protocol(&http_protocol);
184 #endif
185 #endif
186 }