Skip to content

Commit c75d2c8

Browse files
Merge pull request #2457 from JeromeMartinez/MXF_ADM_Profiles
MXF: crosscheck of ADM profiles
2 parents 2274522 + ba13456 commit c75d2c8

File tree

5 files changed

+112
-23
lines changed

5 files changed

+112
-23
lines changed

Source/MediaInfo/Audio/File_Adm.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7704,6 +7704,12 @@ void File_Adm::Streams_Fill()
77047704
File_Adm_Private->clear();
77057705
}
77067706

7707+
//---------------------------------------------------------------------------
7708+
void File_Adm::Streams_Finish()
7709+
{
7710+
Streams_Finish_Conformance();
7711+
}
7712+
77077713
//***************************************************************************
77087714
// Buffer - File header
77097715
//***************************************************************************

Source/MediaInfo/Audio/File_Adm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ private :
5151
//Streams management
5252
void Streams_Accept();
5353
void Streams_Fill();
54+
void Streams_Finish();
5455

5556
//Buffer - File header
5657
bool FileHeader_Begin();

Source/MediaInfo/Multiple/File_Mxf.cpp

Lines changed: 94 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2428,6 +2428,10 @@ void File_Mxf::Streams_Finish()
24282428
Merge(*DolbyAudioMetadata, Stream_Audio, 0, 0);
24292429
if (Adm)
24302430
{
2431+
Fill(Adm);
2432+
#if defined(MEDIAINFO_ADM_YES)
2433+
CompareAdmProfiles();
2434+
#endif
24312435
Finish(Adm);
24322436
Merge(*Adm, Stream_Audio, 0, 0);
24332437
}
@@ -2472,7 +2476,7 @@ void File_Mxf::Streams_Finish()
24722476
//Commercial names
24732477
Streams_Finish_CommercialNames();
24742478

2475-
Merge_Conformance();
2479+
Streams_Finish_Conformance();
24762480
}
24772481

24782482
//---------------------------------------------------------------------------
@@ -10908,8 +10912,15 @@ void File_Mxf::RIFFChunkStreamID_link1()
1090810912
void File_Mxf::ADMProfileLevelULBatch()
1090910913
{
1091010914
VECTOR(16);
10915+
set<int128u> List;
1091110916
for (int32u i=0; i<Count; i++)
10912-
Skip_UUID( "UUID");
10917+
{
10918+
int128u UUID;
10919+
Get_UUID (UUID, "UUID"); Param_Info1(Mxf_Param_Info((int32u)UUID.hi, UUID.lo)); Element_Info1(Mxf_Param_Info((int32u)UUID.hi, UUID.lo));
10920+
List.insert(UUID);
10921+
}
10922+
10923+
ADMProfileLevelULBatch_List[InstanceUID] = std::move(List);
1091310924
}
1091410925

1091510926
//---------------------------------------------------------------------------
@@ -11345,25 +11356,6 @@ void File_Mxf::MGAMetadataSectionLinkID()
1134511356
Skip_UUID( "UUID");
1134611357
}
1134711358

11348-
//---------------------------------------------------------------------------
11349-
void File_Mxf::SADMMetadataSectionLinkID()
11350-
{
11351-
//Parsing
11352-
Skip_UUID( "UUID");
11353-
}
11354-
11355-
//---------------------------------------------------------------------------
11356-
void File_Mxf::SADMProfileLevelULBatch()
11357-
{
11358-
//Parsing
11359-
VECTOR(16);
11360-
for (int32u i=0; i<Count; i++)
11361-
{
11362-
//Parsing
11363-
Skip_UUID( "UUID");
11364-
}
11365-
}
11366-
1136711359
//---------------------------------------------------------------------------
1136811360
void File_Mxf::MultipleDescriptor_FileDescriptors()
1136911361
{
@@ -16019,6 +16011,87 @@ void File_Mxf::Descriptor_Fill(const char* Name, const Ztring& Value)
1601916011
Info->second = Value;
1602016012
}
1602116013

