关闭

嵌入式 hi3518c镜像动态翻转实现

676人阅读 评论(0) 收藏 举报
分类:



int dyn_alter_pic_mirror(char *mirror_value)
{
    HI_S32s32Ret;
   VI_CHN_ATTR_S stChnAttr;
    VI_CHN ViChn= 0;
    ROTATE_EenRotate = ROTATE_NONE;
   SAMPLE_VI_CHN_SET_E enViChnSet =joseph_ipnc_param.joseph_ipnc_pic_attr.joseph_ipnc_mirror;

   enViChnSet = atoi(mirror_value);//transfer in
    enRotate =ROTATE_NONE;

   stChnAttr.stCapRect.s32X =  0;
   stChnAttr.stCapRect.s32Y = 0;
   stChnAttr.stCapRect.u32Width = 1280;
   stChnAttr.stCapRect.u32Height = 720;
   stChnAttr.enCapSel = VI_CAPSEL_BOTH;
   stChnAttr.stDestSize.u32Width = 1280;
   stChnAttr.stDestSize.u32Height = 720;
   stChnAttr.enPixFormat =SAMPLE_PIXEL_FORMAT;  

   stChnAttr.bMirror = HI_FALSE;
   stChnAttr.bFlip = HI_FALSE;

   switch(enViChnSet)
    {
       case VI_CHN_SET_MIRROR:
           stChnAttr.bMirror = HI_TRUE;
           break;

       case VI_CHN_SET_FLIP:
           stChnAttr.bFlip = HI_TRUE;
           break;
           
       case VI_CHN_SET_FLIP_MIRROR:
           stChnAttr.bMirror = HI_TRUE;
           stChnAttr.bFlip = HI_TRUE;
           break;
           
       default:
           break;
    }

   stChnAttr.bChromaResample = HI_FALSE;
   stChnAttr.s32SrcFrameRate = 30;
   stChnAttr.s32FrameRate = 30;

    s32Ret =HI_MPI_VI_SetChnAttr(ViChn, &stChnAttr);
    if (s32Ret!= HI_SUCCESS)
    {
       SAMPLE_PRT("failed with %#x!\n", s32Ret);
       return HI_FAILURE;
    }

    s32Ret =HI_MPI_VI_EnableChn(ViChn);
    if (s32Ret!= HI_SUCCESS)
    {
       SAMPLE_PRT("failed with %#x!\n", s32Ret);
       return HI_FAILURE;
    }
 return HI_SUCCESS;
}

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:986755次
    • 积分:17703
    • 等级:
    • 排名:第540名
    • 原创:741篇
    • 转载:522篇
    • 译文:0篇
    • 评论:105条
    最新评论