20555
- 收藏
- 点赞
- 分享
- 举报
HI3531 VPSS工作模式
我刚开始学习3531,基于sample vdec,写了一个显示jpeg图像到DHD0的程序
程序能正常工作,但是如果我试图调用HI_MPI_VPSS_SetChnMode设置工作模式为VPSS_CHN_MODE_USER,程序不报错,但是显示无图像。
[code]int startVpss() {/*{{{*/
VPSS_GRP vpssGrp;
VPSS_CHN vpssChn;
VPSS_GRP_ATTR_S stGrpAttr;
VPSS_CHN_ATTR_S stChnAttr;
VPSS_GRP_PARAM_S stVpssParam;
VPSS_CHN_MODE_S stChnMode;
HI_S32 s32Ret;
stGrpAttr.u32MaxW = 2048;
stGrpAttr.u32MaxH = 2048;
stGrpAttr.bDrEn = HI_FALSE;
stGrpAttr.bDbEn = HI_FALSE;
stGrpAttr.bIeEn = HI_TRUE;
stGrpAttr.bNrEn = HI_TRUE;
stGrpAttr.bHistEn = HI_FALSE;
stGrpAttr.enDieMode = VPSS_DIE_MODE_AUTO;
stGrpAttr.enPixFmt = SAMPLE_PIXEL_FORMAT;
vpssGrp = 0;
/*** create vpss group ***/
s32Ret = HI_MPI_VPSS_CreateGrp(vpssGrp, &stGrpAttr);
if (s32Ret != HI_SUCCESS) {
SAMPLE_PRT("HI_MPI_VPSS_CreateGrp failed with 0x%#x!\n", s32Ret);
return HI_FAILURE;
}
/*** set vpss param ***/
s32Ret = HI_MPI_VPSS_GetGrpParam(vpssGrp, &stVpssParam);
if (s32Ret != HI_SUCCESS) {
SAMPLE_PRT("HI_MPI_VPSS_GetGrpParam failed with 0x%#x!\n", s32Ret);
return HI_FAILURE;
}
stVpssParam.u32MotionThresh = 0;
s32Ret = HI_MPI_VPSS_SetGrpParam(vpssGrp, &stVpssParam);
if (s32Ret != HI_SUCCESS) {
SAMPLE_PRT("HI_MPI_VPSS_SetGrpParam failed with 0x%#x!\n", s32Ret);
return HI_FAILURE;
}
/*** enable vpss chn, with frame ***/
vpssChn = 2;
/* Set Vpss Chn attr */
stChnAttr.bSpEn = HI_FALSE;
stChnAttr.bFrameEn = HI_TRUE;
stChnAttr.stFrame.u32Color[VPSS_FRAME_WORK_LEFT] = 0xff00;
stChnAttr.stFrame.u32Color[VPSS_FRAME_WORK_RIGHT] = 0xff00;
stChnAttr.stFrame.u32Color[VPSS_FRAME_WORK_BOTTOM] = 0xff00;
stChnAttr.stFrame.u32Color[VPSS_FRAME_WORK_TOP] = 0xff00;
stChnAttr.stFrame.u32Width[VPSS_FRAME_WORK_LEFT] = 2;
stChnAttr.stFrame.u32Width[VPSS_FRAME_WORK_RIGHT] = 2;
stChnAttr.stFrame.u32Width[VPSS_FRAME_WORK_TOP] = 2;
stChnAttr.stFrame.u32Width[VPSS_FRAME_WORK_BOTTOM] = 2;
s32Ret = HI_MPI_VPSS_SetChnAttr(vpssGrp, vpssChn, &stChnAttr);
if (s32Ret != HI_SUCCESS) {
SAMPLE_PRT("HI_MPI_VPSS_SetChnAttr failed with 0x%#x\n", s32Ret);
return HI_FAILURE;
}
stChnMode.enChnMode = VPSS_CHN_MODE_USER;
stChnMode.enPixelFormat = SAMPLE_PIXEL_FORMAT;
stChnMode.bDouble = HI_FALSE;
stChnMode.u32Width = 1920;
stChnMode.u32Height = 1080;
//s32Ret = HI_MPI_VPSS_SetChnMode(vpssGrp, vpssChn, &stChnMode); // <---------------------- 调用这个就不显示图像
//if(s32Ret != HI_SUCCESS) {
// SAMPLE_PRT("HI_MPI_VPSS_SetChnMode failed with %#x\n", s32Ret);
// return HI_FAILURE;
//}
s32Ret = HI_MPI_VPSS_EnableChn(vpssGrp, vpssChn);
if (s32Ret != HI_SUCCESS) {
SAMPLE_PRT("HI_MPI_VPSS_EnableChn failed with 0x%#x\n", s32Ret);
return HI_FAILURE;
}
/*** start vpss group ***/
s32Ret = HI_MPI_VPSS_StartGrp(vpssGrp);
if (s32Ret != HI_SUCCESS) {
SAMPLE_PRT("HI_MPI_VPSS_StartGrp failed with 0x%#x\n", s32Ret);
return HI_FAILURE;
}
return HI_SUCCESS;
}/*}}}*/
[/code]
1.默认AUTO模式下,可以正常显示图像。VPSS从哪里自动得到相应的配置?是从绑定到的VO得到的吗?
2.我这里应该如何设置才能正常显示图像呢?
P.S. 我看到文档里说如果要用到虚拟VO,就得设置VPSS的模式为USER,所以我想先在DHD0试试这个API
程序能正常工作,但是如果我试图调用HI_MPI_VPSS_SetChnMode设置工作模式为VPSS_CHN_MODE_USER,程序不报错,但是显示无图像。
[code]int startVpss() {/*{{{*/
VPSS_GRP vpssGrp;
VPSS_CHN vpssChn;
VPSS_GRP_ATTR_S stGrpAttr;
VPSS_CHN_ATTR_S stChnAttr;
VPSS_GRP_PARAM_S stVpssParam;
VPSS_CHN_MODE_S stChnMode;
HI_S32 s32Ret;
stGrpAttr.u32MaxW = 2048;
stGrpAttr.u32MaxH = 2048;
stGrpAttr.bDrEn = HI_FALSE;
stGrpAttr.bDbEn = HI_FALSE;
stGrpAttr.bIeEn = HI_TRUE;
stGrpAttr.bNrEn = HI_TRUE;
stGrpAttr.bHistEn = HI_FALSE;
stGrpAttr.enDieMode = VPSS_DIE_MODE_AUTO;
stGrpAttr.enPixFmt = SAMPLE_PIXEL_FORMAT;
vpssGrp = 0;
/*** create vpss group ***/
s32Ret = HI_MPI_VPSS_CreateGrp(vpssGrp, &stGrpAttr);
if (s32Ret != HI_SUCCESS) {
SAMPLE_PRT("HI_MPI_VPSS_CreateGrp failed with 0x%#x!\n", s32Ret);
return HI_FAILURE;
}
/*** set vpss param ***/
s32Ret = HI_MPI_VPSS_GetGrpParam(vpssGrp, &stVpssParam);
if (s32Ret != HI_SUCCESS) {
SAMPLE_PRT("HI_MPI_VPSS_GetGrpParam failed with 0x%#x!\n", s32Ret);
return HI_FAILURE;
}
stVpssParam.u32MotionThresh = 0;
s32Ret = HI_MPI_VPSS_SetGrpParam(vpssGrp, &stVpssParam);
if (s32Ret != HI_SUCCESS) {
SAMPLE_PRT("HI_MPI_VPSS_SetGrpParam failed with 0x%#x!\n", s32Ret);
return HI_FAILURE;
}
/*** enable vpss chn, with frame ***/
vpssChn = 2;
/* Set Vpss Chn attr */
stChnAttr.bSpEn = HI_FALSE;
stChnAttr.bFrameEn = HI_TRUE;
stChnAttr.stFrame.u32Color[VPSS_FRAME_WORK_LEFT] = 0xff00;
stChnAttr.stFrame.u32Color[VPSS_FRAME_WORK_RIGHT] = 0xff00;
stChnAttr.stFrame.u32Color[VPSS_FRAME_WORK_BOTTOM] = 0xff00;
stChnAttr.stFrame.u32Color[VPSS_FRAME_WORK_TOP] = 0xff00;
stChnAttr.stFrame.u32Width[VPSS_FRAME_WORK_LEFT] = 2;
stChnAttr.stFrame.u32Width[VPSS_FRAME_WORK_RIGHT] = 2;
stChnAttr.stFrame.u32Width[VPSS_FRAME_WORK_TOP] = 2;
stChnAttr.stFrame.u32Width[VPSS_FRAME_WORK_BOTTOM] = 2;
s32Ret = HI_MPI_VPSS_SetChnAttr(vpssGrp, vpssChn, &stChnAttr);
if (s32Ret != HI_SUCCESS) {
SAMPLE_PRT("HI_MPI_VPSS_SetChnAttr failed with 0x%#x\n", s32Ret);
return HI_FAILURE;
}
stChnMode.enChnMode = VPSS_CHN_MODE_USER;
stChnMode.enPixelFormat = SAMPLE_PIXEL_FORMAT;
stChnMode.bDouble = HI_FALSE;
stChnMode.u32Width = 1920;
stChnMode.u32Height = 1080;
//s32Ret = HI_MPI_VPSS_SetChnMode(vpssGrp, vpssChn, &stChnMode); // <---------------------- 调用这个就不显示图像
//if(s32Ret != HI_SUCCESS) {
// SAMPLE_PRT("HI_MPI_VPSS_SetChnMode failed with %#x\n", s32Ret);
// return HI_FAILURE;
//}
s32Ret = HI_MPI_VPSS_EnableChn(vpssGrp, vpssChn);
if (s32Ret != HI_SUCCESS) {
SAMPLE_PRT("HI_MPI_VPSS_EnableChn failed with 0x%#x\n", s32Ret);
return HI_FAILURE;
}
/*** start vpss group ***/
s32Ret = HI_MPI_VPSS_StartGrp(vpssGrp);
if (s32Ret != HI_SUCCESS) {
SAMPLE_PRT("HI_MPI_VPSS_StartGrp failed with 0x%#x\n", s32Ret);
return HI_FAILURE;
}
return HI_SUCCESS;
}/*}}}*/
[/code]
1.默认AUTO模式下,可以正常显示图像。VPSS从哪里自动得到相应的配置?是从绑定到的VO得到的吗?
2.我这里应该如何设置才能正常显示图像呢?
P.S. 我看到文档里说如果要用到虚拟VO,就得设置VPSS的模式为USER,所以我想先在DHD0试试这个API
我来回答
回答24个
时间排序
认可量排序
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
加载中···
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2016-04-10 17:45:15
-
2017-08-15 11:28:28
-
2016-08-18 11:01:26
-
2014-03-04 16:07:05
-
2022-03-04 15:35:16
-
2018-07-03 16:16:49
-
12016-04-12 16:51:45
-
12016-01-18 23:22:46
-
2019-10-25 18:40:13
-
2017-07-27 14:10:29
-
2018-07-05 14:24:36
-
2016-04-13 17:17:09
-
2015-10-09 15:20:25
-
02014-01-14 17:16:59
-
2015-11-06 02:07:02
-
2014-06-23 22:40:48
-
02019-10-19 09:19:38
-
2018-01-04 09:29:21
-
2016-03-09 11: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币)
取消
确认