4 * Copyright (c) 2006 The Libav Project
6 * This file is part of Libav.
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.
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.
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
28 #ifndef AVFORMAT_FLV_H
29 #define AVFORMAT_FLV_H
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
36 #define FLV_VIDEO_FRAMETYPE_OFFSET 4
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
44 #define FLV_VIDEO_CODECID_MASK 0x0f
45 #define FLV_VIDEO_FRAMETYPE_MASK 0xf0
47 #define AMF_END_OF_OBJECT 0x09
50 FLV_HEADER_FLAG_HASVIDEO = 1,
51 FLV_HEADER_FLAG_HASAUDIO = 4,
55 FLV_TAG_TYPE_AUDIO = 0x08,
56 FLV_TAG_TYPE_VIDEO = 0x09,
57 FLV_TAG_TYPE_META = 0x12,
66 FLV_SAMPLESSIZE_8BIT = 0,
67 FLV_SAMPLESSIZE_16BIT = 1 << FLV_AUDIO_SAMPLESSIZE_OFFSET,
71 FLV_SAMPLERATE_SPECIAL = 0, /**< signifies 5512Hz and 8000Hz in the case of NELLYMOSER */
72 FLV_SAMPLERATE_11025HZ = 1 << FLV_AUDIO_SAMPLERATE_OFFSET,
73 FLV_SAMPLERATE_22050HZ = 2 << FLV_AUDIO_SAMPLERATE_OFFSET,
74 FLV_SAMPLERATE_44100HZ = 3 << FLV_AUDIO_SAMPLERATE_OFFSET,
79 FLV_CODECID_ADPCM = 1 << FLV_AUDIO_CODECID_OFFSET,
80 FLV_CODECID_MP3 = 2 << FLV_AUDIO_CODECID_OFFSET,
81 FLV_CODECID_PCM_LE = 3 << FLV_AUDIO_CODECID_OFFSET,
82 FLV_CODECID_NELLYMOSER_16KHZ_MONO = 4 << FLV_AUDIO_CODECID_OFFSET,
83 FLV_CODECID_NELLYMOSER_8KHZ_MONO = 5 << FLV_AUDIO_CODECID_OFFSET,
84 FLV_CODECID_NELLYMOSER = 6 << FLV_AUDIO_CODECID_OFFSET,
85 FLV_CODECID_AAC = 10<< FLV_AUDIO_CODECID_OFFSET,
86 FLV_CODECID_SPEEX = 11<< FLV_AUDIO_CODECID_OFFSET,
91 FLV_CODECID_SCREEN = 3,
94 FLV_CODECID_SCREEN2 = 6,
99 FLV_FRAME_KEY = 1 << FLV_VIDEO_FRAMETYPE_OFFSET,
100 FLV_FRAME_INTER = 2 << FLV_VIDEO_FRAMETYPE_OFFSET,
101 FLV_FRAME_DISP_INTER = 3 << FLV_VIDEO_FRAMETYPE_OFFSET,
105 AMF_DATA_TYPE_NUMBER = 0x00,
106 AMF_DATA_TYPE_BOOL = 0x01,
107 AMF_DATA_TYPE_STRING = 0x02,
108 AMF_DATA_TYPE_OBJECT = 0x03,
109 AMF_DATA_TYPE_NULL = 0x05,
110 AMF_DATA_TYPE_UNDEFINED = 0x06,
111 AMF_DATA_TYPE_REFERENCE = 0x07,
112 AMF_DATA_TYPE_MIXEDARRAY = 0x08,
113 AMF_DATA_TYPE_OBJECT_END = 0x09,
114 AMF_DATA_TYPE_ARRAY = 0x0a,
115 AMF_DATA_TYPE_DATE = 0x0b,
116 AMF_DATA_TYPE_LONG_STRING = 0x0c,
117 AMF_DATA_TYPE_UNSUPPORTED = 0x0d,
120 #endif /* AVFORMAT_FLV_H */