Definition at line 701 of file VideoAccessObject.h. References ILOG_ERROR, mFrame, mPacket, mRgbFrame, mRgbFrameData, mSrcAddress, and mVideoCodecCtx. Referenced by VideoAccessObject(). 00702 { 00703 mPacket = new AVPacket; 00704 mPacket->data = 0; 00705 00706 // Allocate frame for reading 00707 mFrame = avcodec_alloc_frame(); 00708 00709 // Allocate frame for RGB conversion 00710 mRgbFrame = avcodec_alloc_frame(); 00711 00712 if ((mRgbFrame == NULL) || (mFrame == NULL)) 00713 { 00714 ILOG_ERROR("Could not allocate frame memory for: " << mSrcAddress); 00715 return false; 00716 } 00717 00718 // allocate buffer to hold frame data converted to RGB 00719 const int numBytes = avpicture_get_size( 00720 PIX_FMT_RGB24, mVideoCodecCtx->width, mVideoCodecCtx->height); 00721 mRgbFrameData = new UInt8[numBytes]; 00722 00723 // Assign appropriate parts of buffer to image planes in mRgbFrame 00724 int result = avpicture_fill( (AVPicture*) mRgbFrame, 00725 mRgbFrameData, PIX_FMT_RGB24, mVideoCodecCtx->width, mVideoCodecCtx->height); 00726 00727 return true; 00728 }
|