Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

long Impala::Core::VideoSet::Mpeg7DocAudio::GetMediaDuration ( DOMNode mediaTime  )  [inline, private]

Definition at line 289 of file Mpeg7DocAudio.h.

References Impala::Util::StringParser::AdvanceP(), Impala::Util::StringParser::Contains(), Impala::Util::StringParser::Eat(), Impala::Util::XmlDoc::GetChildNode(), Impala::Util::XmlDoc::GetElementValue(), and Impala::Util::StringParser::GetInt().

Referenced by AddSegment(), and ReadData().

00290     {
00291         DOMNode* duration = GetChildNode(mediaTime, "MediaDuration", true);
00292         String s = GetElementValue(duration);
00293         // e.g. s = PT00H00M04S2122N30000F
00294         Util::StringParser p(s);
00295         p.Eat('T'); // T is begin of duration
00296         long total = 0;
00297         if (p.Contains("H"))
00298         {
00299             total += p.GetInt('H') * 3600;
00300             p.AdvanceP(1);
00301         }
00302         if (p.Contains("M"))
00303         {
00304             total += p.GetInt('M') * 60;
00305             p.AdvanceP(1);
00306         }
00307         if (p.Contains("S"))
00308         {
00309             total += p.GetInt('S');
00310             p.AdvanceP(1);
00311         }
00312         long fractions = p.GetInt('N');
00313         p.AdvanceP(1);
00314         long nrFractions = p.GetInt('F');
00315         long dur = total*nrFractions + fractions;
00316         if (nrFractions == 30000) // probably NTSC with time unit PT1001N30000F
00317             dur /= 1001;
00318         return dur;
00319     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:22:06 2011 for ImpalaSrc by  doxygen 1.5.1