初始化MMP系统 范例

文档中的例子:

/*********************************
*函数功能:初始化MMP系统
*输出参数:
*返回值:成功为0 失败非0
*********************************/
HI_S32 fun_sys_init()
{
    HI_S32 s32ret;         //返回值
    VB_CONF_S struVbConf;         //缓存池结构体
    MPP_SYS_CONF_S struSysConf; 

    /*配置缓存池属性*/
    memset(&struVbConf,0,sizeof(VB_CONF_S)); 
    struVbConf.u32MaxPoolCnt = 64;        //缓存池的个数
    struVbConf.astCommPool[0].u32BlkSize = 1920*1088*2;     //每块的大小
    struVbConf.astCommPool[0].u32BlkCnt = 15;         //缓存块个数
    memset(struVbConf.astCommPool[0].acMmzName,0,sizeof(struVbConf.astCommPool[0].acMmzName));         //缓存池MMZ名字
    s32ret = HI_MPI_VB_SetConf(&struVbConf);         //设置 MPP 视频缓存池属性。
    if (HI_SUCCESS != s32ret) 
    { 
        return s32ret; 
    } 

    s32ret = HI_MPI_VB_Init();     //先调用 HI_MPI_VB_SetConf 后再初始化 方可成功
    if (HI_SUCCESS != s32ret) 
    { 
        return s32ret; 
    } 

    /*配置系统控制参数*/
    struSysConf.u32AlignWidth = 16;     //字节对齐
/* set config of mpp system*/ 
    s32ret = HI_MPI_SYS_SetConf(&struSysConf); 
    if (HI_SUCCESS != s32ret) 
    { 
        printf("Set mpp sys config failed!\n"); 
        return s32ret; 
    } 

/* init system*/ 
    s32ret = HI_MPI_SYS_Init();     //初始化MMP系统
    if (HI_SUCCESS != s32ret) 
    { 
        printf("Mpi init failed!\n"); 
        return s32ret; 
    } 

/* ...... */ 

/* exit system 去初始化*/ 
    s32ret = HI_MPI_SYS_Exit(); 
    if (HI_SUCCESS != s32ret) 
    { 
        printf("Mpi exit failed!\n"); 
        return s32ret; 
    } 

    s32ret = HI_MPI_VB_Exit(); 
    if (HI_SUCCESS != s32ret) 
    {
        return s32ret; 
    }
}

 

posted @ 2020-08-11 09:06  祁峰_1024  阅读(329)  评论(0编辑  收藏  举报