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