FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 {
70 };
71 
72 enum {
73  FLV_MONO = 0,
75 };
76 
77 enum {
80 };
81 
82 enum {
83  FLV_SAMPLERATE_SPECIAL = 0, /**< signifies 5512Hz and 8000Hz in the case of NELLYMOSER */
87 };
88 
89 enum {
101 };
102 
103 enum {
112 };
113 
114 enum {
115  FLV_FRAME_KEY = 1 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< key frame (for AVC, a seekable frame)
116  FLV_FRAME_INTER = 2 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< inter frame (for AVC, a non-seekable frame)
117  FLV_FRAME_DISP_INTER = 3 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< disposable inter frame (H.263 only)
118  FLV_FRAME_GENERATED_KEY = 4 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< generated key frame (reserved for server use only)
119  FLV_FRAME_VIDEO_INFO_CMD = 5 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< video info/command frame
120 };
121 
122 typedef enum {
136 } AMFDataType;
137 
138 #endif /* AVFORMAT_FLV_H */
Definition: flv.h:74
Definition: flv.h:73
#define FLV_VIDEO_FRAMETYPE_OFFSET
Definition: flv.h:36
#define FLV_AUDIO_SAMPLERATE_OFFSET
Definition: flv.h:33
AMFDataType
Definition: flv.h:122
disposable inter frame (H.263 only)
Definition: flv.h:117
inter frame (for AVC, a non-seekable frame)
Definition: flv.h:116
#define FLV_AUDIO_CODECID_OFFSET
Definition: flv.h:34
#define FLV_AUDIO_SAMPLESSIZE_OFFSET
Definition: flv.h:32
video info/command frame
Definition: flv.h:119
generated key frame (reserved for server use only)
Definition: flv.h:118
signifies 5512Hz and 8000Hz in the case of NELLYMOSER
Definition: flv.h:83
key frame (for AVC, a seekable frame)
Definition: flv.h:115
FlvTagType
Definition: flv.h:59