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

bool Impala::Core::Stream::Lavc::VideoAccessObject::InitFrames (  )  [inline, private]

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     }


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