cllc: Implement ARGB support
[ffmpeg.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       = AV_CODEC_ID_AC3,
42     .video_codec       = AV_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       = AV_CODEC_ID_ADPCM_ADX,
54     .video_codec       = AV_CODEC_ID_NONE,
55     .write_packet      = ff_raw_write_packet,
56     .flags             = AVFMT_NOTIMESTAMPS,
57 };
58 #endif
59
60 #if CONFIG_CAVSVIDEO_MUXER
61 AVOutputFormat ff_cavsvideo_muxer = {
62     .name              = "cavsvideo",
63     .long_name         = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"),
64     .extensions        = "cavs",
65     .audio_codec       = AV_CODEC_ID_NONE,
66     .video_codec       = AV_CODEC_ID_CAVS,
67     .write_packet      = ff_raw_write_packet,
68     .flags             = AVFMT_NOTIMESTAMPS,
69 };
70 #endif
71
72 #if CONFIG_DIRAC_MUXER
73 AVOutputFormat ff_dirac_muxer = {
74     .name              = "dirac",
75     .long_name         = NULL_IF_CONFIG_SMALL("raw Dirac"),
76     .extensions        = "drc",
77     .audio_codec       = AV_CODEC_ID_NONE,
78     .video_codec       = AV_CODEC_ID_DIRAC,
79     .write_packet      = ff_raw_write_packet,
80     .flags             = AVFMT_NOTIMESTAMPS,
81 };
82 #endif
83
84 #if CONFIG_DNXHD_MUXER
85 AVOutputFormat ff_dnxhd_muxer = {
86     .name              = "dnxhd",
87     .long_name         = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
88     .extensions        = "dnxhd",
89     .audio_codec       = AV_CODEC_ID_NONE,
90     .video_codec       = AV_CODEC_ID_DNXHD,
91     .write_packet      = ff_raw_write_packet,
92     .flags             = AVFMT_NOTIMESTAMPS,
93 };
94 #endif
95
96 #if CONFIG_DTS_MUXER
97 AVOutputFormat ff_dts_muxer = {
98     .name              = "dts",
99     .long_name         = NULL_IF_CONFIG_SMALL("raw DTS"),
100     .mime_type         = "audio/x-dca",
101     .extensions        = "dts",
102     .audio_codec       = AV_CODEC_ID_DTS,
103     .video_codec       = AV_CODEC_ID_NONE,
104     .write_packet      = ff_raw_write_packet,
105     .flags             = AVFMT_NOTIMESTAMPS,
106 };
107 #endif
108
109 #if CONFIG_EAC3_MUXER
110 AVOutputFormat ff_eac3_muxer = {
111     .name              = "eac3",
112     .long_name         = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
113     .mime_type         = "audio/x-eac3",
114     .extensions        = "eac3",
115     .audio_codec       = AV_CODEC_ID_EAC3,
116     .video_codec       = AV_CODEC_ID_NONE,
117     .write_packet      = ff_raw_write_packet,
118     .flags             = AVFMT_NOTIMESTAMPS,
119 };
120 #endif
121
122 #if CONFIG_G722_MUXER
123 AVOutputFormat ff_g722_muxer = {
124     .name              = "g722",
125     .long_name         = NULL_IF_CONFIG_SMALL("raw G.722"),
126     .mime_type         = "audio/G722",
127     .extensions        = "g722",
128     .audio_codec       = AV_CODEC_ID_ADPCM_G722,
129     .video_codec       = AV_CODEC_ID_NONE,
130     .write_packet      = ff_raw_write_packet,
131     .flags             = AVFMT_NOTIMESTAMPS,
132 };
133 #endif
134
135 #if CONFIG_H261_MUXER
136 AVOutputFormat ff_h261_muxer = {
137     .name              = "h261",
138     .long_name         = NULL_IF_CONFIG_SMALL("raw H.261"),
139     .mime_type         = "video/x-h261",
140     .extensions        = "h261",
141     .audio_codec       = AV_CODEC_ID_NONE,
142     .video_codec       = AV_CODEC_ID_H261,
143     .write_packet      = ff_raw_write_packet,
144     .flags             = AVFMT_NOTIMESTAMPS,
145 };
146 #endif
147
148 #if CONFIG_H263_MUXER
149 AVOutputFormat ff_h263_muxer = {
150     .name              = "h263",
151     .long_name         = NULL_IF_CONFIG_SMALL("raw H.263"),
152     .mime_type         = "video/x-h263",
153     .extensions        = "h263",
154     .audio_codec       = AV_CODEC_ID_NONE,
155     .video_codec       = AV_CODEC_ID_H263,
156     .write_packet      = ff_raw_write_packet,
157     .flags             = AVFMT_NOTIMESTAMPS,
158 };
159 #endif
160
161 #if CONFIG_H264_MUXER
162 AVOutputFormat ff_h264_muxer = {
163     .name              = "h264",
164     .long_name         = NULL_IF_CONFIG_SMALL("raw H.264 video"),
165     .extensions        = "h264",
166     .audio_codec       = AV_CODEC_ID_NONE,
167     .video_codec       = AV_CODEC_ID_H264,
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"),
177     .extensions        = "m4v",
178     .audio_codec       = AV_CODEC_ID_NONE,
179     .video_codec       = AV_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       = AV_CODEC_ID_NONE,
192     .video_codec       = AV_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       = AV_CODEC_ID_MLP,
204     .video_codec       = AV_CODEC_ID_NONE,
205     .write_packet      = ff_raw_write_packet,
206     .flags             = AVFMT_NOTIMESTAMPS,
207 };
208 #endif
209
210 #if CONFIG_MPEG1VIDEO_MUXER
211 AVOutputFormat ff_mpeg1video_muxer = {
212     .name              = "mpeg1video",
213     .long_name         = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
214     .mime_type         = "video/x-mpeg",
215     .extensions        = "mpg,mpeg,m1v",
216     .audio_codec       = AV_CODEC_ID_NONE,
217     .video_codec       = AV_CODEC_ID_MPEG1VIDEO,
218     .write_packet      = ff_raw_write_packet,
219     .flags             = AVFMT_NOTIMESTAMPS,
220 };
221 #endif
222
223 #if CONFIG_MPEG2VIDEO_MUXER
224 AVOutputFormat ff_mpeg2video_muxer = {
225     .name              = "mpeg2video",
226     .long_name         = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
227     .extensions        = "m2v",
228     .audio_codec       = AV_CODEC_ID_NONE,
229     .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
230     .write_packet      = ff_raw_write_packet,
231     .flags             = AVFMT_NOTIMESTAMPS,
232 };
233 #endif
234
235 #if CONFIG_RAWVIDEO_MUXER
236 AVOutputFormat ff_rawvideo_muxer = {
237     .name              = "rawvideo",
238     .long_name         = NULL_IF_CONFIG_SMALL("raw video"),
239     .extensions        = "yuv,rgb",
240     .audio_codec       = AV_CODEC_ID_NONE,
241     .video_codec       = AV_CODEC_ID_RAWVIDEO,
242     .write_packet      = ff_raw_write_packet,
243     .flags             = AVFMT_NOTIMESTAMPS,
244 };
245 #endif
246
247 #if CONFIG_SRT_MUXER
248 AVOutputFormat ff_srt_muxer = {
249     .name              = "srt",
250     .long_name         = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
251     .mime_type         = "application/x-subrip",
252     .extensions        = "srt",
253     .write_packet      = ff_raw_write_packet,
254     .flags             = AVFMT_NOTIMESTAMPS,
255     .subtitle_codec    = AV_CODEC_ID_SRT,
256 };
257 #endif
258
259 #if CONFIG_TRUEHD_MUXER
260 AVOutputFormat ff_truehd_muxer = {
261     .name              = "truehd",
262     .long_name         = NULL_IF_CONFIG_SMALL("raw TrueHD"),
263     .extensions        = "thd",
264     .audio_codec       = AV_CODEC_ID_TRUEHD,
265     .video_codec       = AV_CODEC_ID_NONE,
266     .write_packet      = ff_raw_write_packet,
267     .flags             = AVFMT_NOTIMESTAMPS,
268 };
269 #endif