Statistics
| Branch: | Revision:

ffmpeg / libavformat / raw.c @ 9f2fc126

History | View | Annotate | Download (31.3 KB)

1
/*
2
 * RAW muxer and demuxer
3
 * Copyright (c) 2001 Fabrice Bellard
4
 * Copyright (c) 2005 Alex Beregszaszi
5
 *
6
 * This file is part of FFmpeg.
7
 *
8
 * FFmpeg 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
 * FFmpeg 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 FFmpeg; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
 */
22

    
23
#include "libavutil/crc.h"
24
#include "libavcodec/ac3_parser.h"
25
#include "libavcodec/bitstream.h"
26
#include "libavcodec/bytestream.h"
27
#include "avformat.h"
28
#include "raw.h"
29
#include "id3v2.h"
30

    
31
/* simple formats */
32
#if CONFIG_FLAC_MUXER
33
static int flac_write_header(struct AVFormatContext *s)
34
{
35
    static const uint8_t header[8] = {
36
        0x66, 0x4C, 0x61, 0x43, 0x80, 0x00, 0x00, 0x22
37
    };
38
    uint8_t *streaminfo = s->streams[0]->codec->extradata;
39
    int len = s->streams[0]->codec->extradata_size;
40
    if(streaminfo != NULL && len > 0) {
41
        put_buffer(s->pb, header, 8);
42
        put_buffer(s->pb, streaminfo, len);
43
    }
44
    return 0;
45
}
46

    
47
static int flac_write_trailer(struct AVFormatContext *s)
48
{
49
    ByteIOContext *pb = s->pb;
50
    uint8_t *streaminfo = s->streams[0]->codec->extradata;
51
    int len = s->streams[0]->codec->extradata_size;
52
    int64_t file_size;
53

    
54
    if (streaminfo && len > 0 && !url_is_streamed(s->pb)) {
55
        file_size = url_ftell(pb);
56
        url_fseek(pb, 8, SEEK_SET);
57
        put_buffer(pb, streaminfo, len);
58
        url_fseek(pb, file_size, SEEK_SET);
59
        put_flush_packet(pb);
60
    }
61
    return 0;
62
}
63
#endif
64

    
65
#if CONFIG_ROQ_MUXER
66
static int roq_write_header(struct AVFormatContext *s)
67
{
68
    static const uint8_t header[] = {
69
        0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00
70
    };
71

    
72
    put_buffer(s->pb, header, 8);
73
    put_flush_packet(s->pb);
74

    
75
    return 0;
76
}
77
#endif
78

    
79
#if CONFIG_NULL_MUXER
80
static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
81
{
82
    return 0;
83
}
84
#endif
85

    
86
#if CONFIG_MUXERS
87
static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt)
88
{
89
    put_buffer(s->pb, pkt->data, pkt->size);
90
    put_flush_packet(s->pb);
91
    return 0;
92
}
93
#endif
94

    
95
#if CONFIG_DEMUXERS
96
/* raw input */
97
static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
98
{
99
    AVStream *st;
100
    int id;
101

    
102
    st = av_new_stream(s, 0);
103
    if (!st)
104
        return AVERROR(ENOMEM);
105

    
106
        id = s->iformat->value;
107
        if (id == CODEC_ID_RAWVIDEO) {
108
            st->codec->codec_type = CODEC_TYPE_VIDEO;
109
        } else {
110
            st->codec->codec_type = CODEC_TYPE_AUDIO;
111
        }
112
        st->codec->codec_id = id;
113

    
114
        switch(st->codec->codec_type) {
115
        case CODEC_TYPE_AUDIO:
116
            st->codec->sample_rate = ap->sample_rate;
117
            if(ap->channels) st->codec->channels = ap->channels;
118
            else             st->codec->channels = 1;
119
            av_set_pts_info(st, 64, 1, st->codec->sample_rate);
120
            break;
121
        case CODEC_TYPE_VIDEO:
122
            if(ap->time_base.num)
123
                av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
124
            else
125
                av_set_pts_info(st, 64, 1, 25);
126
            st->codec->width = ap->width;
127
            st->codec->height = ap->height;
128
            st->codec->pix_fmt = ap->pix_fmt;
129
            if(st->codec->pix_fmt == PIX_FMT_NONE)
130
                st->codec->pix_fmt= PIX_FMT_YUV420P;
131
            break;
132
        default:
133
            return -1;
134
        }
135
    return 0;
136
}
137

    
138
#define RAW_PACKET_SIZE 1024
139

    
140
static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
141
{
142
    int ret, size, bps;
143
    //    AVStream *st = s->streams[0];
144

    
145
    size= RAW_PACKET_SIZE;
146

    
147
    ret= av_get_packet(s->pb, pkt, size);
148

    
149
    pkt->stream_index = 0;
150
    if (ret <= 0) {
151
        return AVERROR(EIO);
152
    }
153
    /* note: we need to modify the packet size here to handle the last
154
       packet */
155
    pkt->size = ret;
156

    
157
    bps= av_get_bits_per_sample(s->streams[0]->codec->codec_id);
158
    assert(bps); // if false there IS a bug elsewhere (NOT in this function)
159
    pkt->dts=
160
    pkt->pts= pkt->pos*8 / (bps * s->streams[0]->codec->channels);
161

    
162
    return ret;
163
}
164

    
165
static int raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
166
{
167
    int ret, size;
168

    
169
    size = RAW_PACKET_SIZE;
170

    
171
    if (av_new_packet(pkt, size) < 0)
172
        return AVERROR(EIO);
173

    
174
    pkt->pos= url_ftell(s->pb);
175
    pkt->stream_index = 0;
176
    ret = get_partial_buffer(s->pb, pkt->data, size);
177
    if (ret <= 0) {
178
        av_free_packet(pkt);
179
        return AVERROR(EIO);
180
    }
181
    pkt->size = ret;
182
    return ret;
183
}
184
#endif
185

    
186
#if CONFIG_RAWVIDEO_DEMUXER
187
static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
188
{
189
    int packet_size, ret, width, height;
190
    AVStream *st = s->streams[0];
191

    
192
    width = st->codec->width;
193
    height = st->codec->height;
194

    
195
    packet_size = avpicture_get_size(st->codec->pix_fmt, width, height);
196
    if (packet_size < 0)
197
        return -1;
198

    
199
    ret= av_get_packet(s->pb, pkt, packet_size);
200
    pkt->pts=
201
    pkt->dts= pkt->pos / packet_size;
202

    
203
    pkt->stream_index = 0;
204
    if (ret != packet_size) {
205
        return AVERROR(EIO);
206
    } else {
207
        return 0;
208
    }
209
}
210
#endif
211

    
212
#if CONFIG_INGENIENT_DEMUXER
213
// http://www.artificis.hu/files/texts/ingenient.txt
214
static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt)
215
{
216
    int ret, size, w, h, unk1, unk2;
217

    
218
    if (get_le32(s->pb) != MKTAG('M', 'J', 'P', 'G'))
219
        return AVERROR(EIO); // FIXME
220

    
221
    size = get_le32(s->pb);
222

    
223
    w = get_le16(s->pb);
224
    h = get_le16(s->pb);
225

    
226
    url_fskip(s->pb, 8); // zero + size (padded?)
227
    url_fskip(s->pb, 2);
228
    unk1 = get_le16(s->pb);
229
    unk2 = get_le16(s->pb);
230
    url_fskip(s->pb, 22); // ASCII timestamp
231

    
232
    av_log(s, AV_LOG_DEBUG, "Ingenient packet: size=%d, width=%d, height=%d, unk1=%d unk2=%d\n",
233
        size, w, h, unk1, unk2);
234

    
235
    if (av_new_packet(pkt, size) < 0)
236
        return AVERROR(EIO);
237

    
238
    pkt->pos = url_ftell(s->pb);
239
    pkt->stream_index = 0;
240
    ret = get_buffer(s->pb, pkt->data, size);
241
    if (ret <= 0) {
242
        av_free_packet(pkt);
243
        return AVERROR(EIO);
244
    }
245
    pkt->size = ret;
246
    return ret;
247
}
248
#endif
249

    
250
#if CONFIG_DEMUXERS
251
int pcm_read_seek(AVFormatContext *s,
252
                  int stream_index, int64_t timestamp, int flags)
