allformats.c 9.43 KB
Newer Older
1 2 3 4
/*
 * Register all the formats and protocols
 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
 *
5
 * This file is part of Libav.
6
 *
7
 * Libav is free software; you can redistribute it and/or
8 9
 * modify it under the terms of the GNU Lesser General Public
 * 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
 * Libav is distributed in the hope that it will be useful,
13 14 15 16 17
 * 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
18
 * License along with Libav; 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 "rtp.h"
23
#include "rdt.h"
24
#include "url.h"
25

Diego Biurrun's avatar
Diego Biurrun committed
26
#define REGISTER_MUXER(X,x) { \
27 28
    extern AVOutputFormat ff_##x##_muxer; \
    if(CONFIG_##X##_MUXER) av_register_output_format(&ff_##x##_muxer); }
Diego Biurrun's avatar
Diego Biurrun committed
29

Diego Biurrun's avatar
Diego Biurrun committed
30
#define REGISTER_DEMUXER(X,x) { \
31 32
    extern AVInputFormat ff_##x##_demuxer; \
    if(CONFIG_##X##_DEMUXER) av_register_input_format(&ff_##x##_demuxer); }
Diego Biurrun's avatar
Diego Biurrun committed
33

34
#define REGISTER_MUXDEMUX(X,x)  REGISTER_MUXER(X,x); REGISTER_DEMUXER(X,x)
Diego Biurrun's avatar
Diego Biurrun committed
35

Diego Biurrun's avatar
Diego Biurrun committed
36
#define REGISTER_PROTOCOL(X,x) { \
37
    extern URLProtocol ff_##x##_protocol; \
38
    if(CONFIG_##X##_PROTOCOL) ffurl_register_protocol(&ff_##x##_protocol, sizeof(ff_##x##_protocol)); }
39

40 41
void av_register_all(void)
{
42
    static int initialized;
43

44
    if (initialized)
45
        return;
46
    initialized = 1;
47

48 49
    avcodec_register_all();

Diego Biurrun's avatar
Diego Biurrun committed
50
    /* (de)muxers */
51
    REGISTER_MUXER    (A64, a64);
52 53 54
    REGISTER_DEMUXER  (AAC, aac);
    REGISTER_MUXDEMUX (AC3, ac3);
    REGISTER_MUXER    (ADTS, adts);
Justin Ruggles's avatar
Justin Ruggles committed
55
    REGISTER_MUXDEMUX (ADX, adx);
56
    REGISTER_DEMUXER  (AEA, aea);
57 58
    REGISTER_MUXDEMUX (AIFF, aiff);
    REGISTER_MUXDEMUX (AMR, amr);
Peter Ross's avatar
Peter Ross committed
59
    REGISTER_DEMUXER  (ANM, anm);
60
    REGISTER_DEMUXER  (APC, apc);
Kostya Shishkov's avatar
Kostya Shishkov committed
61
    REGISTER_DEMUXER  (APE, ape);
62
    REGISTER_DEMUXER  (APPLEHTTP, applehttp);
63
    REGISTER_MUXDEMUX (ASF, asf);
Michael Niedermayer's avatar
Michael Niedermayer committed
64
    REGISTER_MUXDEMUX (ASS, ass);
65 66 67
    REGISTER_MUXER    (ASF_STREAM, asf_stream);
    REGISTER_MUXDEMUX (AU, au);
    REGISTER_MUXDEMUX (AVI, avi);
68
    REGISTER_DEMUXER  (AVISYNTH, avisynth);
Baptiste Coudurier's avatar
Baptiste Coudurier committed
69
    REGISTER_MUXER    (AVM2, avm2);
70 71
    REGISTER_DEMUXER  (AVS, avs);
    REGISTER_DEMUXER  (BETHSOFTVID, bethsoftvid);
Sisir Koppaka's avatar
Sisir Koppaka committed
72
    REGISTER_DEMUXER  (BFI, bfi);
Peter Ross's avatar
Peter Ross committed
73
    REGISTER_DEMUXER  (BINK, bink);
