video4linux2 input support
[libav.git] / libavformat / allformats.c
1 /*
2 * Register all the formats and protocols
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 #include "avformat.h"
20
21 /* If you do not call this function, then you can select exactly which
22 formats you want to support */
23
24 /**
25 * Initialize libavcodec and register all the codecs and formats.
26 */
27 void av_register_all(void)
28 {
29 static int inited = 0;
30
31 if (inited != 0)
32 return;
33 inited = 1;
34
35 avcodec_init();
36 avcodec_register_all();
37
38 mpegps_init();
39 mpegts_init();
40 #ifdef CONFIG_MUXERS
41 crc_init();
42 img_init();
43 img2_init();
44 #endif //CONFIG_MUXERS
45 raw_init();
46 mp3_init();
47 rm_init();
48 asf_init();
49 #ifdef CONFIG_MUXERS
50 avienc_init();
51 #endif //CONFIG_MUXERS
52 avidec_init();
53 ff_wav_init();
54 ff_mmf_init();
55 swf_init();
56 au_init();
57 #ifdef CONFIG_MUXERS
58 gif_init();
59 #endif //CONFIG_MUXERS
60 mov_init();
61 #ifdef CONFIG_MUXERS
62 movenc_init();
63 jpeg_init();
64 #endif //CONFIG_MUXERS
65 ff_dv_init();
66 fourxm_init();
67 #ifdef CONFIG_MUXERS
68 flvenc_init();
69 #endif //CONFIG_MUXERS
70 flvdec_init();
71 str_init();
72 roq_init();
73 ipmovie_init();
74 wc3_init();
75 westwood_init();
76 film_init();
77 idcin_init();
78 flic_init();
79 vmd_init();
80
81 #if defined(AMR_NB) || defined(AMR_NB_FIXED) || defined(AMR_WB)
82 amr_init();
83 #endif
84 yuv4mpeg_init();
85
86 ogg_init();
87 #ifdef CONFIG_LIBOGG
88 libogg_init();
89 #endif
90
91 ffm_init();
92 #if defined(CONFIG_VIDEO4LINUX2)
93 v4l2_init();
94 #endif
95 #if defined(CONFIG_VIDEO4LINUX) || defined(CONFIG_BKTR)
96 video_grab_init();
97 #endif
98 #if defined(CONFIG_AUDIO_OSS) || defined(CONFIG_AUDIO_BEOS)
99 audio_init();
100 #endif
101
102 #ifdef CONFIG_DV1394
103 dv1394_init();
104 #endif
105
106 #ifdef CONFIG_DC1394
107 dc1394_init();
108 #endif
109
110 nut_init();
111 matroska_init();
112 sol_init();
113 ea_init();
114 nsvdec_init();
115 daud_init();
116
117 #ifdef CONFIG_MUXERS
118 /* image formats */
119 #if 0
120 av_register_image_format(&pnm_image_format);
121 av_register_image_format(&pbm_image_format);
122 av_register_image_format(&pgm_image_format);
123 av_register_image_format(&ppm_image_format);
124 av_register_image_format(&pam_image_format);
125 av_register_image_format(&pgmyuv_image_format);
126 av_register_image_format(&yuv_image_format);
127 #ifdef CONFIG_ZLIB
128 av_register_image_format(&png_image_format);
129 #endif
130 av_register_image_format(&jpeg_image_format);
131 #endif
132 av_register_image_format(&gif_image_format);
133 // av_register_image_format(&sgi_image_format); heap corruption, dont enable
134 #endif //CONFIG_MUXERS
135
136 #ifdef CONFIG_PROTOCOLS
137 /* file protocols */
138 register_protocol(&file_protocol);
139 register_protocol(&pipe_protocol);
140 #ifdef CONFIG_NETWORK
141 rtsp_init();
142 rtp_init();
143 register_protocol(&udp_protocol);
144 register_protocol(&rtp_protocol);
145 register_protocol(&tcp_protocol);
146 register_protocol(&http_protocol);
147 #endif
148 #endif
149 }