100l (forgoten seeking functions)
[libav.git] / libavformat / raw.c
CommitLineData
de6d9b64
FB
1/*
2 * RAW encoder and decoder
19720f15 3 * Copyright (c) 2001 Fabrice Bellard.
de6d9b64 4 *
19720f15
FB
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.
de6d9b64 9 *
19720f15 10 * This library is distributed in the hope that it will be useful,
de6d9b64 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19720f15
FB
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
de6d9b64 14 *
19720f15
FB
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
de6d9b64 18 */
de6d9b64
FB
19#include "avformat.h"
20
764ef400 21#ifdef CONFIG_ENCODERS
de6d9b64 22/* simple formats */
5c91a675 23static int raw_write_header(struct AVFormatContext *s)
de6d9b64
FB
24{
25 return 0;
26}
27
e928649b 28static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt)
de6d9b64 29{
e928649b 30 put_buffer(&s->pb, pkt->data, pkt->size);
de6d9b64
FB
31 put_flush_packet(&s->pb);
32 return 0;
33}
34
5c91a675 35static int raw_write_trailer(struct AVFormatContext *s)
de6d9b64
FB
36{
37 return 0;
38}
764ef400 39#endif //CONFIG_ENCODERS
de6d9b64
FB
40
41/* raw input */
0c1a9eda 42static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
de6d9b64
FB
43{
44 AVStream *st;
c9a65ca8 45 int id;
de6d9b64 46
c9a65ca8 47 st = av_new_stream(s, 0);
de6d9b64 48 if (!st)
c9a65ca8 49 return AVERROR_NOMEM;
de6d9b64 50 if (ap) {
c9a65ca8
FB
51 id = s->iformat->value;
52 if (id == CODEC_ID_RAWVIDEO) {
de6d9b64 53 st->codec.codec_type = CODEC_TYPE_VIDEO;
de6d9b64 54 } else {
c9a65ca8 55 st->codec.codec_type = CODEC_TYPE_AUDIO;
de6d9b64 56 }
c9a65ca8
FB
57 st->codec.codec_id = id;
58
de6d9b64
FB
59 switch(st->codec.codec_type) {
60 case CODEC_TYPE_AUDIO:
61 st->codec.sample_rate = ap->sample_rate;
62 st->codec.channels = ap->channels;
de6d9b64
FB
63 break;
64 case CODEC_TYPE_VIDEO:
14bea432
MN
65 st->codec.frame_rate = ap->frame_rate;
66 st->codec.frame_rate_base = ap->frame_rate_base;
de6d9b64
FB
67 st->codec.width = ap->width;
68 st->codec.height = ap->height;
63167088 69 st->codec.pix_fmt = ap->pix_fmt;
de6d9b64
FB
70 break;
71 default:
27e084bd 72 return -1;
de6d9b64
FB
73 }
74 } else {
27e084bd 75 return -1;
de6d9b64
FB
76 }
77 return 0;
78}
79
2e93e3aa 80#define RAW_PACKET_SIZE 1024
de6d9b64 81
5c91a675 82static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
de6d9b64 83{
7866eeff 84 int ret, size;
2a6874fd 85 // AVStream *st = s->streams[0];
7866eeff 86
231dd3f3 87 size= RAW_PACKET_SIZE;
de6d9b64 88
7866eeff 89 if (av_new_packet(pkt, size) < 0)
0bd586c5 90 return AVERROR_IO;
de6d9b64
FB
91
92 pkt->stream_index = 0;
7866eeff 93 ret = get_buffer(&s->pb, pkt->data, size);
2e93e3aa 94 if (ret <= 0) {
de6d9b64 95 av_free_packet(pkt);
0bd586c5 96 return AVERROR_IO;
2e93e3aa
FB
97 }
98 /* note: we need to modify the packet size here to handle the last
99 packet */
100 pkt->size = ret;
de6d9b64
FB
101 return ret;
102}
103
e15dec10
LS
104static int raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
105{
106 int ret, size;
107
108 size = RAW_PACKET_SIZE;
109
110 if (av_new_packet(pkt, size) < 0)
0bd586c5 111 return AVERROR_IO;
e15dec10
LS
112
113 pkt->stream_index = 0;
114 ret = get_partial_buffer(&s->pb, pkt->data, size);
115 if (ret <= 0) {
116 av_free_packet(pkt);
0bd586c5 117 return AVERROR_IO;
e15dec10
LS
118 }
119 pkt->size = ret;
120 return ret;
121}
122
5c91a675 123static int raw_read_close(AVFormatContext *s)
de6d9b64
FB
124{
125 return 0;
126}
127
4986a429 128int pcm_read_seek(AVFormatContext *s,
7b3c1382 129 int stream_index, int64_t timestamp, int flags)
4986a429
FB
130{
131 AVStream *st;
132 int block_align, byte_rate;
133 int64_t pos;
134
135 st = s->streams[0];
136 switch(st->codec.codec_id) {
137 case CODEC_ID_PCM_S16LE:
138 case CODEC_ID_PCM_S16BE:
139 case CODEC_ID_PCM_U16LE:
140 case CODEC_ID_PCM_U16BE:
141 block_align = 2 * st->codec.channels;
142 byte_rate = block_align * st->codec.sample_rate;
143 break;
144 case CODEC_ID_PCM_S8:
145 case CODEC_ID_PCM_U8:
146 case CODEC_ID_PCM_MULAW:
147 case CODEC_ID_PCM_ALAW:
148 block_align = st->codec.channels;
149 byte_rate = block_align * st->codec.sample_rate;
150 break;
151 default:
152 block_align = st->codec.block_align;
153 byte_rate = st->codec.bit_rate / 8;
154 break;
155 }
156
157 if (block_align <= 0 || byte_rate <= 0)
158 return -1;
159
160 /* compute the position by aligning it to block_align */
7b3c1382
MN
161 pos = av_rescale_rnd(timestamp * byte_rate,
162 st->time_base.num,
163 st->time_base.den * (int64_t)block_align,
164 (flags & AVSEEK_FLAG_BACKWARD) ? AV_ROUND_DOWN : AV_ROUND_UP);
165 pos *= block_align;
4986a429
FB
166
167 /* recompute exact position */
77405fc8 168 st->cur_dts = av_rescale(pos, st->time_base.den, byte_rate * (int64_t)st->time_base.num);
4986a429
FB
169 url_fseek(&s->pb, pos + s->data_offset, SEEK_SET);
170 return 0;
171}
172
cd66005d
FB
173/* ac3 read */
174static int ac3_read_header(AVFormatContext *s,
175 AVFormatParameters *ap)
176{
177 AVStream *st;
178
179 st = av_new_stream(s, 0);
180 if (!st)
181 return AVERROR_NOMEM;
182
183 st->codec.codec_type = CODEC_TYPE_AUDIO;
184 st->codec.codec_id = CODEC_ID_AC3;
4986a429 185 st->need_parsing = 1;
cd66005d
FB
186 /* the parameters will be extracted from the compressed bitstream */
187 return 0;
188}
189
23c99253
MN
190/* dts read */
191static int dts_read_header(AVFormatContext *s,
192 AVFormatParameters *ap)
193{
194 AVStream *st;
195
196 st = av_new_stream(s, 0);
197 if (!st)
198 return AVERROR_NOMEM;
199
200 st->codec.codec_type = CODEC_TYPE_AUDIO;
201 st->codec.codec_id = CODEC_ID_DTS;
202 st->need_parsing = 1;
203 /* the parameters will be extracted from the compressed bitstream */
204 return 0;
205}
206
de6d9b64
FB
207/* mpeg1/h263 input */
208static int video_read_header(AVFormatContext *s,
209 AVFormatParameters *ap)
210{
211 AVStream *st;
212
c9a65ca8 213 st = av_new_stream(s, 0);
de6d9b64 214 if (!st)
c9a65ca8 215 return AVERROR_NOMEM;
de6d9b64
FB
216
217 st->codec.codec_type = CODEC_TYPE_VIDEO;
c9a65ca8 218 st->codec.codec_id = s->iformat->value;
4986a429
FB
219 st->need_parsing = 1;
220
27e084bd 221 /* for mjpeg, specify frame rate */
7866eeff 222 /* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/
4986a429
FB
223 if (st->codec.codec_id == CODEC_ID_MJPEG ||
224 st->codec.codec_id == CODEC_ID_MPEG4) {
225 if (ap && ap->frame_rate) {
14bea432
MN
226 st->codec.frame_rate = ap->frame_rate;
227 st->codec.frame_rate_base = ap->frame_rate_base;
27e084bd 228 } else {
14bea432
MN
229 st->codec.frame_rate = 25;
230 st->codec.frame_rate_base = 1;
27e084bd
FB
231 }
232 }
de6d9b64
FB
233 return 0;
234}
235
c9a65ca8
FB
236#define SEQ_START_CODE 0x000001b3
237#define GOP_START_CODE 0x000001b8
238#define PICTURE_START_CODE 0x00000100
239
240/* XXX: improve that by looking at several start codes */
241static int mpegvideo_probe(AVProbeData *p)
242{
fa777321
FB
243 int code;
244 const uint8_t *d;
c9a65ca8
FB
245
246 /* we search the first start code. If it is a sequence, gop or
247 picture start code then we decide it is an mpeg video
248 stream. We do not send highest value to give a chance to mpegts */
fa777321
FB
249 /* NOTE: the search range was restricted to avoid too many false
250 detections */
251
252 if (p->buf_size < 6)
253 return 0;
254 d = p->buf;
255 code = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | (d[3]);
256 if ((code & 0xffffff00) == 0x100) {
257 if (code == SEQ_START_CODE ||
258 code == GOP_START_CODE ||
259 code == PICTURE_START_CODE)
260 return 50 - 1;
261 else
262 return 0;
c9a65ca8
FB
263 }
264 return 0;
265}
266
d07f9043
MN
267static int h263_probe(AVProbeData *p)
268{
269 int code;
270 const uint8_t *d;
271
272 if (p->buf_size < 6)
273 return 0;
274 d = p->buf;
275 code = (d[0] << 14) | (d[1] << 6) | (d[2] >> 2);
276 if (code == 0x20) {
277 return 50;
278 }
279 return 0;
280}
281
c6148de2
MN
282static int h261_probe(AVProbeData *p)
283{
284 int code;
285 const uint8_t *d;
286
287 if (p->buf_size < 6)
288 return 0;
289 d = p->buf;
290 code = (d[0] << 12) | (d[1] << 4) | (d[2] >> 4);
291 if (code == 0x10) {
292 return 50;
293 }
294 return 0;
295}
296
c9a65ca8
FB
297AVInputFormat ac3_iformat = {
298 "ac3",
299 "raw ac3",
300 0,
301 NULL,
cd66005d 302 ac3_read_header,
e15dec10 303 raw_read_partial_packet,
de6d9b64 304 raw_read_close,
bb76a117 305 .extensions = "ac3",
de6d9b64
FB
306};
307
764ef400 308#ifdef CONFIG_ENCODERS
c9a65ca8 309AVOutputFormat ac3_oformat = {
de6d9b64
FB
310 "ac3",
311 "raw ac3",
312 "audio/x-ac3",
313 "ac3",
c9a65ca8 314 0,
de6d9b64
FB
315 CODEC_ID_AC3,
316 0,
317 raw_write_header,
318 raw_write_packet,
319 raw_write_trailer,
320};
764ef400 321#endif //CONFIG_ENCODERS
de6d9b64 322
23c99253
MN
323AVInputFormat dts_iformat = {
324 "dts",
325 "raw dts",
326 0,
327 NULL,
328 dts_read_header,
329 raw_read_partial_packet,
330 raw_read_close,
331 .extensions = "dts",
332};
333
c6148de2
MN
334AVInputFormat h261_iformat = {
335 "h261",
336 "raw h261",
337 0,
338 h261_probe,
339 video_read_header,
340 raw_read_partial_packet,
341 raw_read_close,
342 .extensions = "h261",
343 .value = CODEC_ID_H261,
344};
345
d07f9043
MN
346AVInputFormat h263_iformat = {
347 "h263",
348 "raw h263",
349 0,
350 h263_probe,
351 video_read_header,
e15dec10 352 raw_read_partial_packet,
d07f9043
MN
353 raw_read_close,
354// .extensions = "h263", //FIXME remove after writing mpeg4_probe
355 .value = CODEC_ID_H263,
356};
357
764ef400 358#ifdef CONFIG_ENCODERS
c9a65ca8 359AVOutputFormat h263_oformat = {
de6d9b64
FB
360 "h263",
361 "raw h263",
362 "video/x-h263",
363 "h263",
364 0,
c9a65ca8 365 0,
de6d9b64
FB
366 CODEC_ID_H263,
367 raw_write_header,
368 raw_write_packet,
369 raw_write_trailer,
c9a65ca8 370};
764ef400 371#endif //CONFIG_ENCODERS
c9a65ca8 372
7866eeff
MN
373AVInputFormat m4v_iformat = {
374 "m4v",
375 "raw MPEG4 video format",
376 0,
2f0f5b20 377 NULL /*mpegvideo_probe*/,
7866eeff 378 video_read_header,
e15dec10 379 raw_read_partial_packet,
7866eeff 380 raw_read_close,
bb76a117
MR
381 .extensions = "m4v", //FIXME remove after writing mpeg4_probe
382 .value = CODEC_ID_MPEG4,
7866eeff
MN
383};
384
764ef400 385#ifdef CONFIG_ENCODERS
89b3d7c9
MK
386AVOutputFormat m4v_oformat = {
387 "m4v",
388 "raw MPEG4 video format",
389 NULL,
390 "m4v",
391 0,
392 CODEC_ID_NONE,
393 CODEC_ID_MPEG4,
394 raw_write_header,
395 raw_write_packet,
396 raw_write_trailer,
397};
764ef400 398#endif //CONFIG_ENCODERS
89b3d7c9 399
0da71265
MN
400AVInputFormat h264_iformat = {
401 "h264",
402 "raw H264 video format",
403 0,
404 NULL /*mpegvideo_probe*/,
405 video_read_header,
e15dec10 406 raw_read_partial_packet,
0da71265
MN
407 raw_read_close,
408 .extensions = "h26l,h264", //FIXME remove after writing mpeg4_probe
409 .value = CODEC_ID_H264,
410};
411
764ef400 412#ifdef CONFIG_ENCODERS
0da71265
MN
413AVOutputFormat h264_oformat = {
414 "h264",
415 "raw H264 video format",
416 NULL,
417 "h264",
418 0,
419 CODEC_ID_NONE,
420 CODEC_ID_H264,
421 raw_write_header,
422 raw_write_packet,
423 raw_write_trailer,
424};
764ef400 425#endif //CONFIG_ENCODERS
0da71265 426
c9a65ca8
FB
427AVInputFormat mpegvideo_iformat = {
428 "mpegvideo",
429 "MPEG video",
430 0,
431 mpegvideo_probe,
de6d9b64 432 video_read_header,
e15dec10 433 raw_read_partial_packet,
de6d9b64 434 raw_read_close,
bb76a117 435 .value = CODEC_ID_MPEG1VIDEO,
de6d9b64
FB
436};
437
764ef400 438#ifdef CONFIG_ENCODERS
c9a65ca8
FB
439AVOutputFormat mpeg1video_oformat = {
440 "mpeg1video",
de6d9b64
FB
441 "MPEG video",
442 "video/x-mpeg",
443 "mpg,mpeg",
444 0,
c9a65ca8 445 0,
de6d9b64
FB
446 CODEC_ID_MPEG1VIDEO,
447 raw_write_header,
448 raw_write_packet,
449 raw_write_trailer,
de6d9b64 450};
764ef400 451#endif //CONFIG_ENCODERS
de6d9b64 452
c9a65ca8 453AVInputFormat mjpeg_iformat = {
27e084bd
FB
454 "mjpeg",
455 "MJPEG video",
27e084bd 456 0,
c9a65ca8 457 NULL,
27e084bd 458 video_read_header,
e15dec10 459 raw_read_partial_packet,
27e084bd 460 raw_read_close,
bb76a117
MR
461 .extensions = "mjpg,mjpeg",
462 .value = CODEC_ID_MJPEG,
27e084bd
FB
463};
464
764ef400 465#ifdef CONFIG_ENCODERS
c9a65ca8
FB
466AVOutputFormat mjpeg_oformat = {
467 "mjpeg",
468 "MJPEG video",
469 "video/x-mjpeg",
470 "mjpg,mjpeg",
5ed8fafc 471 0,
5ed8fafc 472 0,
c9a65ca8 473 CODEC_ID_MJPEG,
5ed8fafc
FB
474 raw_write_header,
475 raw_write_packet,
476 raw_write_trailer,
5ed8fafc 477};
764ef400 478#endif //CONFIG_ENCODERS
5ed8fafc 479
c9a65ca8 480/* pcm formats */
764ef400 481
4986a429 482#define PCMINPUTDEF(name, long_name, ext, codec) \
764ef400
MM
483AVInputFormat pcm_ ## name ## _iformat = {\
484 #name,\
485 long_name,\
486 0,\
487 NULL,\
488 raw_read_header,\
489 raw_read_packet,\
490 raw_read_close,\
4986a429 491 pcm_read_seek,\
764ef400
MM
492 .extensions = ext,\
493 .value = codec,\
494};
495
4986a429
FB
496#if !defined(CONFIG_ENCODERS) && defined(CONFIG_DECODERS)
497
498#define PCMDEF(name, long_name, ext, codec) \
499 PCMINPUTDEF(name, long_name, ext, codec)
500
764ef400 501#else
5ed8fafc 502
c9a65ca8 503#define PCMDEF(name, long_name, ext, codec) \
4986a429 504 PCMINPUTDEF(name, long_name, ext, codec)\
c9a65ca8
FB
505\
506AVOutputFormat pcm_ ## name ## _oformat = {\
507 #name,\
508 long_name,\
509 NULL,\
510 ext,\
511 0,\
512 codec,\
513 0,\
514 raw_write_header,\
515 raw_write_packet,\
516 raw_write_trailer,\
5ed8fafc 517};
764ef400 518#endif //CONFIG_ENCODERS
5ed8fafc 519
5ed8fafc 520#ifdef WORDS_BIGENDIAN
c9a65ca8
FB
521#define BE_DEF(s) s
522#define LE_DEF(s) NULL
5ed8fafc 523#else
c9a65ca8
FB
524#define BE_DEF(s) NULL
525#define LE_DEF(s) s
5ed8fafc 526#endif
5ed8fafc 527
5ed8fafc 528
c9a65ca8
FB
529PCMDEF(s16le, "pcm signed 16 bit little endian format",
530 LE_DEF("sw"), CODEC_ID_PCM_S16LE)
5ed8fafc 531
c9a65ca8
FB
532PCMDEF(s16be, "pcm signed 16 bit big endian format",
533 BE_DEF("sw"), CODEC_ID_PCM_S16BE)
5ed8fafc 534
c9a65ca8
FB
535PCMDEF(u16le, "pcm unsigned 16 bit little endian format",
536 LE_DEF("uw"), CODEC_ID_PCM_U16LE)
5ed8fafc 537
c9a65ca8
FB
538PCMDEF(u16be, "pcm unsigned 16 bit big endian format",
539 BE_DEF("uw"), CODEC_ID_PCM_U16BE)
5ed8fafc 540
c9a65ca8
FB
541PCMDEF(s8, "pcm signed 8 bit format",
542 "sb", CODEC_ID_PCM_S8)
5ed8fafc 543
c9a65ca8
FB
544PCMDEF(u8, "pcm unsigned 8 bit format",
545 "ub", CODEC_ID_PCM_U8)
5ed8fafc 546
c9a65ca8
FB
547PCMDEF(mulaw, "pcm mu law format",
548 "ul", CODEC_ID_PCM_MULAW)
de6d9b64 549
c9a65ca8
FB
550PCMDEF(alaw, "pcm A law format",
551 "al", CODEC_ID_PCM_ALAW)
de6d9b64 552
5c91a675 553static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
de6d9b64
FB
554{
555 int packet_size, ret, width, height;
556 AVStream *st = s->streams[0];
557
558 width = st->codec.width;
559 height = st->codec.height;
560
63167088
RS
561 packet_size = avpicture_get_size(st->codec.pix_fmt, width, height);
562 if (packet_size < 0)
71c32f19 563 return -1;
de6d9b64
FB
564
565 if (av_new_packet(pkt, packet_size) < 0)
0bd586c5 566 return AVERROR_IO;
de6d9b64
FB
567
568 pkt->stream_index = 0;
c2c2cd2d 569#if 0
de6d9b64
FB
570 /* bypass buffered I/O */
571 ret = url_read(url_fileno(&s->pb), pkt->data, pkt->size);
c2c2cd2d
MN
572#else
573 ret = get_buffer(&s->pb, pkt->data, pkt->size);
574#endif
de6d9b64
FB
575 if (ret != pkt->size) {
576 av_free_packet(pkt);
0bd586c5 577 return AVERROR_IO;
de6d9b64
FB
578 } else {
579 return 0;
580 }
581}
582
c9a65ca8
FB
583AVInputFormat rawvideo_iformat = {
584 "rawvideo",
585 "raw video format",
586 0,
587 NULL,
588 raw_read_header,
589 rawvideo_read_packet,
590 raw_read_close,
bb76a117
MR
591 .extensions = "yuv",
592 .value = CODEC_ID_RAWVIDEO,
c9a65ca8
FB
593};
594
764ef400 595#ifdef CONFIG_ENCODERS
c9a65ca8 596AVOutputFormat rawvideo_oformat = {
de6d9b64
FB
597 "rawvideo",
598 "raw video format",
599 NULL,
600 "yuv",
c9a65ca8 601 0,
de6d9b64
FB
602 CODEC_ID_NONE,
603 CODEC_ID_RAWVIDEO,
604 raw_write_header,
605 raw_write_packet,
606 raw_write_trailer,
de6d9b64 607};
764ef400 608#endif //CONFIG_ENCODERS
c9a65ca8 609
764ef400 610#ifdef CONFIG_ENCODERS
e928649b 611static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
87bdd3e5
FB
612{
613 return 0;
614}
615
616AVOutputFormat null_oformat = {
617 "null",
618 "null video format",
619 NULL,
620 NULL,
621 0,
622#ifdef WORDS_BIGENDIAN
623 CODEC_ID_PCM_S16BE,
624#else
625 CODEC_ID_PCM_S16LE,
626#endif
627 CODEC_ID_RAWVIDEO,
628 raw_write_header,
629 null_write_packet,
630 raw_write_trailer,
b1d89f82 631 .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
87bdd3e5 632};
764ef400
MM
633#endif //CONFIG_ENCODERS
634
635#ifndef CONFIG_ENCODERS
636#define av_register_output_format(format)
637#endif
638#ifndef CONFIG_DECODERS
639#define av_register_input_format(format)
640#endif
87bdd3e5 641
c9a65ca8
FB
642int raw_init(void)
643{
c9a65ca8
FB
644 av_register_input_format(&ac3_iformat);
645 av_register_output_format(&ac3_oformat);
646
23c99253
MN
647 av_register_input_format(&dts_iformat);
648
c6148de2
MN
649 av_register_input_format(&h261_iformat);
650
d07f9043 651 av_register_input_format(&h263_iformat);
c9a65ca8 652 av_register_output_format(&h263_oformat);
89b3d7c9 653
7866eeff 654 av_register_input_format(&m4v_iformat);
89b3d7c9 655 av_register_output_format(&m4v_oformat);
0da71265
MN
656
657 av_register_input_format(&h264_iformat);
658 av_register_output_format(&h264_oformat);
c9a65ca8
FB
659
660 av_register_input_format(&mpegvideo_iformat);
661 av_register_output_format(&mpeg1video_oformat);
662
663 av_register_input_format(&mjpeg_iformat);
664 av_register_output_format(&mjpeg_oformat);
665
666 av_register_input_format(&pcm_s16le_iformat);
667 av_register_output_format(&pcm_s16le_oformat);
668 av_register_input_format(&pcm_s16be_iformat);
669 av_register_output_format(&pcm_s16be_oformat);
670 av_register_input_format(&pcm_u16le_iformat);
671 av_register_output_format(&pcm_u16le_oformat);
672 av_register_input_format(&pcm_u16be_iformat);
673 av_register_output_format(&pcm_u16be_oformat);
674 av_register_input_format(&pcm_s8_iformat);
675 av_register_output_format(&pcm_s8_oformat);
676 av_register_input_format(&pcm_u8_iformat);
677 av_register_output_format(&pcm_u8_oformat);
678 av_register_input_format(&pcm_mulaw_iformat);
679 av_register_output_format(&pcm_mulaw_oformat);
680 av_register_input_format(&pcm_alaw_iformat);
681 av_register_output_format(&pcm_alaw_oformat);
682
683 av_register_input_format(&rawvideo_iformat);
684 av_register_output_format(&rawvideo_oformat);
87bdd3e5
FB
685
686 av_register_output_format(&null_oformat);
c9a65ca8
FB
687 return 0;
688}