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

bool Impala::Core::Stream::Lavc::StrategyIgnoringNativeIndex::ScanOnePacket ( int *  packetCount,
int *  frameCount,
bool  validating 
) [inline, private]

Definition at line 208 of file StrategyIgnoringNativeIndex.h.

References Impala::Core::Stream::Lavc::VideoAccessObject::AtEof(), Impala::Core::Stream::Lavc::VideoAccessObject::GopSize(), ILOG_DEBUG, Impala::Max(), Impala::Core::Stream::Lavc::VideoAccessStrategy::mVao, ProcessPacket(), and Impala::Core::Stream::Lavc::VideoAccessObject::ReadPacket().

Referenced by ScanPackets().

00209     {
00210         const int MAX_POST_EOF_FAILURES = Max(15, 2 * mVao->GopSize());
00211         int nrOfConsecutivePostEofFailures = 0;
00212 
00213         while (true)
00214         {
00215             const bool atEofBeforeRead = mVao->AtEof();
00216             const int readPacketResult = mVao->ReadPacket();
00217             if (mVao->AtEof() && !atEofBeforeRead)
00218                 ILOG_DEBUG("Reached end of file");
00219 
00220             const bool readPacketFailed = (readPacketResult < 0);
00221             if (!readPacketFailed)
00222             {
00223                 if (atEofBeforeRead)
00224                 {
00225                     ILOG_DEBUG("A packet was successfully read after " <<
00226                         "reading arrived at end of file");
00227                 }
00228                 const int packetNr = (*packetCount)++;
00229                 ProcessPacket(packetNr, frameCount, validating);
00230                 return false;
00231             }
00232 
00233             ILOG_DEBUG("ReadPacket() failed and returned: " << 
00234                 readPacketResult);
00235 
00236             if (atEofBeforeRead)
00237             {
00238                 if (readPacketFailed)
00239                 {
00240                     nrOfConsecutivePostEofFailures++;
00241                     if (nrOfConsecutivePostEofFailures > MAX_POST_EOF_FAILURES)
00242                     {
00243                         ILOG_DEBUG("Max. nr of consecutive post-EOF " <<
00244                             "read failures reached (" <<
00245                             MAX_POST_EOF_FAILURES << ")");
00246                         return true;
00247                     }
00248                 }
00249                 else 
00250                     nrOfConsecutivePostEofFailures = 0;
00251             }
00252         }
00253     }

Here is the call graph for this function:


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