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

void Impala::Core::Stream::Lavc::StrategyIgnoringNativeIndex::ProcessPacket ( int  packetNr,
int *  frameCount,
bool  validating 
) [inline, private]

Definition at line 259 of file StrategyIgnoringNativeIndex.h.

References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Add(), Impala::Core::Stream::Lavc::VideoAccessObject::CurrentFilePosition(), Impala::Core::Stream::Lavc::VideoAccessObject::CurrentPacketFlags(), Impala::Core::Stream::Lavc::VideoAccessObject::CurrentPacketIsVideo(), Impala::Core::Stream::Lavc::VideoAccessObject::CurrentPacketSize(), Impala::Core::Stream::Lavc::VideoAccessObject::DecodeFrame(), Impala::Core::Stream::Lavc::VideoAccessObject::FrameIsKey(), Impala::Core::Stream::Lavc::VideoAccessObject::FrameType(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get2(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get3(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get4(), ILOG_DEBUG, ILOG_ERROR, Impala::Core::Stream::Lavc::VideoAccessStrategy::mBadFrameCount, Impala::Core::Stream::Lavc::VideoAccessStrategy::mLeadingBadFrameCount, Impala::Core::Stream::Lavc::VideoAccessStrategy::mPackets, Impala::Core::Stream::Lavc::VideoAccessStrategy::mVao, and Impala::Core::Stream::Lavc::VideoAccessStrategy::ProcessFrame().

Referenced by ScanOnePacket().

00260     {
00261         const int size = mVao->CurrentPacketSize();
00262         const int flags = mVao->CurrentPacketFlags();
00263         const UInt64 posAfterRead = mVao->CurrentFilePosition();
00264 
00265         if (validating)
00266         {
00267             if (mPackets->Get2(packetNr) != size || 
00268                 mPackets->Get3(packetNr) != flags ||
00269                 mPackets->Get4(packetNr) != posAfterRead)
00270             {
00271                 ILOG_ERROR("Packet " << packetNr << " not reproducable");
00272                 return;
00273             }
00274         }
00275         else
00276             mPackets->Add(packetNr, size, flags, posAfterRead);
00277 
00278         if (mVao->CurrentPacketIsVideo()) 
00279         {
00280             int frameDecoded = 0;
00281             const int len = mVao->DecodeFrame(&frameDecoded);
00282 
00283             // libavcodec's packet flags usage is not clear,  
00284             // but this appeared to work out fine: 
00285             const bool ignorePacket = (frameDecoded <= 0) && (flags != 0);
00286 
00287             if (!ignorePacket)
00288             {
00289                 const bool frameValid = (len >= 0 && frameDecoded > 0);
00290                 bool frameIsKey = false;
00291                 if (frameValid)
00292                 {
00293                     frameIsKey = (mVao->FrameType() == 'I' && mVao->FrameIsKey());
00294                 }
00295                 else
00296                 {
00297                     ILOG_DEBUG("DecodeFrame() failed (" << frameDecoded << 
00298                         ") and returned: " << len );
00299                     mBadFrameCount++;
00300                     if (mBadFrameCount >= *frameCount)
00301                         mLeadingBadFrameCount++;
00302                 }
00303 
00304                 const int frameNr = (*frameCount)++;
00305                 ProcessFrame(frameValid, frameIsKey, frameNr, validating);
00306             }
00307         }
00308     }

Here is the call graph for this function:


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