allformats.c 9.96 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
#include "version.h"
26

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

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

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

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

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

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

49 50
    avcodec_register_all();

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

Diego Biurrun's avatar
Diego Biurrun committed
244
    /* protocols */
245
#if FF_API_APPLEHTTP_PROTO
246
    REGISTER_PROTOCOL (APPLEHTTP, applehttp);
247
#endif
248
    REGISTER_PROTOCOL (CONCAT, concat);
249
    REGISTER_PROTOCOL (CRYPTO, crypto);
Samuel Pitoiset's avatar
Samuel Pitoiset committed
250
    REGISTER_PROTOCOL (FFRTMPCRYPT, ffrtmpcrypt);
251
    REGISTER_PROTOCOL (FFRTMPHTTP, ffrtmphttp);
252
    REGISTER_PROTOCOL (FILE, file);
253
    REGISTER_PROTOCOL (GOPHER, gopher);
254
    REGISTER_PROTOCOL (HLS, hls);
255
    REGISTER_PROTOCOL (HTTP, http);
256
    REGISTER_PROTOCOL (HTTPPROXY, httpproxy);
257
    REGISTER_PROTOCOL (HTTPS, https);
258
    REGISTER_PROTOCOL (MMSH, mmsh);
259
    REGISTER_PROTOCOL (MMST, mmst);
Måns Rullgård's avatar
Måns Rullgård committed
260
    REGISTER_PROTOCOL (MD5,  md5);
261
    REGISTER_PROTOCOL (PIPE, pipe);
262
    REGISTER_PROTOCOL (RTMP, rtmp);
Samuel Pitoiset's avatar
Samuel Pitoiset committed
263
    REGISTER_PROTOCOL (RTMPE, rtmpe);
Samuel Pitoiset's avatar
Samuel Pitoiset committed
264
    REGISTER_PROTOCOL (RTMPS, rtmps);
Samuel Pitoiset's avatar
Samuel Pitoiset committed
265
    REGISTER_PROTOCOL (RTMPT, rtmpt);
Samuel Pitoiset's avatar
Samuel Pitoiset committed
266
    REGISTER_PROTOCOL (RTMPTE, rtmpte);
Samuel Pitoiset's avatar
Samuel Pitoiset committed
267
    REGISTER_PROTOCOL (RTMPTS, rtmpts);
268
    REGISTER_PROTOCOL (RTP, rtp);
269
    REGISTER_PROTOCOL (SCTP, sctp);
270
    REGISTER_PROTOCOL (TCP, tcp);
271
    REGISTER_PROTOCOL (TLS, tls);
272
    REGISTER_PROTOCOL (UDP, udp);
273 274 275 276 277 278 279

    /* external libraries */
    REGISTER_PROTOCOL (LIBRTMP, librtmp);
    REGISTER_PROTOCOL (LIBRTMPE, librtmpe);
    REGISTER_PROTOCOL (LIBRTMPS, librtmps);
    REGISTER_PROTOCOL (LIBRTMPT, librtmpt);
    REGISTER_PROTOCOL (LIBRTMPTE, librtmpte);
280
}