MCPcopy Create free account
hub / github.com/MediaArea/MediaInfoLib / EbuCore_Transform_Text

Function EbuCore_Transform_Text

Source/MediaInfo/Export/Export_EbuCore.cpp:958–989  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

956
957//---------------------------------------------------------------------------
958void EbuCore_Transform_Text(Node* Parent, MediaInfo_Internal &MI, size_t StreamPos)
959{
960 Node* Child=Parent->Add_Child("ebucore:dataFormat", true);
961
962 //if (!MI.Get(Stream_Text, StreamPos, Text_ID).empty())
963 // ToReturn+=__T(" dataFormatId=\"")+MI.Get(Stream_Text, StreamPos, Text_ID)+__T("\"");
964 Ztring Format_Version=MI.Get(Stream_Text, StreamPos, Text_Format_Version);
965 if (!Format_Version.empty())
966 {
967 Format_Version.FindAndReplace(__T("Version "), Ztring());
968 Child->Add_Attribute("dataFormatVersionId", Format_Version);
969 }
970 Child->Add_Attribute_IfNotEmpty(MI, Stream_Text, StreamPos, Text_Format, "dataFormatName");
971 Child->Add_Attribute_IfNotEmpty(MI, Stream_Text, StreamPos, Text_ID, "dataTrackId");
972
973 //subtitlingTrack
974 {
975 Node* Child2=Child->Add_Child("ebucore:captioningFormat", true);
976 Child2->Add_Attribute_IfNotEmpty(MI, Stream_Text, StreamPos, Text_Format, "captioningFormatName");
977 Child2->Add_Attribute_IfNotEmpty(MI, Stream_Text, StreamPos, Text_ID, "trackId");
978 Child2->Add_Attribute_IfNotEmpty(MI, Stream_Text, StreamPos, Text_Title, "typeLabel");
979 Child2->Add_Attribute_IfNotEmpty(MI, Stream_Text, StreamPos, Text_Language, "language");
980
981 if (!MI.Get(Stream_Text, StreamPos, Text_CodecID).empty() || !MI.Get(Stream_Text, StreamPos, Text_Format_Commercial_IfAny).empty())
982 {
983 Node* Child3=Child->Add_Child("ebucore:codec", true);
984 if (!MI.Get(Stream_Text, StreamPos, Text_CodecID).empty())
985 Child3->Add_Child("ebucore:codecIdentifier", true)->Add_Child("dc:identifier", MI.Get(Stream_Text, StreamPos, Text_CodecID), true);
986 Child3->Add_Child_IfNotEmpty(MI, Stream_Text, StreamPos, Text_Format_Commercial_IfAny, "ebucore:name", true);
987 }
988 }
989}
990
991//---------------------------------------------------------------------------
992Ztring EbuCore_Duration(int64s MS)

Callers 1

TransformMethod · 0.85

Calls 6

Add_AttributeMethod · 0.80
Add_Child_IfNotEmptyMethod · 0.80
GetMethod · 0.65
Add_ChildMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected