dmabuf in pipeline

Nicolas Dufresne nicolas at ndufresne.ca
Thu Apr 8 15:59:28 UTC 2021


Le jeudi 08 avril 2021 à 08:53 -0500, prg.amc a écrit :
> Hi, currently I have a problem in passing dmabuf fd to other elements.
> 
> so, I have plugin which acts as src and it will receive dma fd from another
> process using DBUS, so there a way to pass the same fd to next elements, the
> next element knows how to access the memory location using the fd.
> 
>      GstBuffer *buffer = gst_buffer_new();
> 
>     GstAllocator *allocator = gst_dmabuf_allocator_new();
> 
>     if (buffer != nullptr && allocator != nullptr) {

These two _new() function will never fail.

>       GstMemory *mem = gst_dmabuf_allocator_alloc(allocator, fd, nBufSize);
> 
>        gst_buffer_append_memory(buffer, mem);
> 
>       *buf = buffer;
> 
> This is what i`m using now, but with the above code gstreamer is trying to
> copy the data using fdmemory. where the fd is not accessable directly.
> 
> *0x5575c30f70 ERROR               fdmemory gstfdmemory.c:126:gst_fd_mem_map:
> 0x5575e47520: fd 14: mmap failed: No such device
> ERROR               fdmemory gstfdmemory.c:126:gst_fd_mem_map: 0x5575e47520:
> fd 14: mmap failed: No such device
> *
> 
> I`m i doing it correct? and i dont have any custom bufferpool manager.

Along the way, something in your pipeline (undocumented here) is doing a memory
map to access the data. But this mapping failed because the DMABuf FD is
invalid. I would recommend reviewing how you "pass" the FD through DBus, as it
seems this isn't appropriate method. Perhaps you are using an FD value from
another process ?

> 
> 
> 
> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




More information about the gstreamer-devel mailing list