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

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

Definition at line 290 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().

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

Here is the call graph for this function:


Generated on Fri Mar 19 11:30:58 2010 for ImpalaSrc by  doxygen 1.5.1