253
{
254
    AVStream *st;
255
    int block_align, byte_rate, ret;
256
    int64_t pos;
257

    
258
    st = s->streams[0];
259

    
260
    block_align = st->codec->block_align ? st->codec->block_align :
261
        (av_get_bits_per_sample(st->codec->codec_id) * st->codec->channels) >> 3;
262
    byte_rate = st->codec->bit_rate ? st->codec->bit_rate >> 3 :
263
        block_align * st->codec->sample_rate;
264

    
265
    if (block_align <= 0 || byte_rate <= 0)
266
        return -1;
267

    
268
    /* compute the position by aligning it to block_align */
269
    pos = av_rescale_rnd(timestamp * byte_rate,
270
                         st->time_base.num,
271
                         st->time_base.den * (int64_t)block_align,
272
                         (flags & AVSEEK_FLAG_BACKWARD) ? AV_ROUND_DOWN : AV_ROUND_UP);
273
    pos *= block_align;
274

    
275
    /* recompute exact position */
276
    st->cur_dts = av_rescale(pos, st->time_base.den, byte_rate * (int64_t)st->time_base.num);
277
    if ((ret = url_fseek(s->pb, pos + s->data_offset, SEEK_SET)) < 0)
278
        return ret;
279
    return 0;
280
}
281

    
282
static int audio_read_header(AVFormatContext *s,
283
                             AVFormatParameters *ap)
284
{
285
    AVStream *st = av_new_stream(s, 0);
286
    if (!st)
287
        return AVERROR(ENOMEM);
288
    st->codec->codec_type = CODEC_TYPE_AUDIO;
289
    st->codec->codec_id = s->iformat->value;
290
    st->need_parsing = AVSTREAM_PARSE_FULL;
291
    /* the parameters will be extracted from the compressed bitstream */
292

    
293
    if(st->codec->codec_id == CODEC_ID_FLAC) {
294
        /* skip ID3v2 header if found */
295
        uint8_t buf[ID3v2_HEADER_SIZE];
296
        int ret = get_buffer(s->pb, buf, ID3v2_HEADER_SIZE);
297
        if (ret == ID3v2_HEADER_SIZE && ff_id3v2_match(buf)) {
298
            int len = ff_id3v2_tag_len(buf);
299
            url_fseek(s->pb, len - ID3v2_HEADER_SIZE, SEEK_CUR);
300
        } else {
301
            url_fseek(s->pb, 0, SEEK_SET);
302
        }
303
    }
304
    return 0;
305
}
306

    
307
/* MPEG-1/H.263 input */
308
static int video_read_header(AVFormatContext *s,
309
                             AVFormatParameters *ap)
