- 收藏
- 点赞
- 分享
- 举报
使用海思mpp,如何播放pcm数据?
目前已经有pcm数据,能直接送AO播放数据吗?但是尝试过失败了,会挂机。
sigNO.11;P-0;GP-277;T-RTCCB;PC-0x149bdc<>FNC-HI_MPI_AO_SendFrame;FN-./demo;RelativeAddr:1900—1
以下是我写的送AO的接口:
int MppSendPcmData2Ao(const void data, size_t len, sz_u64 pts, sz_u32 seq) } 哪位朋友能帮忙指导下?
{
HI_S32 s32Ret;
AUDIO_FRAME_S stAoFrame;
VB_BLK VbBlk;
unsigned int u32PhyAddr;
unsigned char pVirAddr;
AUDIO_DEV Ao_dev = 0;
AO_CHN Ao_chn = 0;
static int num = 1;
if (num > 0)
{
COMM_AUDIO_AoUnbindAdec(Ao_dev, Ao_chn, 0);
--num;
}
if (len <= 0)
{
printf("recv len: %d\n", len);
return HI_NULL;
}
VB_POOL_CONFIG_S stVbPoolCfg;
VB_POOL vbpool;
memset(&stVbPoolCfg, 0, sizeof(VB_POOL_CONFIG_S));
stVbPoolCfg.u64BlkSize = 1024 * 64;
stVbPoolCfg.u32BlkCnt = 1;
stVbPoolCfg.enRemapMode = VB_REMAP_MODE_NONE;
vbpool = HI_MPI_VB_CreatePool(&stVbPoolCfg);
if (VB_INVALID_POOLID == vbpool)
{
ZLOG_ERROR("HI_MPI_VB_CreatePool failed!\n");
return HI_FAILURE;
}
stAoFrame.u32Len = len;
stAoFrame.enBitwidth = AUDIO_BIT_WIDTH_16;
stAoFrame.enSoundmode = AUDIO_SOUND_MODE_STEREO;
stAoFrame.u32Seq = seq;
stAoFrame.u64PhyAddr[1] = 0;
stAoFrame.u32PoolId[1] = 0;
stAoFrame.u64TimeStamp = pts;
VbBlk = HI_MPI_VB_GetBlock(vbpool, len, NULL);
if (VB_INVALID_HANDLE == VbBlk)
{
printf("HI_MPI_VB_GetBlock err! size:%d\n",len);
return HI_FAILURE;
}
u32PhyAddr = HI_MPI_VB_Handle2PhysAddr(VbBlk);
if (0 == u32PhyAddr)
{
printf("Func:%s, Info:HI_MPI_VB_Handle2PhysAddr fail\n", __FUNCTION__);
HI_MPI_VB_ReleaseBlock(VbBlk);
return HI_FAILURE;
}
stAoFrame.u32PoolId[0]= HI_MPI_VB_Handle2PoolId(VbBlk);
pVirAddr = (unsigned char *)HI_MPI_SYS_Mmap(u32PhyAddr,len);
if (NULL == pVirAddr)
{
printf("Func:%s, Info:HI_MPI_SYS_Mmap fail\n", __FUNCTION__);
HI_MPI_VB_ReleaseBlock(VbBlk);
return HI_FAILURE;
}
memcpy(pVirAddr,data,len);
stAoFrame.u64PhyAddr[0]= u32PhyAddr;
stAoFrame.u64VirAddr[0] = pVirAddr;
s32Ret = HI_MPI_AO_SendFrame(Ao_dev, Ao_chn, &stAoFrame, 0);
if (HI_SUCCESS != s32Ret )
{
printf("%s: HI_MPI_AENC_SendFrame(0, 0), failed with %#x!\n", __FUNCTION__, s32Ret);
return HI_FAILURE;
}
HI_MPI_SYS_Munmap(pVirAddr,len);
HI_MPI_VB_ReleaseBlock(VbBlk);
HI_MPI_VB_DestroyPool(vbpool);
return HI_SUCCESS;
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
-
2020-03-05 17:50:48
-
2021-08-18 14:54:02
-
2018-08-01 14:28:23
-
2018-07-31 10:34:21
-
2017-04-28 10:44:47
-
2018-08-24 11:29:46
-
2018-11-14 20:43:50
-
2023-08-08 12:24:20
-
2016-06-28 19:02:03
-
2018-09-06 17:36:06
-
02021-07-19 20:01:50
-
2023-07-19 16:46:20
-
2024-10-22 09:37:40
-
02023-11-24 21:41:17
-
2023-07-13 11:22:04
-
2020-04-05 14:27:01
-
2018-12-21 01:06:21
-
2016-03-29 14:14:25
-
2014-03-11 08:14:35
-
5RK3588的DPHY0接lt6911uxe转HDMI抓帧分辨率不对
-
20求rv1106板子的sdk包或者开发板资料
-
10ss928烧录uboot失败
-
10求助,3588调试imx586和ov50c40时,按照瑞芯微的单摄8k配置好设备树后,驱动配置的8k分辨率的,但是只能抓到4k的图,且颜色偏粉
-
50帮忙解决个交叉编译的问题
-
20帮忙交叉编译个源码
-
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
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明