How to consume VAAPI VASurface in appsink
Galoppo, Nico
nico.galoppo at intel.com
Thu Aug 9 15:56:10 UTC 2018
Thanks!
However, the vaapipostproc doesn't seem to support "video/x-raw(memory:DMABuf)" on its source pad. I tried it out as follows:
gst-launch-1.0 -v souphttpsrc location=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm ! matroskademux ! vaapidecodebin ! vaapipostproc ! "video/x-raw(memory:DMABuf)" ! fakesink
Is there something I’m missing?
Also, if I do find a way to use gst_dmabuf_memory_get_fd(), how do I make sure to keep a reference to the memory so that it doesn't get reused after returning from the 'new-sample' callback? Is simply mapping the buffer sufficient?
Thanks,
Nico
-----Original Message-----
From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> On Behalf Of Víctor Jáquez
Sent: Thursday, August 09, 2018 8:07 AM
To: gstreamer-devel at lists.freedesktop.org
Subject: Re: How to consume VAAPI VASurface in appsink
On Wed, 08 Aug 2018 at 23:41, Galoppo, Nico wrote:
> I have constructed a pipeline for decoding compressed video, with an
> appsink element at the end. The decoding pipeline is using GPU
> hardware decoding through libva/gst-vaapi. I am pulling samples in the appsink "new-sample"
> signal callback, and have confirmed that the caps include
> "video/x-raw(VASurface)".
-> "video/x-raw(memory:VASurface)"
>
> My intent is to display (and potentially process) the framebuffer
> contained by the VASurface. Can I somehow get access to the VASurface
> through the GstBuffer contained in the GstSample? If so, then I could
> get to a DRM prime handle for GL/CL interop.
The VASurface is in a buffer's meta. But the meta's structure is not available. You might look at the element's source and copy the structure and extract it.
Nonetheless, if you want the DRM prime handle, I guess there's a direct way to do it, after the vaapipostproc set the caps feature "video/x-raw(memory:DMABuf)", then you get the dmabuf fd with
gst_dmabuf_memory_get_fd()
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-dmabuf.html
vmjl
>
> Thanks,
>
> Nico
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
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