GNOME Bugzilla – Bug 759481
Add in another camera support for dma_buf in gst-vaapi
Last modified: 2016-02-22 20:38:58 UTC
Created attachment 317407 [details] Add icamerasrc support in gstreamer-vaapi static gboolean has_dmabuf_capable_peer (GstVaapiPluginBase * plugin, GstPad * pad) { ... ... if (GST_IS_PUSH_SRC (element)) { element_name = gst_element_get_name (element); if (!element_name || sscanf (element_name, "v4l2src%d", &v) != 1) break; v = 0; g_object_get (element, "io-mode", &v, NULL); is_dmabuf_capable = v == 5; /* "dmabuf-import" enum value */ Current above code implementation is hardcode support for dma-buff v4l2src. Coming soon there will be another camera plugin need to support dma-buf and using gstreamer-vaapi. Attached the code patches. At the same time, also waiting for verify result from another party.
Created attachment 317943 [details] [review] Add the patches using for support icamerasrc for dmabuf This is final patches, we tested is working. Please review it. CC-ing Sreerenj. Thanks.
Created attachment 317950 [details] [review] Add icamerasrc support in gstreamer-vaapi Added in tested-by in commit message.
I think that rather to commit this (which is based on the hackish function has_dmabuf_capable_peer()) we should rely in the memory:DMABuf capsfeature. We should work rather on bug 755072
(In reply to Lim Siew Hoon from comment #2) > Created attachment 317950 [details] [review] [review] > Add icamerasrc support in gstreamer-vaapi > > Added in tested-by in commit message. - Where can I get the Icamerasrc ? is it open sourced? I can't find it in 01org/github - please give a description about "icamerasrc" in the commit message.
Sorry. On hold first. Still pending to the icamerasrc upload to Github. They still haven't upload the code yet. Once they uploaded, will update it. https://github.com/01org/icamerasrc
Review of attachment 317950 [details] [review]: Few more: -- indentation is incorrect -- why unnecessary strlen()?, use hardcoded value in strncmp
Created attachment 321466 [details] [review] Add icamerasrc support in gstreamer-vaapi Attached new rework patch: 1. Added description about "icamerasrc" in commit message. 1. Fix the incorrect indentation 2. Replace strlen by using hardcoded value in strncmp. Current the icamerasrc source code already upload in https://github.com/01org/icamerasrc.
Pushed, thanks for the patch. commit ce1ab4673c9dedaa9e9d9ead7ff78e25087ea8d6 Author: Lim Siew Hoon <siew.hoon.lim@intel.com> Date: Wed Feb 17 15:40:54 2016 +0200 Add icamerasrc as dmabuf capable peer element icamerasrc is another gstreamer plugin using to capture RAW frames from camera device. It is based on libcamhal library. There are some properties available to control icamera behavior. Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com> Tested & Reviewed: Zhu Haiyang <haiyang.zhu@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=759481 Fixme: This is the similar workaround we done for v4l2src. The workaround will be removed once we fix #755072
Sree, just a reminder that this is terrible hack you have in there. There is no logical reason for a property to be changed from downstream element like this, just like there is no reason for camera to always produce DMABuf when possible. And vaapi should adapt to the received type of buffer rather then enable dmabuf only for camera that is hardcoded in it.
(In reply to Nicolas Dufresne (stormer) from comment #9) > Sree, just a reminder that this is terrible hack you have in there. There is > no logical reason for a property to be changed from downstream element like > this, just like there is no reason for camera to always produce DMABuf when > possible. And vaapi should adapt to the received type of buffer rather then > enable dmabuf only for camera that is hardcoded in it. Nicolas, I knew this is a hack.. We did this hack for v4l2src sometimes back to support a customer when gstreamer-vaapi was not the part of upstream :).. There was no proper dmabuf negotiation capabilities at that time too. As I mentioned in the commit message we will get-rid of this hack once we have a fix for https://bugzilla.gnome.org/show_bug.cgi?id=755072 .