@@ -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()
1090810912void 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//---------------------------------------------------------------------------
1136811360void 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_*
0 commit comments