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