Generic DMABUF to vaapi h264 encoding

Nicolas Dufresne nicolas.dufresne at collabora.com
Thu Jul 23 06:59:50 PDT 2015


Le jeudi 23 juillet 2015 à 10:34 +0200, Volker Vogelhuber a écrit :
> Thanks for your reply. I thought that gstreamer's V4L2 plugins 
> require the source for handling DMABUFs to be a V4L2 device, because 
> I seem to remember that I saw ioctl calls somewhere in the 
> gstreamer's code handling V4L2 sources. Is there also the possibility 
> to use v4l2src with DMABUF file descriptors coming from somewhere 
> else (intel GPU driver).

It's supported, but not required.

> 
> Regarding your other suggestion, you were right, that the format was 
> wrong. I already got vaapipostproc in my pipeline, but the input 
> format accepted seems to be GST_VIDEO_FORMAT_RGBx instead of 
> GST_VIDEO_FORMAT_xRGB.
> 
> I can see during debugging that it now continues to run until 
> somewhere else a internal data flow error occurs. I'm trying to find 
> out where it stops.
> 
> Basically what I want to do is to render into a texture in another 
> application. This texture is exported using a DMABUF file descriptor 
> and passed to my video recording process. There I want to encode it 
> using the VAAPI h264 encoder and after buffer has been processed I 
> can reuse the buffer within the rendering application.
> Therefore it would be also nice if gstreamer can tell me when it is 
> not using the pushed buffer anymore. Is there any callback one could 
> add to maybe the vaapiencode_h264 or vaapipostproc element, that 
> notifies me, when the buffer pushed via appsrc isn't used anymore by 
> the pipeline?

You need to track the memory, not the Buffer itself. If you only care
about rendering it, then just make you dmabuf read only. Otherwise, you
could use gst_mini_object_weak_ref() to get notified when the memory
has been discarded (GstMemory derives from GstMiniObject).

General notice about DMABUF, two driver may not be compatible. Which means the dmabuf from one driver, may not work inside another driver. As Sree mention, he never test the importation path in vaapiencode, that might also be completly broken.

Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150723/7903150c/attachment.sig>


More information about the gstreamer-devel mailing list