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