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

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

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

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

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

Here is the call graph for this function:


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