1645
- 收藏
- 点赞
- 分享
- 举报
3521d添加region失败
在sample_vio.c的基础上修改,尝试加入region的时候出错了,HI_MPI_RGN_Create返回0xffffffff,这个错误码在文档的没有提及,网上也没有找到情况相似的问题,现在一筹莫展,望大侠搭救!
关键代码如下:
SAMPLE_VI_MODE_E enViMode = SAMPLE_VI_MODE_8_720P;
VIDEO_NORM_E enNorm = VIDEO_ENCODING_MODE_PAL;
HI_U32 u32ViChnCnt = 8;
HI_S32 s32VpssGrpCnt = 8;
VB_CONF_S stVbConf;
VPSS_GRP VpssGrp;
VPSS_GRP_ATTR_S stGrpAttr;
VPSS_CHN VpssChn_Venc0 = VPSS_CHN0;
VPSS_CHN VpssChn_VoHD0 = VPSS_CHN1;
VPSS_CHN VpssChn_VoHD1 = VPSS_CHN2;
VPSS_CHN VpssChn_VoSD0 = VPSS_CHN3;
VO_DEV VoDev;
VO_LAYER VoLayer;
VO_CHN VoChn;
VO_PUB_ATTR_S stVoPubAttr_hd0, stVoPubAttr_hd1, stVoPubAttr_sd;
VO_VIDEO_LAYER_ATTR_S stLayerAttr;
SAMPLE_VO_MODE_E enVoMode, enPreVoMode;
HI_S32 i;
HI_S32 s32Ret = HI_SUCCESS;
HI_U32 u32BlkSize;
HI_S32 ch;
SIZE_S stSize;
HI_U32 u32WndNum;
HI_U32 vichn;
HI_U32 VpssChn = 0;
HI_U32 VencChn = 0;
PAYLOAD_TYPE_E enPayLoad[2]= {PT_H264,PT_H264};
PIC_SIZE_E enSize[2] = {PIC_HD720, PIC_D1};
HI_U32 u32Profile = 0;
SAMPLE_RC_E enRcMode = SAMPLE_RC_VBR;
HI_U32 u32ViMaxDevCnt = VIU_MAX_DEV_NUM;
u32ViMaxDevCnt = SAMPLE_COMM_VI_GetMaxDev(g_u32ChipId);
u32ViChnCnt = u32ViMaxDevCnt;
if(u32ViChnCnt == 2)
enViMode = SAMPLE_VI_MODE_2_1080P;
/******************************************
step 1: init variable
******************************************/
memset(&stVbConf,0,sizeof(VB_CONF_S));
u32BlkSize = SAMPLE_COMM_SYS_CalcPicVbBlkSize(enNorm,\
PIC_HD720, SAMPLE_PIXEL_FORMAT, SAMPLE_SYS_ALIGN_WIDTH,COMPRESS_MODE_SEG);
stVbConf.u32MaxPoolCnt = 128;
/* video buffer*/
//todo: vb=15
stVbConf.astCommPool[0].u32BlkSize = u32BlkSize;
stVbConf.astCommPool[0].u32BlkCnt = u32ViChnCnt * 16;
stVbConf.astCommPool[1].u32BlkSize = u32BlkSize + 512 * 1024;
stVbConf.astCommPool[1].u32BlkCnt = u32ViChnCnt * 8;
/******************************************
step 2: mpp system init.
******************************************/
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConf);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("system init failed with %d!\n", s32Ret);
goto END_8_1080P_0;
}
// a_here
#if 1
// Init var
RGN_HANDLE Handle;
RGN_ATTR_S stRgnAttr = {0};
Handle = 0;
stRgnAttr.enType = OVERLAY_RGN;
stRgnAttr.unAttr.stOverlay.enPixelFmt = PIXEL_FORMAT_RGB_1555;
stRgnAttr.unAttr.stOverlay.stSize.u32Width = 16;
stRgnAttr.unAttr.stOverlay.stSize.u32Height = 16;
stRgnAttr.unAttr.stOverlay.u32BgColor = 0x0000ffff;
// Create rgn
s32Ret = HI_MPI_RGN_Create( Handle, &stRgnAttr );
if( s32Ret != HI_SUCCESS )
{
printf( "HI_MPI_RGN_Create() failed with %d!\n", s32Ret );
goto END_8_1080P_0;
}
// Set rgn attr
s32Ret = HI_MPI_RGN_SetAttr( Handle,&stRgnAttr );
if(s32Ret != HI_SUCCESS)
{
printf( "HI_MPI_RGN_SetAttr() failed with %d!\n", s32Ret );
goto END_8_1080P_0;
}
#endif
关键代码如下:
SAMPLE_VI_MODE_E enViMode = SAMPLE_VI_MODE_8_720P;
VIDEO_NORM_E enNorm = VIDEO_ENCODING_MODE_PAL;
HI_U32 u32ViChnCnt = 8;
HI_S32 s32VpssGrpCnt = 8;
VB_CONF_S stVbConf;
VPSS_GRP VpssGrp;
VPSS_GRP_ATTR_S stGrpAttr;
VPSS_CHN VpssChn_Venc0 = VPSS_CHN0;
VPSS_CHN VpssChn_VoHD0 = VPSS_CHN1;
VPSS_CHN VpssChn_VoHD1 = VPSS_CHN2;
VPSS_CHN VpssChn_VoSD0 = VPSS_CHN3;
VO_DEV VoDev;
VO_LAYER VoLayer;
VO_CHN VoChn;
VO_PUB_ATTR_S stVoPubAttr_hd0, stVoPubAttr_hd1, stVoPubAttr_sd;
VO_VIDEO_LAYER_ATTR_S stLayerAttr;
SAMPLE_VO_MODE_E enVoMode, enPreVoMode;
HI_S32 i;
HI_S32 s32Ret = HI_SUCCESS;
HI_U32 u32BlkSize;
HI_S32 ch;
SIZE_S stSize;
HI_U32 u32WndNum;
HI_U32 vichn;
HI_U32 VpssChn = 0;
HI_U32 VencChn = 0;
PAYLOAD_TYPE_E enPayLoad[2]= {PT_H264,PT_H264};
PIC_SIZE_E enSize[2] = {PIC_HD720, PIC_D1};
HI_U32 u32Profile = 0;
SAMPLE_RC_E enRcMode = SAMPLE_RC_VBR;
HI_U32 u32ViMaxDevCnt = VIU_MAX_DEV_NUM;
u32ViMaxDevCnt = SAMPLE_COMM_VI_GetMaxDev(g_u32ChipId);
u32ViChnCnt = u32ViMaxDevCnt;
if(u32ViChnCnt == 2)
enViMode = SAMPLE_VI_MODE_2_1080P;
/******************************************
step 1: init variable
******************************************/
memset(&stVbConf,0,sizeof(VB_CONF_S));
u32BlkSize = SAMPLE_COMM_SYS_CalcPicVbBlkSize(enNorm,\
PIC_HD720, SAMPLE_PIXEL_FORMAT, SAMPLE_SYS_ALIGN_WIDTH,COMPRESS_MODE_SEG);
stVbConf.u32MaxPoolCnt = 128;
/* video buffer*/
//todo: vb=15
stVbConf.astCommPool[0].u32BlkSize = u32BlkSize;
stVbConf.astCommPool[0].u32BlkCnt = u32ViChnCnt * 16;
stVbConf.astCommPool[1].u32BlkSize = u32BlkSize + 512 * 1024;
stVbConf.astCommPool[1].u32BlkCnt = u32ViChnCnt * 8;
/******************************************
step 2: mpp system init.
******************************************/
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConf);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("system init failed with %d!\n", s32Ret);
goto END_8_1080P_0;
}
// a_here
#if 1
// Init var
RGN_HANDLE Handle;
RGN_ATTR_S stRgnAttr = {0};
Handle = 0;
stRgnAttr.enType = OVERLAY_RGN;
stRgnAttr.unAttr.stOverlay.enPixelFmt = PIXEL_FORMAT_RGB_1555;
stRgnAttr.unAttr.stOverlay.stSize.u32Width = 16;
stRgnAttr.unAttr.stOverlay.stSize.u32Height = 16;
stRgnAttr.unAttr.stOverlay.u32BgColor = 0x0000ffff;
// Create rgn
s32Ret = HI_MPI_RGN_Create( Handle, &stRgnAttr );
if( s32Ret != HI_SUCCESS )
{
printf( "HI_MPI_RGN_Create() failed with %d!\n", s32Ret );
goto END_8_1080P_0;
}
// Set rgn attr
s32Ret = HI_MPI_RGN_SetAttr( Handle,&stRgnAttr );
if(s32Ret != HI_SUCCESS)
{
printf( "HI_MPI_RGN_SetAttr() failed with %d!\n", s32Ret );
goto END_8_1080P_0;
}
#endif
我来回答
回答0个
时间排序
认可量排序
暂无数据
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2018-03-28 13:30:30
-
2018-12-15 11:02:11
-
2019-06-04 09:01:01
-
2019-01-12 11:27:38
-
2020-10-19 18:34:52
-
2018-11-19 13:50:02
-
2019-01-25 11:05:32
-
2019-12-11 09:25:54
-
2023-08-31 11:33:39
-
2018-08-01 16:14:09
-
112019-03-29 18:22:17
-
2019-07-09 11:12:50
-
2021-02-05 15:30:47
-
2021-03-09 15:39:19
-
2019-04-19 13:57:00
-
2019-03-28 14:24:26
-
2019-05-31 15:58:45
-
12021-06-22 10:34:35
-
2019-06-25 10:59:08
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
5Hi3516CV610 如何使用SD卡升级固件
-
5cat /dev/logmpp 报错 <3>[ vi] [func]:vi_send_frame_node [line]:99 [info]:vi pic queue is full!
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认