zoukankan      html  css  js  c++  java
  • 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);

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

    DUMP:

    char file_name[128] = {''};
    memset(file_name,'',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);

    //上面这种方式针对YV12三个平面不连续的dump方式
    fwrite(stImgInOut.stImgInfo.pau8Plane[0], 1,pStreamImgBuf->getBufSize(), fp);


    }

  • 相关阅读:
    Using AlloyTouch to control three.js 3D model
    AlloyTouch与three.js 3D模型交互
    移动Web触摸与运动解决方案AlloyTouch开源啦
    transformjs玩转星球
    swing with transformjs
    和transformjs一起摇摆
    getting started with transformjs
    移动Web利器transformjs入门
    腾讯AlloyTeam移动Web裁剪组件AlloyCrop正式开源
    Why AlloyFinger is so much smaller than hammerjs?
  • 原文地址:https://www.cnblogs.com/reality-soul/p/9303367.html
Copyright © 2011-2022 走看看