FFmpeg
flv.h
Go to the documentation of this file.
1 /*
2  * FLV common header
3  *
4  * Copyright (c) 2006 The FFmpeg Project
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 /**
24  * @file
25  * FLV common header
26  */
27 
28 #ifndef AVFORMAT_FLV_H
29 #define AVFORMAT_FLV_H
30 
31 /* offsets for packed values */
32 #define FLV_AUDIO_SAMPLESSIZE_OFFSET 1
33 #define FLV_AUDIO_SAMPLERATE_OFFSET 2
34 #define FLV_AUDIO_CODECID_OFFSET 4
35 
36 #define FLV_VIDEO_FRAMETYPE_OFFSET 4
37 
38 /* bitmasks to isolate specific values */
39 #define FLV_AUDIO_CHANNEL_MASK 0x01
40 #define FLV_AUDIO_SAMPLESIZE_MASK 0x02
41 #define FLV_AUDIO_SAMPLERATE_MASK 0x0c
42 #define FLV_AUDIO_CODECID_MASK 0xf0
43 
44 #define FLV_VIDEO_CODECID_MASK 0x0f
45 #define FLV_VIDEO_FRAMETYPE_MASK 0xf0
46 
47 #define AMF_END_OF_OBJECT 0x09
48 
49 #define KEYFRAMES_TAG "keyframes"
50 #define KEYFRAMES_TIMESTAMP_TAG "times"
51 #define KEYFRAMES_BYTEOFFSET_TAG "filepositions"
52 
53 
54 enum {
57 };
58 
59 enum FlvTagType {
63 };
64 
65 enum {
71 };
72 
73 enum {
74  FLV_MONO = 0,
76 };
77 
78 enum {
81 };
82 
83 enum {
84  FLV_SAMPLERATE_SPECIAL = 0, /**< signifies 5512Hz and 8000Hz in the case of NELLYMOSER */
88 };
89 
90 enum {
102 };
103 
104 enum {
113 };
114 
115 enum {
116  FLV_FRAME_KEY = 1 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< key frame (for AVC, a seekable frame)
117  FLV_FRAME_INTER = 2 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< inter frame (for AVC, a non-seekable frame)
118  FLV_FRAME_DISP_INTER = 3 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< disposable inter frame (H.263 only)
119  FLV_FRAME_GENERATED_KEY = 4 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< generated key frame (reserved for server use only)
120  FLV_FRAME_VIDEO_INFO_CMD = 5 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< video info/command frame
121 };
122 
123 typedef enum {
137 } AMFDataType;
138 
139 #endif /* AVFORMAT_FLV_H */
FLV_HEADER_FLAG_HASAUDIO
@ FLV_HEADER_FLAG_HASAUDIO
Definition: flv.h:56
FLV_CODECID_NELLYMOSER_8KHZ_MONO
@ FLV_CODECID_NELLYMOSER_8KHZ_MONO
Definition: flv.h:96
AMF_DATA_TYPE_UNSUPPORTED
@ AMF_DATA_TYPE_UNSUPPORTED
Definition: flv.h:136
FLV_CODECID_NELLYMOSER_16KHZ_MONO
@ FLV_CODECID_NELLYMOSER_16KHZ_MONO
Definition: flv.h:95
FLV_CODECID_AAC
@ FLV_CODECID_AAC
Definition: flv.h:100
FLV_CODECID_VP6A
@ FLV_CODECID_VP6A
Definition: flv.h:108
FLV_CODECID_PCM_MULAW
@ FLV_CODECID_PCM_MULAW
Definition: flv.h:99
FLV_CODECID_PCM
@ FLV_CODECID_PCM
Definition: flv.h:91
FLV_MONO
@ FLV_MONO
Definition: flv.h:74
FLV_CODECID_NELLYMOSER
@ FLV_CODECID_NELLYMOSER
Definition: flv.h:97
FLV_AUDIO_SAMPLESSIZE_OFFSET
#define FLV_AUDIO_SAMPLESSIZE_OFFSET
Definition: flv.h:32
FLV_AUDIO_SAMPLERATE_OFFSET
#define FLV_AUDIO_SAMPLERATE_OFFSET
Definition: flv.h:33
FLV_SAMPLESSIZE_16BIT
@ FLV_SAMPLESSIZE_16BIT
Definition: flv.h:80
AMF_DATA_TYPE_STRING
@ AMF_DATA_TYPE_STRING
Definition: flv.h:126
FLV_STREAM_TYPE_AUDIO
@ FLV_STREAM_TYPE_AUDIO
Definition: flv.h:67
FLV_STREAM_TYPE_NB
@ FLV_STREAM_TYPE_NB
Definition: flv.h:70
FLV_FRAME_INTER
@ FLV_FRAME_INTER
inter frame (for AVC, a non-seekable frame)
Definition: flv.h:117
FLV_SAMPLERATE_11025HZ
@ FLV_SAMPLERATE_11025HZ
Definition: flv.h:85
FLV_STREAM_TYPE_VIDEO
@ FLV_STREAM_TYPE_VIDEO
Definition: flv.h:66
FLV_TAG_TYPE_META
@ FLV_TAG_TYPE_META
Definition: flv.h:62
AMF_DATA_TYPE_BOOL
@ AMF_DATA_TYPE_BOOL
Definition: flv.h:125
FLV_CODECID_PCM_ALAW
@ FLV_CODECID_PCM_ALAW
Definition: flv.h:98
FLV_FRAME_KEY
@ FLV_FRAME_KEY
key frame (for AVC, a seekable frame)
Definition: flv.h:116
FLV_FRAME_VIDEO_INFO_CMD
@ FLV_FRAME_VIDEO_INFO_CMD
video info/command frame
Definition: flv.h:120
FLV_SAMPLERATE_22050HZ
@ FLV_SAMPLERATE_22050HZ
Definition: flv.h:86
FLV_STREAM_TYPE_DATA
@ FLV_STREAM_TYPE_DATA
Definition: flv.h:69
FLV_HEADER_FLAG_HASVIDEO
@ FLV_HEADER_FLAG_HASVIDEO
Definition: flv.h:55
FLV_CODECID_H263
@ FLV_CODECID_H263
Definition: flv.h:105
AMF_DATA_TYPE_REFERENCE
@ AMF_DATA_TYPE_REFERENCE
Definition: flv.h:130
FLV_SAMPLERATE_SPECIAL
@ FLV_SAMPLERATE_SPECIAL
signifies 5512Hz and 8000Hz in the case of NELLYMOSER
Definition: flv.h:84
AMF_DATA_TYPE_DATE
@ AMF_DATA_TYPE_DATE
Definition: flv.h:134
FLV_STEREO
@ FLV_STEREO
Definition: flv.h:75
AMF_DATA_TYPE_OBJECT_END
@ AMF_DATA_TYPE_OBJECT_END
Definition: flv.h:132
FLV_CODECID_REALH263
@ FLV_CODECID_REALH263
Definition: flv.h:111
FLV_CODECID_SCREEN
@ FLV_CODECID_SCREEN
Definition: flv.h:106
AMFDataType
AMFDataType
Definition: flv.h:123
FLV_TAG_TYPE_VIDEO
@ FLV_TAG_TYPE_VIDEO
Definition: flv.h:61
AMF_DATA_TYPE_MIXEDARRAY
@ AMF_DATA_TYPE_MIXEDARRAY
Definition: flv.h:131
FLV_CODECID_MPEG4
@ FLV_CODECID_MPEG4
Definition: flv.h:112
AMF_DATA_TYPE_OBJECT
@ AMF_DATA_TYPE_OBJECT
Definition: flv.h:127
AMF_DATA_TYPE_LONG_STRING
@ AMF_DATA_TYPE_LONG_STRING
Definition: flv.h:135
FLV_CODECID_ADPCM
@ FLV_CODECID_ADPCM
Definition: flv.h:92
FLV_AUDIO_CODECID_OFFSET
#define FLV_AUDIO_CODECID_OFFSET
Definition: flv.h:34
AMF_DATA_TYPE_UNDEFINED
@ AMF_DATA_TYPE_UNDEFINED
Definition: flv.h:129
FLV_FRAME_GENERATED_KEY
@ FLV_FRAME_GENERATED_KEY
generated key frame (reserved for server use only)
Definition: flv.h:119
AMF_DATA_TYPE_ARRAY
@ AMF_DATA_TYPE_ARRAY
Definition: flv.h:133
FLV_CODECID_MP3
@ FLV_CODECID_MP3
Definition: flv.h:93
FLV_CODECID_PCM_LE
@ FLV_CODECID_PCM_LE
Definition: flv.h:94
FLV_SAMPLERATE_44100HZ
@ FLV_SAMPLERATE_44100HZ
Definition: flv.h:87
FLV_CODECID_H264
@ FLV_CODECID_H264
Definition: flv.h:110
FLV_SAMPLESSIZE_8BIT
@ FLV_SAMPLESSIZE_8BIT
Definition: flv.h:79
FLV_CODECID_VP6
@ FLV_CODECID_VP6
Definition: flv.h:107
FLV_CODECID_SCREEN2
@ FLV_CODECID_SCREEN2
Definition: flv.h:109
FLV_TAG_TYPE_AUDIO
@ FLV_TAG_TYPE_AUDIO
Definition: flv.h:60
AMF_DATA_TYPE_NUMBER
@ AMF_DATA_TYPE_NUMBER
Definition: flv.h:124
FLV_CODECID_SPEEX
@ FLV_CODECID_SPEEX
Definition: flv.h:101
FLV_VIDEO_FRAMETYPE_OFFSET
#define FLV_VIDEO_FRAMETYPE_OFFSET
Definition: flv.h:36
FlvTagType
FlvTagType
Definition: flv.h:59
AMF_DATA_TYPE_NULL
@ AMF_DATA_TYPE_NULL
Definition: flv.h:128
FLV_FRAME_DISP_INTER
@ FLV_FRAME_DISP_INTER
disposable inter frame (H.263 only)
Definition: flv.h:118
FLV_STREAM_TYPE_SUBTITLE
@ FLV_STREAM_TYPE_SUBTITLE
Definition: flv.h:68