Patchwork [1/2] gstreamer1.0-plugins-imx: select Wayland EGL platform if appropriate

login
register
mail settings
Submitter Carlos Rafael Giani
Date June 25, 2014, 9:33 p.m.
Message ID <1403731990-31558-1-git-send-email-dv@pseudoterminal.org>
Download mbox | patch
Permalink /patch/74401/
State Changes Requested
Delegated to: Otavio Salvador
Headers show

Comments

Carlos Rafael Giani - June 25, 2014, 9:33 p.m.
Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
---
 .../gstreamer/gstreamer1.0-plugins-imx_0.9.6.bb          | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
Otavio Salvador - June 26, 2014, 1:45 p.m.
On Wed, Jun 25, 2014 at 6:33 PM, Carlos Rafael Giani
<dv@pseudoterminal.org> wrote:
> Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
> ---
>  .../gstreamer/gstreamer1.0-plugins-imx_0.9.6.bb          | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_0.9.6.bb b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_0.9.6.bb
> index 5074a2c..4504563 100644
> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_0.9.6.bb
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_0.9.6.bb
> @@ -14,7 +14,21 @@ S = "${WORKDIR}/git"
>  inherit waf
>
>  # configure the eglvivsink element to use the appropiate EGL platform code
> -EGLVIVSINK_PLATFORM = "${@base_contains('DISTRO_FEATURES', 'x11', 'x11', 'fb', d)}"
> +# X11 if x11 is present in DISTRO_FEATURES
> +# Wayland if x11 is not present in DISTRO_FEATURES, but wayland is
> +# Framebuffer otherwise
> +EGLVIVSINK_PLATFORM = "fb"
> +
> +python() {
> +    eglvivsink_platform = 'fb'
> +    if base_contains('DISTRO_FEATURES', 'x11', True, False, d):
> +        eglvivsink_platform = 'x11'
> +    elif base_contains('DISTRO_FEATURES', 'wayland', True, False, d):
> +        eglvivsink_platform = 'wayland'
> +
> +    d.setVar('EGLVIVSINK_PLATFORM', eglvivsink_platform)
> +}

I agree with the goal of the patch and it does makes sense to do it
automatically. The use of python anonymous should be avoided when
possible though. Please look at the cairo[1] bbappend how we handle
the three cases using the inline python code which is more commonly
used for this kind of thing.

Can you rework it?

Patch

diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_0.9.6.bb b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_0.9.6.bb
index 5074a2c..4504563 100644
--- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_0.9.6.bb
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_0.9.6.bb
@@ -14,7 +14,21 @@  S = "${WORKDIR}/git"
 inherit waf
 
 # configure the eglvivsink element to use the appropiate EGL platform code
-EGLVIVSINK_PLATFORM = "${@base_contains('DISTRO_FEATURES', 'x11', 'x11', 'fb', d)}"
+# X11 if x11 is present in DISTRO_FEATURES
+# Wayland if x11 is not present in DISTRO_FEATURES, but wayland is
+# Framebuffer otherwise
+EGLVIVSINK_PLATFORM = "fb"
+
+python() {
+    eglvivsink_platform = 'fb'
+    if base_contains('DISTRO_FEATURES', 'x11', True, False, d):
+        eglvivsink_platform = 'x11'
+    elif base_contains('DISTRO_FEATURES', 'wayland', True, False, d):
+        eglvivsink_platform = 'wayland'
+
+    d.setVar('EGLVIVSINK_PLATFORM', eglvivsink_platform)
+}
+
 EXTRA_OECONF = "--egl-platform=${EGLVIVSINK_PLATFORM} --kernel-headers=${STAGING_KERNEL_DIR}/include"
 
 # LIBV is used by gst-plugins-package.inc to specify the GStreamer version (0.10 vs 1.0)