comparison swf.h @ 3302:171f5664d129 libavformat

split swf de/muxer
author bcoudurier
date Tue, 20 May 2008 23:31:10 +0000
parents swf.c@6f61c3b36632
children 9877da0d8be3
comparison
equal deleted inserted replaced
3301:11b6da5ffe78 3302:171f5664d129
1 /*
2 * Flash Compatible Streaming Format common header.
3 * Copyright (c) 2000 Fabrice Bellard.
4 * Copyright (c) 2003 Tinic Uro.
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 #ifndef FFMPEG_SWF_H
24 #define FFMPEG_SWF_H
25
26 #include "avformat.h"
27 #include "riff.h" /* for CodecTag */
28
29 /* should have a generic way to indicate probable size */
30 #define DUMMY_FILE_SIZE (100 * 1024 * 1024)
31 #define DUMMY_DURATION 600 /* in seconds */
32
33 #define TAG_END 0
34 #define TAG_SHOWFRAME 1
35 #define TAG_DEFINESHAPE 2
36 #define TAG_FREECHARACTER 3
37 #define TAG_PLACEOBJECT 4
38 #define TAG_REMOVEOBJECT 5
39 #define TAG_STREAMHEAD 18
40 #define TAG_STREAMBLOCK 19
41 #define TAG_JPEG2 21
42 #define TAG_PLACEOBJECT2 26
43 #define TAG_STREAMHEAD2 45
44 #define TAG_VIDEOSTREAM 60
45 #define TAG_VIDEOFRAME 61
46 #define TAG_FILEATTRIBUTES 69
47
48 #define TAG_LONG 0x100
49
50 /* flags for shape definition */
51 #define FLAG_MOVETO 0x01
52 #define FLAG_SETFILL0 0x02
53 #define FLAG_SETFILL1 0x04
54
55 #define AUDIO_FIFO_SIZE 65536
56
57 /* character id used */
58 #define BITMAP_ID 0
59 #define VIDEO_ID 0
60 #define SHAPE_ID 1
61
62 #undef NDEBUG
63 #include <assert.h>
64
65 typedef struct {
66 int audio_stream_index;
67 offset_t duration_pos;
68 offset_t tag_pos;
69
70 int samples_per_frame;
71 int sound_samples;
72 int swf_frame_number;
73 int video_frame_number;
74 int frame_rate;
75 int tag;
76
77 uint8_t audio_fifo[AUDIO_FIFO_SIZE];
78 int audio_in_pos;
79
80 int video_type;
81 int audio_type;
82 } SWFContext;
83
84 static const AVCodecTag swf_codec_tags[] = {
85 {CODEC_ID_FLV1, 0x02},
86 {CODEC_ID_VP6F, 0x04},
87 {0, 0},
88 };
89
90 static const AVCodecTag swf_audio_codec_tags[] = {
91 {CODEC_ID_PCM_S16LE, 0x00},
92 {CODEC_ID_ADPCM_SWF, 0x01},
93 {CODEC_ID_MP3, 0x02},
94 {CODEC_ID_PCM_S16LE, 0x03},
95 //{CODEC_ID_NELLYMOSER, 0x06},
96 {0, 0},
97 };
98
99 #endif /* FFMPEG_SWF_H */