|
板凳
楼主 |
发表于 2021-11-30 14:45:06
|
只看该作者
我看mpp源码里面有rga 的功能
但是我在使用mpp源码中的rga的时候报错
os_allocator_drm_mmap map_dumb failed: Unknown error -1
这是怎么回事
实例代码:
MppBuffer dst_buf = NULL;
MppFrame rk_dstframe = NULL;
ret = mpp_buffer_get(NULL, &dst_buf, size*3);
if(ret)
{
printf("malloc dst_buf error\n");
}
mpp_frame_init(&rk_dstframe);
mpp_frame_set_buffer(rk_dstframe, dst_buf);
mpp_frame_set_width(rk_dstframe, m_iWidth);
mpp_frame_set_height(rk_dstframe, m_iHeight);
mpp_frame_set_hor_stride(rk_dstframe, MPP_ALIGN(m_iWidth, 16));
mpp_frame_set_ver_stride(rk_dstframe, MPP_ALIGN(m_iHeight, 16));
mpp_frame_set_fmt(rk_dstframe, MPP_FMT_RGB888);
ret = rga_control(mRga, RGA_CMD_SET_SRC, rk_srcframe);
if (ret) {
printf("rga cmd setup source failed %d\n", ret);
}
ret = rga_control(mRga, RGA_CMD_SET_DST, rk_dstframe);
if (ret) {
printf("rga cmd setup destination failed %d\n", ret);
}
ret = rga_control(mRga, RGA_CMD_RUN_SYNC, NULL);
if (ret) {
printf("rga cmd process copy failed %d\n", ret);
}
uint8_t *tmpbuffer = (uint8_t *)dst_buf;
if(tmpbuffer)
{
printf("======%p======\n",tmpbuffer);
memcpy(buffer,tmpbuffer,size*3);
}
mpp_frame_deinit(&rk_dstframe);
|
|