Statistics
| Branch: | Revision:

ffmpeg / libavformat / raw.c @ 9f2fc126

History | View | Annotate | Download (31.3 KB)

1 115329f1 Diego Biurrun
/*
2 7fbde343 Aurelien Jacobs
 * RAW muxer and demuxer
3 406792e7 Diego Biurrun
 * Copyright (c) 2001 Fabrice Bellard
4 84c63c01 Alex Beregszaszi
 * Copyright (c) 2005 Alex Beregszaszi
5 de6d9b64 Fabrice Bellard
 *
6 b78e7197 Diego Biurrun
 * This file is part of FFmpeg.
7
 *
8
 * FFmpeg is free software; you can redistribute it and/or
9 19720f15 Fabrice Bellard
 * modify it under the terms of the GNU Lesser General Public
10
 * License as published by the Free Software Foundation; either
11 b78e7197 Diego Biurrun
 * version 2.1 of the License, or (at your option) any later version.
12 de6d9b64 Fabrice Bellard
 *
13 b78e7197 Diego Biurrun
 * FFmpeg is distributed in the hope that it will be useful,
14 de6d9b64 Fabrice Bellard
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 19720f15 Fabrice Bellard
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Lesser General Public License for more details.
17 de6d9b64 Fabrice Bellard
 *
18 19720f15 Fabrice Bellard
 * You should have received a copy of the GNU Lesser General Public
19 b78e7197 Diego Biurrun
 * License along with FFmpeg; if not, write to the Free Software
20 5509bffa Diego Biurrun
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 de6d9b64 Fabrice Bellard
 */
22 245976da Diego Biurrun
23
#include "libavutil/crc.h"
24
#include "libavcodec/ac3_parser.h"
25
#include "libavcodec/bitstream.h"
26
#include "libavcodec/bytestream.h"
27 de6d9b64 Fabrice Bellard
#include "avformat.h"
28 7241a6bb Aurelien Jacobs
#include "raw.h"
29 ac3ef4a4 Alex Converse
#include "id3v2.h"
30 de6d9b64 Fabrice Bellard
31
/* simple formats */
32 b250f9c6 Aurelien Jacobs
#if CONFIG_FLAC_MUXER
33 ce1d2a95 Justin Ruggles
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 899681cd Björn Axelsson
        put_buffer(s->pb, header, 8);
42
        put_buffer(s->pb, streaminfo, len);
43 ce1d2a95 Justin Ruggles
    }
44
    return 0;
45
}
46 e1a12934 Justin Ruggles
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 bc5c918e Diego Biurrun
    int64_t file_size;
53 e1a12934 Justin Ruggles
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 96445426 Diego Biurrun
#endif
64 ce1d2a95 Justin Ruggles
65 b250f9c6 Aurelien Jacobs
#if CONFIG_ROQ_MUXER
66 13dec857 Vitor Sessak
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 899681cd Björn Axelsson
    put_buffer(s->pb, header, 8);
73
    put_flush_packet(s->pb);
74 13dec857 Vitor Sessak
75
    return 0;
76
}
77 96445426 Diego Biurrun
#endif
78 13dec857 Vitor Sessak
79 b250f9c6 Aurelien Jacobs
#if CONFIG_NULL_MUXER
80 76d32428 Diego Biurrun
static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
81
{
82
    return 0;
83
}
84 96445426 Diego Biurrun
#endif
85 76d32428 Diego Biurrun
86 b250f9c6 Aurelien Jacobs
#if CONFIG_MUXERS
87 e928649b Michael Niedermayer
static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt)
88 de6d9b64 Fabrice Bellard
{
89 899681cd Björn Axelsson
    put_buffer(s->pb, pkt->data, pkt->size);
90
    put_flush_packet(s->pb);
91 de6d9b64 Fabrice Bellard
    return 0;
92
}
93 082f7acf Diego Biurrun
#endif
94 de6d9b64 Fabrice Bellard
95 b250f9c6 Aurelien Jacobs
#if CONFIG_DEMUXERS
96 de6d9b64 Fabrice Bellard
/* raw input */
97 0c1a9eda Zdenek Kabelac
static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
98 de6d9b64 Fabrice Bellard
{
99
    AVStream *st;
100 c9a65ca8 Fabrice Bellard
    int id;
101 de6d9b64 Fabrice Bellard
102 c9a65ca8 Fabrice Bellard
    st = av_new_stream(s, 0);
103 de6d9b64 Fabrice Bellard
    if (!st)
104 769e10f0 Panagiotis Issaris
        return AVERROR(ENOMEM);
105 c04c3282 Michael Niedermayer
106 c9a65ca8 Fabrice Bellard
        id = s->iformat->value;
107
        if (id == CODEC_ID_RAWVIDEO) {
108 01f4895c Michael Niedermayer
            st->codec->codec_type = CODEC_TYPE_VIDEO;
109 de6d9b64 Fabrice Bellard
        } else {
110 01f4895c Michael Niedermayer
            st->codec->codec_type = CODEC_TYPE_AUDIO;
111 de6d9b64 Fabrice Bellard
        }
112 01f4895c Michael Niedermayer
        st->codec->codec_id = id;
113 c9a65ca8 Fabrice Bellard
114 01f4895c Michael Niedermayer
        switch(st->codec->codec_type) {
115 de6d9b64 Fabrice Bellard
        case CODEC_TYPE_AUDIO:
116 01f4895c Michael Niedermayer
            st->codec->sample_rate = ap->sample_rate;
117 bf9067cf Michael Niedermayer
            if(ap->channels) st->codec->channels = ap->channels;
118
            else             st->codec->channels = 1;
119 01f4895c Michael Niedermayer
            av_set_pts_info(st, 64, 1, st->codec->sample_rate);
120 de6d9b64 Fabrice Bellard
            break;
121
        case CODEC_TYPE_VIDEO:
122 9de0be61 Michael Niedermayer
            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 01f4895c Michael Niedermayer
            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 de6d9b64 Fabrice Bellard
            break;
132
        default:
133 27e084bd Fabrice Bellard
            return -1;
134 de6d9b64 Fabrice Bellard
        }
135
    return 0;
136
}
137
138 2e93e3aa Fabrice Bellard
#define RAW_PACKET_SIZE 1024
139 de6d9b64 Fabrice Bellard
140 5c91a675 Zdenek Kabelac
static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
141 de6d9b64 Fabrice Bellard
{
142 f5b41031 Michael Niedermayer
    int ret, size, bps;
143 2a6874fd Fabrice Bellard
    //    AVStream *st = s->streams[0];
144 115329f1 Diego Biurrun
145 231dd3f3 Fabrice Bellard
    size= RAW_PACKET_SIZE;
146 de6d9b64 Fabrice Bellard
147 899681cd Björn Axelsson
    ret= av_get_packet(s->pb, pkt, size);
148 de6d9b64 Fabrice Bellard
149
    pkt->stream_index = 0;
150 2e93e3aa Fabrice Bellard
    if (ret <= 0) {
151 6f3e0b21 Panagiotis Issaris
        return AVERROR(EIO);
152 2e93e3aa Fabrice Bellard
    }
153
    /* note: we need to modify the packet size here to handle the last
154
       packet */
155
    pkt->size = ret;
156 f5b41031 Michael Niedermayer
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 de6d9b64 Fabrice Bellard
    return ret;
163
}
164
165 e15dec10 Leon van Stuivenberg
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 6f3e0b21 Panagiotis Issaris
        return AVERROR(EIO);
