00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00028 #ifndef AVFORMAT_FLV_H
00029 #define AVFORMAT_FLV_H
00030
00031
00032 #define FLV_AUDIO_SAMPLESSIZE_OFFSET 1
00033 #define FLV_AUDIO_SAMPLERATE_OFFSET 2
00034 #define FLV_AUDIO_CODECID_OFFSET 4
00035
00036 #define FLV_VIDEO_FRAMETYPE_OFFSET 4
00037
00038
00039 #define FLV_AUDIO_CHANNEL_MASK 0x01
00040 #define FLV_AUDIO_SAMPLESIZE_MASK 0x02
00041 #define FLV_AUDIO_SAMPLERATE_MASK 0x0c
00042 #define FLV_AUDIO_CODECID_MASK 0xf0
00043
00044 #define FLV_VIDEO_CODECID_MASK 0x0f
00045 #define FLV_VIDEO_FRAMETYPE_MASK 0xf0
00046
00047 #define AMF_END_OF_OBJECT 0x09
00048
00049 #define KEYFRAMES_TAG "keyframes"
00050 #define KEYFRAMES_TIMESTAMP_TAG "times"
00051 #define KEYFRAMES_BYTEOFFSET_TAG "filepositions"
00052
00053
00054 enum {
00055 FLV_HEADER_FLAG_HASVIDEO = 1,
00056 FLV_HEADER_FLAG_HASAUDIO = 4,
00057 };
00058
00059 enum {
00060 FLV_TAG_TYPE_AUDIO = 0x08,
00061 FLV_TAG_TYPE_VIDEO = 0x09,
00062 FLV_TAG_TYPE_META = 0x12,
00063 };
00064
00065 enum {
00066 FLV_STREAM_TYPE_VIDEO,
00067 FLV_STREAM_TYPE_AUDIO,
00068 FLV_STREAM_TYPE_DATA,
00069 FLV_STREAM_TYPE_NB,
00070 };
00071
00072 enum {
00073 FLV_MONO = 0,
00074 FLV_STEREO = 1,
00075 };
00076
00077 enum {
00078 FLV_SAMPLESSIZE_8BIT = 0,
00079 FLV_SAMPLESSIZE_16BIT = 1 << FLV_AUDIO_SAMPLESSIZE_OFFSET,
00080 };
00081
00082 enum {
00083 FLV_SAMPLERATE_SPECIAL = 0,
00084 FLV_SAMPLERATE_11025HZ = 1 << FLV_AUDIO_SAMPLERATE_OFFSET,
00085 FLV_SAMPLERATE_22050HZ = 2 << FLV_AUDIO_SAMPLERATE_OFFSET,
00086 FLV_SAMPLERATE_44100HZ = 3 << FLV_AUDIO_SAMPLERATE_OFFSET,
00087 };
00088
00089 enum {
00090 FLV_CODECID_PCM = 0,
00091 FLV_CODECID_ADPCM = 1 << FLV_AUDIO_CODECID_OFFSET,
00092 FLV_CODECID_MP3 = 2 << FLV_AUDIO_CODECID_OFFSET,
00093 FLV_CODECID_PCM_LE = 3 << FLV_AUDIO_CODECID_OFFSET,
00094 FLV_CODECID_NELLYMOSER_16KHZ_MONO = 4 << FLV_AUDIO_CODECID_OFFSET,
00095 FLV_CODECID_NELLYMOSER_8KHZ_MONO = 5 << FLV_AUDIO_CODECID_OFFSET,
00096 FLV_CODECID_NELLYMOSER = 6 << FLV_AUDIO_CODECID_OFFSET,
00097 FLV_CODECID_AAC = 10<< FLV_AUDIO_CODECID_OFFSET,
00098 FLV_CODECID_SPEEX = 11<< FLV_AUDIO_CODECID_OFFSET,
00099 };
00100
00101 enum {
00102 FLV_CODECID_H263 = 2,
00103 FLV_CODECID_SCREEN = 3,
00104 FLV_CODECID_VP6 = 4,
00105 FLV_CODECID_VP6A = 5,
00106 FLV_CODECID_SCREEN2 = 6,
00107 FLV_CODECID_H264 = 7,
00108 FLV_CODECID_REALH263= 8,
00109 FLV_CODECID_MPEG4 = 9,
00110 };
00111
00112 enum {
00113 FLV_FRAME_KEY = 1 << FLV_VIDEO_FRAMETYPE_OFFSET,
00114 FLV_FRAME_INTER = 2 << FLV_VIDEO_FRAMETYPE_OFFSET,
00115 FLV_FRAME_DISP_INTER = 3 << FLV_VIDEO_FRAMETYPE_OFFSET,
00116 };
00117
00118 typedef enum {
00119 AMF_DATA_TYPE_NUMBER = 0x00,
00120 AMF_DATA_TYPE_BOOL = 0x01,
00121 AMF_DATA_TYPE_STRING = 0x02,
00122 AMF_DATA_TYPE_OBJECT = 0x03,
00123 AMF_DATA_TYPE_NULL = 0x05,
00124 AMF_DATA_TYPE_UNDEFINED = 0x06,
00125 AMF_DATA_TYPE_REFERENCE = 0x07,
00126 AMF_DATA_TYPE_MIXEDARRAY = 0x08,
00127 AMF_DATA_TYPE_OBJECT_END = 0x09,
00128 AMF_DATA_TYPE_ARRAY = 0x0a,
00129 AMF_DATA_TYPE_DATE = 0x0b,
00130 AMF_DATA_TYPE_LONG_STRING = 0x0c,
00131 AMF_DATA_TYPE_UNSUPPORTED = 0x0d,
00132 } AMFDataType;
00133
00134 #endif