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

virtual VideoIndex* Impala::Core::Stream::Lavc::StrategyIgnoringNativeIndex::ConstructIndexProtected (  )  const [inline, protected, virtual]

Attempts to determine a unique seek target for all valid key frames; seek targets are expressed in byte positions; the caller assumes ownership of the returned object.

Implements Impala::Core::Stream::Lavc::VideoAccessStrategy.

Definition at line 118 of file StrategyIgnoringNativeIndex.h.

References Impala::Core::Stream::Lavc::VideoIndex::AddFrame(), FindSeekPosition(), Impala::Core::Stream::Lavc::VideoAccessStrategy::FrameIsKey(), Impala::Core::Stream::Lavc::VideoAccessStrategy::FrameIsStable(), Impala::Core::Stream::Lavc::VideoAccessStrategy::FrameIsValid(), ILOG_DEBUG, ILOG_ERROR, Impala::Core::Stream::Lavc::VideoIndex::NrOfEntries(), and Impala::Core::Stream::Lavc::VideoAccessStrategy::NrOfFrames().

00119     {
00120         VideoIndex* videoIndex = new VideoIndex();
00121         UInt64 seekPos;
00122         int packetToStartSearchAt = -1; 
00123         const int frameCount = NrOfFrames();
00124         for (int f = 0; f < frameCount; f++)
00125         {
00126             if (FrameIsValid(f) && FrameIsKey(f) && FrameIsStable(f))
00127             {
00128                 const bool frameIsSeekable = FindSeekPosition(f, 
00129                     &seekPos, &packetToStartSearchAt);
00130                 if (frameIsSeekable)
00131                 {
00132                     videoIndex->AddFrame(f, true, seekPos);
00133                     ILOG_DEBUG("Indexed frame: " << f << " " << f << 
00134                         " true " << seekPos);
00135                 }
00136                 else if (videoIndex->NrOfEntries() == 0)
00137                 {
00138                     ILOG_ERROR("Failed to find a seek position for " <<
00139                         "frame " << f);
00140                     delete videoIndex;
00141                     return 0;
00142                 }
00143             }
00144         }
00145         return videoIndex;
00146     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:18:09 2010 for ImpalaSrc by  doxygen 1.5.1