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

Method Inform

Source/MediaInfo/MediaInfo_Inform.cpp:150–735  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

148
149//---------------------------------------------------------------------------
150Ztring MediaInfo_Internal::Inform()
151{
152 {
153 CriticalSectionLocker CSL(CS);
154 if (Info && Info->Status[File__Analyze::IsUpdated])
155 Info->Open_Buffer_Update();
156 }
157
158 #if MEDIAINFO_TRACE
159 if (MediaInfoLib::Config.Inform_Get()!=__T("MAXML") && (MediaInfoLib::Config.Trace_Level_Get() || MediaInfoLib::Config.Inform_Get()==__T("Details")))
160 {
161 if (!Details.empty())
162 return Ztring().From_UTF8(Details);
163 else if (Info)
164 return Info->Details_Get();
165 else
166 return Ztring();
167 }
168 #endif //MEDIAINFO_TRACE
169
170 #if MEDIAINFO_ADVANCED
171 if (Config.TimeCode_Dumps)
172 {
173 string Result="<media";
174 if (Config.ParseSpeed<1.0)
175 Result+=" full=\"0\"";
176 Ztring Options=Get(Stream_General, 0, General_CompleteName, Info_Options);
177 if (InfoOption_ShowInInform<Options.size() && Options[InfoOption_ShowInInform]==__T('Y'))
178 {
179 Result+=" ref=\"";
180 Result+=XML_Encode(Get(Stream_General, 0, General_CompleteName)).To_UTF8();
181 Result+='\"';
182 }
183 Result+=" format=\"";
184 Result+=XML_Encode(Get(Stream_General, 0, General_Format)).To_UTF8();
185 Result+="\">\n";
186 for (const auto& TimeCode_Dump : *Config.TimeCode_Dumps)
187 {
188 Result+=" <timecode_stream";
189 Result+=TimeCode_Dump.second.Attributes_First;
190 if (TimeCode_Dump.second.Attributes_First.find(" frame_rate=\"")==string::npos && Count_Get(Stream_Video)==1)
191 {
192 auto FrameRate_Num=Get(Stream_Video, 0, Video_FrameRate_Num);
193 auto FrameRate_Den=Get(Stream_Video, 0, Video_FrameRate_Den);
194 auto FrameRate=Get(Stream_Video, 0, Video_FrameRate);
195 if (!FrameRate_Num.empty() && !FrameRate_Den.empty())
196 FrameRate=FrameRate_Num+__T('/')+FrameRate_Den;
197 if (!FrameRate.empty())
198 {
199 Result += " frame_rate=\"";
200 Result += XML_Encode(FrameRate).To_UTF8();
201 Result += '"';
202 }
203 }
204 if (TimeCode_Dump.second.Attributes_First.find(" source=\"")==string::npos)
205 {
206 auto ID_Pos=TimeCode_Dump.second.Attributes_First.find(" id=\"");
207 if (ID_Pos!=string::npos)

Callers

nothing calls this directly

Calls 15

XML_EncodeFunction · 0.85
to_stringFunction · 0.85
Export_EbuCoreClass · 0.85
Export_FimsClass · 0.85
Export_Mpeg7Class · 0.85
Export_PBCoreClass · 0.85
Export_PBCore2Class · 0.85
Export_NisoClass · 0.85
Export_GraphClass · 0.85
timeClass · 0.85
To_XMLFunction · 0.85
To_JSONFunction · 0.85

Tested by

no test coverage detected