Kostya Shishkov's avatar
Kostya Shishkov committed
74
    REGISTER_DEMUXER  (BMV, bmv);
75
    REGISTER_DEMUXER  (C93, c93);
Peter Ross's avatar
Peter Ross committed
76
    REGISTER_DEMUXER  (CAF, caf);
77
    REGISTER_MUXDEMUX (CAVSVIDEO, cavsvideo);
Michael Tison's avatar
Michael Tison committed
78
    REGISTER_DEMUXER  (CDG, cdg);
79
    REGISTER_MUXER    (CRC, crc);
Peter Ross's avatar
Peter Ross committed
80
    REGISTER_MUXDEMUX (DAUD, daud);
Kostya Shishkov's avatar
Kostya Shishkov committed
81
    REGISTER_DEMUXER  (DFA, dfa);
82
    REGISTER_MUXDEMUX (DIRAC, dirac);
Baptiste Coudurier's avatar
Baptiste Coudurier committed
83
    REGISTER_MUXDEMUX (DNXHD, dnxhd);
84
    REGISTER_DEMUXER  (DSICIN, dsicin);
Benjamin Larsson's avatar
Benjamin Larsson committed
85
    REGISTER_MUXDEMUX (DTS, dts);
86 87 88
    REGISTER_MUXDEMUX (DV, dv);
    REGISTER_DEMUXER  (DXA, dxa);
    REGISTER_DEMUXER  (EA, ea);
89
    REGISTER_DEMUXER  (EA_CDATA, ea_cdata);
90
    REGISTER_MUXDEMUX (EAC3, eac3);
91
    REGISTER_MUXDEMUX (FFM, ffm);
Anton Khirnov's avatar
Anton Khirnov committed
92
    REGISTER_MUXDEMUX (FFMETADATA, ffmetadata);
Peter Ross's avatar
Peter Ross committed
93
    REGISTER_MUXDEMUX (FILMSTRIP, filmstrip);
94 95 96 97 98
    REGISTER_MUXDEMUX (FLAC, flac);
    REGISTER_DEMUXER  (FLIC, flic);
    REGISTER_MUXDEMUX (FLV, flv);
    REGISTER_DEMUXER  (FOURXM, fourxm);
    REGISTER_MUXER    (FRAMECRC, framecrc);
99
    REGISTER_MUXER    (FRAMEMD5, framemd5);
100
    REGISTER_MUXDEMUX (G722, g722);
101
    REGISTER_MUXER    (GIF, gif);
102
    REGISTER_DEMUXER  (GSM, gsm);
103 104 105 106 107
    REGISTER_MUXDEMUX (GXF, gxf);
    REGISTER_MUXDEMUX (H261, h261);
    REGISTER_MUXDEMUX (H263, h263);
    REGISTER_MUXDEMUX (H264, h264);
    REGISTER_DEMUXER  (IDCIN, idcin);
Jai Menon's avatar
Jai Menon committed
108
    REGISTER_DEMUXER  (IFF, iff);
109 110 111 112
    REGISTER_MUXDEMUX (IMAGE2, image2);
    REGISTER_MUXDEMUX (IMAGE2PIPE, image2pipe);
    REGISTER_DEMUXER  (INGENIENT, ingenient);
    REGISTER_DEMUXER  (IPMOVIE, ipmovie);
113
    REGISTER_MUXER    (IPOD, ipod);
114
    REGISTER_MUXER    (ISMV, ismv);
115
    REGISTER_DEMUXER  (ISS, iss);
116
    REGISTER_DEMUXER  (IV8, iv8);
117
    REGISTER_MUXDEMUX (IVF, ivf);
Peter Ross's avatar
Peter Ross committed
118
    REGISTER_DEMUXER  (JV, jv);
Janne Grunau's avatar
Janne Grunau committed
119
    REGISTER_MUXDEMUX (LATM, latm);
120
    REGISTER_DEMUXER  (LMLM4, lmlm4);
