Home || Visual Search || Applications || Architecture || 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 119 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().

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

Here is the call graph for this function:


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