00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVFORMAT_MATROSKA_H
00023 #define AVFORMAT_MATROSKA_H
00024
00025 #include "libavcodec/avcodec.h"
00026 #include "metadata.h"
00027
00028
00029 #define EBML_VERSION 1
00030
00031
00032 #define EBML_ID_HEADER 0x1A45DFA3
00033
00034
00035 #define EBML_ID_EBMLVERSION 0x4286
00036 #define EBML_ID_EBMLREADVERSION 0x42F7
00037 #define EBML_ID_EBMLMAXIDLENGTH 0x42F2
00038 #define EBML_ID_EBMLMAXSIZELENGTH 0x42F3
00039 #define EBML_ID_DOCTYPE 0x4282
00040 #define EBML_ID_DOCTYPEVERSION 0x4287
00041 #define EBML_ID_DOCTYPEREADVERSION 0x4285
00042
00043
00044 #define EBML_ID_VOID 0xEC
00045 #define EBML_ID_CRC32 0xBF
00046
00047
00048
00049
00050
00051
00052 #define MATROSKA_ID_SEGMENT 0x18538067
00053
00054
00055 #define MATROSKA_ID_INFO 0x1549A966
00056 #define MATROSKA_ID_TRACKS 0x1654AE6B
00057 #define MATROSKA_ID_CUES 0x1C53BB6B
00058 #define MATROSKA_ID_TAGS 0x1254C367
00059 #define MATROSKA_ID_SEEKHEAD 0x114D9B74
00060 #define MATROSKA_ID_ATTACHMENTS 0x1941A469
00061 #define MATROSKA_ID_CLUSTER 0x1F43B675
00062 #define MATROSKA_ID_CHAPTERS 0x1043A770
00063
00064
00065 #define MATROSKA_ID_TIMECODESCALE 0x2AD7B1
00066 #define MATROSKA_ID_DURATION 0x4489
00067 #define MATROSKA_ID_TITLE 0x7BA9
00068 #define MATROSKA_ID_WRITINGAPP 0x5741
00069 #define MATROSKA_ID_MUXINGAPP 0x4D80
00070 #define MATROSKA_ID_DATEUTC 0x4461
00071 #define MATROSKA_ID_SEGMENTUID 0x73A4
00072
00073
00074 #define MATROSKA_ID_TRACKENTRY 0xAE
00075
00076
00077 #define MATROSKA_ID_TRACKNUMBER 0xD7
00078 #define MATROSKA_ID_TRACKUID 0x73C5
00079 #define MATROSKA_ID_TRACKTYPE 0x83
00080 #define MATROSKA_ID_TRACKVIDEO 0xE0
00081 #define MATROSKA_ID_TRACKAUDIO 0xE1
00082 #define MATROSKA_ID_TRACKOPERATION 0xE2
00083 #define MATROSKA_ID_TRACKCOMBINEPLANES 0xE3
00084 #define MATROSKA_ID_TRACKPLANE 0xE4
00085 #define MATROSKA_ID_TRACKPLANEUID 0xE5
00086 #define MATROSKA_ID_TRACKPLANETYPE 0xE6
00087 #define MATROSKA_ID_CODECID 0x86
00088 #define MATROSKA_ID_CODECPRIVATE 0x63A2
00089 #define MATROSKA_ID_CODECNAME 0x258688
00090 #define MATROSKA_ID_CODECINFOURL 0x3B4040
00091 #define MATROSKA_ID_CODECDOWNLOADURL 0x26B240
00092 #define MATROSKA_ID_CODECDECODEALL 0xAA
00093 #define MATROSKA_ID_TRACKNAME 0x536E
00094 #define MATROSKA_ID_TRACKLANGUAGE 0x22B59C
00095 #define MATROSKA_ID_TRACKFLAGENABLED 0xB9
00096 #define MATROSKA_ID_TRACKFLAGDEFAULT 0x88
00097 #define MATROSKA_ID_TRACKFLAGFORCED 0x55AA
00098 #define MATROSKA_ID_TRACKFLAGLACING 0x9C
00099 #define MATROSKA_ID_TRACKMINCACHE 0x6DE7
00100 #define MATROSKA_ID_TRACKMAXCACHE 0x6DF8
00101 #define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383
00102 #define MATROSKA_ID_TRACKCONTENTENCODINGS 0x6D80
00103 #define MATROSKA_ID_TRACKCONTENTENCODING 0x6240
00104 #define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F
00105 #define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE
00106
00107
00108 #define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3
00109 #define MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0
00110 #define MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA
00111 #define MATROSKA_ID_VIDEOPIXELWIDTH 0xB0
00112 #define MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA
00113 #define MATROSKA_ID_VIDEOPIXELCROPB 0x54AA
00114 #define MATROSKA_ID_VIDEOPIXELCROPT 0x54BB
00115 #define MATROSKA_ID_VIDEOPIXELCROPL 0x54CC
00116 #define MATROSKA_ID_VIDEOPIXELCROPR 0x54DD
00117 #define MATROSKA_ID_VIDEODISPLAYUNIT 0x54B2
00118 #define MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A
00119 #define MATROSKA_ID_VIDEOSTEREOMODE 0x53B8
00120 #define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3
00121 #define MATROSKA_ID_VIDEOCOLORSPACE 0x2EB524
00122
00123
00124 #define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5
00125 #define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ 0x78B5
00126
00127 #define MATROSKA_ID_AUDIOBITDEPTH 0x6264
00128 #define MATROSKA_ID_AUDIOCHANNELS 0x9F
00129
00130
00131 #define MATROSKA_ID_ENCODINGORDER 0x5031
00132 #define MATROSKA_ID_ENCODINGSCOPE 0x5032
00133 #define MATROSKA_ID_ENCODINGTYPE 0x5033
00134 #define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034
00135 #define MATROSKA_ID_ENCODINGCOMPALGO 0x4254
00136 #define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255
00137
00138
00139 #define MATROSKA_ID_POINTENTRY 0xBB
00140
00141
00142 #define MATROSKA_ID_CUETIME 0xB3
00143 #define MATROSKA_ID_CUETRACKPOSITION 0xB7
00144
00145
00146 #define MATROSKA_ID_CUETRACK 0xF7
00147 #define MATROSKA_ID_CUECLUSTERPOSITION 0xF1
00148 #define MATROSKA_ID_CUEBLOCKNUMBER 0x5378
00149
00150
00151 #define MATROSKA_ID_TAG 0x7373
00152 #define MATROSKA_ID_SIMPLETAG 0x67C8
00153 #define MATROSKA_ID_TAGNAME 0x45A3
00154 #define MATROSKA_ID_TAGSTRING 0x4487
00155 #define MATROSKA_ID_TAGLANG 0x447A
00156 #define MATROSKA_ID_TAGDEFAULT 0x4484
00157 #define MATROSKA_ID_TAGDEFAULT_BUG 0x44B4
00158 #define MATROSKA_ID_TAGTARGETS 0x63C0
00159 #define MATROSKA_ID_TAGTARGETS_TYPE 0x63CA
00160 #define MATROSKA_ID_TAGTARGETS_TYPEVALUE 0x68CA
00161 #define MATROSKA_ID_TAGTARGETS_TRACKUID 0x63C5
00162 #define MATROSKA_ID_TAGTARGETS_CHAPTERUID 0x63C4
00163 #define MATROSKA_ID_TAGTARGETS_ATTACHUID 0x63C6
00164
00165
00166 #define MATROSKA_ID_SEEKENTRY 0x4DBB
00167
00168
00169 #define MATROSKA_ID_SEEKID 0x53AB
00170 #define MATROSKA_ID_SEEKPOSITION 0x53AC
00171
00172
00173 #define MATROSKA_ID_CLUSTERTIMECODE 0xE7
00174 #define MATROSKA_ID_CLUSTERPOSITION 0xA7
00175 #define MATROSKA_ID_CLUSTERPREVSIZE 0xAB
00176 #define MATROSKA_ID_BLOCKGROUP 0xA0
00177 #define MATROSKA_ID_SIMPLEBLOCK 0xA3
00178
00179
00180 #define MATROSKA_ID_BLOCK 0xA1
00181 #define MATROSKA_ID_BLOCKDURATION 0x9B
00182 #define MATROSKA_ID_BLOCKREFERENCE 0xFB
00183
00184
00185 #define MATROSKA_ID_ATTACHEDFILE 0x61A7
00186 #define MATROSKA_ID_FILEDESC 0x467E
00187 #define MATROSKA_ID_FILENAME 0x466E
00188 #define MATROSKA_ID_FILEMIMETYPE 0x4660
00189 #define MATROSKA_ID_FILEDATA 0x465C
00190 #define MATROSKA_ID_FILEUID 0x46AE
00191
00192
00193 #define MATROSKA_ID_EDITIONENTRY 0x45B9
00194 #define MATROSKA_ID_CHAPTERATOM 0xB6
00195 #define MATROSKA_ID_CHAPTERTIMESTART 0x91
00196 #define MATROSKA_ID_CHAPTERTIMEEND 0x92
00197 #define MATROSKA_ID_CHAPTERDISPLAY 0x80
00198 #define MATROSKA_ID_CHAPSTRING 0x85
00199 #define MATROSKA_ID_CHAPLANG 0x437C
00200 #define MATROSKA_ID_EDITIONUID 0x45BC
00201 #define MATROSKA_ID_EDITIONFLAGHIDDEN 0x45BD
00202 #define MATROSKA_ID_EDITIONFLAGDEFAULT 0x45DB
00203 #define MATROSKA_ID_EDITIONFLAGORDERED 0x45DD
00204 #define MATROSKA_ID_CHAPTERUID 0x73C4
00205 #define MATROSKA_ID_CHAPTERFLAGHIDDEN 0x98
00206 #define MATROSKA_ID_CHAPTERFLAGENABLED 0x4598
00207 #define MATROSKA_ID_CHAPTERPHYSEQUIV 0x63C3
00208
00209 typedef enum {
00210 MATROSKA_TRACK_TYPE_NONE = 0x0,
00211 MATROSKA_TRACK_TYPE_VIDEO = 0x1,
00212 MATROSKA_TRACK_TYPE_AUDIO = 0x2,
00213 MATROSKA_TRACK_TYPE_COMPLEX = 0x3,
00214 MATROSKA_TRACK_TYPE_LOGO = 0x10,
00215 MATROSKA_TRACK_TYPE_SUBTITLE = 0x11,
00216 MATROSKA_TRACK_TYPE_CONTROL = 0x20,
00217 } MatroskaTrackType;
00218
00219 typedef enum {
00220 MATROSKA_TRACK_ENCODING_COMP_ZLIB = 0,
00221 MATROSKA_TRACK_ENCODING_COMP_BZLIB = 1,
00222 MATROSKA_TRACK_ENCODING_COMP_LZO = 2,
00223 MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP = 3,
00224 } MatroskaTrackEncodingCompAlgo;
00225
00226 typedef enum {
00227 MATROSKA_VIDEO_STEREOMODE_TYPE_MONO = 0,
00228 MATROSKA_VIDEO_STEREOMODE_TYPE_LEFT_RIGHT = 1,
00229 MATROSKA_VIDEO_STEREOMODE_TYPE_BOTTOM_TOP = 2,
00230 MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM = 3,
00231 MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_RL = 4,
00232 MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_LR = 5,
00233 MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_RL = 6,
00234 MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_LR = 7,
00235 MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_RL = 8,
00236 MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_LR = 9,
00237 MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_CYAN_RED = 10,
00238 MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT = 11,
00239 MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_GREEN_MAG = 12,
00240 MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_LR = 13,
00241 MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL = 14,
00242 } MatroskaVideoStereoModeType;
00243
00244
00245
00246
00247
00248 typedef struct CodecTags{
00249 char str[20];
00250 enum CodecID id;
00251 }CodecTags;
00252
00253 typedef struct CodecMime{
00254 char str[32];
00255 enum CodecID id;
00256 }CodecMime;
00257
00258
00259 #define EBML_MAX_DEPTH 16
00260
00261 #define MATROSKA_VIDEO_STEREO_MODE_COUNT 15
00262 #define MATROSKA_VIDEO_STEREO_PLANE_COUNT 3
00263
00264 extern const CodecTags ff_mkv_codec_tags[];
00265 extern const CodecMime ff_mkv_mime_tags[];
00266 extern const AVMetadataConv ff_mkv_metadata_conv[];
00267 extern const char * const matroska_video_stereo_mode[MATROSKA_VIDEO_STEREO_MODE_COUNT];
00268 extern const char * const matroska_video_stereo_plane[MATROSKA_VIDEO_STEREO_PLANE_COUNT];
00269
00270 #endif