121
    REGISTER_DEMUXER  (LXF, lxf);
122
    REGISTER_MUXDEMUX (M4V, m4v);
123
    REGISTER_MUXER    (MD5, md5);
124 125 126
    REGISTER_MUXDEMUX (MATROSKA, matroska);
    REGISTER_MUXER    (MATROSKA_AUDIO, matroska_audio);
    REGISTER_MUXDEMUX (MJPEG, mjpeg);
Ramiro Polla's avatar
Ramiro Polla committed
127
    REGISTER_MUXDEMUX (MLP, mlp);
128 129 130 131 132 133 134
    REGISTER_DEMUXER  (MM, mm);
    REGISTER_MUXDEMUX (MMF, mmf);
    REGISTER_MUXDEMUX (MOV, mov);
    REGISTER_MUXER    (MP2, mp2);
    REGISTER_MUXDEMUX (MP3, mp3);
    REGISTER_MUXER    (MP4, mp4);
    REGISTER_DEMUXER  (MPC, mpc);
135
    REGISTER_DEMUXER  (MPC8, mpc8);
136 137 138 139 140 141 142 143 144 145 146 147
    REGISTER_MUXER    (MPEG1SYSTEM, mpeg1system);
    REGISTER_MUXER    (MPEG1VCD, mpeg1vcd);
    REGISTER_MUXER    (MPEG1VIDEO, mpeg1video);
    REGISTER_MUXER    (MPEG2DVD, mpeg2dvd);
    REGISTER_MUXER    (MPEG2SVCD, mpeg2svcd);
    REGISTER_MUXER    (MPEG2VIDEO, mpeg2video);
    REGISTER_MUXER    (MPEG2VOB, mpeg2vob);
    REGISTER_DEMUXER  (MPEGPS, mpegps);
    REGISTER_MUXDEMUX (MPEGTS, mpegts);
    REGISTER_DEMUXER  (MPEGTSRAW, mpegtsraw);
    REGISTER_DEMUXER  (MPEGVIDEO, mpegvideo);
    REGISTER_MUXER    (MPJPEG, mpjpeg);
Ramiro Polla's avatar
Ramiro Polla committed
148
    REGISTER_DEMUXER  (MSNWC_TCP, msnwc_tcp);
149
    REGISTER_DEMUXER  (MTV, mtv);
Gregory Montoir's avatar
Gregory Montoir committed
150
    REGISTER_DEMUXER  (MVI, mvi);
151
    REGISTER_MUXDEMUX (MXF, mxf);
Baptiste Coudurier's avatar
Baptiste Coudurier committed
152
    REGISTER_MUXER    (MXF_D10, mxf_d10);
Anatoly Nenashev's avatar
Anatoly Nenashev committed
153
    REGISTER_DEMUXER  (MXG, mxg);
Nicolas Martin's avatar
Nicolas Martin committed
154
    REGISTER_DEMUXER  (NC, nc);
155 156 157 158
    REGISTER_DEMUXER  (NSV, nsv);
    REGISTER_MUXER    (NULL, null);
    REGISTER_MUXDEMUX (NUT, nut);
    REGISTER_DEMUXER  (NUV, nuv);
Baptiste Coudurier's avatar
Baptiste Coudurier committed
159
    REGISTER_MUXDEMUX (OGG, ogg);
160
    REGISTER_MUXDEMUX (OMA, oma);
161 162
    REGISTER_MUXDEMUX (PCM_ALAW,  pcm_alaw);
    REGISTER_MUXDEMUX (PCM_MULAW, pcm_mulaw);
163 164 165 166 167 168 169 170
    REGISTER_MUXDEMUX (PCM_F64BE, pcm_f64be);
    REGISTER_MUXDEMUX (PCM_F64LE, pcm_f64le);
    REGISTER_MUXDEMUX (PCM_F32BE, pcm_f32be);
    REGISTER_MUXDEMUX (PCM_F32LE, pcm_f32le);
    REGISTER_MUXDEMUX (PCM_S32BE, pcm_s32be);
    REGISTER_MUXDEMUX (PCM_S32LE, pcm_s32le);
    REGISTER_MUXDEMUX (PCM_S24BE, pcm_s24be);
    REGISTER_MUXDEMUX (PCM_S24LE, pcm_s24le);
