Commit ad917d35 authored by Steve Lhomme's avatar Steve Lhomme

add support for new v4 elements in libmatroska2, mkclean and mkvalidator

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/foundation_src@851 a6f86f6d-0131-4f8e-9e7b-e335508773d5
parent ab06c575
......@@ -44,6 +44,7 @@
#define PROFILE_MATROSKA_V1 1
#define PROFILE_MATROSKA_V2 2
#define PROFILE_MATROSKA_V3 4
#define PROFILE_MATROSKA_V4 32
#define PROFILE_WEBM 8
#define PROFILE_DIVX 16
......
......@@ -191,8 +191,10 @@ extern const ebml_context MATROSKA_ContextTrackEntry;
extern const ebml_context MATROSKA_ContextTracks;
extern const ebml_context MATROSKA_ContextCueTime;
extern const ebml_context MATROSKA_ContextCueDuration;
extern const ebml_context MATROSKA_ContextCueTrack;
extern const ebml_context MATROSKA_ContextCueClusterPosition;
extern const ebml_context MATROSKA_ContextCueRelativePosition;
extern const ebml_context MATROSKA_ContextCueBlockNumber;
extern const ebml_context MATROSKA_ContextCueCodecState;
extern const ebml_context MATROSKA_ContextCueRefTime;
......
......@@ -392,8 +392,10 @@ const ebml_semantic EBML_SemanticTracks[] = {
};
const ebml_context MATROSKA_ContextTracks = {0x1654AE6B, EBML_MASTER_CLASS, 0, 0, "Tracks", EBML_SemanticTracks, EBML_SemanticGlobals, NULL};
const ebml_context MATROSKA_ContextCueTime = {0xB3, EBML_INTEGER_CLASS, 0, 0, "CueTime", NULL, EBML_SemanticGlobals, NULL};
const ebml_context MATROSKA_ContextCueDuration = {0xB2, EBML_INTEGER_CLASS, 0, 0, "CueDuration", NULL, EBML_SemanticGlobals, NULL};
const ebml_context MATROSKA_ContextCueTrack = {0xF7, EBML_INTEGER_CLASS, 0, 0, "CueTrack", NULL, EBML_SemanticGlobals, NULL};
const ebml_context MATROSKA_ContextCueClusterPosition = {0xF1, EBML_INTEGER_CLASS, 0, 0, "CueClusterPosition", NULL, EBML_SemanticGlobals, NULL};
const ebml_context MATROSKA_ContextCueRelativePosition = {0xF0, EBML_INTEGER_CLASS, 0, 0, "CueRelativePosition", NULL, EBML_SemanticGlobals, NULL};
const ebml_context MATROSKA_ContextCueBlockNumber = {0x5378, EBML_INTEGER_CLASS, 1, (intptr_t)1, "CueBlockNumber", NULL, EBML_SemanticGlobals, NULL};
const ebml_context MATROSKA_ContextCueCodecState = {0xEA, EBML_INTEGER_CLASS, 1, (intptr_t)0, "CueCodecState", NULL, EBML_SemanticGlobals, NULL};
const ebml_context MATROSKA_ContextCueRefTime = {0x96, EBML_INTEGER_CLASS, 0, 0, "CueRefTime", NULL, EBML_SemanticGlobals, NULL};
......@@ -413,6 +415,7 @@ const ebml_context MATROSKA_ContextCueReference = {0xDB, EBML_MASTER_CLASS, 0, 0
const ebml_semantic EBML_SemanticCueTrackPositions[] = {
{1, 1, &MATROSKA_ContextCueTrack, 0},
{1, 1, &MATROSKA_ContextCueClusterPosition, 0},
{0, 1, &MATROSKA_ContextCueRelativePosition, PROFILE_MATROSKA_V1|PROFILE_MATROSKA_V2|PROFILE_MATROSKA_V3|PROFILE_DIVX|PROFILE_WEBM},
{0, 1, &MATROSKA_ContextCueBlockNumber, 0},
{0, 1, &MATROSKA_ContextCueCodecState, PROFILE_MATROSKA_V1|PROFILE_DIVX|PROFILE_WEBM},
{0, 0, &MATROSKA_ContextCueReference, PROFILE_MATROSKA_V1|PROFILE_DIVX|PROFILE_WEBM},
......@@ -422,6 +425,7 @@ const ebml_context MATROSKA_ContextCueTrackPositions = {0xB7, EBML_MASTER_CLASS,
const ebml_semantic EBML_SemanticCuePoint[] = {
{1, 1, &MATROSKA_ContextCueTime, 0},
{0, 1, &MATROSKA_ContextCueDuration, PROFILE_MATROSKA_V1|PROFILE_MATROSKA_V2|PROFILE_MATROSKA_V3|PROFILE_DIVX|PROFILE_WEBM},
{1, 0, &MATROSKA_ContextCueTrackPositions, 0},
{0, 0, NULL ,0} // end of the table
};
......
......@@ -142,7 +142,7 @@ typedef struct track_info
static const tchar_t *GetProfileName(size_t ProfileNum)
{
static const tchar_t *Profile[7] = {T("unknown"), T("matroska v1"), T("matroska v2"), T("matroska v3"), T("webm"), T("matroska+DivX")};
static const tchar_t *Profile[7] = {T("unknown"), T("matroska v1"), T("matroska v2"), T("matroska v3"), T("webm"), T("matroska+DivX"), T("matroska v4")};
switch (ProfileNum)
{
default: return Profile[0];
......@@ -151,6 +151,7 @@ static const tchar_t *Profile[7] = {T("unknown"), T("matroska v1"), T("matroska
case PROFILE_MATROSKA_V3: return Profile[3];
case PROFILE_WEBM: return Profile[4];
case PROFILE_DIVX: return Profile[5];
case PROFILE_MATROSKA_V4: return Profile[6];
}
}
......@@ -164,6 +165,7 @@ static int GetProfileId(int Profile)
case PROFILE_MATROSKA_V3: return 3;
case PROFILE_WEBM: return 4;
case PROFILE_DIVX: return 5;
case PROFILE_MATROSKA_V4: return 6;
}
}
......@@ -1492,6 +1494,8 @@ int main(int argc, const char *argv[])
DstProfile = PROFILE_WEBM;
else if (tcsisame_ascii(Path,T("5")))
DstProfile = PROFILE_DIVX;
else if (tcsisame_ascii(Path,T("6")))
DstProfile = PROFILE_MATROSKA_V4;
else
{
TextPrintf(StdErr,T("Unknown doctype %s\r\n"),Path);
......@@ -1637,6 +1641,8 @@ int main(int argc, const char *argv[])
SrcProfile = PROFILE_MATROSKA_V2;
else if (SrcProfile==PROFILE_MATROSKA_V1 && DocVersion==3)
SrcProfile = PROFILE_MATROSKA_V3;
else if (SrcProfile==PROFILE_MATROSKA_V1 && DocVersion==4)
SrcProfile = PROFILE_MATROSKA_V4;
if (!DstProfile)
DstProfile = SrcProfile;
......@@ -1863,8 +1869,10 @@ int main(int argc, const char *argv[])
DocVersion=2;
if (DstProfile==PROFILE_MATROSKA_V3)
DocVersion=3;
if (DstProfile==PROFILE_MATROSKA_V4)
DocVersion=4;
if (ARRAYCOUNT(Alternate3DTracks, block_info*) && DstProfile!=PROFILE_MATROSKA_V3)
if (ARRAYCOUNT(Alternate3DTracks, block_info*) && DstProfile!=PROFILE_MATROSKA_V3 && DstProfile!=PROFILE_MATROSKA_V4)
{
TextPrintf(StdErr,T("Using --alt-3d in profile '%s' try \"--doctype %d\"\r\n"),GetProfileName(DstProfile),GetProfileId(PROFILE_MATROSKA_V3));
goto exit;
......
......@@ -135,7 +135,7 @@ void DebugMessage(const tchar_t* Msg,...)
static const tchar_t *GetProfileName(size_t ProfileNum)
{
static const tchar_t *Profile[7] = {T("unknown"), T("matroska v1"), T("matroska v2"), T("matroska v3"), T("webm"), T("matroska+DivX") };
static const tchar_t *Profile[7] = {T("unknown"), T("matroska v1"), T("matroska v2"), T("matroska v3"), T("webm"), T("matroska+DivX"), T("matroska v4")};
switch (ProfileNum)
{
default: return Profile[0];
......@@ -144,6 +144,7 @@ static const tchar_t *Profile[7] = {T("unknown"), T("matroska v1"), T("matroska
case PROFILE_MATROSKA_V3: return Profile[3];
case PROFILE_WEBM: return Profile[4];
case PROFILE_DIVX: return Profile[5];
case PROFILE_MATROSKA_V4: return Profile[6];
}
}
......@@ -1013,6 +1014,8 @@ int main(int argc, const char *argv[])
{
if (DivX)
MatroskaProfile = PROFILE_DIVX;
else if (EL_Int(EbmlReadDocVer)==4)
MatroskaProfile = PROFILE_MATROSKA_V4;
else if (EL_Int(EbmlReadDocVer)==3)
MatroskaProfile = PROFILE_MATROSKA_V3;
else if (EL_Int(EbmlReadDocVer)==2)
......
......@@ -64,6 +64,12 @@ static void AddElementSemantic(textwriter *CFile, const SpecElement *elt, bool_t
hasData = 1;
TextWrite(CFile, T("PROFILE_MATROSKA_V3"));
}
if (!elt->MinVersion || elt->MinVersion>4 || (elt->MaxVersion && elt->MaxVersion<4)) {
if (hasData)
TextWrite(CFile, T("|"));
hasData = 1;
TextWrite(CFile, T("PROFILE_MATROSKA_V4"));
}
if (!elt->InDivX) {
if (hasData)
TextWrite(CFile, T("|"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment