83c1fa8bc68bd5a03c6c70c5b42d56959ce1c39a
[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 /* If you do not call this function, then you can select exactly which
25 formats you want to support */
26
27 /**
28 * Initialize libavcodec and register all the codecs and formats.
29 */
30 void av_register_all(void)
31 {
32 static int inited = 0;
33
34 if (inited != 0)
35 return;
36 inited = 1;
37
38 avcodec_init();
39 avcodec_register_all();
40
41 #ifdef CONFIG_FOURXM_DEMUXER
42 av_register_input_format(&fourxm_demuxer);
43 #endif
44 #ifdef CONFIG_ADTS_MUXER
45 av_register_output_format(&adts_muxer);
46 #endif
47 #ifdef CONFIG_AIFF_DEMUXER
48 av_register_input_format(&aiff_demuxer);
49 #endif
50 #ifdef CONFIG_AIFF_MUXER
51 av_register_output_format(&aiff_muxer);
52 #endif
53 #ifdef CONFIG_AMR_DEMUXER
54 av_register_input_format(&amr_demuxer);
55 #endif
56 #ifdef CONFIG_AMR_MUXER
57 av_register_output_format(&amr_muxer);
58 #endif
59 #ifdef CONFIG_ASF_DEMUXER
60 av_register_input_format(&asf_demuxer);
61 #endif
62 #ifdef CONFIG_ASF_MUXER
63 av_register_output_format(&asf_muxer);
64 #endif
65 #ifdef CONFIG_ASF_STREAM_MUXER
66 av_register_output_format(&asf_stream_muxer);
67 #endif
68 #ifdef CONFIG_AU_DEMUXER
69 av_register_input_format(&au_demuxer);
70 #endif
71 #ifdef CONFIG_AU_MUXER
72 av_register_output_format(&au_muxer);
73 #endif
74 #if defined(CONFIG_AUDIO_OSS) || defined(CONFIG_AUDIO_BEOS)
75 #ifdef CONFIG_AUDIO_DEMUXER
76 av_register_input_format(&audio_demuxer);
77 #endif
78 #ifdef CONFIG_AUDIO_MUXER
79 av_register_output_format(&audio_muxer);
80 #endif
81 #endif /* CONFIG_AUDIO_OSS || CONFIG_AUDIO_BEOS */
82 #ifdef CONFIG_AVI_DEMUXER
83 av_register_input_format(&avi_demuxer);
84 #endif
85 #ifdef CONFIG_AVI_MUXER
86 av_register_output_format(&avi_muxer);
87 #endif
88 #ifdef CONFIG_AVISYNTH
89 av_register_input_format(&avisynth_demuxer);
90 #endif
91 #ifdef CONFIG_AVS_DEMUXER
92 av_register_input_format(&avs_demuxer);
93 #endif
94 #ifdef CONFIG_CRC_MUXER
95 av_register_output_format(&crc_muxer);
96 #endif
97 #ifdef CONFIG_FRAMECRC_MUXER
98 av_register_output_format(&framecrc_muxer);
99 #endif
100 #ifdef CONFIG_DAUD_DEMUXER
101 av_register_input_format(&daud_demuxer);
102 #endif
103 #ifdef CONFIG_DC1394
104 #ifdef CONFIG_DC1394_DEMUXER
105 av_register_input_format(&dc1394_demuxer);
106 #endif
107 #endif /* CONFIG_DC1394 */
108 #ifdef CONFIG_DSICIN_DEMUXER
109 av_register_input_format(&dsicin_demuxer);
110 #endif
111 #ifdef CONFIG_DV1394
112 #ifdef CONFIG_DV1394_DEMUXER
113 av_register_input_format(&dv1394_demuxer);
114 #endif
115 #endif /* CONFIG_DV1394 */
116 #ifdef CONFIG_DV_DEMUXER
117 av_register_input_format(&dv_demuxer);
118 #endif
119 #ifdef CONFIG_DV_MUXER
120 av_register_output_format(&dv_muxer);
121 #endif
122 #ifdef CONFIG_EA_DEMUXER
123 av_register_input_format(&ea_demuxer);
124 #endif
125 #ifdef CONFIG_FFM_DEMUXER
126 av_register_input_format(&ffm_demuxer);
127 #endif
128 #ifdef CONFIG_FFM_MUXER
129 av_register_output_format(&ffm_muxer);
130 #endif
131 #ifdef CONFIG_FLIC_DEMUXER
132 av_register_input_format(&flic_demuxer);
133 #endif
134 #ifdef CONFIG_FLV_DEMUXER
135 av_register_input_format(&flv_demuxer);
136 #endif
137 #ifdef CONFIG_FLV_MUXER
138 av_register_output_format(&flv_muxer);
139 #endif
140 #ifdef CONFIG_GIF_MUXER
141 av_register_output_format(&gif_muxer);
142 #endif
143 #ifdef CONFIG_GIF_DEMUXER
144 av_register_input_format(&gif_demuxer);
145 #endif
146 #ifdef CONFIG_GXF_DEMUXER
147 av_register_input_format(&gxf_demuxer);
148 #endif
149 #if defined(CONFIG_GXF_MUXER) && defined(CONFIG_GPL)
150 av_register_output_format(&gxf_muxer);
151 #endif
152 #ifdef CONFIG_IDCIN_DEMUXER
153 av_register_input_format(&idcin_demuxer);
154 #endif
155 #ifdef CONFIG_ROQ_DEMUXER
156 av_register_input_format(&roq_demuxer);
157 #endif
158 #ifdef CONFIG_IMAGE2_DEMUXER
159 av_register_input_format(&image2_demuxer);
160 #endif
161 #ifdef CONFIG_IMAGE2PIPE_DEMUXER
162 av_register_input_format(&image2pipe_demuxer);
163 #endif
164 #ifdef CONFIG_IMAGE2_MUXER
165 av_register_output_format(&image2_muxer);
166 #endif
167 #ifdef CONFIG_IMAGE2PIPE_MUXER
168 av_register_output_format(&image2pipe_muxer);
169 #endif
170 #ifdef CONFIG_IMAGE_DEMUXER
171 av_register_input_format(&image_demuxer);
172 #endif
173 #ifdef CONFIG_IMAGEPIPE_DEMUXER
174 av_register_input_format(&imagepipe_demuxer);
175 #endif
176 #ifdef CONFIG_IMAGE_MUXER
177 av_register_output_format(&image_muxer);
178 #endif
179 #ifdef CONFIG_IMAGEPIPE_MUXER
180 av_register_output_format(&imagepipe_muxer);
181 #endif
182 #ifdef CONFIG_IPMOVIE_DEMUXER
183 av_register_input_format(&ipmovie_demuxer);
184 #endif
185 #ifdef CONFIG_MATROSKA_DEMUXER
186 av_register_input_format(&matroska_demuxer);
187 #endif
188 #ifdef CONFIG_MM_DEMUXER
189 av_register_input_format(&mm_demuxer);
190 #endif
191 #ifdef CONFIG_MMF_DEMUXER
192 av_register_input_format(&mmf_demuxer);
193 #endif
194 #ifdef CONFIG_MMF_MUXER
195 av_register_output_format(&mmf_muxer);
196 #endif
197 #ifdef CONFIG_MOV_DEMUXER
198 av_register_input_format(&mov_demuxer);
199 #endif
200 #ifdef CONFIG_MOV_MUXER
201 av_register_output_format(&mov_muxer);
202 #endif
203 #ifdef CONFIG_TGP_MUXER
204 av_register_output_format(&tgp_muxer);
205 #endif
206 #ifdef CONFIG_MP4_MUXER
207 av_register_output_format(&mp4_muxer);
208 #endif
209 #ifdef CONFIG_PSP_MUXER
210 av_register_output_format(&psp_muxer);
211 #endif
212 #ifdef CONFIG_TG2_MUXER
213 av_register_output_format(&tg2_muxer);
214 #endif
215 #ifdef CONFIG_MP3_DEMUXER
216 av_register_input_format(&mp3_demuxer);
217 #endif
218 #ifdef CONFIG_MP2_MUXER
219 av_register_output_format(&mp2_muxer);
220 #endif
221 #ifdef CONFIG_MP3_MUXER
222 av_register_output_format(&mp3_muxer);
223 #endif
224 #ifdef CONFIG_MPEG1SYSTEM_MUXER
225 av_register_output_format(&mpeg1system_muxer);
226 #endif
227 #ifdef CONFIG_MPEG1VCD_MUXER
228 av_register_output_format(&mpeg1vcd_muxer);
229 #endif
230 #ifdef CONFIG_MPEG2VOB_MUXER
231 av_register_output_format(&mpeg2vob_muxer);
232 #endif
233 #ifdef CONFIG_MPEG2SVCD_MUXER
234 av_register_output_format(&mpeg2svcd_muxer);
235 #endif
236 #ifdef CONFIG_MPEG2DVD_MUXER
237 av_register_output_format(&mpeg2dvd_muxer);
238 #endif
239 #ifdef CONFIG_MPEGPS_DEMUXER
240 av_register_input_format(&mpegps_demuxer);
241 #endif
242 #ifdef CONFIG_MPEGTS_DEMUXER
243 av_register_input_format(&mpegts_demuxer);
244 #endif
245 #ifdef CONFIG_MPEGTS_MUXER
246 av_register_output_format(&mpegts_muxer);
247 #endif
248 #ifdef CONFIG_MPJPEG_MUXER
249 av_register_output_format(&mpjpeg_muxer);
250 #endif
251 #ifdef CONFIG_MXF_DEMUXER
252 av_register_input_format(&mxf_demuxer);
253 #endif
254 #ifdef CONFIG_NSV_DEMUXER
255 av_register_input_format(&nsv_demuxer);
256 #endif
257 #ifdef CONFIG_NUT_DEMUXER
258 av_register_input_format(&nut_demuxer);
259 #endif
260 #ifdef CONFIG_NUT_MUXER
261 av_register_output_format(&nut_muxer);
262 #endif
263 #ifdef CONFIG_NUV_DEMUXER
264 av_register_input_format(&nuv_demuxer);
265 #endif
266 #ifdef CONFIG_OGG_DEMUXER
267 av_register_input_format(&ogg_demuxer);
268 #endif
269 #ifdef CONFIG_LIBOGG
270 #ifdef CONFIG_OGG_MUXER
271 av_register_output_format(&ogg_muxer);
272 #endif
273 #endif /* CONFIG_LIBOGG */
274 #ifdef CONFIG_STR_DEMUXER
275 av_register_input_format(&str_demuxer);
276 #endif
277 #ifdef CONFIG_SHORTEN_DEMUXER
278 av_register_input_format(&shorten_demuxer);
279 #endif
280 #ifdef CONFIG_FLAC_DEMUXER
281 av_register_input_format(&flac_demuxer);
282 #endif
283 #ifdef CONFIG_FLAC_MUXER
284 av_register_output_format(&flac_muxer);
285 #endif
286 #ifdef CONFIG_AC3_DEMUXER
287 av_register_input_format(&ac3_demuxer);
288 #endif
289 #ifdef CONFIG_AC3_MUXER
290 av_register_output_format(&ac3_muxer);
291 #endif
292 #ifdef CONFIG_DTS_DEMUXER
293 av_register_input_format(&dts_demuxer);
294 #endif
295 #ifdef CONFIG_AAC_DEMUXER
296 av_register_input_format(&aac_demuxer);
297 #endif
298 #ifdef CONFIG_H261_DEMUXER
299 av_register_input_format(&h261_demuxer);
300 #endif
301 #ifdef CONFIG_H261_MUXER
302 av_register_output_format(&h261_muxer);
303 #endif
304 #ifdef CONFIG_H263_DEMUXER
305 av_register_input_format(&h263_demuxer);
306 #endif
307 #ifdef CONFIG_H263_MUXER
308 av_register_output_format(&h263_muxer);
309 #endif
310 #ifdef CONFIG_M4V_DEMUXER
311 av_register_input_format(&m4v_demuxer);
312 #endif
313 #ifdef CONFIG_M4V_MUXER
314 av_register_output_format(&m4v_muxer);
315 #endif
316 #ifdef CONFIG_H264_DEMUXER
317 av_register_input_format(&h264_demuxer);
318 #endif
319 #ifdef CONFIG_H264_MUXER
320 av_register_output_format(&h264_muxer);
321 #endif
322 #ifdef CONFIG_MPEGVIDEO_DEMUXER
323 av_register_input_format(&mpegvideo_demuxer);
324 #endif
325 #ifdef CONFIG_MPEG1VIDEO_MUXER
326 av_register_output_format(&mpeg1video_muxer);
327 #endif
328 #ifdef CONFIG_MPEG2VIDEO_MUXER
329 av_register_output_format(&mpeg2video_muxer);
330 #endif
331 #ifdef CONFIG_MJPEG_DEMUXER
332 av_register_input_format(&mjpeg_demuxer);
333 #endif
334 #ifdef CONFIG_INGENIENT_DEMUXER
335 av_register_input_format(&ingenient_demuxer);
336 #endif
337 #ifdef CONFIG_MJPEG_MUXER
338 av_register_output_format(&mjpeg_muxer);
339 #endif
340 #ifdef CONFIG_PCM_S16LE_DEMUXER
341 av_register_input_format(&pcm_s16le_demuxer);
342 #endif
343 #ifdef CONFIG_PCM_S16LE_MUXER
344 av_register_output_format(&pcm_s16le_muxer);
345 #endif
346 #ifdef CONFIG_PCM_S16BE_DEMUXER
347 av_register_input_format(&pcm_s16be_demuxer);
348 #endif
349 #ifdef CONFIG_PCM_S16BE_MUXER
350 av_register_output_format(&pcm_s16be_muxer);
351 #endif
352 #ifdef CONFIG_PCM_U16LE_DEMUXER
353 av_register_input_format(&pcm_u16le_demuxer);
354 #endif
355 #ifdef CONFIG_PCM_U16LE_MUXER
356 av_register_output_format(&pcm_u16le_muxer);
357 #endif
358 #ifdef CONFIG_PCM_U16BE_DEMUXER
359 av_register_input_format(&pcm_u16be_demuxer);
360 #endif
361 #ifdef CONFIG_PCM_U16BE_MUXER
362 av_register_output_format(&pcm_u16be_muxer);
363 #endif
364 #ifdef CONFIG_PCM_S8_DEMUXER
365 av_register_input_format(&pcm_s8_demuxer);
366 #endif
367 #ifdef CONFIG_PCM_S8_MUXER
368 av_register_output_format(&pcm_s8_muxer);
369 #endif
370 #ifdef CONFIG_PCM_U8_DEMUXER
371 av_register_input_format(&pcm_u8_demuxer);
372 #endif
373 #ifdef CONFIG_PCM_U8_MUXER
374 av_register_output_format(&pcm_u8_muxer);
375 #endif
376 #ifdef CONFIG_PCM_MULAW_DEMUXER
377 av_register_input_format(&pcm_mulaw_demuxer);
378 #endif
379 #ifdef CONFIG_PCM_MULAW_MUXER
380 av_register_output_format(&pcm_mulaw_muxer);
381 #endif
382 #ifdef CONFIG_PCM_ALAW_DEMUXER
383 av_register_input_format(&pcm_alaw_demuxer);
384 #endif
385 #ifdef CONFIG_PCM_ALAW_MUXER
386 av_register_output_format(&pcm_alaw_muxer);
387 #endif
388 #ifdef CONFIG_RAWVIDEO_DEMUXER
389 av_register_input_format(&rawvideo_demuxer);
390 #endif
391 #ifdef CONFIG_RAWVIDEO_MUXER
392 av_register_output_format(&rawvideo_muxer);
393 #endif
394 #ifdef CONFIG_NULL_MUXER
395 av_register_output_format(&null_muxer);
396 #endif
397 #ifdef CONFIG_RM_DEMUXER
398 av_register_input_format(&rm_demuxer);
399 #endif
400 #ifdef CONFIG_RM_MUXER
401 av_register_output_format(&rm_muxer);
402 #endif
403 #ifdef CONFIG_NETWORK
404 #ifdef CONFIG_RTP_MUXER
405 av_register_output_format(&rtp_muxer);
406 #endif
407 #ifdef CONFIG_RTSP_DEMUXER
408 av_register_input_format(&rtsp_demuxer);
409 #endif
410 #ifdef CONFIG_SDP_DEMUXER
411 av_register_input_format(&sdp_demuxer);
412 #endif
413 #ifdef CONFIG_REDIR_DEMUXER
414 av_register_input_format(&redir_demuxer);
415 #endif
416 #endif /* CONFIG_NETWORK */
417 #ifdef CONFIG_SEGAFILM_DEMUXER
418 av_register_input_format(&segafilm_demuxer);
419 #endif
420 #ifdef CONFIG_VMD_DEMUXER
421 av_register_input_format(&vmd_demuxer);
422 #endif
423 #ifdef CONFIG_SMACKER_DEMUXER
424 av_register_input_format(&smacker_demuxer);
425 #endif
426 #ifdef CONFIG_SOL_DEMUXER
427 av_register_input_format(&sol_demuxer);
428 #endif
429 #ifdef CONFIG_SWF_DEMUXER
430 av_register_input_format(&swf_demuxer);
431 #endif
432 #ifdef CONFIG_SWF_MUXER
433 av_register_output_format(&swf_muxer);
434 #endif
435 #ifdef CONFIG_TTA_DEMUXER
436 av_register_input_format(&tta_demuxer);
437 #endif
438 #ifdef CONFIG_VIDEO4LINUX2
439 #ifdef CONFIG_V4L2_DEMUXER
440 av_register_input_format(&v4l2_demuxer);
441 #endif
442 #endif /* CONFIG_VIDEO4LINUX2 */
443 #if defined(CONFIG_VIDEO4LINUX) || defined(CONFIG_BKTR)
444 #ifdef CONFIG_VIDEO_GRAB_DEVICE_DEMUXER
445 av_register_input_format(&video_grab_device_demuxer);
446 #endif
447 #endif /* CONFIG_VIDEO4LINUX || CONFIG_BKTR */
448 #ifdef CONFIG_VOC_DEMUXER
449 av_register_input_format(&voc_demuxer);
450 #endif
451 #ifdef CONFIG_VOC_MUXER
452 av_register_output_format(&voc_muxer);
453 #endif
454 #ifdef CONFIG_WAV_DEMUXER
455 av_register_input_format(&wav_demuxer);
456 #endif
457 #ifdef CONFIG_WAV_MUXER
458 av_register_output_format(&wav_muxer);
459 #endif
460 #ifdef CONFIG_WC3_DEMUXER
461 av_register_input_format(&wc3_demuxer);
462 #endif
463 #ifdef CONFIG_WSAUD_DEMUXER
464 av_register_input_format(&wsaud_demuxer);
465 #endif
466 #ifdef CONFIG_WSVQA_DEMUXER
467 av_register_input_format(&wsvqa_demuxer);
468 #endif
469 #ifdef CONFIG_WV_DEMUXER
470 av_register_input_format(&wv_demuxer);
471 #endif
472 #ifdef CONFIG_YUV4MPEGPIPE_MUXER
473 av_register_output_format(&yuv4mpegpipe_muxer);
474 #endif
475 #ifdef CONFIG_YUV4MPEGPIPE_DEMUXER
476 av_register_input_format(&yuv4mpegpipe_demuxer);
477 #endif
478
479 /* image formats */
480 #if 0
481 av_register_image_format(&pnm_image_format);
482 av_register_image_format(&pbm_image_format);
483 av_register_image_format(&pgm_image_format);
484 av_register_image_format(&ppm_image_format);
485 av_register_image_format(&pam_image_format);
486 av_register_image_format(&pgmyuv_image_format);
487 av_register_image_format(&yuv_image_format);
488 #ifdef CONFIG_ZLIB
489 av_register_image_format(&png_image_format);
490 #endif
491 av_register_image_format(&jpeg_image_format);
492 #endif
493 av_register_image_format(&gif_image_format);
494 // av_register_image_format(&sgi_image_format); heap corruption, dont enable
495
496 #ifdef CONFIG_PROTOCOLS
497 /* file protocols */
498 register_protocol(&file_protocol);
499 register_protocol(&pipe_protocol);
500 #ifdef CONFIG_NETWORK
501 register_protocol(&udp_protocol);
502 register_protocol(&rtp_protocol);
503 register_protocol(&tcp_protocol);
504 register_protocol(&http_protocol);
505 #endif
506 #endif
507 }