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

virtual bool Impala::Core::Stream::Lavc::StrategyIgnoringNativeIndex::ScanProtected (  )  [inline, protected, virtual]

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

Definition at line 45 of file StrategyIgnoringNativeIndex.h.

References Impala::Core::Stream::Lavc::VideoAccessStrategy::CurrentFrameMatchesFrame(), Impala::Core::Stream::Lavc::VideoAccessObject::CurrentFrameToRgb(), Impala::Core::Stream::Lavc::VideoAccessStrategy::DecodeNextValidFrame(), Impala::Core::Stream::Lavc::VideoAccessStrategy::FrameIsKey(), Impala::Core::Stream::Lavc::VideoAccessObject::FrameType(), ILOG_ERROR, ILOG_INFO, Impala::Core::Stream::Lavc::VideoAccessStrategy::mBadFrameCount, Impala::Core::Stream::Lavc::VideoAccessStrategy::mFrames, Impala::Core::Stream::Lavc::VideoAccessStrategy::mLeadingBadFrameCount, Impala::Core::Stream::Lavc::VideoAccessStrategy::mScanDataPresent, Impala::Core::Stream::Lavc::VideoAccessStrategy::mVao, Impala::Core::Stream::Lavc::VideoAccessObject::Reset(), ScanPackets(), and Impala::Core::Table::Table::Size().

00046     {
00047         ILOG_INFO("First scan pass, collecting...");
00048         bool debug = false;
00049         if (!debug)
00050             ScanPackets(false);
00051         //else
00052         //    ReadScanData("scandata");
00053         //if (!debug)
00054         //    WriteScanData("scandata");
00055         mScanDataPresent = true;
00056         mVao->Reset();
00057         ILOG_INFO("Second scan pass, validating...");
00058         if (!debug)
00059             ScanPackets(true);
00060         //else
00061         //    ReadScanData("scandata");
00062         //if (!debug)
00063         //    WriteScanData("scandata");
00064 
00065         const int frameCnt = mFrames->Size();
00066         if (frameCnt <= 0)
00067         {
00068             ILOG_ERROR("No frames found");
00069             return false;
00070         }
00071 
00072         ILOG_INFO("Detected " << mLeadingBadFrameCount << 
00073             " leading bad frame(s) and " << mBadFrameCount << 
00074             " bad frame(s) in total");
00075         if (mLeadingBadFrameCount >= frameCnt)
00076         {
00077             ILOG_ERROR("No valid frames found");
00078             return false;
00079         }
00080 
00081         const int firstValidFrameNr = mLeadingBadFrameCount;
00082         if (!FrameIsKey(firstValidFrameNr))
00083         {
00084             ILOG_ERROR("Unexpected: first valid frame (" << firstValidFrameNr <<
00085                 ") is not a key frame (type: " << mVao->FrameType() << ")");
00086             return false;
00087         }
00088 
00089         // validate reproduction of first valid key frame's hash
00090         mVao->Reset();
00091         bool lookForKeyFrame = true;
00092         PacketTrace trace(10);
00093         bool foundFirstKeyFrame = 
00094             DecodeNextValidFrame(lookForKeyFrame, &trace);
00095         if (!foundFirstKeyFrame)
00096         {
00097             ILOG_ERROR("Could not locate first valid key frame");
00098             return false;
00099         }
00100 
00101         mVao->CurrentFrameToRgb();
00102         if (!CurrentFrameMatchesFrame(firstValidFrameNr, &trace))
00103         {
00104             ILOG_ERROR("Could not reproduce first valid key frame " << 
00105                 firstValidFrameNr);
00106             return false;
00107         }
00108 
00109         return true;
00110     }

Here is the call graph for this function:


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