2089
- 收藏
- 点赞
- 分享
- 举报
3519 VO 发送自己修改过的图像,一直是蓝屏
HI_S32 s32Ret;
HI_S32 s32MilliSec = -1;
VB_BLK VbBlk;
HI_U64 u64PhyAddr;
HI_U8 *pVirAddr;
//VB_POOL u32PoolId;
HI_U32 u32Size;
HI_U32 u32Stride;
SAMPLE_VI_FRAME_CONFIG_S stFrmCfg;
VIDEO_FRAME_INFO_S stVoFrameInfo;
stFrmCfg.u32Width = psrcFrameInfo->stVFrame.u32Width;
stFrmCfg.u32Height = psrcFrameInfo->stVFrame.u32Height;
stFrmCfg.u32ByteAlign = 0;
stFrmCfg.enPixelFormat = PIXEL_FORMAT_YUV_SEMIPLANAR_420;
stFrmCfg.enCompressMode = COMPRESS_MODE_NONE;
stFrmCfg.enVideoFormat = VIDEO_FORMAT_LINEAR;
stFrmCfg.enDynamicRange = DYNAMIC_RANGE_SDR8;
u32Stride = psrcFrameInfo->stVFrame.u32Stride[0];
u32Size = u32Stride * stFrmCfg.u32Height*3/2;
printf("u32Stride is %d %d %d\n ",u32Size,u32Stride,stFrmCfg.u32Height);
VbBlk = HI_MPI_VB_GetBlock(u32PoolId, u32Size, HI_NULL);
if (VB_INVALID_HANDLE == VbBlk)
{
SAMPLE_PRT("HI_MPI_VB_GetBlock err! size:%d\n", u32Size);
return HI_FAILURE;
}
u64PhyAddr = HI_MPI_VB_Handle2PhysAddr(VbBlk);
if (0 == u64PhyAddr)
{
SAMPLE_PRT("HI_MPI_VB_Handle2PhysAddr err!\n");
return HI_FAILURE;
}
pVirAddr = (HI_U8 *)HI_MPI_SYS_Mmap(u64PhyAddr, u32Size);
if (NULL == pVirAddr)
{
SAMPLE_PRT("HI_MPI_SYS_Mmap err!\n");
return HI_FAILURE;
}
stVoFrameInfo.u32PoolId = u32PoolId;
stVoFrameInfo.enModId = HI_ID_VI;
stVoFrameInfo.stVFrame.u64PhyAddr[0] = u64PhyAddr;
stVoFrameInfo.stVFrame.u64PhyAddr[1] = stVoFrameInfo.stVFrame.u64PhyAddr[0] + u32Stride*1080;
stVoFrameInfo.stVFrame.u64PhyAddr[2] = stVoFrameInfo.stVFrame.u64PhyAddr[1] + u32Stride*1080;
stVoFrameInfo.stVFrame.u64VirAddr[0] = (HI_U64)(HI_UL)pVirAddr;
stVoFrameInfo.stVFrame.u64VirAddr[1] = stVoFrameInfo.stVFrame.u64VirAddr[0] + u32Stride*1080;
stVoFrameInfo.stVFrame.u64VirAddr[2] = stVoFrameInfo.stVFrame.u64VirAddr[1] + u32Stride*1080;
stVoFrameInfo.stVFrame.u32Stride[0] = u32Stride;
stVoFrameInfo.stVFrame.u32Stride[1] = u32Stride;
stVoFrameInfo.stVFrame.u32Stride[2] = u32Stride;
stVoFrameInfo.stVFrame.u32Width = stFrmCfg.u32Width;
stVoFrameInfo.stVFrame.u32Height = stFrmCfg.u32Height;
stVoFrameInfo.stVFrame.enPixelFormat = stFrmCfg.enPixelFormat;
stVoFrameInfo.stVFrame.enVideoFormat = stFrmCfg.enVideoFormat;
stVoFrameInfo.stVFrame.enCompressMode = stFrmCfg.enCompressMode;
stVoFrameInfo.stVFrame.enField = VIDEO_FIELD_FRAME;
stVoFrameInfo.stVFrame.enDynamicRange = DYNAMIC_RANGE_SDR8;
stVoFrameInfo.stVFrame.enColorGamut = psrcFrameInfo->stVFrame.enColorGamut;
//HI_U8* yPtr = (HI_U8*)HI_MPI_SYS_Mmap(stVoFrameInfo.stVFrame.u64VirAddr[0], u32Size);
printf("config ok\n");
memcpy(pVirAddr,yuvdata,u32Size);
printf("memcpy ok\n");
// s32Ret = HI_MPI_VB_Handle2PoolId(VbBlk);
printf("HI_MPI_VB_Handle2PoolId OK\n");
//直接发送HI_MPI_VPSS_GetChnFrame视频没问题
//s32Ret = HI_MPI_VO_SendFrame(0, 0,psrcFrameInfo,s32MilliSec);
s32Ret = HI_MPI_VO_SendFrame(0, 0,&stVoFrameInfo,s32MilliSec);
//HI_MPI_SYS_Munmap(yPtr, u32Size);
s32Ret = HI_MPI_SYS_Munmap((HI_VOID*)(HI_UL)pVirAddr, u32Size);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("HI_MPI_SYS_Munmap failure!\n");
}
s32Ret = HI_MPI_VB_ReleaseBlock(VbBlk);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("HI_MPI_VB_ReleaseBlock block 0x%x failure\n", VbBlk);
}
HI_S32 s32MilliSec = -1;
VB_BLK VbBlk;
HI_U64 u64PhyAddr;
HI_U8 *pVirAddr;
//VB_POOL u32PoolId;
HI_U32 u32Size;
HI_U32 u32Stride;
SAMPLE_VI_FRAME_CONFIG_S stFrmCfg;
VIDEO_FRAME_INFO_S stVoFrameInfo;
stFrmCfg.u32Width = psrcFrameInfo->stVFrame.u32Width;
stFrmCfg.u32Height = psrcFrameInfo->stVFrame.u32Height;
stFrmCfg.u32ByteAlign = 0;
stFrmCfg.enPixelFormat = PIXEL_FORMAT_YUV_SEMIPLANAR_420;
stFrmCfg.enCompressMode = COMPRESS_MODE_NONE;
stFrmCfg.enVideoFormat = VIDEO_FORMAT_LINEAR;
stFrmCfg.enDynamicRange = DYNAMIC_RANGE_SDR8;
u32Stride = psrcFrameInfo->stVFrame.u32Stride[0];
u32Size = u32Stride * stFrmCfg.u32Height*3/2;
printf("u32Stride is %d %d %d\n ",u32Size,u32Stride,stFrmCfg.u32Height);
VbBlk = HI_MPI_VB_GetBlock(u32PoolId, u32Size, HI_NULL);
if (VB_INVALID_HANDLE == VbBlk)
{
SAMPLE_PRT("HI_MPI_VB_GetBlock err! size:%d\n", u32Size);
return HI_FAILURE;
}
u64PhyAddr = HI_MPI_VB_Handle2PhysAddr(VbBlk);
if (0 == u64PhyAddr)
{
SAMPLE_PRT("HI_MPI_VB_Handle2PhysAddr err!\n");
return HI_FAILURE;
}
pVirAddr = (HI_U8 *)HI_MPI_SYS_Mmap(u64PhyAddr, u32Size);
if (NULL == pVirAddr)
{
SAMPLE_PRT("HI_MPI_SYS_Mmap err!\n");
return HI_FAILURE;
}
stVoFrameInfo.u32PoolId = u32PoolId;
stVoFrameInfo.enModId = HI_ID_VI;
stVoFrameInfo.stVFrame.u64PhyAddr[0] = u64PhyAddr;
stVoFrameInfo.stVFrame.u64PhyAddr[1] = stVoFrameInfo.stVFrame.u64PhyAddr[0] + u32Stride*1080;
stVoFrameInfo.stVFrame.u64PhyAddr[2] = stVoFrameInfo.stVFrame.u64PhyAddr[1] + u32Stride*1080;
stVoFrameInfo.stVFrame.u64VirAddr[0] = (HI_U64)(HI_UL)pVirAddr;
stVoFrameInfo.stVFrame.u64VirAddr[1] = stVoFrameInfo.stVFrame.u64VirAddr[0] + u32Stride*1080;
stVoFrameInfo.stVFrame.u64VirAddr[2] = stVoFrameInfo.stVFrame.u64VirAddr[1] + u32Stride*1080;
stVoFrameInfo.stVFrame.u32Stride[0] = u32Stride;
stVoFrameInfo.stVFrame.u32Stride[1] = u32Stride;
stVoFrameInfo.stVFrame.u32Stride[2] = u32Stride;
stVoFrameInfo.stVFrame.u32Width = stFrmCfg.u32Width;
stVoFrameInfo.stVFrame.u32Height = stFrmCfg.u32Height;
stVoFrameInfo.stVFrame.enPixelFormat = stFrmCfg.enPixelFormat;
stVoFrameInfo.stVFrame.enVideoFormat = stFrmCfg.enVideoFormat;
stVoFrameInfo.stVFrame.enCompressMode = stFrmCfg.enCompressMode;
stVoFrameInfo.stVFrame.enField = VIDEO_FIELD_FRAME;
stVoFrameInfo.stVFrame.enDynamicRange = DYNAMIC_RANGE_SDR8;
stVoFrameInfo.stVFrame.enColorGamut = psrcFrameInfo->stVFrame.enColorGamut;
//HI_U8* yPtr = (HI_U8*)HI_MPI_SYS_Mmap(stVoFrameInfo.stVFrame.u64VirAddr[0], u32Size);
printf("config ok\n");
memcpy(pVirAddr,yuvdata,u32Size);
printf("memcpy ok\n");
// s32Ret = HI_MPI_VB_Handle2PoolId(VbBlk);
printf("HI_MPI_VB_Handle2PoolId OK\n");
//直接发送HI_MPI_VPSS_GetChnFrame视频没问题
//s32Ret = HI_MPI_VO_SendFrame(0, 0,psrcFrameInfo,s32MilliSec);
s32Ret = HI_MPI_VO_SendFrame(0, 0,&stVoFrameInfo,s32MilliSec);
//HI_MPI_SYS_Munmap(yPtr, u32Size);
s32Ret = HI_MPI_SYS_Munmap((HI_VOID*)(HI_UL)pVirAddr, u32Size);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("HI_MPI_SYS_Munmap failure!\n");
}
s32Ret = HI_MPI_VB_ReleaseBlock(VbBlk);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("HI_MPI_VB_ReleaseBlock block 0x%x failure\n", VbBlk);
}
我来回答
回答3个
时间排序
认可量排序
认可0
认可0
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2017-09-04 11:31:38
-
2018-11-26 16:56:14
-
2018-10-10 09:23:24
-
2024-10-31 14:51:35
-
2018-12-20 09:21:34
-
2020-11-24 18:30:26
-
2014-05-05 13:58:08
-
2019-04-12 14:44:49
-
2018-08-10 16:47:56
-
2020-11-11 15:21:33
-
2016-08-10 16:58:57
-
2017-01-16 21:28:27
-
2019-10-29 16:20:32
-
2019-01-11 16:09:05
-
2017-01-09 16:11:52
-
2020-03-26 17:00:21
-
2018-11-17 11:02:14
-
2018-12-07 14:03:02
-
2020-10-05 19:12:15
无更多相似问答 去提问
点击登录
-- 积分
-- 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币)
取消
确认