173 115329f1 Diego Biurrun
174 899681cd Björn Axelsson
    pkt->pos= url_ftell(s->pb);
175 e15dec10 Leon van Stuivenberg
    pkt->stream_index = 0;
176 899681cd Björn Axelsson
    ret = get_partial_buffer(s->pb, pkt->data, size);
177 e15dec10 Leon van Stuivenberg
    if (ret <= 0) {
178
        av_free_packet(pkt);
179 6f3e0b21 Panagiotis Issaris
        return AVERROR(EIO);
180 e15dec10 Leon van Stuivenberg
    }
181
    pkt->size = ret;
182
    return ret;
183
}
184 4c00864f Diego Biurrun
#endif
185 e15dec10 Leon van Stuivenberg
186 b250f9c6 Aurelien Jacobs
#if CONFIG_RAWVIDEO_DEMUXER
187 76d32428 Diego Biurrun
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 4c00864f Diego Biurrun
#endif
211 76d32428 Diego Biurrun
212 b250f9c6 Aurelien Jacobs
#if CONFIG_INGENIENT_DEMUXER
213 84c63c01 Alex Beregszaszi
// 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 115329f1 Diego Biurrun
218 899681cd Björn Axelsson
    if (get_le32(s->pb) != MKTAG('M', 'J', 'P', 'G'))
219 6f3e0b21 Panagiotis Issaris
        return AVERROR(EIO); // FIXME
220 84c63c01 Alex Beregszaszi
221 899681cd Björn Axelsson
    size = get_le32(s->pb);
222 115329f1 Diego Biurrun
223 899681cd Björn Axelsson
    w = get_le16(s->pb);
224
    h = get_le16(s->pb);
225 115329f1 Diego Biurrun
226 899681cd Björn Axelsson
    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 fb9f1117 Diego Biurrun
    url_fskip(s->pb, 22); // ASCII timestamp
231 115329f1 Diego Biurrun
232 ff9843ca Benoit Fouet
    av_log(s, AV_LOG_DEBUG, "Ingenient packet: size=%d, width=%d, height=%d, unk1=%d unk2=%d\n",
233 bb270c08 Diego Biurrun
        size, w, h, unk1, unk2);
234 84c63c01 Alex Beregszaszi
235
    if (av_new_packet(pkt, size) < 0)
236 6f3e0b21 Panagiotis Issaris
        return AVERROR(EIO);
237 84c63c01 Alex Beregszaszi
238 899681cd Björn Axelsson
    pkt->pos = url_ftell(s->pb);
239 84c63c01 Alex Beregszaszi
    pkt->stream_index = 0;
240 899681cd Björn Axelsson
    ret = get_buffer(s->pb, pkt->data, size);
241 84c63c01 Alex Beregszaszi
    if (ret <= 0) {
242
        av_free_packet(pkt);
243 6f3e0b21 Panagiotis Issaris
        return AVERROR(EIO);
244 84c63c01 Alex Beregszaszi
    }
245
    pkt->size = ret;
246
    return ret;
247
}
248 4c00864f Diego Biurrun
#endif
249 84c63c01 Alex Beregszaszi
250 b250f9c6 Aurelien Jacobs
#if CONFIG_DEMUXERS
251 115329f1 Diego Biurrun
int pcm_read_seek(AVFormatContext *s,
252 7b3c1382 Michael Niedermayer
                  int stream_index, int64_t timestamp, int flags)
253 4986a429 Fabrice Bellard
{
254
    AVStream *st;
255 d701934b Baptiste Coudurier
    int block_align, byte_rate, ret;
256 4986a429 Fabrice Bellard
    int64_t pos;
257
258
    st = s->streams[0];
259 708e3e7d Baptiste Coudurier
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 115329f1 Diego Biurrun
265 4986a429 Fabrice Bellard
    if (block_align <= 0 || byte_rate <= 0)
266
        return -1;
267
268
    /* compute the position by aligning it to block_align */
269 115329f1 Diego Biurrun
    pos = av_rescale_rnd(timestamp * byte_rate,
270
                         st->time_base.num,
271 7b3c1382 Michael Niedermayer
                         st->time_base.den * (int64_t)block_align,
272
                         (flags & AVSEEK_FLAG_BACKWARD) ? AV_ROUND_DOWN : AV_ROUND_UP);
273
    pos *= block_align;
274 4986a429 Fabrice Bellard
275
    /* recompute exact position */
276 77405fc8 Michael Niedermayer
    st->cur_dts = av_rescale(pos, st->time_base.den, byte_rate * (int64_t)st->time_base.num);
277 d701934b Baptiste Coudurier
    if ((ret = url_fseek(s->pb, pos + s->data_offset, SEEK_SET)) < 0)
278
        return ret;
279 4986a429 Fabrice Bellard
    return 0;
280
}
281
282 a0af2fa4 Baptiste Coudurier
static int audio_read_header(AVFormatContext *s,
283
                             AVFormatParameters *ap)
284 fda885c7 Måns Rullgård
{
285 a0af2fa4 Baptiste Coudurier
    AVStream *st = av_new_stream(s, 0);
286 fda885c7 Måns Rullgård
    if (!st)
287 769e10f0 Panagiotis Issaris
        return AVERROR(ENOMEM);
288 fda885c7 Måns Rullgård
    st->codec->codec_type = CODEC_TYPE_AUDIO;
289 a0af2fa4 Baptiste Coudurier
    st->codec->codec_id = s->iformat->value;
290 57004ff1 Aurelien Jacobs
    st->need_parsing = AVSTREAM_PARSE_FULL;
291 fda885c7 Måns Rullgård
    /* the parameters will be extracted from the compressed bitstream */
292 6cde949a David DeHaven
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 fda885c7 Måns Rullgård
    return 0;
305
}
306
307 fb9f1117 Diego Biurrun
/* MPEG-1/H.263 input */
308 de6d9b64 Fabrice Bellard
static int video_read_header(AVFormatContext *s,
309
                             AVFormatParameters *ap)
