2,542
社区成员
发帖
与我相关
我的任务
分享
unsigned Cx_FileDecodeApapter_VLC::fVlcDecoderFrameCB(void **opaque, char *chroma,unsigned *width, unsigned *height,unsigned *pitches,unsigned *lines)
{
Cx_FileDecodeApapter_VLC * stream = (Cx_FileDecodeApapter_VLC*)*opaque;
strcpy(chroma,"I420");
unsigned long buftotalline = 0;
unsigned long bufcurline = 0;
for(int i=0;i<chromaDesc->plane_count;i++)
{
pitches[i] = *width * chromaDesc->p[i].w.num / chromaDesc->p[i].w.den * chromaDesc->pixel_size;
lines[i] = *height * chromaDesc->p[i].h.num / chromaDesc->p[i].h.den;
buftotalline += pitches[i] * lines[i];
if(i == 0)
stream->yuvYBuf_ = new char[pitches[i] * lines[i]];
if(i == 1)
stream->yuvUBuf_ = new char[pitches[i] * lines[i]];
if(i == 2)
stream->yuvVBuf_ = new char[pitches[i] * lines[i]];
}
return buftotalline + 32;
}
Cx_FileDecodeApapter_VLC* stream;
stream = (Cx_FileDecodeApapter_VLC*)opaque;
EnterCriticalSection(&stream->VlcCBDataLock_);
if(NULL != stream->yuvframebuf_)
*planes = stream->yuvframebuf_;
if(NULL != stream->yuvYBuf_ && NULL != stream->yuvUBuf_ && NULL != stream->yuvVBuf_)
{
planes[0] = stream->yuvYBuf_;
planes[1] = stream->yuvUBuf_;
planes[2] = stream->yuvVBuf_;
}
return NULL;
void Cx_FileDecodeApapter_VLC::fVlcDecoderUnLockCB(void *opaque, void *picture,void *const *planes)
{
//显示代码省略,主要是把yuvYBuf_,yuvUBuf_,yuvVBuf_f那里的数据显示出来
}