171 172 173
    REGISTER_MUXDEMUX (PCM_S16BE, pcm_s16be);
    REGISTER_MUXDEMUX (PCM_S16LE, pcm_s16le);
    REGISTER_MUXDEMUX (PCM_S8,    pcm_s8);
174 175 176 177
    REGISTER_MUXDEMUX (PCM_U32BE, pcm_u32be);
    REGISTER_MUXDEMUX (PCM_U32LE, pcm_u32le);
    REGISTER_MUXDEMUX (PCM_U24BE, pcm_u24be);
    REGISTER_MUXDEMUX (PCM_U24LE, pcm_u24le);
178 179 180
    REGISTER_MUXDEMUX (PCM_U16BE, pcm_u16be);
    REGISTER_MUXDEMUX (PCM_U16LE, pcm_u16le);
    REGISTER_MUXDEMUX (PCM_U8,    pcm_u8);
181
    REGISTER_DEMUXER  (PMP, pmp);
182
    REGISTER_MUXER    (PSP, psp);
Ivo van Poorten's avatar
Ivo van Poorten committed
183
    REGISTER_DEMUXER  (PVA, pva);
Kenan Gillet's avatar
Kenan Gillet committed
184
    REGISTER_DEMUXER  (QCP, qcp);
Baptiste Coudurier's avatar
Baptiste Coudurier committed
185
    REGISTER_DEMUXER  (R3D, r3d);
186
    REGISTER_MUXDEMUX (RAWVIDEO, rawvideo);
Sascha Sommer's avatar
Sascha Sommer committed
187
    REGISTER_DEMUXER  (RL2, rl2);
188 189
    REGISTER_MUXDEMUX (RM, rm);
    REGISTER_MUXDEMUX (ROQ, roq);
Eli Friedman's avatar
Eli Friedman committed
190
    REGISTER_DEMUXER  (RPL, rpl);
191
    REGISTER_MUXDEMUX (RSO, rso);
192
    REGISTER_MUXDEMUX (RTP, rtp);
Martin Storsjö's avatar
Martin Storsjö committed
193
    REGISTER_MUXDEMUX (RTSP, rtsp);
Martin Storsjö's avatar
Martin Storsjö committed
194
    REGISTER_MUXDEMUX (SAP, sap);
195
    REGISTER_DEMUXER  (SDP, sdp);
196
#if CONFIG_RTPDEC
Ryan Martell's avatar
Ryan Martell committed
197
    av_register_rtp_dynamic_payload_handlers();
198
    av_register_rdt_dynamic_payload_handlers();
199
#endif
200
    REGISTER_DEMUXER  (SEGAFILM, segafilm);
201
    REGISTER_MUXER    (SEGMENT, segment);
202
    REGISTER_DEMUXER  (SHORTEN, shorten);
203
    REGISTER_DEMUXER  (SIFF, siff);
204
    REGISTER_DEMUXER  (SMACKER, smacker);
Paul B Mahol's avatar
Paul B Mahol committed
205
    REGISTER_MUXDEMUX (SMJPEG, smjpeg);
206
    REGISTER_DEMUXER  (SOL, sol);
207
    REGISTER_MUXDEMUX (SOX, sox);
Anssi Hannula's avatar
Anssi Hannula committed
208
    REGISTER_MUXDEMUX (SPDIF, spdif);
Aurelien Jacobs's avatar
Aurelien Jacobs committed
209
    REGISTER_MUXDEMUX (SRT, srt);
