dmabuf from appsink

Nicolas Dufresne nicolas at ndufresne.ca
Wed Sep 8 17:05:48 UTC 2021


Le mercredi 08 septembre 2021 à 19:17 +0400, Lusine Hayrapetyan via gstreamer-
devel a écrit :
> Hi Folks,
> 
> I have a pipeline which does gpu decoding and ends with appsink.
> Is it possible to get dmabuf from appsink with zero-copy?

Yes, though may require an extra step. Here's some example:

Checking if you did receive dmabuf:
https://gitlab.freedesktop.org/mesa/kmscube/-/blob/master/gst-decoder.c#L395

Getting dmabuf FD (note that dup is optional, you can simply ref the gstmemory
or the buffer for the needed amount of time):
https://gitlab.freedesktop.org/mesa/kmscube/-/blob/master/gst-decoder.c#L412

Telling upstream that you support GstVideoMeta can greatly help preventing
upstream copies:
https://gitlab.freedesktop.org/mesa/kmscube/-/blob/master/gst-decoder.c#L242

> 
> Thanks,
> Lusine
> 




More information about the gstreamer-devel mailing list