310
{
311
    AVStream *st;
312

    
313
    st = av_new_stream(s, 0);
314
    if (!st)
315
        return AVERROR(ENOMEM);
316

    
317
    st->codec->codec_type = CODEC_TYPE_VIDEO;
318
    st->codec->codec_id = s->iformat->value;
319
    st->need_parsing = AVSTREAM_PARSE_FULL;
320

    
321
    /* for MJPEG, specify frame rate */
322
    /* for MPEG-4 specify it, too (most MPEG-4 streams do not have the fixed_vop_rate set ...)*/
323
    if (ap->time_base.num) {
324
        av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
325
    } else if ( st->codec->codec_id == CODEC_ID_MJPEG ||
326
                st->codec->codec_id == CODEC_ID_MPEG4 ||
327
                st->codec->codec_id == CODEC_ID_DIRAC ||
328
                st->codec->codec_id == CODEC_ID_H264) {
329
        av_set_pts_info(st, 64, 1, 25);
330
    }
331

    
332
    return 0;
333
}
334
#endif
335

    
336
#if CONFIG_MPEGVIDEO_DEMUXER
337
#define SEQ_START_CODE          0x000001b3
338
#define GOP_START_CODE          0x000001b8
339
#define PICTURE_START_CODE      0x00000100
340
#define SLICE_START_CODE        0x00000101
341
#define PACK_START_CODE         0x000001ba
342
#define VIDEO_ID                0x000001e0
343
#define AUDIO_ID                0x000001c0
344

    
345
static int mpegvideo_probe(AVProbeData *p)
346
{
347
    uint32_t code= -1;
348
    int pic=0, seq=0, slice=0, pspack=0, pes=0;
349
    int i;
350

    
351
    for(i=0; i<p->buf_size; i++){
352
        code = (code<<8) + p->buf[i];
353
        if ((code & 0xffffff00) == 0x100) {
354
            switch(code){
355
            case     SEQ_START_CODE:   seq++; break;
356
            case PICTURE_START_CODE:   pic++; break;
357
            case   SLICE_START_CODE: slice++; break;
358
            case    PACK_START_CODE: pspack++; break;
359
            }
360
            if     ((code & 0x1f0) == VIDEO_ID)   pes++;
361
            else if((code & 0x1e0) == AUDIO_ID)   pes++;
362
        }
363
    }
364
    if(seq && seq*9<=pic*10 && pic*9<=slice*10 && !pspack && !pes)
365
        return AVPROBE_SCORE_MAX/2+1; // +1 for .mpg
366
    return 0;
367
}
368

    
369
#define CAVS_SEQ_START_CODE       0x000001b0
370
#define CAVS_PIC_I_START_CODE     0x000001b3
371
#define CAVS_UNDEF_START_CODE     0x000001b4
372
#define CAVS_PIC_PB_START_CODE    0x000001b6
373
#define CAVS_VIDEO_EDIT_CODE      0x000001b7
374
#define CAVS_PROFILE_JIZHUN       0x20
375

    
376
static int cavsvideo_probe(AVProbeData *p)
377
{
378
    uint32_t code= -1;
379
    int pic=0, seq=0, slice_pos = 0;
380
    int i;
381

    
382
    for(i=0; i<p->buf_size; i++){
383
        code = (code<<8) + p->buf[i];
384
        if ((code & 0xffffff00) == 0x100) {
385
            if(code < CAVS_SEQ_START_CODE) {
386
                /* slices have to be consecutive */
387
                if(code < slice_pos)
388
                    return 0;
389
                slice_pos = code;
390
            } else {
391
                slice_pos = 0;
392
            }
393
            if (code == CAVS_SEQ_START_CODE) {
394
                seq++;
395
                /* check for the only currently supported profile */
396
                if(p->buf[i+1] != CAVS_PROFILE_JIZHUN)
397
                    return 0;
398
            } else if ((code == CAVS_PIC_I_START_CODE) ||
399
                       (code == CAVS_PIC_PB_START_CODE)) {
400
                pic++;
401
            } else if ((code == CAVS_UNDEF_START_CODE) ||
402
                       (code >  CAVS_VIDEO_EDIT_CODE)) {
403
                return 0;
404
            }
405
        }
406
    }
407
    if(seq && seq*9<=pic*10)
408
        return AVPROBE_SCORE_MAX/2;
409
    return 0;
410
}
411
#endif
412

    
413
#if CONFIG_M4V_DEMUXER
414
#define VISUAL_OBJECT_START_CODE       0x000001b5
415
#define VOP_START_CODE                 0x000001b6
416

    
417
static int mpeg4video_probe(AVProbeData *probe_packet)
418
{
419
    uint32_t temp_buffer= -1;
420
    int VO=0, VOL=0, VOP = 0, VISO = 0, res=0;
421
    int i;
422

    
423
    for(i=0; i<probe_packet->buf_size; i++){
424
        temp_buffer = (temp_buffer<<8) + probe_packet->buf[i];
425
        if ((temp_buffer & 0xffffff00) != 0x100)
426
            continue;
427

    
428
        if (temp_buffer == VOP_START_CODE)                         VOP++;
429
        else if (temp_buffer == VISUAL_OBJECT_START_CODE)          VISO++;
430
        else if (temp_buffer < 0x120)                              VO++;
431
        else if (temp_buffer < 0x130)                              VOL++;
432
        else if (   !(0x1AF < temp_buffer && temp_buffer < 0x1B7)
433
                 && !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++;
434
    }
435

    
436
    if ( VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0 && res==0)
437
        return AVPROBE_SCORE_MAX/2;
438
    return 0;
439
}
440
#endif
441

    
442
#if CONFIG_H264_DEMUXER
443
static int h264_probe(AVProbeData *p)
444
{
445
    uint32_t code= -1;
446
    int sps=0, pps=0, idr=0, res=0, sli=0;
447
    int i;
448

    
449
    for(i=0; i<p->buf_size; i++){
450
        code = (code<<8) + p->buf[i];
451
        if ((code & 0xffffff00) == 0x100) {
452
            int ref_idc= (code>>5)&3;
453
            int type   = code & 0x1F;
454
            static const int8_t ref_zero[32]={
455
                2, 0, 0, 0, 0,-1, 1,-1,
456
               -1, 1, 1, 1, 1,-1, 2, 2,
457
                2, 2, 2, 0, 2, 2, 2, 2,
458
                2, 2, 2, 2, 2, 2, 2, 2
459
            };
460

    
461
            if(code & 0x80) //forbidden bit
462
                return 0;
463

    
464
            if(ref_zero[type] == 1 && ref_idc)
465
                return 0;
466
            if(ref_zero[type] ==-1 && !ref_idc)
467
                return 0;
468
            if(ref_zero[type] == 2)
469
                res++;
470

    
471
            switch(type){
472
            case     1:   sli++; break;
473
            case     5:   idr++; break;
474
            case     7:
475
                if(p->buf[i+2]&0x0F)
476
                    return 0;
477
                sps++;
478
                break;
479
            case     8:   pps++; break;
480
            }
481
        }
482
    }
483
    if(sps && pps && (idr||sli>3) && res<(sps+pps+idr))
484
        return AVPROBE_SCORE_MAX/2+1; // +1 for .mpg
485
    return 0;
486
}
487
#endif
488

    
489
#if CONFIG_H263_DEMUXER
490
static int h263_probe(AVProbeData *p)
491
{
492
    int code;
493
    const uint8_t *d;
494

    
495
    d = p->buf;
496
    code = (d[0] << 14) | (d[1] << 6) | (d[2] >> 2);
497
    if (code == 0x20) {
498
        return 50;
499
    }
500
    return 0;
501
}
502
#endif
503

    
504
#if CONFIG_H261_DEMUXER
505
static int h261_probe(AVProbeData *p)
506
{
507
    int code;
508
    const uint8_t *d;
509

    
510
    d = p->buf;
511
    code = (d[0] << 12) | (d[1] << 4) | (d[2] >> 4);
512
    if (code == 0x10) {
513
        return 50;
514
    }
515
    return 0;
516
}
517
#endif
518

    
519
#if CONFIG_DTS_DEMUXER
520
#define DCA_MARKER_14B_BE 0x1FFFE800
521
#define DCA_MARKER_14B_LE 0xFF1F00E8
522
#define DCA_MARKER_RAW_BE 0x7FFE8001
523
#define DCA_MARKER_RAW_LE 0xFE7F0180
524
static int dts_probe(AVProbeData *p)
525
{
526
    const uint8_t *buf, *bufp;
527
    uint32_t state = -1;
528

    
529
    buf = p->buf;
530

    
531
    for(; buf < (p->buf+p->buf_size)-2; buf+=2) {
532
        bufp = buf;
533
        state = (state << 16) | bytestream_get_be16(&bufp);
534

    
535
        /* regular bitstream */
536
        if (state == DCA_MARKER_RAW_BE || state == DCA_MARKER_RAW_LE)
537
            return AVPROBE_SCORE_MAX/2+1;
538

    
539
        /* 14 bits big-endian bitstream */
540
        if (state == DCA_MARKER_14B_BE)
541
            if ((bytestream_get_be16(&bufp) & 0xFFF0) == 0x07F0)
542
                return AVPROBE_SCORE_MAX/2+1;
543

    
544
        /* 14 bits little-endian bitstream */
545
        if (state == DCA_MARKER_14B_LE)
546
            if ((bytestream_get_be16(&bufp) & 0xF0FF) == 0xF007)
547
                return AVPROBE_SCORE_MAX/2+1;
548
    }
549

    
550
    return 0;
551
}
552
#endif
553

    
554
#if CONFIG_DIRAC_DEMUXER
555
static int dirac_probe(AVProbeData *p)
556
{
557
    if (AV_RL32(p->buf) == MKTAG('B', 'B', 'C', 'D'))
558
        return AVPROBE_SCORE_MAX;
559
    else
560
        return 0;
561
}
562
#endif
563

    
564
#if CONFIG_DNXHD_DEMUXER
565
static int dnxhd_probe(AVProbeData *p)
566
{
567
    static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01};
568
    if (!memcmp(p->buf, header, 5))
569
        return AVPROBE_SCORE_MAX;
570
    else
571
        return 0;
572
}
573
#endif
574

    
575
#if CONFIG_AC3_DEMUXER || CONFIG_EAC3_DEMUXER
576
static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id)
577
{
578
    int max_frames, first_frames = 0, frames;
579
    uint8_t *buf, *buf2, *end;
580
    AC3HeaderInfo hdr;
581
    GetBitContext gbc;
582
    enum CodecID codec_id = CODEC_ID_AC3;
583

    
584
    max_frames = 0;
585
    buf = p->buf;
586
    end = buf + p->buf_size;
587

    
588
    for(; buf < end; buf++) {
589
        buf2 = buf;
590

    
591
        for(frames = 0; buf2 < end; frames++) {
592
            init_get_bits(&gbc, buf2, 54);
593
            if(ff_ac3_parse_header(&gbc, &hdr) < 0)
594
                break;
595
            if(buf2 + hdr.frame_size > end ||
596
               av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, buf2 + 2, hdr.frame_size - 2))
597
                break;
598
            if (hdr.bitstream_id > 10)
599
                codec_id = CODEC_ID_EAC3;
600
            buf2 += hdr.frame_size;
601
        }
602
        max_frames = FFMAX(max_frames, frames);
603
        if(buf == p->buf)
604
            first_frames = frames;
605
    }
