From ce1ab4673c9dedaa9e9d9ead7ff78e25087ea8d6 Mon Sep 17 00:00:00 2001 From: Lim Siew Hoon Date: Wed, 17 Feb 2016 15:40:54 +0200 Subject: [PATCH] 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 Tested & Reviewed: Zhu Haiyang 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 --- gst/vaapi/gstvaapipluginbase.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 9c52bcc3fb..cb477ca33e 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -375,12 +375,19 @@ 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) + if (!element_name) + break; + + if ((sscanf (element_name, "v4l2src%d", &v) != 1) + && (sscanf (element_name, "camerasrc%d", &v) != 1)) break; v = 0; g_object_get (element, "io-mode", &v, NULL); - is_dmabuf_capable = v == 5; /* "dmabuf-import" enum value */ + if (strncmp (element_name, "camerasrc", 9) == 0) + is_dmabuf_capable = v == 3; + else + is_dmabuf_capable = v == 5; /* "dmabuf-import" enum value */ break; } else if (GST_IS_BASE_TRANSFORM (element)) { element_name = gst_element_get_name (element);