Attempts to decode a video frame from the currently buffered packet.
Definition at line 435 of file VideoAccessObject.h. References CurrentPacketIsVideo(), ILOG_DEBUG, ILOG_ERROR, mFrame, mPacket, and mVideoCodecCtx. Referenced by Impala::Core::Stream::Lavc::VideoAccessStrategy::DecodeNextFrame(), and Impala::Core::Stream::Lavc::StrategyIgnoringNativeIndex::ProcessPacket(). 00436 { 00437 if (!CurrentPacketIsVideo()) 00438 { 00439 ILOG_ERROR("Attempt to decode video frame from non-video packet"); 00440 return -1; 00441 } 00442 00443 const int len = avcodec_decode_video(mVideoCodecCtx, 00444 mFrame, resultCode, mPacket->data, mPacket->size); 00445 // from avcodec.h: 00446 // resultCode : 0 if no frame could be decompressed, 00447 // otherwise, it is nonzero. 00448 // len : On error a negative value is returned, otherwise the 00449 // number of bytes used or zero if no frame could be 00450 // decompressed. 00451 00452 if (len < 0) 00453 { 00454 // indicates an error condition according to avcodec.h 00455 00456 //if (len < -1) 00457 //{ 00458 ILOG_DEBUG("avcodec_decode_video returned " << len << 00459 " (negative value) indicating an error occurred"); 00460 //} 00461 //else 00462 //{ 00463 //} 00464 } 00465 else if (len == 0) 00466 { 00467 if (*resultCode != 0) 00468 ILOG_DEBUG("Failed assumption on avcodec_decode_video: " << 00469 "len=0 (no frame decompressed, but not an error) " << 00470 "but resultCode=" << *resultCode <<" (non-zero)"); 00471 } 00472 else if (*resultCode == 0) 00473 { 00474 ILOG_DEBUG("Failed assumption on avcodec_decode_video: " << 00475 "len>0 (bytes used for decompressed frame, no error occurred) " << 00476 "but resultCode=0 (no frame could be decompressed)"); 00477 } 00478 00479 return len; 00480 }
Here is the call graph for this function:
|