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

virtual bool Impala::Core::Stream::RgbDataSrcLavc::ReadFrameData (  )  [inline, private, virtual]

Implements Impala::Core::Stream::RgbDataSrcInfo.

Definition at line 375 of file RgbDataSrcLavc.h.

References CheckMD5Hash(), Impala::Core::Stream::Lavc::VideoAccessStrategy::CurrentFrameToRgb(), Impala::Core::Stream::RgbDataSrcInfo::FrameValid(), Impala::Core::Stream::RgbDataSrcInfo::GetSeekableFrame(), ILOG_DEBUG, ILOG_ERROR, mBufferedFrameNr, Impala::Core::Stream::RgbDataSrc::mCurrentFrameNr, Impala::Core::Stream::RgbDataSrc::mFormatName, Impala::Core::Stream::RgbDataSrc::mIndexExists, mLastDecodedFrameNr, Impala::Core::Stream::RgbDataSrc::mTargetFrameNr, mVideoAccessor, ReadToTarget(), Reset(), and SeekFrame().

00376     {
00377         if (mTargetFrameNr == mCurrentFrameNr)
00378             return true;
00379 
00380         if (!FrameValid(mTargetFrameNr) || mTargetFrameNr == mBufferedFrameNr)
00381         {
00382             mCurrentFrameNr = mTargetFrameNr;
00383             return true;
00384         }
00385 
00386         if (mTargetFrameNr < mBufferedFrameNr)
00387             Reset();
00388 
00389         const bool videoSeekable = mIndexExists;
00390         if (videoSeekable)
00391         {
00392             int sFrameNr = GetSeekableFrame(mTargetFrameNr);
00393             // dont jump just to read the next frame:
00394             if (sFrameNr > mBufferedFrameNr + 1)
00395             {
00396                 ILOG_DEBUG("Targeting frame " << mTargetFrameNr << 
00397                     " by first seeking to frame " << sFrameNr);
00398                 if (!SeekFrame(sFrameNr))
00399                     return false;
00400                 mLastDecodedFrameNr = mBufferedFrameNr = mCurrentFrameNr = 
00401                     sFrameNr;
00402             }
00403         }
00404 
00405         const bool lastDecodedFrameValid = ReadToTarget();
00406         mCurrentFrameNr = mLastDecodedFrameNr;
00407         if (lastDecodedFrameValid)
00408         {
00409             int result = mVideoAccessor->CurrentFrameToRgb();
00410             mBufferedFrameNr = mCurrentFrameNr;
00411 
00412             if (mFormatName != "asf") // SK: dirty debug fix
00413                 if (!CheckMD5Hash(mBufferedFrameNr))
00414                 {
00415                     ILOG_ERROR("Frame hash failure going to frame " << 
00416                         mTargetFrameNr);
00417                     return false;
00418                 }
00419         }
00420 
00421         return true;
00422     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:17:42 2010 for ImpalaSrc by  doxygen 1.5.1