606
    if(codec_id != expected_codec_id) return 0;
607
    if   (first_frames>=3) return AVPROBE_SCORE_MAX * 3 / 4;
608
    else if(max_frames>=3) return AVPROBE_SCORE_MAX / 2;
609
    else if(max_frames>=1) return 1;
610
    else                   return 0;
611
}
612
#endif
613

    
614
#if CONFIG_AC3_DEMUXER
615
static int ac3_probe(AVProbeData *p)
616
{
617
    return ac3_eac3_probe(p, CODEC_ID_AC3);
618
}
619
#endif
620

    
621
#if CONFIG_EAC3_DEMUXER
622
static int eac3_probe(AVProbeData *p)
623
{
624
    return ac3_eac3_probe(p, CODEC_ID_EAC3);
625
}
626
#endif
627

    
628
#if CONFIG_FLAC_DEMUXER
629
static int flac_probe(AVProbeData *p)
630
{
631
    uint8_t *bufptr = p->buf;
632
    uint8_t *end    = p->buf + p->buf_size;
633

    
634
    if(ff_id3v2_match(bufptr))
635
        bufptr += ff_id3v2_tag_len(bufptr);
636

    
637
    if(bufptr > end-4 || memcmp(bufptr, "fLaC", 4)) return 0;
638
    else                                            return AVPROBE_SCORE_MAX/2;
639
}
640
#endif
641

    
642
#if CONFIG_AAC_DEMUXER
643
static int adts_aac_probe(AVProbeData *p)
644
{
645
    int max_frames = 0, first_frames = 0;
646
    int fsize, frames;
647
    uint8_t *buf0 = p->buf;
648
    uint8_t *buf2;
649
    uint8_t *buf;
650
    uint8_t *end = buf0 + p->buf_size - 7;
651

    
652
    if (ff_id3v2_match(buf0)) {
653
        buf0 += ff_id3v2_tag_len(buf0);
654
    }
655
    buf = buf0;
656

    
657
    for(; buf < end; buf= buf2+1) {
658
        buf2 = buf;
659

    
660
        for(frames = 0; buf2 < end; frames++) {
661
            uint32_t header = AV_RB16(buf2);
662
            if((header&0xFFF6) != 0xFFF0)
663
                break;
664
            fsize = (AV_RB32(buf2+3)>>13) & 0x8FFF;
665
            if(fsize < 7)
666
                break;
667
            buf2 += fsize;
668
        }
669
        max_frames = FFMAX(max_frames, frames);
670
        if(buf == buf0)
671
            first_frames= frames;
672
    }
673
    if   (first_frames>=3) return AVPROBE_SCORE_MAX/2+1;
674
    else if(max_frames>500)return AVPROBE_SCORE_MAX/2;
675
    else if(max_frames>=3) return AVPROBE_SCORE_MAX/4;
676
    else if(max_frames>=1) return 1;
677
    else                   return 0;
678
}
679
#endif
680

    
681
/* Note: Do not forget to add new entries to the Makefile as well. */
682

    
683
#if CONFIG_AAC_DEMUXER
684
AVInputFormat aac_demuxer = {
685
    "aac",
686
    NULL_IF_CONFIG_SMALL("raw ADTS AAC"),
687
    0,
688
    adts_aac_probe,
689
    audio_read_header,
690
    raw_read_partial_packet,
691
    .flags= AVFMT_GENERIC_INDEX,
692
    .extensions = "aac",
693
    .value = CODEC_ID_AAC,
694
};
695
#endif
696

    
697
#if CONFIG_AC3_DEMUXER
698
AVInputFormat ac3_demuxer = {
699
    "ac3",
700
    NULL_IF_CONFIG_SMALL("raw AC-3"),
701
    0,
702
    ac3_probe,
703
    audio_read_header,
704
    raw_read_partial_packet,
705
    .flags= AVFMT_GENERIC_INDEX,
706
    .extensions = "ac3",
707
    .value = CODEC_ID_AC3,
708
};
709
#endif
710

    
711
#if CONFIG_AC3_MUXER
712
AVOutputFormat ac3_muxer = {
713
    "ac3",
714
    NULL_IF_CONFIG_SMALL("raw AC-3"),
715
    "audio/x-ac3",
716
    "ac3",
717
    0,
718
    CODEC_ID_AC3,
719
    CODEC_ID_NONE,
720
    NULL,
721
    raw_write_packet,
722
    .flags= AVFMT_NOTIMESTAMPS,
723
};
724
#endif
725

    
726
#if CONFIG_DIRAC_DEMUXER
727
AVInputFormat dirac_demuxer = {
728
    "dirac",
729
    NULL_IF_CONFIG_SMALL("raw Dirac"),
730
    0,
731
    dirac_probe,
732
    video_read_header,
733
    raw_read_partial_packet,
734
    .flags= AVFMT_GENERIC_INDEX,
735
    .value = CODEC_ID_DIRAC,
736
};
737
#endif
738

    
739
#if CONFIG_DIRAC_MUXER
740
AVOutputFormat dirac_muxer = {
741
    "dirac",
742
    NULL_IF_CONFIG_SMALL("raw Dirac"),
743
    NULL,
744
    "drc",
745
    0,
746
    CODEC_ID_NONE,
747
    CODEC_ID_DIRAC,
748
    NULL,
749
    raw_write_packet,
750
    .flags= AVFMT_NOTIMESTAMPS,
751
};
752
#endif
753

    
754
#if CONFIG_DNXHD_DEMUXER
755
AVInputFormat dnxhd_demuxer = {
756
    "dnxhd",
757
    NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
758
    0,
759
    dnxhd_probe,
760
    video_read_header,
761
    raw_read_partial_packet,
762
    .flags= AVFMT_GENERIC_INDEX,
763
    .value = CODEC_ID_DNXHD,
764
};
765
#endif
766

    
767
#if CONFIG_DNXHD_MUXER
768
AVOutputFormat dnxhd_muxer = {
769
    "dnxhd",
770
    NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
771
    NULL,
772
    "dnxhd",
773
    0,
774
    CODEC_ID_NONE,
775
    CODEC_ID_DNXHD,
776
    NULL,
777
    raw_write_packet,
778
    .flags= AVFMT_NOTIMESTAMPS,
779
};
780
#endif
781

    
782
#if CONFIG_DTS_DEMUXER
783
AVInputFormat dts_demuxer = {
784
    "dts",
785
    NULL_IF_CONFIG_SMALL("raw DTS"),
786
    0,
787
    dts_probe,
788
    audio_read_header,
789
    raw_read_partial_packet,
790
    .flags= AVFMT_GENERIC_INDEX,
791
    .extensions = "dts",
792
    .value = CODEC_ID_DTS,
793
};
794
#endif
795

    
796
#if CONFIG_DTS_MUXER
797
AVOutputFormat dts_muxer = {
798
    "dts",
799
    NULL_IF_CONFIG_SMALL("raw DTS"),
800
    "audio/x-dca",
801
    "dts",
802
    0,
803
    CODEC_ID_DTS,
804
    CODEC_ID_NONE,
805
    NULL,
806
    raw_write_packet,
807
    .flags= AVFMT_NOTIMESTAMPS,
808
};
809
#endif
810

    
811
#if CONFIG_EAC3_DEMUXER
812
AVInputFormat eac3_demuxer = {
813
    "eac3",
814
    NULL_IF_CONFIG_SMALL("raw E-AC-3"),
815
    0,
816
    eac3_probe,
817
    audio_read_header,
818
    raw_read_partial_packet,
819
    .flags= AVFMT_GENERIC_INDEX,
820
    .extensions = "eac3",
821
    .value = CODEC_ID_EAC3,
822
};
823
#endif
824

    
825
#if CONFIG_EAC3_MUXER
826
AVOutputFormat eac3_muxer = {
827
    "eac3",
828
    NULL_IF_CONFIG_SMALL("raw E-AC-3"),
829
    "audio/x-eac3",
830
    "eac3",
831
    0,
832
    CODEC_ID_EAC3,
833
    CODEC_ID_NONE,
834
    NULL,
835
    raw_write_packet,
836
    .flags= AVFMT_NOTIMESTAMPS,
837
};
838
#endif
839

    
840
#if CONFIG_FLAC_DEMUXER
841
AVInputFormat flac_demuxer = {
842
    "flac",
843
    NULL_IF_CONFIG_SMALL("raw FLAC"),
844
    0,
845
    flac_probe,
846
    audio_read_header,
847
    raw_read_partial_packet,
848
    .flags= AVFMT_GENERIC_INDEX,
849
    .extensions = "flac",
850
    .value = CODEC_ID_FLAC,
851
};
852
#endif
853

    
854
#if CONFIG_FLAC_MUXER
855
AVOutputFormat flac_muxer = {
856
    "flac",
857
    NULL_IF_CONFIG_SMALL("raw FLAC"),
858
    "audio/x-flac",
859
    "flac",
860
    0,
861
    CODEC_ID_FLAC,
862
    CODEC_ID_NONE,
863
    flac_write_header,
864
    raw_write_packet,
865
    flac_write_trailer,
866
    .flags= AVFMT_NOTIMESTAMPS,
867
};
868
#endif
869

    
870
#if CONFIG_GSM_DEMUXER
871
AVInputFormat gsm_demuxer = {
872
    "gsm",
873
    NULL_IF_CONFIG_SMALL("raw GSM"),
874
    0,
875
    NULL,
876
    audio_read_header,
877
    raw_read_partial_packet,
878
    .flags= AVFMT_GENERIC_INDEX,
879
    .extensions = "gsm",
880
    .value = CODEC_ID_GSM,
881
};
882
#endif
883

    
884
#if CONFIG_H261_DEMUXER
885
AVInputFormat h261_demuxer = {
886
    "h261",
887
    NULL_IF_CONFIG_SMALL("raw H.261"),
888
    0,
889
    h261_probe,
890
    video_read_header,
891
    raw_read_partial_packet,
892
    .flags= AVFMT_GENERIC_INDEX,
893
    .extensions = "h261",
894
    .value = CODEC_ID_H261,
895
};
896
#endif
897

    
898
#if CONFIG_H261_MUXER
899
AVOutputFormat h261_muxer = {
900
    "h261",
901
    NULL_IF_CONFIG_SMALL("raw H.261"),
902
    "video/x-h261",
903
    "h261",
904
    0,
905
    CODEC_ID_NONE,
906
    CODEC_ID_H261,
907
    NULL,
908
    raw_write_packet,
909
    .flags= AVFMT_NOTIMESTAMPS,
910
};
911
#endif
912

    
913
#if CONFIG_H263_DEMUXER
914
AVInputFormat h263_demuxer = {
915
    "h263",
916
    NULL_IF_CONFIG_SMALL("raw H.263"),
917
    0,
918
    h263_probe,
919
    video_read_header,
920
    raw_read_partial_packet,
921
    .flags= AVFMT_GENERIC_INDEX,
922
//    .extensions = "h263", //FIXME remove after writing mpeg4_probe
923
    .value = CODEC_ID_H263,
924
};
925
#endif
926

    
927
#if CONFIG_H263_MUXER
928
AVOutputFormat h263_muxer = {
929
    "h263",
930
    NULL_IF_CONFIG_SMALL("raw H.263"),
931
    "video/x-h263",
932
    "h263",
933
    0,
934
    CODEC_ID_NONE,
935
    CODEC_ID_H263,
936
    NULL,
937
    raw_write_packet,
938
    .flags= AVFMT_NOTIMESTAMPS,
939
};
940
#endif
941

    
942
#if CONFIG_H264_DEMUXER
943
AVInputFormat h264_demuxer = {
944
    "h264",
945
    NULL_IF_CONFIG_SMALL("raw H.264 video format"),
946
    0,
947
    h264_probe,
948
    video_read_header,
949
    raw_read_partial_packet,
950
    .flags= AVFMT_GENERIC_INDEX,
951
    .extensions = "h26l,h264,264", //FIXME remove after writing mpeg4_probe
952
    .value = CODEC_ID_H264,
953
};
954
#endif
955

    
956
#if CONFIG_H264_MUXER
957
AVOutputFormat h264_muxer = {
958
    "h264",
959
    NULL_IF_CONFIG_SMALL("raw H.264 video format"),
960
    NULL,
961
    "h264",
962
    0,
963
    CODEC_ID_NONE,
964
    CODEC_ID_H264,
965
    NULL,
966
    raw_write_packet,
967
    .flags= AVFMT_NOTIMESTAMPS,
968
};
969
#endif
970

    
971
#if CONFIG_INGENIENT_DEMUXER
972
AVInputFormat ingenient_demuxer = {
973
    "ingenient",
974
    NULL_IF_CONFIG_SMALL("raw Ingenient MJPEG"),
975
    0,
976
    NULL,
977
    video_read_header,
978
    ingenient_read_packet,
979
    .flags= AVFMT_GENERIC_INDEX,
980
    .extensions = "cgi", // FIXME
981
    .value = CODEC_ID_MJPEG,
982
};
983
#endif
984

    
985
#if CONFIG_M4V_DEMUXER
986
AVInputFormat m4v_demuxer = {
987
    "m4v",
988
    NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
989
    0,
990
    mpeg4video_probe, /** probing for MPEG-4 data */
991
    video_read_header,
992
    raw_read_partial_packet,
993
    .flags= AVFMT_GENERIC_INDEX,
994
    .extensions = "m4v",
995
    .value = CODEC_ID_MPEG4,
996
};
997
#endif
998

    
999
#if CONFIG_M4V_MUXER
1000
AVOutputFormat m4v_muxer = {
1001
    "m4v",
1002
    NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
1003
    NULL,
1004
    "m4v",
1005
    0,
1006
    CODEC_ID_NONE,
1007
    CODEC_ID_MPEG4,
1008
    NULL,
1009
    raw_write_packet,
1010
    .flags= AVFMT_NOTIMESTAMPS,
1011
};
1012
#endif
1013

    
1014
#if CONFIG_MJPEG_DEMUXER
1015
AVInputFormat mjpeg_demuxer = {
1016
    "mjpeg",
1017
    NULL_IF_CONFIG_SMALL("raw MJPEG video"),
1018
    0,
1019
    NULL,
1020
    video_read_header,
1021
    raw_read_partial_packet,
1022
    .flags= AVFMT_GENERIC_INDEX,
1023
    .extensions = "mjpg,mjpeg",
1024
    .value = CODEC_ID_MJPEG,
1025
};
1026
#endif
1027

    
1028
#if CONFIG_MJPEG_MUXER
1029
AVOutputFormat mjpeg_muxer = {
1030
    "mjpeg",
1031
    NULL_IF_CONFIG_SMALL("raw MJPEG video"),
1032
    "video/x-mjpeg",
1033
    "mjpg,mjpeg",
1034
    0,
1035
    CODEC_ID_NONE,
1036
    CODEC_ID_MJPEG,
1037
    NULL,
1038
    raw_write_packet,
1039
    .flags= AVFMT_NOTIMESTAMPS,
1040
};
1041
#endif
1042

    
1043
#if CONFIG_MLP_DEMUXER
1044
AVInputFormat mlp_demuxer = {
1045
    "mlp",
1046
    NULL_IF_CONFIG_SMALL("raw MLP"),
1047
    0,
1048
    NULL,
1049
    audio_read_header,
1050
    raw_read_partial_packet,
1051
    .flags= AVFMT_GENERIC_INDEX,
1052
    .extensions = "mlp",
1053
    .value = CODEC_ID_MLP,
1054
};
1055
#endif
1056

    
1057
#if CONFIG_MPEG1VIDEO_MUXER
1058
AVOutputFormat mpeg1video_muxer = {
1059
    "mpeg1video",
1060
    NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
1061
    "video/x-mpeg",
1062
    "mpg,mpeg,m1v",
1063
    0,
1064
    CODEC_ID_NONE,
1065
    CODEC_ID_MPEG1VIDEO,
1066
    NULL,
1067
    raw_write_packet,
1068
    .flags= AVFMT_NOTIMESTAMPS,
1069
};
1070
#endif
1071

    
1072
#if CONFIG_MPEG2VIDEO_MUXER
1073
AVOutputFormat mpeg2video_muxer = {
1074
    "mpeg2video",
1075
    NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
1076
    NULL,
1077
    "m2v",
1078
    0,
1079
    CODEC_ID_NONE,
1080
    CODEC_ID_MPEG2VIDEO,
1081
    NULL,
1082
    raw_write_packet,
1083
    .flags= AVFMT_NOTIMESTAMPS,
1084
};
1085
#endif
1086

    
1087
#if CONFIG_MPEGVIDEO_DEMUXER
1088
AVInputFormat mpegvideo_demuxer = {
1089
    "mpegvideo",
1090
    NULL_IF_CONFIG_SMALL("raw MPEG video"),
1091
    0,
1092
    mpegvideo_probe,
1093
    video_read_header,
1094
    raw_read_partial_packet,
1095
    .flags= AVFMT_GENERIC_INDEX,
1096
    .value = CODEC_ID_MPEG1VIDEO,
1097
};
1098
#endif
1099

    
1100
#if CONFIG_CAVSVIDEO_DEMUXER
1101
AVInputFormat cavsvideo_demuxer = {
1102
    "cavsvideo",
1103
    NULL_IF_CONFIG_SMALL("Chinese AVS video"),
1104
    0,
1105
    cavsvideo_probe,
1106
    video_read_header,
1107
    raw_read_partial_packet,
1108
    .flags= AVFMT_GENERIC_INDEX,
1109
    .value = CODEC_ID_CAVS,
1110
};
1111
#endif
1112

    
1113
#if CONFIG_NULL_MUXER
1114
AVOutputFormat null_muxer = {
1115
    "null",
1116
    NULL_IF_CONFIG_SMALL("raw null video format"),
1117
    NULL,
1118
    NULL,
1119
    0,
1120
#ifdef WORDS_BIGENDIAN
1121
    CODEC_ID_PCM_S16BE,
1122
#else
1123
    CODEC_ID_PCM_S16LE,
1124
#endif
1125
    CODEC_ID_RAWVIDEO,
1126
    NULL,
1127
    null_write_packet,
1128
    .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE | AVFMT_NOTIMESTAMPS,
1129
};
1130
#endif
1131

    
1132
#if CONFIG_RAWVIDEO_DEMUXER
1133
AVInputFormat rawvideo_demuxer = {
1134
    "rawvideo",
1135
    NULL_IF_CONFIG_SMALL("raw video format"),
1136
    0,
1137
    NULL,
1138
    raw_read_header,
1139
    rawvideo_read_packet,
1140
    .flags= AVFMT_GENERIC_INDEX,
1141
    .extensions = "yuv,cif,qcif,rgb",
1142
    .value = CODEC_ID_RAWVIDEO,
1143
};
1144
#endif
1145

    
1146
#if CONFIG_RAWVIDEO_MUXER
1147
AVOutputFormat rawvideo_muxer = {
1148
    "rawvideo",
1149
    NULL_IF_CONFIG_SMALL("raw video format"),
1150
    NULL,
1151
    "yuv,rgb",
1152
    0,
1153
    CODEC_ID_NONE,
1154
    CODEC_ID_RAWVIDEO,
1155
    NULL,
1156
    raw_write_packet,
1157
    .flags= AVFMT_NOTIMESTAMPS,
1158
};
1159
#endif
1160

    
1161
#if CONFIG_ROQ_MUXER
1162
AVOutputFormat roq_muxer =
1163
{
1164
    "RoQ",
1165
    NULL_IF_CONFIG_SMALL("raw id RoQ format"),
1166
    NULL,
1167
    "roq",
1168
    0,
1169
    CODEC_ID_ROQ_DPCM,
1170
    CODEC_ID_ROQ,
1171
    roq_write_header,
1172
    raw_write_packet,
1173
};
1174
#endif
1175

    
1176
#if CONFIG_SHORTEN_DEMUXER
1177
AVInputFormat shorten_demuxer = {
1178
    "shn",
1179
    NULL_IF_CONFIG_SMALL("raw Shorten"),
1180
    0,
1181
    NULL,
1182
    audio_read_header,
1183
    raw_read_partial_packet,
1184
    .flags= AVFMT_GENERIC_INDEX,
1185
    .extensions = "shn",
1186
    .value = CODEC_ID_SHORTEN,
1187
};
1188
#endif
1189

    
1190
#if CONFIG_VC1_DEMUXER
1191
AVInputFormat vc1_demuxer = {
1192
    "vc1",
1193
    NULL_IF_CONFIG_SMALL("raw VC-1"),
1194
    0,
1195
    NULL /* vc1_probe */,
1196
    video_read_header,
1197
    raw_read_partial_packet,
1198
    .extensions = "vc1",
1199
    .value = CODEC_ID_VC1,
1200
};
1201
#endif
1202

    
1203
/* PCM formats */
1204

    
1205
#define PCMINPUTDEF(name, long_name, ext, codec) \
1206
AVInputFormat pcm_ ## name ## _demuxer = {\
1207
    #name,\