210 211 212 213 214 215
    REGISTER_DEMUXER  (STR, str);
    REGISTER_MUXDEMUX (SWF, swf);
    REGISTER_MUXER    (TG2, tg2);
    REGISTER_MUXER    (TGP, tgp);
    REGISTER_DEMUXER  (THP, thp);
    REGISTER_DEMUXER  (TIERTEXSEQ, tiertexseq);
216
    REGISTER_DEMUXER  (TMV, tmv);
Ramiro Polla's avatar
Ramiro Polla committed
217
    REGISTER_MUXDEMUX (TRUEHD, truehd);
218 219
    REGISTER_DEMUXER  (TTA, tta);
    REGISTER_DEMUXER  (TXD, txd);
Peter Ross's avatar
Peter Ross committed
220
    REGISTER_DEMUXER  (TTY, tty);
221
    REGISTER_DEMUXER  (VC1, vc1);
222
    REGISTER_MUXDEMUX (VC1T, vc1t);
223 224
    REGISTER_DEMUXER  (VMD, vmd);
    REGISTER_MUXDEMUX (VOC, voc);
Vitor Sessak's avatar
Vitor Sessak committed
225
    REGISTER_DEMUXER  (VQF, vqf);
Daniel Verkamp's avatar
Daniel Verkamp committed
226
    REGISTER_DEMUXER  (W64, w64);
227 228
    REGISTER_MUXDEMUX (WAV, wav);
    REGISTER_DEMUXER  (WC3, wc3);
James Zern's avatar
James Zern committed
229
    REGISTER_MUXER    (WEBM, webm);
230 231
    REGISTER_DEMUXER  (WSAUD, wsaud);
    REGISTER_DEMUXER  (WSVQA, wsvqa);
Peter Ross's avatar
Peter Ross committed
232
    REGISTER_DEMUXER  (WTV, wtv);
233
    REGISTER_DEMUXER  (WV, wv);
Robert Marston's avatar
Robert Marston committed
234
    REGISTER_DEMUXER  (XA, xa);
Sven Hesse's avatar
Sven Hesse committed
235
    REGISTER_DEMUXER  (XMV, xmv);
Max Horn's avatar
Max Horn committed
236
    REGISTER_DEMUXER  (XWMA, xwma);
237
    REGISTER_DEMUXER  (YOP, yop);
238
    REGISTER_MUXDEMUX (YUV4MPEGPIPE, yuv4mpegpipe);
239

240 241 242
    /* external libraries */
    REGISTER_MUXDEMUX (LIBNUT, libnut);

Diego Biurrun's avatar
Diego Biurrun committed
243
    /* protocols */
244
    REGISTER_PROTOCOL (APPLEHTTP, applehttp);
245
    REGISTER_PROTOCOL (CONCAT, concat);
246
    REGISTER_PROTOCOL (CRYPTO, crypto);
247
    REGISTER_PROTOCOL (FILE, file);
248
    REGISTER_PROTOCOL (GOPHER, gopher);
249
    REGISTER_PROTOCOL (HTTP, http);
250
    REGISTER_PROTOCOL (HTTPPROXY, httpproxy);
251
    REGISTER_PROTOCOL (HTTPS, https);
252
    REGISTER_PROTOCOL (MMSH, mmsh);
253
    REGISTER_PROTOCOL (MMST, mmst);
Måns Rullgård's avatar
Måns Rullgård committed
254
    REGISTER_PROTOCOL (MD5,  md5);
255
    REGISTER_PROTOCOL (PIPE, pipe);
256
    REGISTER_PROTOCOL (RTMP, rtmp);
257 258 259 260
    REGISTER_PROTOCOL (RTMPE, rtmpe);
    REGISTER_PROTOCOL (RTMPS, rtmps);
    REGISTER_PROTOCOL (RTMPT, rtmpt);
    REGISTER_PROTOCOL (RTMPTE, rtmpte);
261 262
    REGISTER_PROTOCOL (RTP, rtp);
    REGISTER_PROTOCOL (TCP, tcp);
263
    REGISTER_PROTOCOL (TLS, tls);
264
    REGISTER_PROTOCOL (UDP, udp);
265
}