YUYV&YV12&mtk6763

stImgInOut.stImgInfo.enImageType = UV_IMAGE_TYPE_YV12;
stImgInOut.stImgInfo.as32Pitch[0] = pStreamImgBuf->getImgWidthStride(0);
stImgInOut.stImgInfo.as32Pitch[1] = pStreamImgBuf->getImgWidthStride(1);
stImgInOut.stImgInfo.as32Pitch[2] = pStreamImgBuf->getImgWidthStride(2);
stImgInOut.stImgInfo.pau8Plane[0] = (uvUInt8*)pStreamImgBuf->getVirAddr();
stImgInOut.stImgInfo.pau8Plane[1] = stImgInOut.stImgInfo.pau8Plane[0] + stImgInOut.stImgInfo.as32Pitch[0] * stImgInOut.stImgInfo.s32Height;
stImgInOut.stImgInfo.pau8Plane[2] = stImgInOut.stImgInfo.pau8Plane[1] + ((stImgInOut.stImgInfo.as32Pitch[1] * stImgInOut.stImgInfo.s32Height)>>1);ide

 

stImgInOut.stImgInfo.enImageType = UV_IMAGE_TYPE_YUYV;
stImgInOut.stImgInfo.as32Pitch[0] = pStreamImgBuf->getImgWidthStride(0) << 1;
stImgInOut.stImgInfo.pau8Plane[0] = (uvUInt8*)pStreamImgBuf->getVirAddr();get

 

DUMP:it

char file_name[128] = {'\0'};
memset(file_name,'\0',sizeof(file_name));
sprintf(file_name,"sdcard/uvfbpre/fbpre_befor_%dx%d.yuv",pStreamImgBuf->getImgWidth(),pStreamImgBuf->getImgHeight());

FILE *fp = fopen(file_name, "wb");
if (NULL != fp)
{


if(stImgInOut.stImgInfo.enImageType == UV_IMAGE_TYPE_YUYV)
{
fwrite(stImgInOut.stImgInfo.pau8Plane[0], 1,pStreamImgBuf->getBufSize(), fp);
}
else if(stImgInOut.stImgInfo.enImageType == UV_IMAGE_TYPE_YV12)
{
// fwrite(stImgInOut.stImgInfo.pau8Plane[0], 1,pStreamImgBuf->getImgWidthStride(0)*pStreamImgBuf->getImgHeight(), fp);
// fwrite(stImgInOut.stImgInfo.pau8Plane[1], 1,(pStreamImgBuf->getImgWidthStride(1)*pStreamImgBuf->getImgHeight())>>1, fp);
// fwrite(stImgInOut.stImgInfo.pau8Plane[2], 1,(pStreamImgBuf->getImgWidthStride(2)*pStreamImgBuf->getImgHeight())>>1, fp);file

//上面這種方式針對YV12三個平面不連續的dump方式
fwrite(stImgInOut.stImgInfo.pau8Plane[0], 1,pStreamImgBuf->getBufSize(), fp);printf

}

本站公眾號
   歡迎關注本站公眾號,獲取更多信息