Mercurial > libavformat.hg
annotate raw.c @ 126:23f62139c013 libavformat
prefers MP3 codec (rather than MP2) for output if
compiled with MP3LAME and output file seems to be of MP3 type patch by (Andriy Rysin <arysin at bcsii dot net>) with minor changes by me
author | michaelni |
---|---|
date | Mon, 05 May 2003 12:59:42 +0000 |
parents | 7500e14259a6 |
children | 45633cd5518a |
rev | line source |
---|---|
0 | 1 /* |
2 * RAW encoder and decoder | |
3 * Copyright (c) 2001 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 */ | |
19 #include "avformat.h" | |
20 | |
21 /* simple formats */ | |
64 | 22 static int raw_write_header(struct AVFormatContext *s) |
0 | 23 { |
24 return 0; | |
25 } | |
26 | |
64 | 27 static int raw_write_packet(struct AVFormatContext *s, int stream_index, |
28 unsigned char *buf, int size, int force_pts) | |
0 | 29 { |
30 put_buffer(&s->pb, buf, size); | |
31 put_flush_packet(&s->pb); | |
32 return 0; | |
33 } | |
34 | |
64 | 35 static int raw_write_trailer(struct AVFormatContext *s) |
0 | 36 { |
37 return 0; | |
38 } | |
39 | |
40 /* raw input */ | |
65 | 41 static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap) |
0 | 42 { |
43 AVStream *st; | |
44 int id; | |
45 | |
46 st = av_new_stream(s, 0); | |
47 if (!st) | |
48 return AVERROR_NOMEM; | |
49 if (ap) { | |
50 id = s->iformat->value; | |
51 if (id == CODEC_ID_RAWVIDEO) { | |
52 st->codec.codec_type = CODEC_TYPE_VIDEO; | |
53 } else { | |
54 st->codec.codec_type = CODEC_TYPE_AUDIO; | |
55 } | |
56 st->codec.codec_id = id; | |
57 | |
58 switch(st->codec.codec_type) { | |
59 case CODEC_TYPE_AUDIO: | |
60 st->codec.sample_rate = ap->sample_rate; | |
61 st->codec.channels = ap->channels; | |
62 break; | |
63 case CODEC_TYPE_VIDEO: | |
85
25062c9b1f86
per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents:
65
diff
changeset
|
64 st->codec.frame_rate = ap->frame_rate; |
25062c9b1f86
per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents:
65
diff
changeset
|
65 st->codec.frame_rate_base = ap->frame_rate_base; |
0 | 66 st->codec.width = ap->width; |
67 st->codec.height = ap->height; | |
68 break; | |
69 default: | |
70 return -1; | |
71 } | |
72 } else { | |
73 return -1; | |
74 } | |
75 return 0; | |
76 } | |
77 | |
78 #define RAW_PACKET_SIZE 1024 | |
79 | |
64 | 80 static int raw_read_packet(AVFormatContext *s, AVPacket *pkt) |
0 | 81 { |
82 int ret, size; | |
28 | 83 // AVStream *st = s->streams[0]; |
0 | 84 |
85 size= RAW_PACKET_SIZE; | |
86 | |
87 if (av_new_packet(pkt, size) < 0) | |
88 return -EIO; | |
89 | |
90 pkt->stream_index = 0; | |
91 ret = get_buffer(&s->pb, pkt->data, size); | |
92 if (ret <= 0) { | |
93 av_free_packet(pkt); | |
94 return -EIO; | |
95 } | |
96 /* note: we need to modify the packet size here to handle the last | |
97 packet */ | |
98 pkt->size = ret; | |
99 return ret; | |
100 } | |
101 | |
64 | 102 static int raw_read_close(AVFormatContext *s) |
0 | 103 { |
104 return 0; | |
105 } | |
106 | |
107 /* mp3 read */ | |
108 static int mp3_read_header(AVFormatContext *s, | |
109 AVFormatParameters *ap) | |
110 { | |
111 AVStream *st; | |
125
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
112 int pos; |
0 | 113 |
114 st = av_new_stream(s, 0); | |
115 if (!st) | |
116 return AVERROR_NOMEM; | |
117 | |
118 st->codec.codec_type = CODEC_TYPE_AUDIO; | |
119 st->codec.codec_id = CODEC_ID_MP2; | |
125
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
120 |
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
121 /* looking for 11111111 111MMLLC - MPEG synchronization tag |
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
122 MM: 00 - MPEG-2.5, 10 - MPEG-2, 11 - MPEG-1 |
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
123 LL: 11 - Layer I, 10 - Layer II, 01 - Layer III |
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
124 XXX: this code does not read more bytes from file |
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
125 so if ID3 (or other stuff) length > IO_BUFFER_SIZE it fails back to CODEC_ID_MP2 */ |
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
126 for(pos=0; pos < s->pb.buffer_size-1; pos++) |
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
127 if( s->pb.buffer[pos] == 0xFF && (s->pb.buffer[pos] & 0xE0) == 0xE0 ) |
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
128 break; |
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
129 |
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
130 if( pos < s->pb.buffer_size-1 && (s->pb.buffer[pos+1] & 6) == 2 ) |
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
131 st->codec.codec_id = CODEC_ID_MP3LAME; |
7500e14259a6
mp3 codec autodetection patch by (Andriy Rysin <arysin at bcsii dot net>)
michaelni
parents:
100
diff
changeset
|
132 |
0 | 133 /* the parameters will be extracted from the compressed bitstream */ |
134 return 0; | |
135 } | |
136 | |
63 | 137 /* ac3 read */ |
138 static int ac3_read_header(AVFormatContext *s, | |
139 AVFormatParameters *ap) | |
140 { | |
141 AVStream *st; | |
142 | |
143 st = av_new_stream(s, 0); | |
144 if (!st) | |
145 return AVERROR_NOMEM; | |
146 | |
147 st->codec.codec_type = CODEC_TYPE_AUDIO; | |
148 st->codec.codec_id = CODEC_ID_AC3; | |
149 /* the parameters will be extracted from the compressed bitstream */ | |
150 return 0; | |
151 } | |
152 | |
0 | 153 /* mpeg1/h263 input */ |
154 static int video_read_header(AVFormatContext *s, | |
155 AVFormatParameters *ap) | |
156 { | |
157 AVStream *st; | |
158 | |
159 st = av_new_stream(s, 0); | |
160 if (!st) | |
161 return AVERROR_NOMEM; | |
162 | |
163 st->codec.codec_type = CODEC_TYPE_VIDEO; | |
164 st->codec.codec_id = s->iformat->value; | |
165 /* for mjpeg, specify frame rate */ | |
166 /* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/ | |
167 if (st->codec.codec_id == CODEC_ID_MJPEG || st->codec.codec_id == CODEC_ID_MPEG4) { | |
168 if (ap) { | |
85
25062c9b1f86
per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents:
65
diff
changeset
|
169 st->codec.frame_rate = ap->frame_rate; |
25062c9b1f86
per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents:
65
diff
changeset
|
170 st->codec.frame_rate_base = ap->frame_rate_base; |
0 | 171 } else { |
85
25062c9b1f86
per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents:
65
diff
changeset
|
172 st->codec.frame_rate = 25; |
25062c9b1f86
per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents:
65
diff
changeset
|
173 st->codec.frame_rate_base = 1; |
0 | 174 } |
175 } | |
176 return 0; | |
177 } | |
178 | |
179 #define SEQ_START_CODE 0x000001b3 | |
180 #define GOP_START_CODE 0x000001b8 | |
181 #define PICTURE_START_CODE 0x00000100 | |
182 | |
183 /* XXX: improve that by looking at several start codes */ | |
184 static int mpegvideo_probe(AVProbeData *p) | |
185 { | |
49 | 186 int code; |
187 const uint8_t *d; | |
0 | 188 |
189 /* we search the first start code. If it is a sequence, gop or | |
190 picture start code then we decide it is an mpeg video | |
191 stream. We do not send highest value to give a chance to mpegts */ | |
49 | 192 /* NOTE: the search range was restricted to avoid too many false |
193 detections */ | |
194 | |
195 if (p->buf_size < 6) | |
196 return 0; | |
197 d = p->buf; | |
198 code = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | (d[3]); | |
199 if ((code & 0xffffff00) == 0x100) { | |
200 if (code == SEQ_START_CODE || | |
201 code == GOP_START_CODE || | |
202 code == PICTURE_START_CODE) | |
203 return 50 - 1; | |
204 else | |
205 return 0; | |
0 | 206 } |
207 return 0; | |
208 } | |
209 | |
210 AVInputFormat mp3_iformat = { | |
211 "mp3", | |
212 "MPEG audio", | |
213 0, | |
214 NULL, | |
215 mp3_read_header, | |
216 raw_read_packet, | |
217 raw_read_close, | |
218 .extensions = "mp2,mp3", /* XXX: use probe */ | |
219 }; | |
220 | |
221 AVOutputFormat mp2_oformat = { | |
222 "mp2", | |
223 "MPEG audio layer 2", | |
224 "audio/x-mpeg", | |
126
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
225 #ifdef CONFIG_MP3LAME |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
226 "mp2", |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
227 #else |
0 | 228 "mp2,mp3", |
126
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
229 #endif |
0 | 230 0, |
231 CODEC_ID_MP2, | |
232 0, | |
233 raw_write_header, | |
234 raw_write_packet, | |
235 raw_write_trailer, | |
236 }; | |
237 | |
126
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
238 #ifdef CONFIG_MP3LAME |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
239 AVOutputFormat mp3_oformat = { |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
240 "mp3", |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
241 "MPEG audio layer 3", |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
242 "audio/x-mpeg", |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
243 "mp3", |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
244 0, |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
245 CODEC_ID_MP3LAME, |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
246 0, |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
247 raw_write_header, |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
248 raw_write_packet, |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
249 raw_write_trailer, |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
250 }; |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
251 #endif |
0 | 252 |
253 AVInputFormat ac3_iformat = { | |
254 "ac3", | |
255 "raw ac3", | |
256 0, | |
257 NULL, | |
63 | 258 ac3_read_header, |
0 | 259 raw_read_packet, |
260 raw_read_close, | |
261 .extensions = "ac3", | |
262 }; | |
263 | |
264 AVOutputFormat ac3_oformat = { | |
265 "ac3", | |
266 "raw ac3", | |
267 "audio/x-ac3", | |
268 "ac3", | |
269 0, | |
270 CODEC_ID_AC3, | |
271 0, | |
272 raw_write_header, | |
273 raw_write_packet, | |
274 raw_write_trailer, | |
275 }; | |
276 | |
277 AVOutputFormat h263_oformat = { | |
278 "h263", | |
279 "raw h263", | |
280 "video/x-h263", | |
281 "h263", | |
282 0, | |
283 0, | |
284 CODEC_ID_H263, | |
285 raw_write_header, | |
286 raw_write_packet, | |
287 raw_write_trailer, | |
288 }; | |
289 | |
290 AVInputFormat m4v_iformat = { | |
291 "m4v", | |
292 "raw MPEG4 video format", | |
293 0, | |
294 NULL /*mpegvideo_probe*/, | |
295 video_read_header, | |
296 raw_read_packet, | |
297 raw_read_close, | |
298 .extensions = "m4v", //FIXME remove after writing mpeg4_probe | |
299 .value = CODEC_ID_MPEG4, | |
300 }; | |
301 | |
302 AVOutputFormat m4v_oformat = { | |
303 "m4v", | |
304 "raw MPEG4 video format", | |
305 NULL, | |
306 "m4v", | |
307 0, | |
308 CODEC_ID_NONE, | |
309 CODEC_ID_MPEG4, | |
310 raw_write_header, | |
311 raw_write_packet, | |
312 raw_write_trailer, | |
313 }; | |
314 | |
100 | 315 AVInputFormat h264_iformat = { |
316 "h264", | |
317 "raw H264 video format", | |
318 0, | |
319 NULL /*mpegvideo_probe*/, | |
320 video_read_header, | |
321 raw_read_packet, | |
322 raw_read_close, | |
323 .extensions = "h26l,h264", //FIXME remove after writing mpeg4_probe | |
324 .value = CODEC_ID_H264, | |
325 }; | |
326 | |
327 AVOutputFormat h264_oformat = { | |
328 "h264", | |
329 "raw H264 video format", | |
330 NULL, | |
331 "h264", | |
332 0, | |
333 CODEC_ID_NONE, | |
334 CODEC_ID_H264, | |
335 raw_write_header, | |
336 raw_write_packet, | |
337 raw_write_trailer, | |
338 }; | |
339 | |
0 | 340 AVInputFormat mpegvideo_iformat = { |
341 "mpegvideo", | |
342 "MPEG video", | |
343 0, | |
344 mpegvideo_probe, | |
345 video_read_header, | |
346 raw_read_packet, | |
347 raw_read_close, | |
348 .value = CODEC_ID_MPEG1VIDEO, | |
349 }; | |
350 | |
351 AVOutputFormat mpeg1video_oformat = { | |
352 "mpeg1video", | |
353 "MPEG video", | |
354 "video/x-mpeg", | |
355 "mpg,mpeg", | |
356 0, | |
357 0, | |
358 CODEC_ID_MPEG1VIDEO, | |
359 raw_write_header, | |
360 raw_write_packet, | |
361 raw_write_trailer, | |
362 }; | |
363 | |
364 AVInputFormat mjpeg_iformat = { | |
365 "mjpeg", | |
366 "MJPEG video", | |
367 0, | |
368 NULL, | |
369 video_read_header, | |
370 raw_read_packet, | |
371 raw_read_close, | |
372 .extensions = "mjpg,mjpeg", | |
373 .value = CODEC_ID_MJPEG, | |
374 }; | |
375 | |
376 AVOutputFormat mjpeg_oformat = { | |
377 "mjpeg", | |
378 "MJPEG video", | |
379 "video/x-mjpeg", | |
380 "mjpg,mjpeg", | |
381 0, | |
382 0, | |
383 CODEC_ID_MJPEG, | |
384 raw_write_header, | |
385 raw_write_packet, | |
386 raw_write_trailer, | |
387 }; | |
388 | |
389 /* pcm formats */ | |
390 | |
391 #define PCMDEF(name, long_name, ext, codec) \ | |
392 AVInputFormat pcm_ ## name ## _iformat = {\ | |
393 #name,\ | |
394 long_name,\ | |
395 0,\ | |
396 NULL,\ | |
397 raw_read_header,\ | |
398 raw_read_packet,\ | |
399 raw_read_close,\ | |
400 .extensions = ext,\ | |
401 .value = codec,\ | |
402 };\ | |
403 \ | |
404 AVOutputFormat pcm_ ## name ## _oformat = {\ | |
405 #name,\ | |
406 long_name,\ | |
407 NULL,\ | |
408 ext,\ | |
409 0,\ | |
410 codec,\ | |
411 0,\ | |
412 raw_write_header,\ | |
413 raw_write_packet,\ | |
414 raw_write_trailer,\ | |
415 }; | |
416 | |
417 #ifdef WORDS_BIGENDIAN | |
418 #define BE_DEF(s) s | |
419 #define LE_DEF(s) NULL | |
420 #else | |
421 #define BE_DEF(s) NULL | |
422 #define LE_DEF(s) s | |
423 #endif | |
424 | |
425 | |
426 PCMDEF(s16le, "pcm signed 16 bit little endian format", | |
427 LE_DEF("sw"), CODEC_ID_PCM_S16LE) | |
428 | |
429 PCMDEF(s16be, "pcm signed 16 bit big endian format", | |
430 BE_DEF("sw"), CODEC_ID_PCM_S16BE) | |
431 | |
432 PCMDEF(u16le, "pcm unsigned 16 bit little endian format", | |
433 LE_DEF("uw"), CODEC_ID_PCM_U16LE) | |
434 | |
435 PCMDEF(u16be, "pcm unsigned 16 bit big endian format", | |
436 BE_DEF("uw"), CODEC_ID_PCM_U16BE) | |
437 | |
438 PCMDEF(s8, "pcm signed 8 bit format", | |
439 "sb", CODEC_ID_PCM_S8) | |
440 | |
441 PCMDEF(u8, "pcm unsigned 8 bit format", | |
442 "ub", CODEC_ID_PCM_U8) | |
443 | |
444 PCMDEF(mulaw, "pcm mu law format", | |
445 "ul", CODEC_ID_PCM_MULAW) | |
446 | |
447 PCMDEF(alaw, "pcm A law format", | |
448 "al", CODEC_ID_PCM_ALAW) | |
449 | |
64 | 450 static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt) |
0 | 451 { |
452 int packet_size, ret, width, height; | |
453 AVStream *st = s->streams[0]; | |
454 | |
455 width = st->codec.width; | |
456 height = st->codec.height; | |
457 | |
458 switch(st->codec.pix_fmt) { | |
459 case PIX_FMT_YUV420P: | |
460 packet_size = (width * height * 3) / 2; | |
461 break; | |
462 case PIX_FMT_YUV422: | |
463 packet_size = (width * height * 2); | |
464 break; | |
465 case PIX_FMT_BGR24: | |
466 case PIX_FMT_RGB24: | |
467 packet_size = (width * height * 3); | |
468 break; | |
469 default: | |
470 av_abort(); | |
471 break; | |
472 } | |
473 | |
474 if (av_new_packet(pkt, packet_size) < 0) | |
475 return -EIO; | |
476 | |
477 pkt->stream_index = 0; | |
478 #if 0 | |
479 /* bypass buffered I/O */ | |
480 ret = url_read(url_fileno(&s->pb), pkt->data, pkt->size); | |
481 #else | |
482 ret = get_buffer(&s->pb, pkt->data, pkt->size); | |
483 #endif | |
484 if (ret != pkt->size) { | |
485 av_free_packet(pkt); | |
486 return -EIO; | |
487 } else { | |
488 return 0; | |
489 } | |
490 } | |
491 | |
492 AVInputFormat rawvideo_iformat = { | |
493 "rawvideo", | |
494 "raw video format", | |
495 0, | |
496 NULL, | |
497 raw_read_header, | |
498 rawvideo_read_packet, | |
499 raw_read_close, | |
500 .extensions = "yuv", | |
501 .value = CODEC_ID_RAWVIDEO, | |
502 }; | |
503 | |
504 AVOutputFormat rawvideo_oformat = { | |
505 "rawvideo", | |
506 "raw video format", | |
507 NULL, | |
508 "yuv", | |
509 0, | |
510 CODEC_ID_NONE, | |
511 CODEC_ID_RAWVIDEO, | |
512 raw_write_header, | |
513 raw_write_packet, | |
514 raw_write_trailer, | |
515 }; | |
516 | |
517 static int null_write_packet(struct AVFormatContext *s, | |
518 int stream_index, | |
519 unsigned char *buf, int size, int force_pts) | |
520 { | |
521 return 0; | |
522 } | |
523 | |
524 AVOutputFormat null_oformat = { | |
525 "null", | |
526 "null video format", | |
527 NULL, | |
528 NULL, | |
529 0, | |
530 #ifdef WORDS_BIGENDIAN | |
531 CODEC_ID_PCM_S16BE, | |
532 #else | |
533 CODEC_ID_PCM_S16LE, | |
534 #endif | |
535 CODEC_ID_RAWVIDEO, | |
536 raw_write_header, | |
537 null_write_packet, | |
538 raw_write_trailer, | |
539 .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE, | |
540 }; | |
541 | |
542 int raw_init(void) | |
543 { | |
544 av_register_input_format(&mp3_iformat); | |
545 av_register_output_format(&mp2_oformat); | |
126
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
546 #ifdef CONFIG_MP3LAME |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
547 av_register_output_format(&mp3_oformat); |
23f62139c013
prefers MP3 codec (rather than MP2) for output if
michaelni
parents:
125
diff
changeset
|
548 #endif |
0 | 549 av_register_input_format(&ac3_iformat); |
550 av_register_output_format(&ac3_oformat); | |
551 | |
552 av_register_output_format(&h263_oformat); | |
553 | |
554 av_register_input_format(&m4v_iformat); | |
555 av_register_output_format(&m4v_oformat); | |
100 | 556 |
557 av_register_input_format(&h264_iformat); | |
558 av_register_output_format(&h264_oformat); | |
0 | 559 |
560 av_register_input_format(&mpegvideo_iformat); | |
561 av_register_output_format(&mpeg1video_oformat); | |
562 | |
563 av_register_input_format(&mjpeg_iformat); | |
564 av_register_output_format(&mjpeg_oformat); | |
565 | |
566 av_register_input_format(&pcm_s16le_iformat); | |
567 av_register_output_format(&pcm_s16le_oformat); | |
568 av_register_input_format(&pcm_s16be_iformat); | |
569 av_register_output_format(&pcm_s16be_oformat); | |
570 av_register_input_format(&pcm_u16le_iformat); | |
571 av_register_output_format(&pcm_u16le_oformat); | |
572 av_register_input_format(&pcm_u16be_iformat); | |
573 av_register_output_format(&pcm_u16be_oformat); | |
574 av_register_input_format(&pcm_s8_iformat); | |
575 av_register_output_format(&pcm_s8_oformat); | |
576 av_register_input_format(&pcm_u8_iformat); | |
577 av_register_output_format(&pcm_u8_oformat); | |
578 av_register_input_format(&pcm_mulaw_iformat); | |
579 av_register_output_format(&pcm_mulaw_oformat); | |
580 av_register_input_format(&pcm_alaw_iformat); | |
581 av_register_output_format(&pcm_alaw_oformat); | |
582 | |
583 av_register_input_format(&rawvideo_iformat); | |
584 av_register_output_format(&rawvideo_oformat); | |
585 | |
586 av_register_output_format(&null_oformat); | |
587 return 0; | |
588 } |