adx: add an adx muxer
[libav.git] / libavformat / rawenc.c
1 /*
2 * RAW muxers
3 * Copyright (c) 2001 Fabrice Bellard
4 * Copyright (c) 2005 Alex Beregszaszi
5 *
6 * This file is part of Libav.
7 *
8 * Libav is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * Libav is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with Libav; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 #include "avformat.h"
24 #include "rawenc.h"
25
26 int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
27 {
28 avio_write(s->pb, pkt->data, pkt->size);
29 avio_flush(s->pb);
30 return 0;
31 }
32
33 /* Note: Do not forget to add new entries to the Makefile as well. */
34
35 #if CONFIG_AC3_MUXER
36 AVOutputFormat ff_ac3_muxer = {
37 .name = "ac3",
38 .long_name = NULL_IF_CONFIG_SMALL("raw AC-3"),
39 .mime_type = "audio/x-ac3",
40 .extensions = "ac3",
41 .audio_codec = CODEC_ID_AC3,
42 .video_codec = CODEC_ID_NONE,
43 .write_packet = ff_raw_write_packet,
44 .flags= AVFMT_NOTIMESTAMPS,
45 };
46 #endif
47
48 #if CONFIG_ADX_MUXER
49 AVOutputFormat ff_adx_muxer = {
50 .name = "adx",
51 .long_name = NULL_IF_CONFIG_SMALL("CRI ADX"),
52 .extensions = "adx",
53 .audio_codec = CODEC_ID_ADPCM_ADX,
54 .video_codec = CODEC_ID_NONE,
55 .write_packet = ff_raw_write_packet,
56 .flags = AVFMT_NOTIMESTAMPS,
57 };
58 #endif
59
60 #if CONFIG_DIRAC_MUXER
61 AVOutputFormat ff_dirac_muxer = {
62 .name = "dirac",
63 .long_name = NULL_IF_CONFIG_SMALL("raw Dirac"),
64 .extensions = "drc",
65 .audio_codec = CODEC_ID_NONE,
66 .video_codec = CODEC_ID_DIRAC,
67 .write_packet = ff_raw_write_packet,
68 .flags= AVFMT_NOTIMESTAMPS,
69 };
70 #endif
71
72 #if CONFIG_DNXHD_MUXER
73 AVOutputFormat ff_dnxhd_muxer = {
74 .name = "dnxhd",
75 .long_name = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
76 .extensions = "dnxhd",
77 .audio_codec = CODEC_ID_NONE,
78 .video_codec = CODEC_ID_DNXHD,
79 .write_packet = ff_raw_write_packet,
80 .flags= AVFMT_NOTIMESTAMPS,
81 };
82 #endif
83
84 #if CONFIG_DTS_MUXER
85 AVOutputFormat ff_dts_muxer = {
86 .name = "dts",
87 .long_name = NULL_IF_CONFIG_SMALL("raw DTS"),
88 .mime_type = "audio/x-dca",
89 .extensions = "dts",
90 .audio_codec = CODEC_ID_DTS,
91 .video_codec = CODEC_ID_NONE,
92 .write_packet = ff_raw_write_packet,
93 .flags= AVFMT_NOTIMESTAMPS,
94 };
95 #endif
96
97 #if CONFIG_EAC3_MUXER
98 AVOutputFormat ff_eac3_muxer = {
99 .name = "eac3",
100 .long_name = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
101 .mime_type = "audio/x-eac3",
102 .extensions = "eac3",
103 .audio_codec = CODEC_ID_EAC3,
104 .video_codec = CODEC_ID_NONE,
105 .write_packet = ff_raw_write_packet,
106 .flags= AVFMT_NOTIMESTAMPS,
107 };
108 #endif
109
110 #if CONFIG_G722_MUXER
111 AVOutputFormat ff_g722_muxer = {
112 .name = "g722",
113 .long_name = NULL_IF_CONFIG_SMALL("raw G.722"),
114 .mime_type = "audio/G722",
115 .extensions = "g722",
116 .audio_codec = CODEC_ID_ADPCM_G722,
117 .video_codec = CODEC_ID_NONE,
118 .write_packet = ff_raw_write_packet,
119 .flags= AVFMT_NOTIMESTAMPS,
120 };
121 #endif
122
123 #if CONFIG_H261_MUXER
124 AVOutputFormat ff_h261_muxer = {
125 .name = "h261",
126 .long_name = NULL_IF_CONFIG_SMALL("raw H.261"),
127 .mime_type = "video/x-h261",
128 .extensions = "h261",
129 .audio_codec = CODEC_ID_NONE,
130 .video_codec = CODEC_ID_H261,
131 .write_packet = ff_raw_write_packet,
132 .flags= AVFMT_NOTIMESTAMPS,
133 };
134 #endif
135
136 #if CONFIG_H263_MUXER
137 AVOutputFormat ff_h263_muxer = {
138 .name = "h263",
139 .long_name = NULL_IF_CONFIG_SMALL("raw H.263"),
140 .mime_type = "video/x-h263",
141 .extensions = "h263",
142 .audio_codec = CODEC_ID_NONE,
143 .video_codec = CODEC_ID_H263,
144 .write_packet = ff_raw_write_packet,
145 .flags= AVFMT_NOTIMESTAMPS,
146 };
147 #endif
148
149 #if CONFIG_H264_MUXER
150 AVOutputFormat ff_h264_muxer = {
151 .name = "h264",
152 .long_name = NULL_IF_CONFIG_SMALL("raw H.264 video format"),
153 .extensions = "h264",
154 .audio_codec = CODEC_ID_NONE,
155 .video_codec = CODEC_ID_H264,
156 .write_packet = ff_raw_write_packet,
157 .flags= AVFMT_NOTIMESTAMPS,
158 };
159 #endif
160
161 #if CONFIG_CAVSVIDEO_MUXER
162 AVOutputFormat ff_cavsvideo_muxer = {
163 .name = "cavsvideo",
164 .long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS video"),
165 .extensions = "cavs",
166 .audio_codec = CODEC_ID_NONE,
167 .video_codec = CODEC_ID_CAVS,
168 .write_packet = ff_raw_write_packet,
169 .flags= AVFMT_NOTIMESTAMPS,
170 };
171 #endif
172
173 #if CONFIG_M4V_MUXER
174 AVOutputFormat ff_m4v_muxer = {
175 .name = "m4v",
176 .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
177 .extensions = "m4v",
178 .audio_codec = CODEC_ID_NONE,
179 .video_codec = CODEC_ID_MPEG4,
180 .write_packet = ff_raw_write_packet,
181 .flags= AVFMT_NOTIMESTAMPS,
182 };
183 #endif
184
185 #if CONFIG_MJPEG_MUXER
186 AVOutputFormat ff_mjpeg_muxer = {
187 .name = "mjpeg",
188 .long_name = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
189 .mime_type = "video/x-mjpeg",
190 .extensions = "mjpg,mjpeg",
191 .audio_codec = CODEC_ID_NONE,
192 .video_codec = CODEC_ID_MJPEG,
193 .write_packet = ff_raw_write_packet,
194 .flags= AVFMT_NOTIMESTAMPS,
195 };
196 #endif
197
198 #if CONFIG_MLP_MUXER
199 AVOutputFormat ff_mlp_muxer = {
200 .name = "mlp",
201 .long_name = NULL_IF_CONFIG_SMALL("raw MLP"),
202 .extensions = "mlp",
203 .audio_codec = CODEC_ID_MLP,
204 .video_codec = CODEC_ID_NONE,
205 .write_packet = ff_raw_write_packet,
206 .flags= AVFMT_NOTIMESTAMPS,
207 };
208 #endif
209
210 #if CONFIG_SRT_MUXER
211 AVOutputFormat ff_srt_muxer = {
212 .name = "srt",
213 .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle format"),
214 .mime_type = "application/x-subrip",
215 .extensions = "srt",
216 .write_packet = ff_raw_write_packet,
217 .flags = AVFMT_NOTIMESTAMPS,
218 .subtitle_codec = CODEC_ID_SRT,
219 };
220 #endif
221
222 #if CONFIG_TRUEHD_MUXER
223 AVOutputFormat ff_truehd_muxer = {
224 .name = "truehd",
225 .long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"),
226 .extensions = "thd",
227 .audio_codec = CODEC_ID_TRUEHD,
228 .video_codec = CODEC_ID_NONE,
229 .write_packet = ff_raw_write_packet,
230 .flags= AVFMT_NOTIMESTAMPS,
231 };
232 #endif
233
234 #if CONFIG_MPEG1VIDEO_MUXER
235 AVOutputFormat ff_mpeg1video_muxer = {
236 .name = "mpeg1video",
237 .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
238 .mime_type = "video/x-mpeg",
239 .extensions = "mpg,mpeg,m1v",
240 .audio_codec = CODEC_ID_NONE,
241 .video_codec = CODEC_ID_MPEG1VIDEO,
242 .write_packet = ff_raw_write_packet,
243 .flags= AVFMT_NOTIMESTAMPS,
244 };
245 #endif
246
247 #if CONFIG_MPEG2VIDEO_MUXER
248 AVOutputFormat ff_mpeg2video_muxer = {
249 .name = "mpeg2video",
250 .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
251 .extensions = "m2v",
252 .audio_codec = CODEC_ID_NONE,
253 .video_codec = CODEC_ID_MPEG2VIDEO,
254 .write_packet = ff_raw_write_packet,
255 .flags= AVFMT_NOTIMESTAMPS,
256 };
257 #endif
258
259 #if CONFIG_RAWVIDEO_MUXER
260 AVOutputFormat ff_rawvideo_muxer = {
261 .name = "rawvideo",
262 .long_name = NULL_IF_CONFIG_SMALL("raw video format"),
263 .extensions = "yuv,rgb",
264 .audio_codec = CODEC_ID_NONE,
265 .video_codec = CODEC_ID_RAWVIDEO,
266 .write_packet = ff_raw_write_packet,
267 .flags= AVFMT_NOTIMESTAMPS,
268 };
269 #endif