310
{
311
    AVStream *st;
312
313 c9a65ca8 Fabrice Bellard
    st = av_new_stream(s, 0);
314 de6d9b64 Fabrice Bellard
    if (!st)
315 769e10f0 Panagiotis Issaris
        return AVERROR(ENOMEM);
316 de6d9b64 Fabrice Bellard
317 01f4895c Michael Niedermayer
    st->codec->codec_type = CODEC_TYPE_VIDEO;
318
    st->codec->codec_id = s->iformat->value;
319 57004ff1 Aurelien Jacobs
    st->need_parsing = AVSTREAM_PARSE_FULL;
320 4986a429 Fabrice Bellard
321 fb9f1117 Diego Biurrun
    /* 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 c04c3282 Michael Niedermayer
    if (ap->time_base.num) {
324 80ce3254 Michael Niedermayer
        av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
325 115329f1 Diego Biurrun
    } else if ( st->codec->codec_id == CODEC_ID_MJPEG ||
326 01f4895c Michael Niedermayer
                st->codec->codec_id == CODEC_ID_MPEG4 ||
327 17ac9f1c Luca Barbato
                st->codec->codec_id == CODEC_ID_DIRAC ||
328 01f4895c Michael Niedermayer
                st->codec->codec_id == CODEC_ID_H264) {
329 80ce3254 Michael Niedermayer
        av_set_pts_info(st, 64, 1, 25);
330 27e084bd Fabrice Bellard
    }
331 80ce3254 Michael Niedermayer
332 de6d9b64 Fabrice Bellard
    return 0;
333
}
334 4c00864f Diego Biurrun
#endif
335 de6d9b64 Fabrice Bellard
336 b250f9c6 Aurelien Jacobs
#if CONFIG_MPEGVIDEO_DEMUXER
337 bb270c08 Diego Biurrun
#define SEQ_START_CODE          0x000001b3
338
#define GOP_START_CODE          0x000001b8
339
#define PICTURE_START_CODE      0x00000100
340 93d3e278 Michael Niedermayer
#define SLICE_START_CODE        0x00000101
341
#define PACK_START_CODE         0x000001ba
342 e01dc227 Måns Rullgård
#define VIDEO_ID                0x000001e0
343
#define AUDIO_ID                0x000001c0
344 c9a65ca8 Fabrice Bellard
345
static int mpegvideo_probe(AVProbeData *p)
346
{
347 93d3e278 Michael Niedermayer
    uint32_t code= -1;
348 e01dc227 Måns Rullgård
    int pic=0, seq=0, slice=0, pspack=0, pes=0;
349 93d3e278 Michael Niedermayer
    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 e9f6c8ea Michael Niedermayer
            if     ((code & 0x1f0) == VIDEO_ID)   pes++;
361
            else if((code & 0x1e0) == AUDIO_ID)   pes++;
362 93d3e278 Michael Niedermayer
        }
363 c9a65ca8 Fabrice Bellard
    }
364 e01dc227 Måns Rullgård
    if(seq && seq*9<=pic*10 && pic*9<=slice*10 && !pspack && !pes)
365 93d3e278 Michael Niedermayer
        return AVPROBE_SCORE_MAX/2+1; // +1 for .mpg
366 c9a65ca8 Fabrice Bellard
    return 0;
367
}
368 9f2fc126 Stefan Gehrer
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 4c00864f Diego Biurrun
#endif
412 c9a65ca8 Fabrice Bellard
413 b250f9c6 Aurelien Jacobs
#if CONFIG_M4V_DEMUXER
414 8f57cc5a Thijs Vermeir
#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 5fd5d0ef Michael Niedermayer
    int VO=0, VOL=0, VOP = 0, VISO = 0, res=0;
421 8f57cc5a Thijs Vermeir
    int i;
422
423
    for(i=0; i<probe_packet->buf_size; i++){
424
        temp_buffer = (temp_buffer<<8) + probe_packet->buf[i];
425 c21f308e Roman Shaposhnik
        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 8f57cc5a Thijs Vermeir
    }
435
436 5fd5d0ef Michael Niedermayer
    if ( VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0 && res==0)
437 8f57cc5a Thijs Vermeir
        return AVPROBE_SCORE_MAX/2;
438
    return 0;
439
}
440 4c00864f Diego Biurrun
#endif
441 8f57cc5a Thijs Vermeir
442 b250f9c6 Aurelien Jacobs
#if CONFIG_H264_DEMUXER
443 010acd8e Michael Niedermayer
static int h264_probe(AVProbeData *p)
444
{
445
    uint32_t code= -1;
446 01037451 Michael Niedermayer
    int sps=0, pps=0, idr=0, res=0, sli=0;
447 010acd8e Michael Niedermayer
    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 01037451 Michael Niedermayer
            case     1:   sli++; break;
473 010acd8e Michael Niedermayer
            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 01037451 Michael Niedermayer
    if(sps && pps && (idr||sli>3) && res<(sps+pps+idr))
484 010acd8e Michael Niedermayer
        return AVPROBE_SCORE_MAX/2+1; // +1 for .mpg
485
    return 0;
486
}
487 4c00864f Diego Biurrun
#endif
488 010acd8e Michael Niedermayer
489 b250f9c6 Aurelien Jacobs
#if CONFIG_H263_DEMUXER
490 d07f9043 Michael Niedermayer
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 4c00864f Diego Biurrun
#endif
503 d07f9043 Michael Niedermayer
504 b250f9c6 Aurelien Jacobs
#if CONFIG_H261_DEMUXER
505 c6148de2 Michael Niedermayer
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 4c00864f Diego Biurrun
#endif
518 c6148de2 Michael Niedermayer
519 b250f9c6 Aurelien Jacobs
#if CONFIG_DTS_DEMUXER
520 fde8052e Benjamin Larsson
#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 fb9f1117 Diego Biurrun
        /* regular bitstream */
536 fde8052e Benjamin Larsson
        if (state == DCA_MARKER_RAW_BE || state == DCA_MARKER_RAW_LE)
537
            return AVPROBE_SCORE_MAX/2+1;
538
539 fb9f1117 Diego Biurrun
        /* 14 bits big-endian bitstream */
540 fde8052e Benjamin Larsson
        if (state == DCA_MARKER_14B_BE)
541
            if ((bytestream_get_be16(&bufp) & 0xFFF0) == 0x07F0)
542
                return AVPROBE_SCORE_MAX/2+1;
543
544 fb9f1117 Diego Biurrun
        /* 14 bits little-endian bitstream */
545 fde8052e Benjamin Larsson
        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 4c00864f Diego Biurrun
#endif
553 fde8052e Benjamin Larsson
554 b250f9c6 Aurelien Jacobs
#if CONFIG_DIRAC_DEMUXER
555 17ac9f1c Luca Barbato
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 4c00864f Diego Biurrun
#endif
563 17ac9f1c Luca Barbato
564 b250f9c6 Aurelien Jacobs
#if CONFIG_DNXHD_DEMUXER
565 bd09e8a7 Baptiste Coudurier
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 b250f9c6 Aurelien Jacobs
#if CONFIG_AC3_DEMUXER || CONFIG_EAC3_DEMUXER
576 75198e7a Aurelien Jacobs
static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id)
577 7156aeb9 Justin Ruggles
{
578 8c222bb4 Måns Rullgård
    int max_frames, first_frames = 0, frames;
579 f8b9830b Justin Ruggles
    uint8_t *buf, *buf2, *end;
580
    AC3HeaderInfo hdr;
581 55736cfb Bartlomiej Wolowiec
    GetBitContext gbc;
582 75198e7a Aurelien Jacobs
    enum CodecID codec_id = CODEC_ID_AC3;
583 7156aeb9 Justin Ruggles
584 f8b9830b Justin Ruggles
    max_frames = 0;
585
    buf = p->buf;
586 ecc8fc11 Justin Ruggles
    end = buf + p->buf_size;
587 f8b9830b Justin Ruggles
588
    for(; buf < end; buf++) {
589
        buf2 = buf;
590 7156aeb9 Justin Ruggles
591 f8b9830b Justin Ruggles
        for(frames = 0; buf2 < end; frames++) {
592 55736cfb Bartlomiej Wolowiec
            init_get_bits(&gbc, buf2, 54);
593
            if(ff_ac3_parse_header(&gbc, &hdr) < 0)
594 f8b9830b Justin Ruggles
                break;
595 c675ef70 Andreas Öman
            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 2988c93d Justin Ruggles
            if (hdr.bitstream_id > 10)
599 75198e7a Aurelien Jacobs
                codec_id = CODEC_ID_EAC3;
600 f8b9830b Justin Ruggles
            buf2 += hdr.frame_size;
601
        }
602
        max_frames = FFMAX(max_frames, frames);
603
        if(buf == p->buf)
604
            first_frames = frames;
605
    }
606 75198e7a Aurelien Jacobs
    if(codec_id != expected_codec_id) return 0;
607 f8b9830b Justin Ruggles
    if   (first_frames>=3) return AVPROBE_SCORE_MAX * 3 / 4;
608 2477ce23 Justin Ruggles
    else if(max_frames>=3) return AVPROBE_SCORE_MAX / 2;
609 f8b9830b Justin Ruggles
    else if(max_frames>=1) return 1;
610
    else                   return 0;
611 7156aeb9 Justin Ruggles
}
612 4c00864f Diego Biurrun
#endif
613 7156aeb9 Justin Ruggles
614 b250f9c6 Aurelien Jacobs
#if CONFIG_AC3_DEMUXER
615 2988c93d Justin Ruggles
static int ac3_probe(AVProbeData *p)
616
{
617 75198e7a Aurelien Jacobs
    return ac3_eac3_probe(p, CODEC_ID_AC3);
618 2988c93d Justin Ruggles
}
619
#endif
620
621 b250f9c6 Aurelien Jacobs
#if CONFIG_EAC3_DEMUXER
622 2988c93d Justin Ruggles
static int eac3_probe(AVProbeData *p)
623
{
624 75198e7a Aurelien Jacobs
    return ac3_eac3_probe(p, CODEC_ID_EAC3);
625 2988c93d Justin Ruggles
}
626
#endif
627
628 b250f9c6 Aurelien Jacobs
#if CONFIG_FLAC_DEMUXER
629 e020dbd2 Michael Niedermayer
static int flac_probe(AVProbeData *p)
630
{
631 6cde949a David DeHaven
    uint8_t *bufptr = p->buf;
632 16f753f4 Benoit Fouet
    uint8_t *end    = p->buf + p->buf_size;
633 6cde949a David DeHaven
634
    if(ff_id3v2_match(bufptr))
635
        bufptr += ff_id3v2_tag_len(bufptr);
636
637 16f753f4 Benoit Fouet
    if(bufptr > end-4 || memcmp(bufptr, "fLaC", 4)) return 0;
638 bbfb80f3 Benoit Fouet
    else                                            return AVPROBE_SCORE_MAX/2;
639 e020dbd2 Michael Niedermayer
}
640 4c00864f Diego Biurrun
#endif
641 e020dbd2 Michael Niedermayer
642 b250f9c6 Aurelien Jacobs
#if CONFIG_AAC_DEMUXER
643 2ba0cdd5 Michael Niedermayer
static int adts_aac_probe(AVProbeData *p)
644
{
645
    int max_frames = 0, first_frames = 0;
646
    int fsize, frames;
647 ac3ef4a4 Alex Converse
    uint8_t *buf0 = p->buf;
648 2ba0cdd5 Michael Niedermayer
    uint8_t *buf2;
649 ac3ef4a4 Alex Converse
    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 2ba0cdd5 Michael Niedermayer
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 ac3ef4a4 Alex Converse
        if(buf == buf0)
671 2ba0cdd5 Michael Niedermayer
            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 900eb63d Diego Biurrun
681
/* Note: Do not forget to add new entries to the Makefile as well. */
682
683 b250f9c6 Aurelien Jacobs
#if CONFIG_AAC_DEMUXER
684 76d32428 Diego Biurrun
AVInputFormat aac_demuxer = {
685
    "aac",
686 b4ee1d39 Diego Biurrun
    NULL_IF_CONFIG_SMALL("raw ADTS AAC"),
687 16e861e3 Ramiro Polla
    0,
688 2ba0cdd5 Michael Niedermayer
    adts_aac_probe,
689 16e861e3 Ramiro Polla
    audio_read_header,
690
    raw_read_partial_packet,
691
    .flags= AVFMT_GENERIC_INDEX,
692 76d32428 Diego Biurrun
    .extensions = "aac",
693
    .value = CODEC_ID_AAC,
694 ce1d2a95 Justin Ruggles
};
695 7402ee23 Diego Biurrun
#endif
696 ce1d2a95 Justin Ruggles
697 b250f9c6 Aurelien Jacobs
#if CONFIG_AC3_DEMUXER
698 d2a067d1 Måns Rullgård
AVInputFormat ac3_demuxer = {
699 c9a65ca8 Fabrice Bellard
    "ac3",
700 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("raw AC-3"),
701 c9a65ca8 Fabrice Bellard
    0,
702 7156aeb9 Justin Ruggles
    ac3_probe,
703 a0af2fa4 Baptiste Coudurier
    audio_read_header,
704 e15dec10 Leon van Stuivenberg
    raw_read_partial_packet,
705 e9b78eeb Michael Niedermayer
    .flags= AVFMT_GENERIC_INDEX,
706 bb76a117 Måns Rullgård
    .extensions = "ac3",
707 a0af2fa4 Baptiste Coudurier
    .value = CODEC_ID_AC3,
708 de6d9b64 Fabrice Bellard
};
709 cefd4907 Diego Biurrun
#endif
710 de6d9b64 Fabrice Bellard
711 b250f9c6 Aurelien Jacobs
#if CONFIG_AC3_MUXER
712 d2a067d1 Måns Rullgård
AVOutputFormat ac3_muxer = {
713 de6d9b64 Fabrice Bellard
    "ac3",
714 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("raw AC-3"),
715 115329f1 Diego Biurrun
    "audio/x-ac3",
716 de6d9b64 Fabrice Bellard
    "ac3",
717 c9a65ca8 Fabrice Bellard
    0,
718 de6d9b64 Fabrice Bellard
    CODEC_ID_AC3,
719 d9133126 Carl Eugen Hoyos
    CODEC_ID_NONE,
720 7a97dd84 Baptiste Coudurier
    NULL,
721 de6d9b64 Fabrice Bellard
    raw_write_packet,
722 494bbf58 Michael Niedermayer
    .flags= AVFMT_NOTIMESTAMPS,
723 de6d9b64 Fabrice Bellard
};
724 082f7acf Diego Biurrun
#endif
725 de6d9b64 Fabrice Bellard
726 b250f9c6 Aurelien Jacobs
#if CONFIG_DIRAC_DEMUXER
727 17ac9f1c Luca Barbato
AVInputFormat dirac_demuxer = {
728
    "dirac",
729 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("raw Dirac"),
730 17ac9f1c Luca Barbato
    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 7402ee23 Diego Biurrun
#endif
738 17ac9f1c Luca Barbato
739 b250f9c6 Aurelien Jacobs
#if CONFIG_DIRAC_MUXER
740 17ac9f1c Luca Barbato
AVOutputFormat dirac_muxer = {
741
    "dirac",
742 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("raw Dirac"),
743 17ac9f1c Luca Barbato
    NULL,
744
    "drc",
745
    0,
746 d9133126 Carl Eugen Hoyos
    CODEC_ID_NONE,
747 17ac9f1c Luca Barbato
    CODEC_ID_DIRAC,
748
    NULL,
749
    raw_write_packet,
750
    .flags= AVFMT_NOTIMESTAMPS,
751
};
752
#endif
753
754 b250f9c6 Aurelien Jacobs
#if CONFIG_DNXHD_DEMUXER
755 bd09e8a7 Baptiste Coudurier
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 b250f9c6 Aurelien Jacobs
#if CONFIG_DNXHD_MUXER
768 bd09e8a7 Baptiste Coudurier
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 b250f9c6 Aurelien Jacobs
#if CONFIG_DTS_DEMUXER
783 d2a067d1 Måns Rullgård
AVInputFormat dts_demuxer = {
784 23c99253 Michael Niedermayer
    "dts",
785 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("raw DTS"),
786 23c99253 Michael Niedermayer
    0,
787 fde8052e Benjamin Larsson
    dts_probe,
788 a0af2fa4 Baptiste Coudurier
    audio_read_header,
789 23c99253 Michael Niedermayer
    raw_read_partial_packet,
790 e9b78eeb Michael Niedermayer
    .flags= AVFMT_GENERIC_INDEX,
791 23c99253 Michael Niedermayer
    .extensions = "dts",
792 a0af2fa4 Baptiste Coudurier
    .value = CODEC_ID_DTS,
793 23c99253 Michael Niedermayer
};
794 7402ee23 Diego Biurrun
#endif
795 23c99253 Michael Niedermayer
796 b250f9c6 Aurelien Jacobs
#if CONFIG_DTS_MUXER
797 76d32428 Diego Biurrun
AVOutputFormat dts_muxer = {
798
    "dts",
799
    NULL_IF_CONFIG_SMALL("raw DTS"),
800
    "audio/x-dca",
801
    "dts",
802 fda885c7 Måns Rullgård
    0,
803 76d32428 Diego Biurrun
    CODEC_ID_DTS,
804
    CODEC_ID_NONE,
805 fda885c7 Måns Rullgård
    NULL,
806 76d32428 Diego Biurrun
    raw_write_packet,
807
    .flags= AVFMT_NOTIMESTAMPS,
808
};
809
#endif
810
811 b250f9c6 Aurelien Jacobs
#if CONFIG_EAC3_DEMUXER
812 2988c93d Justin Ruggles
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 b250f9c6 Aurelien Jacobs
#if CONFIG_EAC3_MUXER
826 2988c93d Justin Ruggles
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 b250f9c6 Aurelien Jacobs
#if CONFIG_FLAC_DEMUXER
841 76d32428 Diego Biurrun
AVInputFormat flac_demuxer = {
842
    "flac",
843
    NULL_IF_CONFIG_SMALL("raw FLAC"),
844
    0,
845
    flac_probe,
846 a0af2fa4 Baptiste Coudurier
    audio_read_header,
847 fda885c7 Måns Rullgård
    raw_read_partial_packet,
848 e9b78eeb Michael Niedermayer
    .flags= AVFMT_GENERIC_INDEX,
849 76d32428 Diego Biurrun
    .extensions = "flac",
850
    .value = CODEC_ID_FLAC,
851
};
852 7402ee23 Diego Biurrun
#endif
853 76d32428 Diego Biurrun
854 b250f9c6 Aurelien Jacobs
#if CONFIG_FLAC_MUXER
855 76d32428 Diego Biurrun
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 e1a12934 Justin Ruggles
    flac_write_trailer,
866 76d32428 Diego Biurrun
    .flags= AVFMT_NOTIMESTAMPS,
867 fda885c7 Måns Rullgård
};
868 082f7acf Diego Biurrun
#endif
869 fda885c7 Måns Rullgård
870 b250f9c6 Aurelien Jacobs
#if CONFIG_GSM_DEMUXER
871 60711e95 Michael Niedermayer
AVInputFormat gsm_demuxer = {
872
    "gsm",
873 b4ee1d39 Diego Biurrun
    NULL_IF_CONFIG_SMALL("raw GSM"),
874 60711e95 Michael Niedermayer
    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 7402ee23 Diego Biurrun
#endif
883 60711e95 Michael Niedermayer
884 b250f9c6 Aurelien Jacobs
#if CONFIG_H261_DEMUXER
885 d2a067d1 Måns Rullgård
AVInputFormat h261_demuxer = {
886 c6148de2 Michael Niedermayer
    "h261",
887 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("raw H.261"),
888 c6148de2 Michael Niedermayer
    0,
889
    h261_probe,
890
    video_read_header,
891
    raw_read_partial_packet,
892 e9b78eeb Michael Niedermayer
    .flags= AVFMT_GENERIC_INDEX,
893 c6148de2 Michael Niedermayer
    .extensions = "h261",
894
    .value = CODEC_ID_H261,
895
};
896 7402ee23 Diego Biurrun
#endif
897 c6148de2 Michael Niedermayer
898 b250f9c6 Aurelien Jacobs
#if CONFIG_H261_MUXER
899 d2a067d1 Måns Rullgård
AVOutputFormat h261_muxer = {
900 1c3990db Michael Niedermayer
    "h261",
901 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("raw H.261"),
902 1c3990db Michael Niedermayer
    "video/x-h261",
903
    "h261",
904
    0,
905 d9133126 Carl Eugen Hoyos
    CODEC_ID_NONE,
906 1c3990db Michael Niedermayer
    CODEC_ID_H261,
907 7a97dd84 Baptiste Coudurier
    NULL,
908 1c3990db Michael Niedermayer
    raw_write_packet,
909 494bbf58 Michael Niedermayer
    .flags= AVFMT_NOTIMESTAMPS,
910 1c3990db Michael Niedermayer
};
911 082f7acf Diego Biurrun
#endif
912 1c3990db Michael Niedermayer
913 b250f9c6 Aurelien Jacobs
#if CONFIG_H263_DEMUXER
914 d2a067d1 Måns Rullgård
AVInputFormat h263_demuxer = {
915 d07f9043 Michael Niedermayer
    "h263",
916 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("raw H.263"),
917 d07f9043 Michael Niedermayer
    0,
918
    h263_probe,
919
    video_read_header,
920 e15dec10 Leon van Stuivenberg
    raw_read_partial_packet,
921 e9b78eeb Michael Niedermayer
    .flags= AVFMT_GENERIC_INDEX,
922 d07f9043 Michael Niedermayer
//    .extensions = "h263", //FIXME remove after writing mpeg4_probe
923
    .value = CODEC_ID_H263,
924
};
925 7402ee23 Diego Biurrun
#endif
926 d07f9043 Michael Niedermayer
927 b250f9c6 Aurelien Jacobs
#if CONFIG_H263_MUXER
928 d2a067d1 Måns Rullgård
AVOutputFormat h263_muxer = {
929 de6d9b64 Fabrice Bellard
    "h263",
930 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("raw H.263"),
931 de6d9b64 Fabrice Bellard
    "video/x-h263",
932
    "h263",
933
    0,
934 d9133126 Carl Eugen Hoyos
    CODEC_ID_NONE,
935 de6d9b64 Fabrice Bellard
    CODEC_ID_H263,
936 7a97dd84 Baptiste Coudurier
    NULL,
937 de6d9b64 Fabrice Bellard
    raw_write_packet,
938 494bbf58 Michael Niedermayer
    .flags= AVFMT_NOTIMESTAMPS,
939 c9a65ca8 Fabrice Bellard
};
940 082f7acf Diego Biurrun
#endif
941 c9a65ca8 Fabrice Bellard
942 b250f9c6 Aurelien Jacobs
#if CONFIG_H264_DEMUXER
943 76d32428 Diego Biurrun
AVInputFormat h264_demuxer = {
944
    "h264",
945
    NULL_IF_CONFIG_SMALL("raw H.264 video format"),
946
    0,
947 010acd8e Michael Niedermayer
    h264_probe,
948 76d32428 Diego Biurrun
    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 7402ee23 Diego Biurrun
#endif
955 76d32428 Diego Biurrun
956 b250f9c6 Aurelien Jacobs
#if CONFIG_H264_MUXER
957 76d32428 Diego Biurrun
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 082f7acf Diego Biurrun
#endif
970 76d32428 Diego Biurrun
971 b250f9c6 Aurelien Jacobs
#if CONFIG_INGENIENT_DEMUXER
972 76d32428 Diego Biurrun
AVInputFormat ingenient_demuxer = {
973
    "ingenient",
974 b4ee1d39 Diego Biurrun
    NULL_IF_CONFIG_SMALL("raw Ingenient MJPEG"),
975 76d32428 Diego Biurrun
    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 7402ee23 Diego Biurrun
#endif
984 76d32428 Diego Biurrun
985 b250f9c6 Aurelien Jacobs
#if CONFIG_M4V_DEMUXER
986 d2a067d1 Måns Rullgård
AVInputFormat m4v_demuxer = {
987 7866eeff Michael Niedermayer
    "m4v",
988 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
989 7866eeff Michael Niedermayer
    0,
990 fb9f1117 Diego Biurrun
    mpeg4video_probe, /** probing for MPEG-4 data */
991 7866eeff Michael Niedermayer
    video_read_header,
992 e15dec10 Leon van Stuivenberg
    raw_read_partial_packet,
993 e9b78eeb Michael Niedermayer
    .flags= AVFMT_GENERIC_INDEX,
994 492322fc Michael Niedermayer
    .extensions = "m4v",
995 bb76a117 Måns Rullgård
    .value = CODEC_ID_MPEG4,
996 7866eeff Michael Niedermayer
};
997 7402ee23 Diego Biurrun
#endif
998 7866eeff Michael Niedermayer
999 b250f9c6 Aurelien Jacobs
#if CONFIG_M4V_MUXER
1000 d2a067d1 Måns Rullgård
AVOutputFormat m4v_muxer = {
1001 89b3d7c9 Max Krasnyansky
    "m4v",
1002 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
1003 89b3d7c9 Max Krasnyansky
    NULL,
1004
    "m4v",
1005
    0,
1006
    CODEC_ID_NONE,
1007
    CODEC_ID_MPEG4,
1008 7a97dd84 Baptiste Coudurier
    NULL,
1009 89b3d7c9 Max Krasnyansky
    raw_write_packet,
1010 494bbf58 Michael Niedermayer
    .flags= AVFMT_NOTIMESTAMPS,
1011 89b3d7c9 Max Krasnyansky
};
1012 082f7acf Diego Biurrun
#endif
1013 89b3d7c9 Max Krasnyansky
1014 b250f9c6 Aurelien Jacobs
#if CONFIG_MJPEG_DEMUXER
1015 76d32428 Diego Biurrun
AVInputFormat mjpeg_demuxer = {
1016
    "mjpeg",
1017 b4ee1d39 Diego Biurrun
    NULL_IF_CONFIG_SMALL("raw MJPEG video"),
1018 0da71265 Michael Niedermayer
    0,
1019 76d32428 Diego Biurrun
    NULL,
1020 0da71265 Michael Niedermayer
    video_read_header,
1021 e15dec10 Leon van Stuivenberg
    raw_read_partial_packet,
1022 e9b78eeb Michael Niedermayer
    .flags= AVFMT_GENERIC_INDEX,
1023 76d32428 Diego Biurrun
    .extensions = "mjpg,mjpeg",
1024
    .value = CODEC_ID_MJPEG,
1025 0da71265 Michael Niedermayer
};
1026 7402ee23 Diego Biurrun
#endif
1027 0da71265 Michael Niedermayer
1028 b250f9c6 Aurelien Jacobs
#if CONFIG_MJPEG_MUXER
1029 76d32428 Diego Biurrun
AVOutputFormat mjpeg_muxer = {
1030
    "mjpeg",
1031 b4ee1d39 Diego Biurrun
    NULL_IF_CONFIG_SMALL("raw MJPEG video"),
1032 76d32428 Diego Biurrun
    "video/x-mjpeg",
1033
    "mjpg,mjpeg",
1034 0da71265 Michael Niedermayer
    0,
1035
    CODEC_ID_NONE,
1036 76d32428 Diego Biurrun
    CODEC_ID_MJPEG,
1037 7a97dd84 Baptiste Coudurier
    NULL,
1038 0da71265 Michael Niedermayer
    raw_write_packet,
1039 494bbf58 Michael Niedermayer
    .flags= AVFMT_NOTIMESTAMPS,
1040 0da71265 Michael Niedermayer
};
1041 082f7acf Diego Biurrun
#endif
1042 0da71265 Michael Niedermayer
1043 b250f9c6 Aurelien Jacobs
#if CONFIG_MLP_DEMUXER
1044 76d32428 Diego Biurrun
AVInputFormat mlp_demuxer = {
1045
    "mlp",
1046
    NULL_IF_CONFIG_SMALL("raw MLP"),
1047 c9a65ca8 Fabrice Bellard
    0,
1048 76d32428 Diego Biurrun
    NULL,
1049
    audio_read_header,
1050 e15dec10 Leon van Stuivenberg
    raw_read_partial_packet,
1051 e9b78eeb Michael Niedermayer
    .flags= AVFMT_GENERIC_INDEX,
1052 76d32428 Diego Biurrun
    .extensions = "mlp",
1053
    .value = CODEC_ID_MLP,
1054 de6d9b64 Fabrice Bellard
};
1055 7402ee23 Diego Biurrun
#endif
1056 de6d9b64 Fabrice Bellard
1057 b250f9c6 Aurelien Jacobs
#if CONFIG_MPEG1VIDEO_MUXER
1058 d2a067d1 Måns Rullgård
AVOutputFormat mpeg1video_muxer = {
1059 c9a65ca8 Fabrice Bellard
    "mpeg1video",
1060 b4ee1d39 Diego Biurrun
    NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
1061 de6d9b64 Fabrice Bellard
    "video/x-mpeg",
1062 e0827ba4 Michael Niedermayer
    "mpg,mpeg,m1v",
1063 de6d9b64 Fabrice Bellard
    0,
1064 d9133126 Carl Eugen Hoyos
    CODEC_ID_NONE,
1065 de6d9b64 Fabrice Bellard
    CODEC_ID_MPEG1VIDEO,
1066 7a97dd84 Baptiste Coudurier
    NULL,
1067 de6d9b64 Fabrice Bellard
    raw_write_packet,
1068 494bbf58 Michael Niedermayer
    .flags= AVFMT_NOTIMESTAMPS,
1069 de6d9b64 Fabrice Bellard
};
1070 082f7acf Diego Biurrun
#endif
1071 de6d9b64 Fabrice Bellard
1072 b250f9c6 Aurelien Jacobs
#if CONFIG_MPEG2VIDEO_MUXER
1073 d2a067d1 Måns Rullgård
AVOutputFormat mpeg2video_muxer = {
1074 6ec864da Michael Niedermayer
    "mpeg2video",
1075 b4ee1d39 Diego Biurrun
    NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
1076 6ec864da Michael Niedermayer
    NULL,
1077
    "m2v",
1078
    0,
1079 d9133126 Carl Eugen Hoyos
    CODEC_ID_NONE,
1080 6ec864da Michael Niedermayer
    CODEC_ID_MPEG2VIDEO,
1081 7a97dd84 Baptiste Coudurier
    NULL,
1082 6ec864da Michael Niedermayer
    raw_write_packet,
1083 494bbf58 Michael Niedermayer
    .flags= AVFMT_NOTIMESTAMPS,
1084 6ec864da Michael Niedermayer
};
1085 082f7acf Diego Biurrun
#endif
1086 6ec864da Michael Niedermayer
1087 b250f9c6 Aurelien Jacobs
#if CONFIG_MPEGVIDEO_DEMUXER
1088 76d32428 Diego Biurrun
AVInputFormat mpegvideo_demuxer = {
1089
    "mpegvideo",
1090 b4ee1d39 Diego Biurrun
    NULL_IF_CONFIG_SMALL("raw MPEG video"),
1091 27e084bd Fabrice Bellard
    0,
1092 76d32428 Diego Biurrun
    mpegvideo_probe,
1093 27e084bd Fabrice Bellard
    video_read_header,
1094 e15dec10 Leon van Stuivenberg
    raw_read_partial_packet,
1095 e9b78eeb Michael Niedermayer
    .flags= AVFMT_GENERIC_INDEX,
1096 76d32428 Diego Biurrun
    .value = CODEC_ID_MPEG1VIDEO,
1097 27e084bd Fabrice Bellard
};
1098 7402ee23 Diego Biurrun
#endif
1099 27e084bd Fabrice Bellard
1100 9f2fc126 Stefan Gehrer
#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 b250f9c6 Aurelien Jacobs
#if CONFIG_NULL_MUXER
1114 76d32428 Diego Biurrun
AVOutputFormat null_muxer = {
1115
    "null",
1116 b4ee1d39 Diego Biurrun
    NULL_IF_CONFIG_SMALL("raw null video format"),
1117 76d32428 Diego Biurrun
    NULL,
1118
    NULL,
1119 84c63c01 Alex Beregszaszi
    0,
1120 76d32428 Diego Biurrun
#ifdef WORDS_BIGENDIAN
1121
    CODEC_ID_PCM_S16BE,
1122
#else
1123
    CODEC_ID_PCM_S16LE,
1124
#endif
1125
    CODEC_ID_RAWVIDEO,
1126 84c63c01 Alex Beregszaszi
    NULL,
1127 76d32428 Diego Biurrun
    null_write_packet,
1128
    .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE | AVFMT_NOTIMESTAMPS,
1129
};
1130 082f7acf Diego Biurrun
#endif
1131 76d32428 Diego Biurrun
1132 b250f9c6 Aurelien Jacobs
#if CONFIG_RAWVIDEO_DEMUXER
1133 76d32428 Diego Biurrun
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 e9b78eeb Michael Niedermayer
    .flags= AVFMT_GENERIC_INDEX,
1141 76d32428 Diego Biurrun
    .extensions = "yuv,cif,qcif,rgb",
1142
    .value = CODEC_ID_RAWVIDEO,
1143 84c63c01 Alex Beregszaszi
};
1144 7402ee23 Diego Biurrun
#endif
1145 84c63c01 Alex Beregszaszi
1146 b250f9c6 Aurelien Jacobs
#if CONFIG_RAWVIDEO_MUXER
1147 76d32428 Diego Biurrun
AVOutputFormat rawvideo_muxer = {
1148
    "rawvideo",
1149
    NULL_IF_CONFIG_SMALL("raw video format"),
1150
    NULL,
1151
    "yuv,rgb",
1152 5ed8fafc Fabrice Bellard
    0,
1153 d9133126 Carl Eugen Hoyos
    CODEC_ID_NONE,
1154 76d32428 Diego Biurrun
    CODEC_ID_RAWVIDEO,
1155 7a97dd84 Baptiste Coudurier
    NULL,
1156 5ed8fafc Fabrice Bellard
    raw_write_packet,
1157 494bbf58 Michael Niedermayer
    .flags= AVFMT_NOTIMESTAMPS,
1158 5ed8fafc Fabrice Bellard
};
1159 082f7acf Diego Biurrun
#endif
1160 5ed8fafc Fabrice Bellard
1161 b250f9c6 Aurelien Jacobs
#if CONFIG_ROQ_MUXER
1162 76d32428 Diego Biurrun
AVOutputFormat roq_muxer =
1163
{
1164
    "RoQ",
1165 b4ee1d39 Diego Biurrun
    NULL_IF_CONFIG_SMALL("raw id RoQ format"),
1166 76d32428 Diego Biurrun
    NULL,
1167
    "roq",
1168
    0,
1169
    CODEC_ID_ROQ_DPCM,
1170
    CODEC_ID_ROQ,
1171
    roq_write_header,
1172
    raw_write_packet,
1173
};
1174 082f7acf Diego Biurrun
#endif
1175 76d32428 Diego Biurrun
1176 b250f9c6 Aurelien Jacobs
#if CONFIG_SHORTEN_DEMUXER
1177 76d32428 Diego Biurrun
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 7402ee23 Diego Biurrun
#endif
1189 76d32428 Diego Biurrun
1190 b250f9c6 Aurelien Jacobs
#if CONFIG_VC1_DEMUXER
1191 7bb5c2a6 Kostya Shishkov
AVInputFormat vc1_demuxer = {
1192
    "vc1",
1193 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("raw VC-1"),
1194 7bb5c2a6 Kostya Shishkov
    0,
1195
    NULL /* vc1_probe */,
1196
    video_read_header,
1197
    raw_read_partial_packet,
1198
    .extensions = "vc1",
1199
    .value = CODEC_ID_VC1,
1200
};
1201 7402ee23 Diego Biurrun
#endif
1202 7bb5c2a6 Kostya Shishkov
1203 fb9f1117 Diego Biurrun
/* PCM formats */
1204 764ef400 Mike Melanson
1205 4986a429 Fabrice Bellard
#define PCMINPUTDEF(name, long_name, ext, codec) \
1206 d2a067d1 Måns Rullgård
AVInputFormat pcm_ ## name ## _demuxer = {\
1207 764ef400 Mike Melanson
    #name,\
1208 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL(long_name),\
1209 764ef400 Mike Melanson
    0,\
1210
    NULL,\
1211
    raw_read_header,\
1212
    raw_read_packet,\
1213 9b64a036 Baptiste Coudurier
    NULL,\
1214 4986a429 Fabrice Bellard
    pcm_read_seek,\
1215 e9b78eeb Michael Niedermayer
    .flags= AVFMT_GENERIC_INDEX,\
1216 764ef400 Mike Melanson
    .extensions = ext,\
1217
    .value = codec,\
1218
};
1219
1220 2c8e2014 Diego Biurrun
#define PCMOUTPUTDEF(name, long_name, ext, codec) \
1221 d2a067d1 Måns Rullgård
AVOutputFormat pcm_ ## name ## _muxer = {\
1222 c9a65ca8 Fabrice Bellard
    #name,\
1223 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL(long_name),\
1224 c9a65ca8 Fabrice Bellard
    NULL,\
1225
    ext,\
1226
    0,\
1227
    codec,\
1228 d9133126 Carl Eugen Hoyos
    CODEC_ID_NONE,\
1229 7a97dd84 Baptiste Coudurier
    NULL,\
1230 c9a65ca8 Fabrice Bellard
    raw_write_packet,\
1231 494bbf58 Michael Niedermayer
    .flags= AVFMT_NOTIMESTAMPS,\
1232 5ed8fafc Fabrice Bellard
};
1233 2c8e2014 Diego Biurrun
1234
1235 b250f9c6 Aurelien Jacobs
#if  !CONFIG_MUXERS && CONFIG_DEMUXERS
1236 2c8e2014 Diego Biurrun
#define PCMDEF(name, long_name, ext, codec) \
1237
        PCMINPUTDEF(name, long_name, ext, codec)
1238 b250f9c6 Aurelien Jacobs
#elif CONFIG_MUXERS && !CONFIG_DEMUXERS
1239 2c8e2014 Diego Biurrun
#define PCMDEF(name, long_name, ext, codec) \
1240
        PCMOUTPUTDEF(name, long_name, ext, codec)
1241 b250f9c6 Aurelien Jacobs
#elif CONFIG_MUXERS && CONFIG_DEMUXERS
1242 2c8e2014 Diego Biurrun
#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 5ed8fafc Fabrice Bellard
1249
#ifdef WORDS_BIGENDIAN
1250 c9a65ca8 Fabrice Bellard
#define BE_DEF(s) s
1251
#define LE_DEF(s) NULL
1252 5ed8fafc Fabrice Bellard
#else
1253 c9a65ca8 Fabrice Bellard
#define BE_DEF(s) NULL
1254
#define LE_DEF(s) s
1255 5ed8fafc Fabrice Bellard
#endif
1256
1257 ee7948cb Peter Ross
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 5ed8fafc Fabrice Bellard
1281 ac1ea66e Diego Biurrun
PCMDEF(s16be, "PCM signed 16 bit big-endian format",
1282 c9a65ca8 Fabrice Bellard
       BE_DEF("sw"), CODEC_ID_PCM_S16BE)
1283 5ed8fafc Fabrice Bellard
1284 76d32428 Diego Biurrun
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 5ed8fafc Fabrice Bellard
1290 ee7948cb Peter Ross
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 ac1ea66e Diego Biurrun
PCMDEF(u16be, "PCM unsigned 16 bit big-endian format",
1303 c9a65ca8 Fabrice Bellard
       BE_DEF("uw"), CODEC_ID_PCM_U16BE)
1304 5ed8fafc Fabrice Bellard
1305 76d32428 Diego Biurrun
PCMDEF(u16le, "PCM unsigned 16 bit little-endian format",
1306
       LE_DEF("uw"), CODEC_ID_PCM_U16LE)
1307 5ed8fafc Fabrice Bellard
1308 ac1ea66e Diego Biurrun
PCMDEF(u8, "PCM unsigned 8 bit format",
1309 c9a65ca8 Fabrice Bellard
       "ub", CODEC_ID_PCM_U8)
1310 5ed8fafc Fabrice Bellard
1311 ac1ea66e Diego Biurrun
PCMDEF(alaw, "PCM A-law format",
1312 c9a65ca8 Fabrice Bellard
       "al", CODEC_ID_PCM_ALAW)
1313 de6d9b64 Fabrice Bellard
1314 76d32428 Diego Biurrun
PCMDEF(mulaw, "PCM mu-law format",
1315
       "ul", CODEC_ID_PCM_MULAW)