avformat: Add the https protocol
[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 Libav.
6 *
7 * Libav 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 * Libav 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 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
26 #define REGISTER_MUXER(X,x) { \
27 extern AVOutputFormat ff_##x##_muxer; \
28 if(CONFIG_##X##_MUXER) av_register_output_format(&ff_##x##_muxer); }
29
30 #define REGISTER_DEMUXER(X,x) { \
31 extern AVInputFormat ff_##x##_demuxer; \
32 if(CONFIG_##X##_DEMUXER) av_register_input_format(&ff_##x##_demuxer); }
33
34 #define REGISTER_MUXDEMUX(X,x) REGISTER_MUXER(X,x); REGISTER_DEMUXER(X,x)
35
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 void av_register_all(void)
41 {
42 static int initialized;
43
44 if (initialized)
45 return;
46 initialized = 1;
47
48 avcodec_register_all();
49
50 /* (de)muxers */
51 REGISTER_MUXER (A64, a64);
52 REGISTER_DEMUXER (AAC, aac);
53 REGISTER_MUXDEMUX (AC3, ac3);
54 REGISTER_MUXER (ADTS, adts);
55 REGISTER_DEMUXER (AEA, aea);
56 REGISTER_MUXDEMUX (AIFF, aiff);
57 REGISTER_MUXDEMUX (AMR, amr);
58 REGISTER_DEMUXER (ANM, anm);
59 REGISTER_DEMUXER (APC, apc);
60 REGISTER_DEMUXER (APE, ape);
61 REGISTER_DEMUXER (APPLEHTTP, applehttp);
62 REGISTER_MUXDEMUX (ASF, asf);
63 REGISTER_MUXDEMUX (ASS, ass);
64 REGISTER_MUXER (ASF_STREAM, asf_stream);
65 REGISTER_MUXDEMUX (AU, au);
66 REGISTER_MUXDEMUX (AVI, avi);
67 REGISTER_DEMUXER (AVISYNTH, avisynth);
68 REGISTER_MUXER (AVM2, avm2);
69 REGISTER_DEMUXER (AVS, avs);
70 REGISTER_DEMUXER (BETHSOFTVID, bethsoftvid);
71 REGISTER_DEMUXER (BFI, bfi);
72 REGISTER_DEMUXER (BINK, bink);
73 REGISTER_DEMUXER (C93, c93);
74 REGISTER_DEMUXER (CAF, caf);
75 REGISTER_MUXDEMUX (CAVSVIDEO, cavsvideo);
76 REGISTER_DEMUXER (CDG, cdg);
77 REGISTER_MUXER (CRC, crc);
78 REGISTER_MUXDEMUX (DAUD, daud);
79 REGISTER_DEMUXER (DFA, dfa);
80 REGISTER_MUXDEMUX (DIRAC, dirac);
81 REGISTER_MUXDEMUX (DNXHD, dnxhd);
82 REGISTER_DEMUXER (DSICIN, dsicin);
83 REGISTER_MUXDEMUX (DTS, dts);
84 REGISTER_MUXDEMUX (DV, dv);
85 REGISTER_DEMUXER (DXA, dxa);
86 REGISTER_DEMUXER (EA, ea);
87 REGISTER_DEMUXER (EA_CDATA, ea_cdata);
88 REGISTER_MUXDEMUX (EAC3, eac3);
89 REGISTER_MUXDEMUX (FFM, ffm);
90 REGISTER_MUXDEMUX (FFMETADATA, ffmetadata);
91 REGISTER_MUXDEMUX (FILMSTRIP, filmstrip);
92 REGISTER_MUXDEMUX (FLAC, flac);
93 REGISTER_DEMUXER (FLIC, flic);
94 REGISTER_MUXDEMUX (FLV, flv);
95 REGISTER_DEMUXER (FOURXM, fourxm);
96 REGISTER_MUXER (FRAMECRC, framecrc);
97 REGISTER_MUXER (FRAMEMD5, framemd5);
98 REGISTER_MUXDEMUX (G722, g722);
99 REGISTER_MUXER (GIF, gif);
100 REGISTER_DEMUXER (GSM, gsm);
101 REGISTER_MUXDEMUX (GXF, gxf);
102 REGISTER_MUXDEMUX (H261, h261);
103 REGISTER_MUXDEMUX (H263, h263);
104 REGISTER_MUXDEMUX (H264, h264);
105 REGISTER_DEMUXER (IDCIN, idcin);
106 REGISTER_DEMUXER (IFF, iff);
107 REGISTER_MUXDEMUX (IMAGE2, image2);
108 REGISTER_MUXDEMUX (IMAGE2PIPE, image2pipe);
109 REGISTER_DEMUXER (INGENIENT, ingenient);
110 REGISTER_DEMUXER (IPMOVIE, ipmovie);
111 REGISTER_MUXER (IPOD, ipod);
112 REGISTER_DEMUXER (ISS, iss);
113 REGISTER_DEMUXER (IV8, iv8);
114 REGISTER_MUXDEMUX (IVF, ivf);
115 REGISTER_DEMUXER (JV, jv);
116 REGISTER_MUXDEMUX (LATM, latm);
117 REGISTER_DEMUXER (LMLM4, lmlm4);
118 REGISTER_DEMUXER (LXF, lxf);
119 REGISTER_MUXDEMUX (M4V, m4v);
120 REGISTER_MUXER (MD5, md5);
121 REGISTER_MUXDEMUX (MATROSKA, matroska);
122 REGISTER_MUXER (MATROSKA_AUDIO, matroska_audio);
123 REGISTER_MUXDEMUX (MJPEG, mjpeg);
124 REGISTER_MUXDEMUX (MLP, mlp);
125 REGISTER_DEMUXER (MM, mm);
126 REGISTER_MUXDEMUX (MMF, mmf);
127 REGISTER_MUXDEMUX (MOV, mov);
128 REGISTER_MUXER (MP2, mp2);
129 REGISTER_MUXDEMUX (MP3, mp3);
130 REGISTER_MUXER (MP4, mp4);
131 REGISTER_DEMUXER (MPC, mpc);
132 REGISTER_DEMUXER (MPC8, mpc8);
133 REGISTER_MUXER (MPEG1SYSTEM, mpeg1system);
134 REGISTER_MUXER (MPEG1VCD, mpeg1vcd);
135 REGISTER_MUXER (MPEG1VIDEO, mpeg1video);
136 REGISTER_MUXER (MPEG2DVD, mpeg2dvd);
137 REGISTER_MUXER (MPEG2SVCD, mpeg2svcd);
138 REGISTER_MUXER (MPEG2VIDEO, mpeg2video);
139 REGISTER_MUXER (MPEG2VOB, mpeg2vob);
140 REGISTER_DEMUXER (MPEGPS, mpegps);
141 REGISTER_MUXDEMUX (MPEGTS, mpegts);
142 REGISTER_DEMUXER (MPEGTSRAW, mpegtsraw);
143 REGISTER_DEMUXER (MPEGVIDEO, mpegvideo);
144 REGISTER_MUXER (MPJPEG, mpjpeg);
145 REGISTER_DEMUXER (MSNWC_TCP, msnwc_tcp);
146 REGISTER_DEMUXER (MTV, mtv);
147 REGISTER_DEMUXER (MVI, mvi);
148 REGISTER_MUXDEMUX (MXF, mxf);
149 REGISTER_MUXER (MXF_D10, mxf_d10);
150 REGISTER_DEMUXER (MXG, mxg);
151 REGISTER_DEMUXER (NC, nc);
152 REGISTER_DEMUXER (NSV, nsv);
153 REGISTER_MUXER (NULL, null);
154 REGISTER_MUXDEMUX (NUT, nut);
155 REGISTER_DEMUXER (NUV, nuv);
156 REGISTER_MUXDEMUX (OGG, ogg);
157 REGISTER_DEMUXER (OMA, oma);
158 REGISTER_MUXDEMUX (PCM_ALAW, pcm_alaw);
159 REGISTER_MUXDEMUX (PCM_MULAW, pcm_mulaw);
160 REGISTER_MUXDEMUX (PCM_F64BE, pcm_f64be);
161 REGISTER_MUXDEMUX (PCM_F64LE, pcm_f64le);
162 REGISTER_MUXDEMUX (PCM_F32BE, pcm_f32be);
163 REGISTER_MUXDEMUX (PCM_F32LE, pcm_f32le);
164 REGISTER_MUXDEMUX (PCM_S32BE, pcm_s32be);
165 REGISTER_MUXDEMUX (PCM_S32LE, pcm_s32le);
166 REGISTER_MUXDEMUX (PCM_S24BE, pcm_s24be);
167 REGISTER_MUXDEMUX (PCM_S24LE, pcm_s24le);
168 REGISTER_MUXDEMUX (PCM_S16BE, pcm_s16be);
169 REGISTER_MUXDEMUX (PCM_S16LE, pcm_s16le);
170 REGISTER_MUXDEMUX (PCM_S8, pcm_s8);
171 REGISTER_MUXDEMUX (PCM_U32BE, pcm_u32be);
172 REGISTER_MUXDEMUX (PCM_U32LE, pcm_u32le);
173 REGISTER_MUXDEMUX (PCM_U24BE, pcm_u24be);
174 REGISTER_MUXDEMUX (PCM_U24LE, pcm_u24le);
175 REGISTER_MUXDEMUX (PCM_U16BE, pcm_u16be);
176 REGISTER_MUXDEMUX (PCM_U16LE, pcm_u16le);
177 REGISTER_MUXDEMUX (PCM_U8, pcm_u8);
178 REGISTER_MUXER (PSP, psp);
179 REGISTER_DEMUXER (PVA, pva);
180 REGISTER_DEMUXER (QCP, qcp);
181 REGISTER_DEMUXER (R3D, r3d);
182 REGISTER_MUXDEMUX (RAWVIDEO, rawvideo);
183 REGISTER_DEMUXER (RL2, rl2);
184 REGISTER_MUXDEMUX (RM, rm);
185 REGISTER_MUXDEMUX (ROQ, roq);
186 REGISTER_DEMUXER (RPL, rpl);
187 REGISTER_MUXDEMUX (RSO, rso);
188 REGISTER_MUXDEMUX (RTP, rtp);
189 REGISTER_MUXDEMUX (RTSP, rtsp);
190 REGISTER_MUXDEMUX (SAP, sap);
191 REGISTER_DEMUXER (SDP, sdp);
192 #if CONFIG_RTPDEC
193 av_register_rtp_dynamic_payload_handlers();
194 av_register_rdt_dynamic_payload_handlers();
195 #endif
196 REGISTER_DEMUXER (SEGAFILM, segafilm);
197 REGISTER_DEMUXER (SHORTEN, shorten);
198 REGISTER_DEMUXER (SIFF, siff);
199 REGISTER_DEMUXER (SMACKER, smacker);
200 REGISTER_DEMUXER (SOL, sol);
201 REGISTER_MUXDEMUX (SOX, sox);
202 REGISTER_MUXDEMUX (SPDIF, spdif);
203 REGISTER_MUXDEMUX (SRT, srt);
204 REGISTER_DEMUXER (STR, str);
205 REGISTER_MUXDEMUX (SWF, swf);
206 REGISTER_MUXER (TG2, tg2);
207 REGISTER_MUXER (TGP, tgp);
208 REGISTER_DEMUXER (THP, thp);
209 REGISTER_DEMUXER (TIERTEXSEQ, tiertexseq);
210 REGISTER_DEMUXER (TMV, tmv);
211 REGISTER_MUXDEMUX (TRUEHD, truehd);
212 REGISTER_DEMUXER (TTA, tta);
213 REGISTER_DEMUXER (TXD, txd);
214 REGISTER_DEMUXER (TTY, tty);
215 REGISTER_DEMUXER (VC1, vc1);
216 REGISTER_MUXDEMUX (VC1T, vc1t);
217 REGISTER_DEMUXER (VMD, vmd);
218 REGISTER_MUXDEMUX (VOC, voc);
219 REGISTER_DEMUXER (VQF, vqf);
220 REGISTER_DEMUXER (W64, w64);
221 REGISTER_MUXDEMUX (WAV, wav);
222 REGISTER_DEMUXER (WC3, wc3);
223 REGISTER_MUXER (WEBM, webm);
224 REGISTER_DEMUXER (WSAUD, wsaud);
225 REGISTER_DEMUXER (WSVQA, wsvqa);
226 REGISTER_DEMUXER (WTV, wtv);
227 REGISTER_DEMUXER (WV, wv);
228 REGISTER_DEMUXER (XA, xa);
229 REGISTER_DEMUXER (XMV, xmv);
230 REGISTER_DEMUXER (XWMA, xwma);
231 REGISTER_DEMUXER (YOP, yop);
232 REGISTER_MUXDEMUX (YUV4MPEGPIPE, yuv4mpegpipe);
233
234 /* external libraries */
235 REGISTER_MUXDEMUX (LIBNUT, libnut);
236
237 /* protocols */
238 REGISTER_PROTOCOL (APPLEHTTP, applehttp);
239 REGISTER_PROTOCOL (CONCAT, concat);
240 REGISTER_PROTOCOL (CRYPTO, crypto);
241 REGISTER_PROTOCOL (FILE, file);
242 REGISTER_PROTOCOL (GOPHER, gopher);
243 REGISTER_PROTOCOL (HTTP, http);
244 REGISTER_PROTOCOL (HTTPS, https);
245 REGISTER_PROTOCOL (MMSH, mmsh);
246 REGISTER_PROTOCOL (MMST, mmst);
247 REGISTER_PROTOCOL (MD5, md5);
248 REGISTER_PROTOCOL (PIPE, pipe);
249 REGISTER_PROTOCOL (RTMP, rtmp);
250 #if CONFIG_LIBRTMP
251 REGISTER_PROTOCOL (RTMP, rtmpt);
252 REGISTER_PROTOCOL (RTMP, rtmpe);
253 REGISTER_PROTOCOL (RTMP, rtmpte);
254 REGISTER_PROTOCOL (RTMP, rtmps);
255 #endif
256 REGISTER_PROTOCOL (RTP, rtp);
257 REGISTER_PROTOCOL (TCP, tcp);
258 REGISTER_PROTOCOL (TLS, tls);
259 REGISTER_PROTOCOL (UDP, udp);
260 }