1208
    NULL_IF_CONFIG_SMALL(long_name),\
1209
    0,\
1210
    NULL,\
1211
    raw_read_header,\
1212
    raw_read_packet,\
1213
    NULL,\
1214
    pcm_read_seek,\
1215
    .flags= AVFMT_GENERIC_INDEX,\
1216
    .extensions = ext,\
1217
    .value = codec,\
1218
};
1219

    
1220
#define PCMOUTPUTDEF(name, long_name, ext, codec) \
1221
AVOutputFormat pcm_ ## name ## _muxer = {\
1222
    #name,\
1223
    NULL_IF_CONFIG_SMALL(long_name),\
1224
    NULL,\
1225
    ext,\
1226
    0,\
1227
    codec,\
1228
    CODEC_ID_NONE,\
1229
    NULL,\
1230
    raw_write_packet,\
1231
    .flags= AVFMT_NOTIMESTAMPS,\
1232
};
1233

    
1234

    
1235
#if  !CONFIG_MUXERS && CONFIG_DEMUXERS
1236
#define PCMDEF(name, long_name, ext, codec) \
1237
        PCMINPUTDEF(name, long_name, ext, codec)
1238
#elif CONFIG_MUXERS && !CONFIG_DEMUXERS
1239
#define PCMDEF(name, long_name, ext, codec) \
1240
        PCMOUTPUTDEF(name, long_name, ext, codec)
