本文整理汇总了C++中MediaInfo_Internal::Count_Get方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaInfo_Internal::Count_Get方法的具体用法?C++ MediaInfo_Internal::Count_Get怎么用?C++ MediaInfo_Internal::Count_Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaInfo_Internal
的用法示例。
在下文中一共展示了MediaInfo_Internal::Count_Get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PBCore_MediaType
//---------------------------------------------------------------------------
Ztring PBCore_MediaType(MediaInfo_Internal &MI)
{
if (MI.Count_Get(Stream_Video))
return __T("Video");
else if (MI.Count_Get(Stream_Audio))
return __T("Sound");
else if (MI.Count_Get(Stream_Image))
return __T("Static Image");
else if (MI.Count_Get(Stream_Text))
return __T("Text");
else
return Ztring();
}
示例2: PBCore_Transform__Common_End
//---------------------------------------------------------------------------
void PBCore_Transform__Common_End(Ztring &ToReturn, MediaInfo_Internal &MI, stream_t StreamKind, size_t StreamPos)
{
//essenceTrackAnnotation - all fields (except *_String*) separated by |
Ztring Temp;
for (size_t Pos=0; Pos<MI.Count_Get(StreamKind, StreamPos); Pos++)
if (MI.Get(StreamKind, StreamPos, Pos, Info_Name).find(__T("String"))==std::string::npos && !MI.Get(StreamKind, StreamPos, Pos).empty())
Temp+=MI.Get(StreamKind, StreamPos, Pos, Info_Name)+__T(": ")+MI.Get(StreamKind, StreamPos, Pos)+__T('|');
if (!Temp.empty())
{
Temp.resize(Temp.size()-1);
ToReturn+=__T("\t\t\t<essenceTrackAnnotation>"); ToReturn+=Temp; ToReturn+=__T("</essenceTrackAnnotation>\n");
}
}
示例3: PBCore_Transform
//.........这里部分代码省略.........
essenceTrackType=__T("TimeCode");
break;
}
else
return; //Not supported
default: return; //Not supported
}
ToReturn+=__T("\t\t<pbcoreEssenceTrack>\n");
ToReturn+=__T("\t\t\t<essenceTrackType>")+essenceTrackType+__T("</essenceTrackType>\n");
//essenceTrackIdentifier
if (!MI.Get(StreamKind, StreamPos, __T("ID")).empty())
{
ToReturn+=__T("\t\t\t<essenceTrackIdentifier>")+MI.Get(StreamKind, StreamPos, __T("ID"))+__T("</essenceTrackIdentifier>\n");
ToReturn+=__T("\t\t\t<essenceTrackIdentifierSource>ID (Mediainfo)</essenceTrackIdentifierSource>\n");
}
else if (!MI.Get(StreamKind, StreamPos, __T("UniqueID")).empty())
{
ToReturn+=__T("\t\t\t<essenceTrackIdentifier>")+MI.Get(StreamKind, StreamPos, __T("UniqueID"))+__T("</essenceTrackIdentifier>\n");
ToReturn+=__T("\t\t\t<essenceTrackIdentifierSource>UniqueID (Mediainfo)</essenceTrackIdentifierSource>\n");
}
else if (!MI.Get(StreamKind, StreamPos, __T("StreamKindID")).empty())
{
ToReturn+=__T("\t\t\t<essenceTrackIdentifier>")+MI.Get(StreamKind, StreamPos, __T("StreamKindID"))+__T("</essenceTrackIdentifier>\n");
ToReturn+=__T("\t\t\t<essenceTrackIdentifierSource>StreamKindID (Mediainfo)</essenceTrackIdentifierSource>\n");
}
//essenceTrackStandard
if (StreamKind==Stream_Video && !MI.Get(Stream_Video, StreamPos, Video_Standard).empty())
ToReturn+=__T("\t\t\t<essenceTrackStandard>")+MI.Get(Stream_Video, StreamPos, Video_Standard)+__T("</essenceTrackStandard>\n");
//essenceTrackEncoding
if (!MI.Get(StreamKind, StreamPos, __T("Format")).empty())
{
ToReturn+=__T("\t\t\t<essenceTrackEncoding>");
ToReturn+=MI.Get(StreamKind, StreamPos, __T("Format"));
if (!MI.Get(StreamKind, StreamPos, __T("Format_Profile")).empty()) ToReturn+=__T(' ')+MI.Get(StreamKind, StreamPos, __T("Format_Profile"));
if (!MI.Get(StreamKind, StreamPos, __T("CodecID")).empty()) ToReturn+=__T(" (")+MI.Get(StreamKind, StreamPos, __T("CodecID"))+__T(')');
ToReturn+=__T("</essenceTrackEncoding>\n");
}
//essenceTrackDataRate
if (!MI.Get(StreamKind, StreamPos, __T("BitRate")).empty())
{
ToReturn+=__T("\t\t\t<essenceTrackDataRate>");
ToReturn+=MI.Get(StreamKind, StreamPos, __T("BitRate"));
if (!MI.Get(StreamKind, StreamPos, __T("BitRate_Mode")).empty())
ToReturn+=__T(' ')+MI.Get(StreamKind, StreamPos, __T("BitRate_Mode"));
ToReturn+=__T("</essenceTrackDataRate>\n");
}
//essenceTrackFrameRate
if (StreamKind==Stream_Video && !MI.Get(Stream_Video, StreamPos, Video_FrameRate).empty())
{
ToReturn+=__T("\t\t\t<essenceTrackFrameRate>");
ToReturn+=MI.Get(Stream_Video, StreamPos, Video_FrameRate);
if (!MI.Get(Stream_Video, StreamPos, Video_FrameRate_Mode).empty())
ToReturn+=__T(' ')+MI.Get(Stream_Video, StreamPos, Video_FrameRate_Mode);
ToReturn+=__T("</essenceTrackFrameRate>\n");
}
//essenceTrackSamplingRate
if (StreamKind==Stream_Audio && !MI.Get(Stream_Audio, StreamPos, Audio_SamplingRate).empty())
ToReturn+=__T("\t\t\t<essenceTrackSamplingRate>")+MI.Get(Stream_Audio, StreamPos, Audio_SamplingRate)+__T("</essenceTrackSamplingRate>\n");
//essenceTrackBitDepth
if (!MI.Get(StreamKind, StreamPos, __T("BitDepth")).empty())
ToReturn+=__T("\t\t\t<essenceTrackBitDepth version=\"PBCoreXSD_Ver_1.2_D1\">")+MI.Get(StreamKind, StreamPos, __T("BitDepth"))+__T("</essenceTrackBitDepth>\n");
//essenceTrackFrameSize
if (StreamKind==Stream_Video && !MI.Get(Stream_Video, StreamPos, Video_Width).empty())
ToReturn+=__T("\t\t\t<essenceTrackFrameSize>")+MI.Get(Stream_Video, StreamPos, Video_Width)+__T('x')+MI.Get(Stream_Video, StreamPos, Video_Height)+__T("</essenceTrackFrameSize>\n");
//essenceTrackAspectRatio
if (StreamKind==Stream_Video && !MI.Get(Stream_Video, StreamPos, Video_DisplayAspectRatio).empty())
ToReturn+=__T("\t\t\t<essenceTrackAspectRatio>")+MI.Get(Stream_Video, StreamPos, Video_DisplayAspectRatio)+__T("</essenceTrackAspectRatio>\n");
//essenceTrackDuration
if (!MI.Get(StreamKind, StreamPos, __T("Duration")).empty())
ToReturn+=__T("\t\t\t<essenceTrackDuration>")+MI.Get(StreamKind, StreamPos, __T("Duration"))+__T("</essenceTrackDuration>\n");
//essenceTrackLanguage
if (!MI.Get(StreamKind, StreamPos, __T("Language")).empty())
ToReturn+=__T("\t\t\t<essenceTrackLanguage>")+MediaInfoLib::Config.Iso639_2_Get(MI.Get(StreamKind, StreamPos, __T("Language")))+__T("</essenceTrackLanguage>\n");
//essenceTrackAnnotation - all fields (except *_String*) separated by |
Ztring Temp;
for (size_t Pos=0; Pos<MI.Count_Get(StreamKind, StreamPos); Pos++)
if (MI.Get(StreamKind, StreamPos, Pos, Info_Name).find(__T("String"))==std::string::npos && !MI.Get(StreamKind, StreamPos, Pos).empty())
Temp+=MI.Get(StreamKind, StreamPos, Pos, Info_Name)+__T(": ")+MI.Get(StreamKind, StreamPos, Pos)+__T('|');
if (!Temp.empty())
{
Temp.resize(Temp.size()-1);
ToReturn+=__T("\t\t\t<essenceTrackAnnotation>"); ToReturn+=Temp; ToReturn+=__T("</essenceTrackAnnotation>\n");
}
ToReturn+=__T("\t\t</pbcoreEssenceTrack>\n");
}
示例4: Transform
//---------------------------------------------------------------------------
Ztring Export_PBCore::Transform(MediaInfo_Internal &MI)
{
//Current date/time is ISO format
time_t Time=time(NULL);
Ztring TimeS; TimeS.Date_From_Seconds_1970((int32u)Time);
TimeS.FindAndReplace(__T("UTC "), __T(""));
TimeS.FindAndReplace(__T(" "), __T("T"));
TimeS+=__T('Z');
Ztring ToReturn;
ToReturn+=__T("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
ToReturn+=__T("<PBCoreDescriptionDocument xsi:schemaLocation=\"http://www.pbcore.org/PBCore/PBCoreNamespace.html http://www.pbcore.org/PBCore/PBCoreXSD_Ver_1-2-1.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://www.pbcore.org/PBCore/PBCoreNamespace.html\">\n");
ToReturn+=__T("\t<!-- Generated at ")+TimeS+__T(" by ")+MediaInfoLib::Config.Info_Version_Get()+__T(" -->\n");
ToReturn+=__T("\t<!-- Warning: MediaInfo outputs only pbcoreInstantiation, other mandatory PBCore data is junk -->\n");
ToReturn+=__T("\t<pbcoreIdentifier>\n");
ToReturn+=__T("\t\t<identifier>***</identifier>\n");
ToReturn+=__T("\t\t<identifierSource>***</identifierSource>\n");
ToReturn+=__T("\t</pbcoreIdentifier>\n");
ToReturn+=__T("\t<pbcoreTitle>\n");
ToReturn+=__T("\t\t<title>***</title>\n");
ToReturn+=__T("\t</pbcoreTitle>\n");
ToReturn+=__T("\t<pbcoreDescription>\n");
ToReturn+=__T("\t\t<description>***</description>\n");
ToReturn+=__T("\t\t<descriptionType>***</descriptionType>\n");
ToReturn+=__T("\t</pbcoreDescription>\n");
ToReturn+=__T("\t<pbcoreInstantiation>\n");
//pbcoreFormatID
ToReturn+=__T("\t\t<pbcoreFormatID>\n");
//formatIdentifier
ToReturn+=__T("\t\t\t<formatIdentifier>")+MI.Get(Stream_General, 0, General_FileName)+__T("</formatIdentifier>\n");
//formatIdentifierSource
ToReturn+=__T("\t\t\t<formatIdentifierSource version=\"PBCoreXSD_Ver_1.2_D1\">File Name</formatIdentifierSource>\n");
ToReturn+=__T("\t\t</pbcoreFormatID>\n");
//formatDigital
if (!MI.Get(Stream_General, 0, General_InternetMediaType).empty())
{
ToReturn+=__T("\t\t<formatDigital>");
ToReturn+=MI.Get(Stream_General, 0, General_InternetMediaType);
ToReturn+=__T("</formatDigital>\n");
}
else
{
//TODO: how to implement formats without Media Type?
ToReturn+=__T("\t\t<formatDigital>");
if (MI.Count_Get(Stream_Video))
ToReturn+=__T("video/x-");
else if (MI.Count_Get(Stream_Image))
ToReturn+=__T("image/x-");
else if (MI.Count_Get(Stream_Audio))
ToReturn+=__T("audio/x-");
else
ToReturn+=__T("application/x-");
ToReturn+=Ztring(MI.Get(Stream_General, 0, __T("Format"))).MakeLowerCase();
ToReturn+=__T("</formatDigital>\n");
}
//formatLocation
ToReturn+=__T("\t\t<formatLocation>")+MI.Get(Stream_General, 0, General_CompleteName)+__T("</formatLocation>\n");
//dateCreated
if (!MI.Get(Stream_General, 0, General_Encoded_Date).empty())
{
Ztring dateCreated=MI.Get(Stream_General, 0, General_Recorded_Date);
dateCreated.FindAndReplace(__T("UTC"), __T("-"));
dateCreated.FindAndReplace(__T(" "), __T("T"));
dateCreated+=__T('Z');
ToReturn+=__T("\t\t<dateCreated>")+dateCreated+__T("</dateCreated>\n");
}
//dateIssued
if (!MI.Get(Stream_General, 0, General_Recorded_Date).empty())
{
Ztring dateIssued=MI.Get(Stream_General, 0, General_Recorded_Date);
dateIssued.FindAndReplace(__T("UTC"), __T("-"));
dateIssued.FindAndReplace(__T(" "), __T("T"));
dateIssued+=__T('Z');
ToReturn+=__T("\t\t<dateIssued>")+dateIssued+__T("</dateIssued>\n");
}
//formatMediaType
if (!PBCore_MediaType(MI).empty())
ToReturn+=__T("\t\t<formatMediaType version=\"PBCoreXSD_Ver_1.2_D1\">")+PBCore_MediaType(MI)+__T("</formatMediaType>\n");
else
ToReturn+=__T("\t\t<formatMediaType version=\"PBCoreXSD_Ver_1.2_D1\">application/octet-stream</formatMediaType>\n");
//formatGenerations
ToReturn+=__T("\t\t<formatGenerations version=\"PBCoreXSD_Ver_1.2_D1\" />\n");
//formatFileSize
if (!MI.Get(Stream_General, 0, General_FileSize).empty())
ToReturn+=__T("\t\t<formatFileSize>")+MI.Get(Stream_General, 0, General_FileSize)+__T("</formatFileSize>\n");
//formatTimeStart
if (!MI.Get(Stream_Video, 0, Video_Delay_Original_String3).empty())
ToReturn+=__T("\t\t<formatTimeStart>")+MI.Get(Stream_Video, 0, Video_Delay_Original_String3)+__T("</formatTimeStart>\n");
else if (!MI.Get(Stream_Video, 0, Video_Delay_String3).empty())
//.........这里部分代码省略.........
示例5: FileHeader_Begin
//.........这里部分代码省略.........
//Chunk
if (!strcmp(ChunkList_Item->Value(), (NameSpace+"Chunk").c_str()))
{
File_DcpPkl::stream::chunk Chunk;
for (XMLElement* Chunk_Item=ChunkList_Item->FirstChildElement(); Chunk_Item; Chunk_Item=Chunk_Item->NextSiblingElement())
{
//Path
if (!strcmp(Chunk_Item->Value(), (NameSpace+"Path").c_str()))
Chunk.Path=Chunk_Item->GetText();
}
Stream.ChunkList.push_back(Chunk);
}
}
}
//Id
if (!strcmp(Asset_Item->Value(), (NameSpace+"Id").c_str()))
Stream.Id=Asset_Item->GetText();
//PackingList
if (!strcmp(Asset_Item->Value(), (NameSpace+"PackingList").c_str()))
{
PKL_Pos=Streams.size();
Stream.StreamKind=(stream_t)(Stream_Max+2); // Means PKL
}
}
Streams.push_back(Stream);
}
}
}
//Creator
if (!strcmp(AssetMap_Item->Value(), (NameSpace+"Creator").c_str()))
Fill(Stream_General, 0, General_Encoded_Library, AssetMap_Item->GetText());
//IssueDate
if (!strcmp(AssetMap_Item->Value(), (NameSpace+"IssueDate").c_str()))
Fill(Stream_General, 0, General_Encoded_Date, AssetMap_Item->GetText());
//Issuer
if (!strcmp(AssetMap_Item->Value(), (NameSpace+"Issuer").c_str()))
Fill(Stream_General, 0, General_EncodedBy, AssetMap_Item->GetText());
}
Element_Offset=File_Size;
//Merging with PKL
if (PKL_Pos<Streams.size() && Streams[PKL_Pos].ChunkList.size()==1)
{
FileName Directory(File_Name);
Ztring PKL_FileName; PKL_FileName.From_UTF8(Streams[PKL_Pos].ChunkList[0].Path);
if (PKL_FileName.find(__T("file://"))==0 && PKL_FileName.find(__T("file:///"))==string::npos)
PKL_FileName.erase(0, 7); //TODO: better handling of relative and absolute file naes
MediaInfo_Internal MI;
MI.Option(__T("File_KeepInfo"), __T("1"));
Ztring ParseSpeed_Save=MI.Option(__T("ParseSpeed_Get"), __T(""));
Ztring Demux_Save=MI.Option(__T("Demux_Get"), __T(""));
MI.Option(__T("ParseSpeed"), __T("0"));
MI.Option(__T("Demux"), Ztring());
MI.Option(__T("File_IsReferenced"), __T("1"));
size_t MiOpenResult=MI.Open(Directory.Path_Get()+PathSeparator+PKL_FileName);
MI.Option(__T("ParseSpeed"), ParseSpeed_Save); //This is a global value, need to reset it. TODO: local value
MI.Option(__T("Demux"), Demux_Save); //This is a global value, need to reset it. TODO: local value
if (MiOpenResult
&& (MI.Get(Stream_General, 0, General_Format)==__T("DCP PKL")
|| MI.Get(Stream_General, 0, General_Format)==__T("IMF PKL")))
{
MergeFromPkl(((File_DcpPkl*)MI.Info)->Streams);
for (size_t Pos=0; Pos<MI.Count_Get(Stream_Other); ++Pos)
{
Stream_Prepare(Stream_Other);
Merge(*MI.Info, Stream_Other, Pos, StreamPos_Last);
}
}
}
//Creating the playlist
if (!Config->File_IsReferenced_Get())
{
ReferenceFiles=new File__ReferenceFilesHelper(this, Config);
for (File_DcpPkl::streams::iterator Stream=Streams.begin(); Stream!=Streams.end(); ++Stream)
if (Stream->StreamKind==(stream_t)(Stream_Max+1) && Stream->ChunkList.size()==1) // Means CPL
{
sequence* Sequence=new sequence;
Sequence->FileNames.push_back(Ztring().From_UTF8(Stream->ChunkList[0].Path));
Sequence->StreamID=ReferenceFiles->Sequences_Size()+1;
ReferenceFiles->AddSequence(Sequence);
}
ReferenceFiles->FilesForStorage=true;
}
//All should be OK...
return true;
}