<div dir="ltr">Thanks, guys. I will take a look at gstgl.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 9, 2019 at 6:39 AM Nirbheek Chauhan <<a href="mailto:nirbheek.chauhan@gmail.com">nirbheek.chauhan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Apr 8, 2019 at 7:40 AM Aaron Boxer <<a href="mailto:boxerab@gmail.com" target="_blank">boxerab@gmail.com</a>> wrote:<br>
> Is there any existing element I could use as a template?<br>
> One twist is that GPUs give the highest performance in asynchronous mode, so<br>
> the element will need to pull buffers from upstream, schedule them to<br>
> the GPU, and only push the processed buffers downstream when the GPU<br>
> completes.  Also, it would be good to have the option of keeping the memory<br>
> on the device, in order to apply a series of kernels without costly move<br>
> to host and back to device.<br>
><br>
<br>
The gstgl library does exactly all this. See, for example, inside<br>
gst-plugins-base/gst-libs/gst/gl/gstglwindow.c,<br>
gst_gl_window_default_send_message() which for instance runs all GL<br>
functions inside the glib main context attached to the window. You can<br>
probably do something similar.<br>
<br>
For keeping memory on the device, that's already supported by<br>
GstBuffer and by GstMemory, for instance GL and DMA-BUF memories are<br>
always on the device. You can add a new caps type for device-side<br>
compute buffers. Matthew (ystreet) might've spent some time on this<br>
already.<br>
<br>
Cheers,<br>
Nirbheek<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></div>