annotate swf.h @ 3345:8947d86e480b libavformat

Make ac3 in avi work better. fixes issue355.
author michael
date Mon, 26 May 2008 00:05:30 +0000
parents 171f5664d129
children 9877da0d8be3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
1 /*
3302
171f5664d129 split swf de/muxer
bcoudurier
parents: 3286
diff changeset
2 * Flash Compatible Streaming Format common header.
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
3 * Copyright (c) 2000 Fabrice Bellard.
359
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
4 * Copyright (c) 2003 Tinic Uro.
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
5 *
1358
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1305
diff changeset
6 * This file is part of FFmpeg.
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1305
diff changeset
7 *
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1305
diff changeset
8 * FFmpeg is free software; you can redistribute it and/or
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
9 * modify it under the terms of the GNU Lesser General Public
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
10 * 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: 1305
diff changeset
11 * version 2.1 of the License, or (at your option) any later version.
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
12 *
1358
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1305
diff changeset
13 * FFmpeg is distributed in the hope that it will be useful,
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
16 * Lesser General Public License for more details.
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
17 *
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
18 * 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: 1305
diff changeset
19 * 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
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
21 */
3286
6f61c3b36632 Use full path for #includes from another directory.
diego
parents: 2959
diff changeset
22
3302
171f5664d129 split swf de/muxer
bcoudurier
parents: 3286
diff changeset
23 #ifndef FFMPEG_SWF_H
171f5664d129 split swf de/muxer
bcoudurier
parents: 3286
diff changeset
24 #define FFMPEG_SWF_H
171f5664d129 split swf de/muxer
bcoudurier
parents: 3286
diff changeset
25
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
26 #include "avformat.h"
1305
541f4aa12efc VP5 and VP6 video decoder
aurel
parents: 1169
diff changeset
27 #include "riff.h" /* for CodecTag */
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
28
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
29 /* should have a generic way to indicate probable size */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
30 #define DUMMY_FILE_SIZE (100 * 1024 * 1024)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
31 #define DUMMY_DURATION 600 /* in seconds */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
32
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
33 #define TAG_END 0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
34 #define TAG_SHOWFRAME 1
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
35 #define TAG_DEFINESHAPE 2
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
36 #define TAG_FREECHARACTER 3
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
37 #define TAG_PLACEOBJECT 4
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
38 #define TAG_REMOVEOBJECT 5
807
alex
parents: 806
diff changeset
39 #define TAG_STREAMHEAD 18
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
40 #define TAG_STREAMBLOCK 19
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
41 #define TAG_JPEG2 21
359
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
42 #define TAG_PLACEOBJECT2 26
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
43 #define TAG_STREAMHEAD2 45
887
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
44 #define TAG_VIDEOSTREAM 60
359
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
45 #define TAG_VIDEOFRAME 61
2955
b2d1cd7ab383 new avm2 (flash 9) muxer, patch by Paul Egan, paulegan at mail dot com
bcoudurier
parents: 2913
diff changeset
46 #define TAG_FILEATTRIBUTES 69
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
47
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
48 #define TAG_LONG 0x100
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
49
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
50 /* flags for shape definition */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
51 #define FLAG_MOVETO 0x01
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
52 #define FLAG_SETFILL0 0x02
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
53 #define FLAG_SETFILL1 0x04
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
54
359
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
55 #define AUDIO_FIFO_SIZE 65536
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
56
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
57 /* character id used */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
58 #define BITMAP_ID 0
359
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
59 #define VIDEO_ID 0
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
60 #define SHAPE_ID 1
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
61
516
59ddf98a5c65 nonsense removial
michael
parents: 482
diff changeset
62 #undef NDEBUG
59ddf98a5c65 nonsense removial
michael
parents: 482
diff changeset
63 #include <assert.h>
359
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
64
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
65 typedef struct {
1638
0c6b7ac24cd7 swf can contain only one audio track, simplify
bcoudurier
parents: 1637
diff changeset
66 int audio_stream_index;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
67 offset_t duration_pos;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
68 offset_t tag_pos;
885
da1d5db0ce5c COSMETICS: Remove all trailing whitespace.
diego
parents: 858
diff changeset
69
359
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
70 int samples_per_frame;
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
71 int sound_samples;
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
72 int swf_frame_number;
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
73 int video_frame_number;
1889
e81bae269ae1 fix pts handling
bcoudurier
parents: 1882
diff changeset
74 int frame_rate;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
75 int tag;
359
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
76
1854
0432f6b969b0 simplify swf muxer
bcoudurier
parents: 1833
diff changeset
77 uint8_t audio_fifo[AUDIO_FIFO_SIZE];
359
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
78 int audio_in_pos;
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
79
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
80 int video_type;
e9232aa21976 - made --extra-cflags option work on darwin
michael
parents: 325
diff changeset
81 int audio_type;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
82 } SWFContext;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
83
1677
2a85c82b8538 add codec_id <-> codec_tag tables to AVIn/OutputFormat
michael
parents: 1673
diff changeset
84 static const AVCodecTag swf_codec_tags[] = {
1305
541f4aa12efc VP5 and VP6 video decoder
aurel
parents: 1169
diff changeset
85 {CODEC_ID_FLV1, 0x02},
541f4aa12efc VP5 and VP6 video decoder
aurel
parents: 1169
diff changeset
86 {CODEC_ID_VP6F, 0x04},
541f4aa12efc VP5 and VP6 video decoder
aurel
parents: 1169
diff changeset
87 {0, 0},
541f4aa12efc VP5 and VP6 video decoder
aurel
parents: 1169
diff changeset
88 };
541f4aa12efc VP5 and VP6 video decoder
aurel
parents: 1169
diff changeset
89
1833
09a67819763e support for adpcm swf, pcm
bcoudurier
parents: 1827
diff changeset
90 static const AVCodecTag swf_audio_codec_tags[] = {
09a67819763e support for adpcm swf, pcm
bcoudurier
parents: 1827
diff changeset
91 {CODEC_ID_PCM_S16LE, 0x00},
09a67819763e support for adpcm swf, pcm
bcoudurier
parents: 1827
diff changeset
92 {CODEC_ID_ADPCM_SWF, 0x01},
09a67819763e support for adpcm swf, pcm
bcoudurier
parents: 1827
diff changeset
93 {CODEC_ID_MP3, 0x02},
09a67819763e support for adpcm swf, pcm
bcoudurier
parents: 1827
diff changeset
94 {CODEC_ID_PCM_S16LE, 0x03},
09a67819763e support for adpcm swf, pcm
bcoudurier
parents: 1827
diff changeset
95 //{CODEC_ID_NELLYMOSER, 0x06},
09a67819763e support for adpcm swf, pcm
bcoudurier
parents: 1827
diff changeset
96 {0, 0},
09a67819763e support for adpcm swf, pcm
bcoudurier
parents: 1827
diff changeset
97 };
09a67819763e support for adpcm swf, pcm
bcoudurier
parents: 1827
diff changeset
98
3302
171f5664d129 split swf de/muxer
bcoudurier
parents: 3286
diff changeset
99 #endif /* FFMPEG_SWF_H */