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

bool Impala::Core::Stream::RgbDataSrcLavc::PopulateIndex ( Lavc::VideoAccessStrategy accessStrategy  )  [inline, private]

Definition at line 327 of file RgbDataSrcLavc.h.

References Impala::Core::Stream::RgbDataSrcInfo::AddIndex(), Impala::Core::Stream::Lavc::VideoAccessStrategy::CleanUp(), Impala::Core::Stream::Lavc::VideoAccessStrategy::ConstructIndex(), Impala::Core::Stream::RgbDataSrcInfo::DUMMY_FRAME_HASH, Impala::Core::Stream::Lavc::VideoAccessStrategy::FrameHash(), Impala::Core::Stream::Lavc::VideoAccessStrategy::FrameIsValid(), Impala::Core::Stream::Lavc::VideoIndex::GetSeekInfo(), ILOG_DEBUG, ILOG_ERROR, ILOG_INFO, Impala::Core::Stream::RgbDataSrcInfo::MarkBadFrame(), Impala::Core::Stream::RgbDataSrc::mIndexExists, Impala::Core::Stream::Lavc::VideoAccessStrategy::NrOfFrames(), and Scan().

Referenced by Init().

00328     {
00329         if (!Scan(accessStrategy))
00330             return false;
00331 
00332         ILOG_INFO("Starting index population...");
00333         ILOG_INFO("Constructing intermediate index...");
00334         Lavc::VideoIndex* tempIndex = accessStrategy.ConstructIndex();
00335         if (!tempIndex)
00336         {
00337             ILOG_ERROR("Construction of intermediate index failed; " <<
00338                 "aborting video population");
00339             return false;
00340         }
00341 
00342         // copy data from temp index to local index
00343         const int nrOfFrames = accessStrategy.NrOfFrames();
00344         String frameHash;
00345         int seekableFrameNr;
00346         UInt64 seekableFramePos = 0;
00347         for (int f = 0; f < nrOfFrames; f++)
00348         {
00349             if (accessStrategy.FrameIsValid(f))
00350             {
00351                 frameHash = accessStrategy.FrameHash(f);
00352                 tempIndex->GetSeekInfo(f, &seekableFrameNr, &seekableFramePos);
00353             }
00354             else
00355             {
00356                 MarkBadFrame(f);
00357                 frameHash = DUMMY_FRAME_HASH;
00358                 seekableFrameNr = -1;
00359                 seekableFramePos = -1;
00360             }
00361 
00362             ILOG_DEBUG("Adding to index: " << f << ", " << seekableFrameNr << 
00363                 ", " << seekableFramePos << ", " << frameHash);
00364             AddIndex(f, seekableFrameNr, seekableFramePos, frameHash);
00365         }
00366 
00367         delete tempIndex;
00368         accessStrategy.CleanUp();
00369         mIndexExists = true;
00370         ILOG_INFO("Finished index population");
00371         return true;
00372     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:20:32 2011 for ImpalaSrc by  doxygen 1.5.1