Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
libavformat
swf.h
Go to the documentation of this file.
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 Libav.
7
*
8
* Libav 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
* Libav 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 Libav; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
*/
22
23
#ifndef AVFORMAT_SWF_H
24
#define AVFORMAT_SWF_H
25
26
#include "
libavutil/fifo.h
"
27
#include "
avformat.h
"
28
#include "
avio.h
"
29
#include "
riff.h
"
/* for CodecTag */
30
31
/* should have a generic way to indicate probable size */
32
#define DUMMY_FILE_SIZE (100 * 1024 * 1024)
33
#define DUMMY_DURATION 600
/* in seconds */
34
35
#define TAG_END 0
36
#define TAG_SHOWFRAME 1
37
#define TAG_DEFINESHAPE 2
38
#define TAG_FREECHARACTER 3
39
#define TAG_PLACEOBJECT 4
40
#define TAG_REMOVEOBJECT 5
41
#define TAG_STREAMHEAD 18
42
#define TAG_STREAMBLOCK 19
43
#define TAG_JPEG2 21
44
#define TAG_PLACEOBJECT2 26
45
#define TAG_STREAMHEAD2 45
46
#define TAG_VIDEOSTREAM 60
47
#define TAG_VIDEOFRAME 61
48
#define TAG_FILEATTRIBUTES 69
49
50
#define TAG_LONG 0x100
51
52
/* flags for shape definition */
53
#define FLAG_MOVETO 0x01
54
#define FLAG_SETFILL0 0x02
55
#define FLAG_SETFILL1 0x04
56
57
#define AUDIO_FIFO_SIZE 65536
58
59
/* character id used */
60
#define BITMAP_ID 0
61
#define VIDEO_ID 0
62
#define SHAPE_ID 1
63
64
#undef NDEBUG
65
#include <assert.h>
66
67
typedef
struct
{
68
int64_t
duration_pos
;
69
int64_t
tag_pos
;
70
int64_t
vframes_pos
;
71
int
samples_per_frame
;
72
int
sound_samples
;
73
int
swf_frame_number
;
74
int
video_frame_number
;
75
int
frame_rate
;
76
int
tag
;
77
AVFifoBuffer
*
audio_fifo
;
78
AVCodecContext
*audio_enc, *
video_enc
;
79
}
SWFContext
;
80
81
static
const
AVCodecTag
swf_codec_tags
[] = {
82
{
CODEC_ID_FLV1
, 0x02},
83
{
CODEC_ID_VP6F
, 0x04},
84
{
CODEC_ID_NONE
, 0},
85
};
86
87
static
const
AVCodecTag
swf_audio_codec_tags
[] = {
88
{
CODEC_ID_PCM_S16LE
, 0x00},
89
{
CODEC_ID_ADPCM_SWF
, 0x01},
90
{
CODEC_ID_MP3
, 0x02},
91
{
CODEC_ID_PCM_S16LE
, 0x03},
92
//{CODEC_ID_NELLYMOSER, 0x06},
93
{
CODEC_ID_NONE
, 0},
94
};
95
96
#endif
/* AVFORMAT_SWF_H */
avio.h
Buffered I/O operations.
SWFContext
Definition:
swf.h:67
CODEC_ID_VP6F
Definition:
avcodec.h:180
SWFContext::frame_rate
int frame_rate
Definition:
swf.h:75
AVCodecTag
Definition:
internal.h:35
SWFContext::swf_frame_number
int swf_frame_number
Definition:
swf.h:73
SWFContext::video_frame_number
int video_frame_number
Definition:
swf.h:74
CODEC_ID_PCM_S16LE
Definition:
avcodec.h:260
SWFContext::sound_samples
int sound_samples
Definition:
swf.h:72
SWFContext::samples_per_frame
int samples_per_frame
Definition:
swf.h:71
riff.h
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
AVFifoBuffer
Definition:
fifo.h:30
AVCodecContext
main external API structure.
Definition:
avcodec.h:1329
fifo.h
a very simple circular buffer FIFO implementation
CODEC_ID_ADPCM_SWF
Definition:
avcodec.h:303
SWFContext::video_enc
AVCodecContext * video_enc
Definition:
swf.h:78
swf_codec_tags
static const AVCodecTag swf_codec_tags[]
Definition:
swf.h:81
SWFContext::vframes_pos
int64_t vframes_pos
Definition:
swf.h:70
avformat.h
Main libavformat public API header.
SWFContext::tag_pos
int64_t tag_pos
Definition:
swf.h:69
CODEC_ID_NONE
Definition:
avcodec.h:84
CODEC_ID_FLV1
Definition:
avcodec.h:108
SWFContext::tag
int tag
Definition:
swf.h:76
swf_audio_codec_tags
static const AVCodecTag swf_audio_codec_tags[]
Definition:
swf.h:87
SWFContext::audio_fifo
AVFifoBuffer * audio_fifo
Definition:
swf.h:77
SWFContext::duration_pos
int64_t duration_pos
Definition:
swf.h:68
CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition:
avcodec.h:336