16014+
//---------------------------------------------------------------------------
16015+
#if defined(MEDIAINFO_ADM_YES)
16016+
struct adm_ul_to_string
16017+
{
16018+
int64u UL;
16019+
const char* Name;
16020+
};
16021+
static adm_ul_to_string Mxf_ADM_UL_To_String[] = {
16022+
{ 0x0402021102010000LL, "AdvSS Emission, Version 1, Level 0" },
16023+
{ 0x0402021102020000LL, "AdvSS Emission, Version 1, Level 1" },
16024+
{ 0x0402021102030000LL, "AdvSS Emission, Version 1, Level 2" },
16025+
{ 0x0D02020101000000LL, "EBU Production, Version 1"},
16026+
{ 0x0E09010106010100LL, "Dolby Atmos Master, Version 1"},
16027+
{ 0x0E09010106010200LL, "Dolby Atmos Master, Version 1"}, // 1.1
16028+
{ 0x0E09010106020100LL, "Dolby E Emission, Version 1, Level 1"},
16029+
};
16030+
void File_Mxf::CompareAdmProfiles()
16031+
{
16032+
if (ADMProfileLevelULBatch_List.empty() || ADMProfileLevelULBatch_List.size() > 1)
16033+
return; // TODO: support multiple ADMProfileLevelULBatch
16034+
16035+
std::set<string> Profile_List_Container;
16036+
auto CanNotCompare = false;
16037+
for (const auto& Item : ADMProfileLevelULBatch_List.cbegin()->second)
16038+
{
16039+
const char* Item_String = nullptr;
16040+
for (const auto& UL_To_String : Mxf_ADM_UL_To_String)
16041+
{
16042+
if (Item.lo == UL_To_String.UL)
16043+
{
16044+
Item_String = UL_To_String.Name;
16045+
break;
16046+
}
16047+
}
16048+
16049+
if (!Item_String)
16050+
{
16051+
CanNotCompare = true;
16052+
continue;
16053+
}
16054+
16055+
Profile_List_Container.insert(Item_String);
16056+
}
16057+
16058+
auto Max = Adm->Count_Get(Stream_Audio, 0);
16059+
std::set<string> Profile_List_Stream;
16060+
for (size_t Pos = 0; Pos < Max; Pos++)
16061+
{
16062+
const auto& Name = Adm->Retrieve_Const(Stream_Audio, 0, Pos, Info_Name);
16063+
if ((Name.size() < 22 || Name.size() > 23 || Name.rfind(__T("AdmProfile AdmProfile"), 0)) && Name != __T("AdmProfile"))
16064+
continue;
16065+
16066+
Profile_List_Stream.insert(Adm->Retrieve_Const(Stream_Audio, 0, Pos, Info_Text).To_UTF8());
16067+
}
16068+
16069+
for (const auto& Profile_Container : Profile_List_Container)
16070+
{
16071+
const auto Profile_Stream = Profile_List_Stream.find(Profile_Container);
16072+
if (Profile_Stream == Profile_List_Stream.end())
16073+
Adm->Fill_Conformance("Crosscheck AdmProfile", '\"' + Profile_Container + "\" is listed in the container but not found in the ADM content");
16074+
else
16075+
Profile_List_Stream.erase(Profile_Stream);
16076+
}
16077+
16078+
for (const auto& Profile_Stream : Profile_List_Stream)
16079+
{
16080+
auto IsKnown = false;
16081+
for (const auto& UL_To_String : Mxf_ADM_UL_To_String)
16082+
{
16083+
if (Profile_Stream == UL_To_String.Name)
16084+
{
16085+
IsKnown = true;
16086+
break;
16087+
}
16088+
}
16089+
if (IsKnown && !CanNotCompare)
16090+
Adm->Fill_Conformance("Crosscheck AdmProfile", '\"' + Profile_Stream + "\" is not listed in the container but found in the ADM content");
16091+
}
16092+
}
16093+
#endif
16094+
1602216095
} //NameSpace
1602316096

1602416097
#endif //MEDIAINFO_MXF_*

Source/MediaInfo/Multiple/File_Mxf.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,8 @@ protected :
421421
void MGAAudioMetadataIdentifier(); //
422422
void MGAAudioMetadataPayloadULArray(); //
423423
void MGAMetadataSectionLinkID(); //
424-
void SADMMetadataSectionLinkID(); //
425-
void SADMProfileLevelULBatch(); //
424+
void SADMMetadataSectionLinkID() { MGAMetadataSectionLinkID(); }
425+
void SADMProfileLevelULBatch() { ADMProfileLevelULBatch(); }
426426
void MPEGAudioBitRate(); //
427427
void MultipleDescriptor_FileDescriptors(); //3F01
428428
void RFC5646SpokenLanguage();
@@ -1459,6 +1459,8 @@ protected :
14591459
int32u ADMChannelMapping_LocalChannelID;
14601460
string ADMChannelMapping_ADMAudioTrackUID;
14611461
std::bitset<2> ADMChannelMapping_Presence;
1462+
std::map<int128u, set<int128u> > ADMProfileLevelULBatch_List;
1463+
void CompareAdmProfiles();
14621464
#endif
14631465
#if defined(MEDIAINFO_IAB_YES)
14641466
File__Analyze* Adm_ForLaterMerge;

Source/MediaInfo/Multiple/File_Mxf_Automated.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4974,6 +4974,9 @@ C(0402020204010000, "MPEG-1 Audio Coding")
49744974
C(0402020204020000, "MPEG-2 Audio Coding")
49754975
C(0402020204030000, "MPEG-2 Advanced Audio Coding")
49764976
C(0402020204040000, "MPEG-4 Advanced Audio Coding")
4977+
C(0402021102010000, "AdvSS Emission Profile, Version 1, Level 0")
4978+
C(0402021102020000, "AdvSS Emission Profile, Version 1, Level 1")
4979+
C(0402021102030000, "AdvSS Emission Profile, Version 1, Level 2")
49774980
C(0403000000000000, "Data Essence")
49784981
C(0403010000000000, "Generic Event Text Essence")
49794982
C(0403010100000000, "Generic Subtitle Essence")
@@ -5239,6 +5242,7 @@ C(0D01130101040000, "AAF AIFF-AIFC Container")
52395242
C(0D01130101040100, "AAF AIFF-AIFC Audio Container")
52405243
C(0D02000000000000, "EBU/UER")
52415244
C(0D02010000000000, "EBUCore")
5245+
C(0D02020101000000, "EBU Production Profile")
52425246
C(0D03000000000000, "Pro-MPEG Forum")
52435247
C(0D04000000000000, "BBC")
52445248
C(0D04010000000000, "Archive Preservation Project")
@@ -5320,6 +5324,9 @@ C(0E09010105020000, "Soundfield Group 5.1.4")
53205324
C(0E09010105040000, "Soundfield Group 7.1.4")
53215325
C(0E09010105060000, "Soundfield Group 9.1.4")
53225326
C(0E09010105070000, "Soundfield Group 9.1.6")
5327+
C(0E09010106010100, "Dolby Atmos Master ADM v1.0")
5328+
C(0E09010106010200, "Dolby Atmos Master ADM v1.1")
5329+
C(0E09010106020100, "Dolby E ADM Profile v1.0")
53235330
C(0E09060400000000, "Immersive Audio Coding")
53245331
C(0E09060500000000, "MXF-GC IAData Frame Wrapped")
53255332
C(0E09060600000000, "UTF-8 Text Data Essence Coding")

0 commit comments

Comments
 (0)