10934
- 收藏
- 点赞
- 分享
- 举报
HI_MPI_VI_GetFrame出错,错误码0xA010800E
今天调试的时候,使用HI_MPI_VI_GetFrame接口获取图像数据,但是函数出错,错误码为:0xA010800E
查看spec发现错误码的解释如下:
0xA010800E HI_ERR_VI_BUF_EMPTY 视频输入缓存为空
但是不明白是什么意思,有没有给解释一下??
代码如下:
[code]/******************************************************************************
A simple program of Hisilicon Hi35xx video encode implementation.
Copyright (C), 2010-2011, Hisilicon Tech. Co., Ltd.
******************************************************************************
Modification: 2011-2 Created
******************************************************************************/
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* End of #ifdef __cplusplus */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "sample_comm.h"
#include "../../include/hi_comm_vgs.h"
VIDEO_NORM_E gs_enNorm = VIDEO_ENCODING_MODE_NTSC;
VI_DEV_ATTR_S DEV_ATTR_TEST_BASE =
{
/* interface mode */
VI_MODE_DIGITAL_CAMERA,
/*VI_MODE_DIGITAL_CAMERA,*/
/* multiplex mode */
VI_WORK_MODE_1Multiplex,
/* r_mask g_mask b_mask*/
{0xFFF00000, 0x0},
/* progessive or interleaving */
VI_SCAN_PROGRESSIVE,
/*AdChnId*/
{ -1, -1, -1, -1},
/*enDataSeq, only support yuv*/
VI_INPUT_DATA_YUYV,
/* synchronization information */
{
/*port_vsync port_vsync_neg port_hsync port_hsync_neg */
VI_VSYNC_PULSE, VI_VSYNC_NEG_LOW, VI_HSYNC_VALID_SINGNAL, VI_HSYNC_NEG_HIGH, VI_VSYNC_VALID_SINGAL, VI_VSYNC_VALID_NEG_HIGH,
/*hsync_hfb hsync_act hsync_hhb*/
{
0, 1280, 0,
/*vsync0_vhb vsync0_act vsync0_hhb*/
0, 720, 0,
/*vsync1_vhb vsync1_act vsync1_hhb*/
0, 0, 0
}
},
/* use interior ISP */
/*VI_PATH_ISP,*/
VI_PATH_BYPASS,
/* input data type */
VI_DATA_TYPE_RGB,
/* bRever */
HI_FALSE,
/* DEV CROP */
{0, 0, 1920, 1080}
};
/******************************************************************************
* function : main()
* Description : video venc sample
******************************************************************************/
int main(int argc, char* argv[])
{
HI_S32 s32Ret;
PIC_SIZE_E enSize = PIC_HD1080;
HI_U32 u32BlkSize;
VB_CONF_S stVbConf;
memset(&stVbConf, 0, sizeof(VB_CONF_S));
stVbConf.u32MaxPoolCnt = 128;
SAMPLE_COMM_VI_GetSizeBySensor(&enSize);
printf("SAMPLE_COMM_VI_GetSizeBySensor = %d\n", PIC_HD1080);
/*video buffer*/
u32BlkSize = SAMPLE_COMM_SYS_CalcPicVbBlkSize(gs_enNorm, \
enSize, SAMPLE_PIXEL_FORMAT, SAMPLE_SYS_ALIGN_WIDTH);
printf("SAMPLE_COMM_SYS_CalcPicVbBlkSize = %d\n", u32BlkSize);
stVbConf.astCommPool[0].u32BlkSize = u32BlkSize;
stVbConf.astCommPool[0].u32BlkCnt = 24;
/******************************************
step 2: mpp system init.
******************************************/
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConf);
if (HI_SUCCESS != s32Ret)
{
printf("system init failed with %d!\n", s32Ret);
return -1;
}
//ISP
s32Ret = SAMPLE_COMM_ISP_Init(WDR_MODE_NONE);
if (HI_SUCCESS != s32Ret)
{
printf("%s: Sensor init failed!\n", __FUNCTION__);
return HI_FAILURE;
}
/******************************************
step 3: run isp thread
note: you can jump over this step, if you do not use Hi3516A interal isp.
******************************************/
s32Ret = SAMPLE_COMM_ISP_Run();
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("%s: ISP init failed!\n", __FUNCTION__);
/* disable videv */
return HI_FAILURE;
}
//Enable dev and ch
VI_DEV ViDev = 0;
VI_CHN ViChn = 0;
VI_DEV_ATTR_S stDevAttr;
VI_CHN_ATTR_S stChnAttr;
memcpy(&stDevAttr, &DEV_ATTR_TEST_BASE, sizeof(stDevAttr));
/*stDevAttr.enIntfMode = VI_MODE_DIGITAL_CAMERA;*/
stDevAttr.enIntfMode = VI_MODE_HISPI;
stDevAttr.enWorkMode = VI_WORK_MODE_1Multiplex;
stDevAttr.au32CompMask[0] = 0xFFF00000;
stDevAttr.au32CompMask[1] = 0x0;
stDevAttr.enScanMode = VI_SCAN_PROGRESSIVE;
stDevAttr.s32AdChnId[0] = -1;
stDevAttr.s32AdChnId[1] = -1;
stDevAttr.s32AdChnId[2] = -1;
stDevAttr.s32AdChnId[3] = -1;
stDevAttr.stDevRect.s32X = 0;
stDevAttr.stDevRect.s32Y = 0;
stDevAttr.stDevRect.u32Width = 1920;
stDevAttr.stDevRect.u32Height = 1080;
printf("set HI_MPI_VI_SetDevAttr\n");
s32Ret = HI_MPI_VI_SetDevAttr(ViDev, &stDevAttr);
if (s32Ret != HI_SUCCESS)
{
printf("Set dev attributes failed with error code %#x!\n", s32Ret);
return HI_FAILURE;
}
printf("set HI_MPI_VI_EnableDev\n");
s32Ret = HI_MPI_VI_EnableDev(ViDev);
if (s32Ret != HI_SUCCESS)
{
printf("Enable dev failed with error code %#x!\n", s32Ret);
return HI_FAILURE;
}
stChnAttr.stCapRect.s32X = 0;
stChnAttr.stCapRect.s32Y = 0;
stChnAttr.stCapRect.u32Width = 1920;
stChnAttr.stCapRect.u32Height = 1080;
stChnAttr.stDestSize.u32Width = 1920;
stChnAttr.stDestSize.u32Height = 1080;
stChnAttr.enCapSel = VI_CAPSEL_BOTH;
stChnAttr.enPixFormat = PIXEL_FORMAT_YUV_SEMIPLANAR_420;
stChnAttr.bMirror = HI_FALSE;
stChnAttr.bFlip = HI_FALSE;
stChnAttr.s32SrcFrameRate = -1;
stChnAttr.s32DstFrameRate = -1;
stChnAttr. enCompressMode = COMPRESS_MODE_NONE;
s32Ret = HI_MPI_VI_SetChnAttr(ViChn,&stChnAttr);
if (s32Ret != HI_SUCCESS)
{
printf("Set chn attributes failed with error code %#x!\n", s32Ret);
return HI_FAILURE;
}
s32Ret = HI_MPI_VI_EnableChn(ViChn);
if (s32Ret != HI_SUCCESS)
{
printf("Enable chn failed with error code %#x!\n", s32Ret);
return HI_FAILURE;
}
/*************************************************************/
VIDEO_FRAME_INFO_S stFrame;
if (s32Ret = HI_MPI_VI_SetFrameDepth(ViChn, 3))
{
printf("HI_MPI_VI_SetFrameDepth err, vi chn %d , ret = 0x%08x\n", ViChn, s32Ret);
return HI_FAILURE;
}
usleep(90000);
if (s32Ret = HI_MPI_VI_GetFrame(ViChn, &stFrame, 10000))
{
printf("HI_MPI_VI_GetFrame err, vi chn %d , ret = 0x%08x\n", ViChn, s32Ret);
return -1;
}
/*************************************************************/
/* now, vi is capturing images, you can do something else ... */
s32Ret = HI_MPI_VI_DisableChn(ViChn);
if (s32Ret != HI_SUCCESS)
{
printf("Disable chn failed with error code %#x!\n", s32Ret);
return HI_FAILURE;
}
s32Ret = HI_MPI_VI_DisableDev(ViDev);
if (s32Ret != HI_SUCCESS)
{
printf("Disable dev failed with error code %#x!\n", s32Ret);
return HI_FAILURE;
}
if (HI_SUCCESS == s32Ret)
{ printf("program exit normally!\n"); }
else
{ printf("program exit abnormally!\n"); }
exit(s32Ret);
}
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* End of #ifdef __cplusplus */[/code]
查看spec发现错误码的解释如下:
0xA010800E HI_ERR_VI_BUF_EMPTY 视频输入缓存为空
但是不明白是什么意思,有没有给解释一下??
代码如下:
[code]/******************************************************************************
A simple program of Hisilicon Hi35xx video encode implementation.
Copyright (C), 2010-2011, Hisilicon Tech. Co., Ltd.
******************************************************************************
Modification: 2011-2 Created
******************************************************************************/
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* End of #ifdef __cplusplus */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "sample_comm.h"
#include "../../include/hi_comm_vgs.h"
VIDEO_NORM_E gs_enNorm = VIDEO_ENCODING_MODE_NTSC;
VI_DEV_ATTR_S DEV_ATTR_TEST_BASE =
{
/* interface mode */
VI_MODE_DIGITAL_CAMERA,
/*VI_MODE_DIGITAL_CAMERA,*/
/* multiplex mode */
VI_WORK_MODE_1Multiplex,
/* r_mask g_mask b_mask*/
{0xFFF00000, 0x0},
/* progessive or interleaving */
VI_SCAN_PROGRESSIVE,
/*AdChnId*/
{ -1, -1, -1, -1},
/*enDataSeq, only support yuv*/
VI_INPUT_DATA_YUYV,
/* synchronization information */
{
/*port_vsync port_vsync_neg port_hsync port_hsync_neg */
VI_VSYNC_PULSE, VI_VSYNC_NEG_LOW, VI_HSYNC_VALID_SINGNAL, VI_HSYNC_NEG_HIGH, VI_VSYNC_VALID_SINGAL, VI_VSYNC_VALID_NEG_HIGH,
/*hsync_hfb hsync_act hsync_hhb*/
{
0, 1280, 0,
/*vsync0_vhb vsync0_act vsync0_hhb*/
0, 720, 0,
/*vsync1_vhb vsync1_act vsync1_hhb*/
0, 0, 0
}
},
/* use interior ISP */
/*VI_PATH_ISP,*/
VI_PATH_BYPASS,
/* input data type */
VI_DATA_TYPE_RGB,
/* bRever */
HI_FALSE,
/* DEV CROP */
{0, 0, 1920, 1080}
};
/******************************************************************************
* function : main()
* Description : video venc sample
******************************************************************************/
int main(int argc, char* argv[])
{
HI_S32 s32Ret;
PIC_SIZE_E enSize = PIC_HD1080;
HI_U32 u32BlkSize;
VB_CONF_S stVbConf;
memset(&stVbConf, 0, sizeof(VB_CONF_S));
stVbConf.u32MaxPoolCnt = 128;
SAMPLE_COMM_VI_GetSizeBySensor(&enSize);
printf("SAMPLE_COMM_VI_GetSizeBySensor = %d\n", PIC_HD1080);
/*video buffer*/
u32BlkSize = SAMPLE_COMM_SYS_CalcPicVbBlkSize(gs_enNorm, \
enSize, SAMPLE_PIXEL_FORMAT, SAMPLE_SYS_ALIGN_WIDTH);
printf("SAMPLE_COMM_SYS_CalcPicVbBlkSize = %d\n", u32BlkSize);
stVbConf.astCommPool[0].u32BlkSize = u32BlkSize;
stVbConf.astCommPool[0].u32BlkCnt = 24;
/******************************************
step 2: mpp system init.
******************************************/
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConf);
if (HI_SUCCESS != s32Ret)
{
printf("system init failed with %d!\n", s32Ret);
return -1;
}
//ISP
s32Ret = SAMPLE_COMM_ISP_Init(WDR_MODE_NONE);
if (HI_SUCCESS != s32Ret)
{
printf("%s: Sensor init failed!\n", __FUNCTION__);
return HI_FAILURE;
}
/******************************************
step 3: run isp thread
note: you can jump over this step, if you do not use Hi3516A interal isp.
******************************************/
s32Ret = SAMPLE_COMM_ISP_Run();
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("%s: ISP init failed!\n", __FUNCTION__);
/* disable videv */
return HI_FAILURE;
}
//Enable dev and ch
VI_DEV ViDev = 0;
VI_CHN ViChn = 0;
VI_DEV_ATTR_S stDevAttr;
VI_CHN_ATTR_S stChnAttr;
memcpy(&stDevAttr, &DEV_ATTR_TEST_BASE, sizeof(stDevAttr));
/*stDevAttr.enIntfMode = VI_MODE_DIGITAL_CAMERA;*/
stDevAttr.enIntfMode = VI_MODE_HISPI;
stDevAttr.enWorkMode = VI_WORK_MODE_1Multiplex;
stDevAttr.au32CompMask[0] = 0xFFF00000;
stDevAttr.au32CompMask[1] = 0x0;
stDevAttr.enScanMode = VI_SCAN_PROGRESSIVE;
stDevAttr.s32AdChnId[0] = -1;
stDevAttr.s32AdChnId[1] = -1;
stDevAttr.s32AdChnId[2] = -1;
stDevAttr.s32AdChnId[3] = -1;
stDevAttr.stDevRect.s32X = 0;
stDevAttr.stDevRect.s32Y = 0;
stDevAttr.stDevRect.u32Width = 1920;
stDevAttr.stDevRect.u32Height = 1080;
printf("set HI_MPI_VI_SetDevAttr\n");
s32Ret = HI_MPI_VI_SetDevAttr(ViDev, &stDevAttr);
if (s32Ret != HI_SUCCESS)
{
printf("Set dev attributes failed with error code %#x!\n", s32Ret);
return HI_FAILURE;
}
printf("set HI_MPI_VI_EnableDev\n");
s32Ret = HI_MPI_VI_EnableDev(ViDev);
if (s32Ret != HI_SUCCESS)
{
printf("Enable dev failed with error code %#x!\n", s32Ret);
return HI_FAILURE;
}
stChnAttr.stCapRect.s32X = 0;
stChnAttr.stCapRect.s32Y = 0;
stChnAttr.stCapRect.u32Width = 1920;
stChnAttr.stCapRect.u32Height = 1080;
stChnAttr.stDestSize.u32Width = 1920;
stChnAttr.stDestSize.u32Height = 1080;
stChnAttr.enCapSel = VI_CAPSEL_BOTH;
stChnAttr.enPixFormat = PIXEL_FORMAT_YUV_SEMIPLANAR_420;
stChnAttr.bMirror = HI_FALSE;
stChnAttr.bFlip = HI_FALSE;
stChnAttr.s32SrcFrameRate = -1;
stChnAttr.s32DstFrameRate = -1;
stChnAttr. enCompressMode = COMPRESS_MODE_NONE;
s32Ret = HI_MPI_VI_SetChnAttr(ViChn,&stChnAttr);
if (s32Ret != HI_SUCCESS)
{
printf("Set chn attributes failed with error code %#x!\n", s32Ret);
return HI_FAILURE;
}
s32Ret = HI_MPI_VI_EnableChn(ViChn);
if (s32Ret != HI_SUCCESS)
{
printf("Enable chn failed with error code %#x!\n", s32Ret);
return HI_FAILURE;
}
/*************************************************************/
VIDEO_FRAME_INFO_S stFrame;
if (s32Ret = HI_MPI_VI_SetFrameDepth(ViChn, 3))
{
printf("HI_MPI_VI_SetFrameDepth err, vi chn %d , ret = 0x%08x\n", ViChn, s32Ret);
return HI_FAILURE;
}
usleep(90000);
if (s32Ret = HI_MPI_VI_GetFrame(ViChn, &stFrame, 10000))
{
printf("HI_MPI_VI_GetFrame err, vi chn %d , ret = 0x%08x\n", ViChn, s32Ret);
return -1;
}
/*************************************************************/
/* now, vi is capturing images, you can do something else ... */
s32Ret = HI_MPI_VI_DisableChn(ViChn);
if (s32Ret != HI_SUCCESS)
{
printf("Disable chn failed with error code %#x!\n", s32Ret);
return HI_FAILURE;
}
s32Ret = HI_MPI_VI_DisableDev(ViDev);
if (s32Ret != HI_SUCCESS)
{
printf("Disable dev failed with error code %#x!\n", s32Ret);
return HI_FAILURE;
}
if (HI_SUCCESS == s32Ret)
{ printf("program exit normally!\n"); }
else
{ printf("program exit abnormally!\n"); }
exit(s32Ret);
}
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* End of #ifdef __cplusplus */[/code]
我来回答
回答5个
时间排序
认可量排序
认可0
认可0
认可0
认可0
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2016-08-01 09:32:42
-
2016-07-18 14:49:27
-
2019-03-08 10:57:11
-
2017-08-24 22:16:35
-
2020-06-03 15:44:54
-
2015-06-15 11:12:24
-
2018-10-22 10:31:09
-
2019-12-20 12:02:51
-
2016-07-01 14:58:43
-
2016-01-13 15:20:50
-
52015-06-17 15:56:41
-
2016-11-03 16:08:16
-
2020-01-14 11:54:49
-
2020-01-14 11:55:22
-
2018-08-28 17:32:18
-
2015-04-27 09:42:02
-
2017-02-22 22:24:53
-
2018-10-24 22:07:28
-
2017-07-05 09:57:16
无更多相似问答 去提问
点击登录
-- 积分
-- 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币)
取消
确认