annotate idroqenc.c @ 6463:4f3cb203b378 libavformat

Add a special function to mkv demxuer to parse length values that includes special-case code to handle all possible encodings of "unknown length".
author reimar
date Mon, 06 Sep 2010 17:51:44 +0000
parents 4775a49a6045
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
885
da1d5db0ce5c COSMETICS: Remove all trailing whitespace.
diego
parents: 868
diff changeset
1 /*
6425
61cc005602fc move id roq muxer to its own file
aurel
parents: 6424
diff changeset
2 * id RoQ (.roq) File muxer
61cc005602fc move id roq muxer to its own file
aurel
parents: 6424
diff changeset
3 * Copyright (c) 2007 Vitor Sessak
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
4 *
1358
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1245
diff changeset
5 * This file is part of FFmpeg.
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1245
diff changeset
6 *
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1245
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
1358
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1245
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
11 *
1358
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1245
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
15 * Lesser General Public License for more details.
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
16 *
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
1358
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1245
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
896
edbe5c3717f9 Update licensing information: The FSF changed postal address.
diego
parents: 887
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
20 */
3286
6f61c3b36632 Use full path for #includes from another directory.
diego
parents: 3274
diff changeset
21
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
22 #include "avformat.h"
6448
4775a49a6045 split raw.c into rawdec.c and rawenc.c
aurel
parents: 6425
diff changeset
23 #include "rawenc.h"
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
24
1078
0bc9422cc0ad Raw flac muxer, patch by Justin Ruggles (jruggle earthlink net). Can be
banan
parents: 1070
diff changeset
25
2076
7b4df9e3b6fd RoQ muxer, patch by Vitor, vitor1001 gmail com
diego
parents: 2075
diff changeset
26 static int roq_write_header(struct AVFormatContext *s)
7b4df9e3b6fd RoQ muxer, patch by Vitor, vitor1001 gmail com
diego
parents: 2075
diff changeset
27 {
7b4df9e3b6fd RoQ muxer, patch by Vitor, vitor1001 gmail com
diego
parents: 2075
diff changeset
28 static const uint8_t header[] = {
7b4df9e3b6fd RoQ muxer, patch by Vitor, vitor1001 gmail com
diego
parents: 2075
diff changeset
29 0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00
7b4df9e3b6fd RoQ muxer, patch by Vitor, vitor1001 gmail com
diego
parents: 2075
diff changeset
30 };
7b4df9e3b6fd RoQ muxer, patch by Vitor, vitor1001 gmail com
diego
parents: 2075
diff changeset
31
2771
d52c718e83f9 Use dynamically allocated ByteIOContext in AVFormatContext
andoma
parents: 2545
diff changeset
32 put_buffer(s->pb, header, 8);
d52c718e83f9 Use dynamically allocated ByteIOContext in AVFormatContext
andoma
parents: 2545
diff changeset
33 put_flush_packet(s->pb);
2076
7b4df9e3b6fd RoQ muxer, patch by Vitor, vitor1001 gmail com
diego
parents: 2075
diff changeset
34
7b4df9e3b6fd RoQ muxer, patch by Vitor, vitor1001 gmail com
diego
parents: 2075
diff changeset
35 return 0;
7b4df9e3b6fd RoQ muxer, patch by Vitor, vitor1001 gmail com
diego
parents: 2075
diff changeset
36 }
7b4df9e3b6fd RoQ muxer, patch by Vitor, vitor1001 gmail com
diego
parents: 2075
diff changeset
37
3546
45c3d2b2b2fb Alphabetically order AVInputFormat/AVOutputFormat declarations.
diego
parents: 3545
diff changeset
38 AVOutputFormat roq_muxer =
45c3d2b2b2fb Alphabetically order AVInputFormat/AVOutputFormat declarations.
diego
parents: 3545
diff changeset
39 {
45c3d2b2b2fb Alphabetically order AVInputFormat/AVOutputFormat declarations.
diego
parents: 3545
diff changeset
40 "RoQ",
4501
3e5b9c1a413e Make format long_names consistent.
diego
parents: 4293
diff changeset
41 NULL_IF_CONFIG_SMALL("raw id RoQ format"),
3546
45c3d2b2b2fb Alphabetically order AVInputFormat/AVOutputFormat declarations.
diego
parents: 3545
diff changeset
42 NULL,
45c3d2b2b2fb Alphabetically order AVInputFormat/AVOutputFormat declarations.
diego
parents: 3545
diff changeset
43 "roq",
45c3d2b2b2fb Alphabetically order AVInputFormat/AVOutputFormat declarations.
diego
parents: 3545
diff changeset
44 0,
45c3d2b2b2fb Alphabetically order AVInputFormat/AVOutputFormat declarations.
diego
parents: 3545
diff changeset
45 CODEC_ID_ROQ_DPCM,
45c3d2b2b2fb Alphabetically order AVInputFormat/AVOutputFormat declarations.
diego
parents: 3545
diff changeset
46 CODEC_ID_ROQ,
45c3d2b2b2fb Alphabetically order AVInputFormat/AVOutputFormat declarations.
diego
parents: 3545
diff changeset
47 roq_write_header,
6425
61cc005602fc move id roq muxer to its own file
aurel
parents: 6424
diff changeset
48 ff_raw_write_packet,
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
49 };