rockchip-linux / mpp

Media Process Platform (MPP) module
548 stars 164 forks source link

RGA处理解码器中数据问题 #375

Open lawaarch opened 1 year ago

lawaarch commented 1 year ago

怎么将MPPfram中的数据映射到RGA中,上个issue为我遇见的具体的问题

HermanChen commented 1 year ago

MppFrame 里带的 MppBuffer 可以 get fd 出来,这个 fd 是 dmabuf,可以导入到 rga 里去使用

lawaarch commented 1 year ago

MppFrame 里带的 MppBuffer 可以 get fd 出来,这个 fd 是 dmabuf,可以导入到 rga 里去使用

我确实是这么整的 RK_U32 buf_size = mpp_frame_get_buf_size(decoder->frame);

int fd=mpp_buffer_get_fd(buffer);

/*--------------RGA----------------*/
src_handle = importbuffer_fd(fd, buf_size);

dst_handle = importbuffer_virtualaddr(yuv_buff, buf_size);

if (src_handle == 0 || dst_handle == 0) {
    printf("importbuffer failed!\n");
    return -1;
}

src_img = wrapbuffer_handle(src_handle, width, height, fmt);
dst_img = wrapbuffer_handle(dst_handle, width, height, fmt);

ret = imcheck(src_img, dst_img, {}, {});
if (IM_STATUS_NOERROR != ret) 
{
    printf("%d, check error! %s", __LINE__, imStrError((IM_STATUS)ret));
    return -1;
}

ret = imcopy(src_img, dst_img);

报错: src has not fd and address for render

howieOfive commented 1 year ago

我也遇到这个问题 ,所以follow一下。RK3568上, mpp解码后。拷贝解码后的的YUV数据到内存,帧率只有20fps。

lawaarch commented 1 year ago

我也遇到这个问题 ,所以follow一下。RK3568上, mpp解码后。拷贝解码后的的YUV数据到内存,帧率只有20fps。

所以RGA是首选

howieOfive commented 1 year ago

是的,之前3399路数不多,勉强还可以。3568就不行了

lawaarch commented 1 year ago

是的,之前3399路数不多,勉强还可以。3568就不行了 你的也没法映射到RGA? 解决了没,我停滞好几周了

howieOfive commented 1 year ago

是的,之前3399路数不多,勉强还可以。3568就不行了 你的也没法映射到RGA? 解决了没,我停滞好几周了

还没有。 这几天才开始看。这个issue,感觉也是比较古老了: https://github.com/rockchip-linux/mpp/issues/80

HermanChen commented 1 year ago

https://github.com/airockchip/librga 可以把 rga 相关的问题提到这里去,我们的rga开发者会协助回复

leitao080709 commented 1 year ago

https://github.com/airockchip/librga 可以把 rga 相关的问题提到这里去,我们的rga开发者会协助回复

希望mpp和rga整合在一起,至少定义的宏能够统一起来,比如YUV420用同一个类型的枚举变量

hbiyik commented 1 year ago

Have a look at here. https://github.com/hbiyik/FFmpeg/blob/7612f91257a22339bfde5e3258b4b8c2671bb876/libavcodec/rkmppdec.c#L192

lawaarch commented 1 year ago

Have a look at here. https://github.com/hbiyik/FFmpeg/blob/7612f91257a22339bfde5e3258b4b8c2671bb876/libavcodec/rkmppdec.c#L192

First of all, thank you for your help. I haven't been working on this function recently. I will have a good look when I have time

lazylazypig commented 1 month ago

请问有什么进展吗?我也遇到类似的问题~_~