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

int Impala::Core::Stream::Lavc::VideoAccessObject::DecodeFrame ( int *  resultCode  )  const [inline]

Attempts to decode a video frame from the currently buffered packet.

Definition at line 420 of file VideoAccessObject.h.

References CurrentPacketIsVideo(), ILOG_DEBUG, ILOG_ERROR, mFrame, mFrameValid, mPacket, and mVideoCodecCtx.

Referenced by Impala::Core::Stream::Lavc::VideoAccessStrategy::DecodeNextFrame(), and Impala::Core::Stream::Lavc::StrategyIgnoringNativeIndex::ProcessPacket().

00421     {
00422         mFrameValid = false;
00423 
00424         if (!CurrentPacketIsVideo())
00425         {
00426             ILOG_ERROR("Attempt to decode video frame from non-video packet");
00427             return -1;
00428         }
00429 
00430         const int len = avcodec_decode_video(mVideoCodecCtx, 
00431                             mFrame, resultCode, mPacket->data, mPacket->size);
00432         // from avcodec.h (v5.1): 
00433         //   resultCode : 0 if no frame could be decompressed, 
00434         //                otherwise, it is nonzero.
00435         //   len        : On error a negative value is returned, otherwise the 
00436         //                number of bytes used or zero if no frame could be 
00437         //                decompressed.
00438 
00439         if (len < 0)
00440         {
00441             // indicates an error condition according to avcodec.h
00442 
00443             //if (len < -1)
00444             //{
00445                 ILOG_DEBUG("avcodec_decode_video returned " << len <<
00446                     " (negative value) indicating an error occurred"); 
00447             //}
00448             //else
00449             //{
00450             //}
00451         }
00452         else if (len == 0)
00453         {
00454             if (*resultCode != 0)
00455                 ILOG_DEBUG("Failed assumption on avcodec_decode_video: " << 
00456                     "len=0 (no frame decompressed, but not an error) " << 
00457                     "but resultCode=" << *resultCode <<" (non-zero)"); 
00458         }
00459         //else if (*resultCode == 0)
00460         //{
00461         //    ILOG_DEBUG("Failed assumption on avcodec_decode_video: " << 
00462         //        "len>0 (bytes used for decompressed frame, no error occurred) " << 
00463         //        "but resultCode=0 (no frame could be decompressed)"); 
00464         //}
00465 
00466         mFrameValid = true;
00467         return len;
00468     }

Here is the call graph for this function:


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