Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Matroska] Support for several flags as Visual/Hearing Impaired, Commentary, Original, TextDescriptions #1921

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions Source/MediaInfo/Multiple/File_Mk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ namespace Elements
const int64u Segment_Tracks_TrackEntry_FlagEnabled=0x39;
const int64u Segment_Tracks_TrackEntry_FlagDefault=0x8;
const int64u Segment_Tracks_TrackEntry_FlagForced=0x15AA;
const int64u Segment_Tracks_TrackEntry_FlagHearingImpaired=0x15AB;
const int64u Segment_Tracks_TrackEntry_FlagVisualImpaired=0x15AC;
const int64u Segment_Tracks_TrackEntry_FlagTextDescriptions=0x15AD;
const int64u Segment_Tracks_TrackEntry_FlagOriginal=0x15AE;
const int64u Segment_Tracks_TrackEntry_FlagCommentary=0x15AF;
const int64u Segment_Tracks_TrackEntry_FlagLacing=0x1C;
const int64u Segment_Tracks_TrackEntry_MinCache=0x2DE7;
const int64u Segment_Tracks_TrackEntry_MaxCache=0x2DF8;
Expand Down Expand Up @@ -1379,6 +1384,16 @@ void File_Mk::Streams_Finish()
//Flags
Fill(StreamKind_Last, StreamPos_Last, "Default", Temp->second.Default?"Yes":"No");
Fill(StreamKind_Last, StreamPos_Last, "Forced", Temp->second.Forced?"Yes":"No");
Fill(StreamKind_Last, StreamPos_Last, "Original", Temp->second.Original?"Yes":"No");

if (StreamKind_Last != Stream_Video)
{
Fill(StreamKind_Last, StreamPos_Last, "HearingImpaired", Temp->second.HearingImpaired?"Yes":"No");
Fill(StreamKind_Last, StreamPos_Last, "Commentary", Temp->second.Commentary?"Yes":"No");
Fill(StreamKind_Last, StreamPos_Last, "TextDescriptions", Temp->second.TextDescriptions?"Yes":"No");
}
else
Fill(StreamKind_Last, StreamPos_Last, "VisualImpaired", Temp->second.VisualImpaired?"Yes":"No");
}

//Chapters
Expand Down Expand Up @@ -1860,6 +1875,11 @@ void File_Mk::Data_Parse()
ATO2(Segment_Tracks_TrackEntry_FlagEnabled, "FlagEnabled")
ATO2(Segment_Tracks_TrackEntry_FlagDefault, "FlagDefault")
ATO2(Segment_Tracks_TrackEntry_FlagForced, "FlagForced")
ATO2(Segment_Tracks_TrackEntry_FlagHearingImpaired, "FlagHearingImpaired")
ATO2(Segment_Tracks_TrackEntry_FlagVisualImpaired, "FlagVisualImpaired")
ATO2(Segment_Tracks_TrackEntry_FlagTextDescriptions, "FlagTextDescriptions")
ATO2(Segment_Tracks_TrackEntry_FlagOriginal, "FlagOriginal")
ATO2(Segment_Tracks_TrackEntry_FlagCommentary, "FlagCommentary")
ATO2(Segment_Tracks_TrackEntry_FlagLacing, "FlagLacing")
ATO2(Segment_Tracks_TrackEntry_MinCache, "MinCache")
ATO2(Segment_Tracks_TrackEntry_MaxCache, "MaxCache")
Expand Down Expand Up @@ -4028,6 +4048,70 @@ void File_Mk::Segment_Tracks_TrackEntry_FlagForced()
Stream[TrackNumber].Forced=UInteger?true:false;
FILLING_END();
}
//---------------------------------------------------------------------------
void File_Mk::Segment_Tracks_TrackEntry_FlagHearingImpaired()
{
//Parsing
int64u UInteger=UInteger_Get();

FILLING_BEGIN();
if (Segment_Info_Count>1)
return; //First element has the priority
Stream[TrackNumber].HearingImpaired=UInteger?true:false;
FILLING_END();
}

//---------------------------------------------------------------------------
void File_Mk::Segment_Tracks_TrackEntry_FlagVisualImpaired()
{
//Parsing
int64u UInteger=UInteger_Get();

FILLING_BEGIN();
if (Segment_Info_Count>1)
return; //First element has the priority
Stream[TrackNumber].VisualImpaired=UInteger?true:false;
FILLING_END();
}

//---------------------------------------------------------------------------
void File_Mk::Segment_Tracks_TrackEntry_FlagTextDescriptions()
{
//Parsing
int64u UInteger=UInteger_Get();

FILLING_BEGIN();
if (Segment_Info_Count>1)
return; //First element has the priority
Stream[TrackNumber].TextDescriptions=UInteger?true:false;
FILLING_END();
}

//---------------------------------------------------------------------------
void File_Mk::Segment_Tracks_TrackEntry_FlagOriginal()
{
//Parsing
int64u UInteger=UInteger_Get();

FILLING_BEGIN();
if (Segment_Info_Count>1)
return; //First element has the priority
Stream[TrackNumber].Original=UInteger?true:false;
FILLING_END();
}

//---------------------------------------------------------------------------
void File_Mk::Segment_Tracks_TrackEntry_FlagCommentary()
{
//Parsing
int64u UInteger=UInteger_Get();

FILLING_BEGIN();
if (Segment_Info_Count>1)
return; //First element has the priority
Stream[TrackNumber].Commentary=UInteger?true:false;
FILLING_END();
}

//---------------------------------------------------------------------------
void File_Mk::Segment_Tracks_TrackEntry_Language()
Expand Down
10 changes: 10 additions & 0 deletions Source/MediaInfo/Multiple/File_Mk.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ private :
void Segment_Tracks_TrackEntry_FlagEnabled(){UInteger_Info();};
void Segment_Tracks_TrackEntry_FlagDefault();
void Segment_Tracks_TrackEntry_FlagForced();
void Segment_Tracks_TrackEntry_FlagHearingImpaired();
void Segment_Tracks_TrackEntry_FlagVisualImpaired();
void Segment_Tracks_TrackEntry_FlagTextDescriptions();
void Segment_Tracks_TrackEntry_FlagOriginal();
void Segment_Tracks_TrackEntry_FlagCommentary();
void Segment_Tracks_TrackEntry_FlagLacing(){UInteger_Info();};
void Segment_Tracks_TrackEntry_MinCache(){UInteger_Info();};
void Segment_Tracks_TrackEntry_MaxCache(){UInteger_Info();};
Expand Down Expand Up @@ -381,6 +386,11 @@ private :
bool Searching_TimeStamp_Start;
bool Default;
bool Forced;
bool HearingImpaired;
bool VisualImpaired;
bool TextDescriptions;
bool Original;
bool Commentary;
int64u ContentCompAlgo;
size_t ContentCompSettings_Buffer_Size;
int8u* ContentCompSettings_Buffer;
Expand Down