1241
#elif CONFIG_MUXERS && CONFIG_DEMUXERS
1242
#define PCMDEF(name, long_name, ext, codec) \
1243
        PCMINPUTDEF(name, long_name, ext, codec)\
1244
        PCMOUTPUTDEF(name, long_name, ext, codec)
1245
#else
1246
#define PCMDEF(name, long_name, ext, codec)
1247
#endif
1248

    
1249
#ifdef WORDS_BIGENDIAN
1250
#define BE_DEF(s) s
1251
#define LE_DEF(s) NULL
1252
#else
1253
#define BE_DEF(s) NULL
1254
#define LE_DEF(s) s
1255
#endif
1256

    
1257
PCMDEF(f64be, "PCM 64 bit floating-point big-endian format",
1258
       NULL, CODEC_ID_PCM_F64BE)
1259

    
1260
PCMDEF(f64le, "PCM 64 bit floating-point little-endian format",
1261
       NULL, CODEC_ID_PCM_F64LE)
1262

    
1263
PCMDEF(f32be, "PCM 32 bit floating-point big-endian format",
1264
       NULL, CODEC_ID_PCM_F32BE)
1265

    
1266
PCMDEF(f32le, "PCM 32 bit floating-point little-endian format",
1267
       NULL, CODEC_ID_PCM_F32LE)
