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

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

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

00310     {
00311         if (!Scan(accessStrategy))
00312             return false;
00313 
00314         ILOG_INFO("Starting index population...");
00315         ILOG_INFO("Constructing intermediate index...");
00316         Lavc::VideoIndex* tempIndex = accessStrategy.ConstructIndex();
00317         if (!tempIndex)
00318         {
00319             ILOG_ERROR("Construction of intermediate index failed; " <<
00320                 "aborting video population");
00321             return false;
00322         }
00323 
00324         // copy data from temp index to local index
00325         const int nrOfFrames = accessStrategy.NrOfFrames();
00326         String frameHash;
00327         int seekableFrameNr;
00328         UInt64 seekableFramePos = 0;
00329         for (int f = 0; f < nrOfFrames; f++)
00330         {
00331             if (accessStrategy.FrameIsValid(f))
00332             {
00333                 frameHash = accessStrategy.FrameHash(f);
00334                 tempIndex->GetSeekInfo(f, &seekableFrameNr, &seekableFramePos);
00335             }
00336             else
00337             {
00338                 MarkBadFrame(f);
00339                 frameHash = DUMMY_FRAME_HASH;
00340                 seekableFrameNr = -1;
00341                 seekableFramePos = -1;
00342             }
00343 
00344             ILOG_DEBUG("Adding to index: " << f << ", " << seekableFrameNr << 
00345                 ", " << seekableFramePos << ", " << frameHash);
00346             AddIndex(f, seekableFrameNr, seekableFramePos, frameHash);
00347         }
00348 
00349         delete tempIndex;
00350         accessStrategy.CleanUp();
00351         mIndexExists = true;
00352         ILOG_INFO("Finished index population");
00353         return true;
00354     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:17:41 2010 for ImpalaSrc by  doxygen 1.5.1