1268

    
1269
PCMDEF(s32be, "PCM signed 32 bit big-endian format",
1270
       NULL, CODEC_ID_PCM_S32BE)
1271

    
1272
PCMDEF(s32le, "PCM signed 32 bit little-endian format",
1273
       NULL, CODEC_ID_PCM_S32LE)
1274

    
1275
PCMDEF(s24be, "PCM signed 24 bit big-endian format",
1276
       NULL, CODEC_ID_PCM_S24BE)
1277

    
1278
PCMDEF(s24le, "PCM signed 24 bit little-endian format",
1279
       NULL, CODEC_ID_PCM_S24LE)
1280

    
1281
PCMDEF(s16be, "PCM signed 16 bit big-endian format",
1282
       BE_DEF("sw"), CODEC_ID_PCM_S16BE)
1283

    
1284
PCMDEF(s16le, "PCM signed 16 bit little-endian format",
1285
       LE_DEF("sw"), CODEC_ID_PCM_S16LE)
1286

    
1287
PCMDEF(s8, "PCM signed 8 bit format",
1288
       "sb", CODEC_ID_PCM_S8)
1289

    
1290
PCMDEF(u32be, "PCM unsigned 32 bit big-endian format",
1291
       NULL, CODEC_ID_PCM_U32BE)
1292

    
1293
PCMDEF(u32le, "PCM unsigned 32 bit little-endian format",
1294
       NULL, CODEC_ID_PCM_U32LE)
1295

    
1296
PCMDEF(u24be, "PCM unsigned 24 bit big-endian format",
1297
       NULL, CODEC_ID_PCM_U24BE)
1298

    
1299
PCMDEF(u24le, "PCM unsigned 24 bit little-endian format",
1300
       NULL, CODEC_ID_PCM_U24LE)
1301

    
1302
PCMDEF(u16be, "PCM unsigned 16 bit big-endian format",
1303
       BE_DEF("uw"), CODEC_ID_PCM_U16BE)
1304

    
1305
PCMDEF(u16le, "PCM unsigned 16 bit little-endian format",
1306
       LE_DEF("uw"), CODEC_ID_PCM_U16LE)
1307

    
1308
PCMDEF(u8, "PCM unsigned 8 bit format",
1309
       "ub", CODEC_ID_PCM_U8)
1310

    
1311
PCMDEF(alaw, "PCM A-law format",
1312
       "al", CODEC_ID_PCM_ALAW)
1313

    
1314
PCMDEF(mulaw, "PCM mu-law format",
1315
       "ul", CODEC_ID_PCM_MULAW)