diff mbox series

[1/1] package/gstreamer1: gl enabled when either GL or GLES2 is present

Message ID 20190725114225.4893-1-cturner@igalia.com
State Superseded
Headers show
Series [1/1] package/gstreamer1: gl enabled when either GL or GLES2 is present | expand

Commit Message

Charlie Turner July 25, 2019, 11:42 a.m. UTC
When building gst1-plugins-base with GL support on the rpi3 (which
supports only GLES2, not full desktop GL), GStreamer was being asked to
disable its GL support completely. This isn't correct since it can be
used with either GL or GLES2.

Signed-off-by: Charlie Turner <cturner@igalia.com>
---
 .../gstreamer1/gst1-plugins-base/gst1-plugins-base.mk    | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Charlie Turner July 31, 2019, 6:18 a.m. UTC | #1
Ping

On Thu, 2019-07-25 at 12:42 +0100, Charlie Turner wrote:
> When building gst1-plugins-base with GL support on the rpi3 (which
> supports only GLES2, not full desktop GL), GStreamer was being asked
> to
> disable its GL support completely. This isn't correct since it can be
> used with either GL or GLES2.
> 
> Signed-off-by: Charlie Turner <cturner@igalia.com>
> ---
>  .../gstreamer1/gst1-plugins-base/gst1-plugins-base.mk    | 9
> +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/package/gstreamer1/gst1-plugins-base/gst1-plugins-
> base.mk b/package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk
> index 66c136c36c..b572c0e992 100644
> --- a/package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk
> +++ b/package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk
> @@ -39,13 +39,18 @@ GST1_PLUGINS_BASE_CONF_OPTS += -Dorc=disabled
>  endif
>  
>  ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_OPENGL),y)
> -GST1_PLUGINS_BASE_GL_API_LIST = opengl
>  GST1_PLUGINS_BASE_CONF_OPTS += -Dgl=enabled
> -GST1_PLUGINS_BASE_DEPENDENCIES += libgl libglu
> +else ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_GLES2),y)
> +GST1_PLUGINS_BASE_CONF_OPTS += -Dgl=enabled
>  else
>  GST1_PLUGINS_BASE_CONF_OPTS += -Dgl=disabled
>  endif
>  
> +ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_OPENGL),y)
> +GST1_PLUGINS_BASE_GL_API_LIST = opengl
> +GST1_PLUGINS_BASE_DEPENDENCIES += libgl libglu
> +endif
> +
>  ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_GLES2),y)
>  GST1_PLUGINS_BASE_GL_API_LIST += gles2
>  GST1_PLUGINS_BASE_DEPENDENCIES += libgles
Adrian Perez de Castro Aug. 8, 2019, 10:11 a.m. UTC | #2
Hello!

On Thu, 25 Jul 2019 12:42:25 +0100, Charlie Turner <cturner@igalia.com> wrote:
> When building gst1-plugins-base with GL support on the rpi3 (which
> supports only GLES2, not full desktop GL), GStreamer was being asked to
> disable its GL support completely. This isn't correct since it can be
> used with either GL or GLES2.

Precisely yesterday we were having a discussion in the #buildroot IRC channel
about how it should be possible to build the GStreamer GL support with APIs
other than desktop OpenGL. This will also enable using it in systems with
EGL+GLES2 support for which GStreamer has support (Vivante, Wayland, etc.),
as I can see from the corresponding “meson.build” file:

 https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/blob/master/gst-libs/gst/gl/meson.build#L228

All in all, your patch looks good to me (thanks, and sorry that it has been
sitting without a review for so long!), and I just have a comment below
asking for a small simplification—please take a look.

> Signed-off-by: Charlie Turner <cturner@igalia.com>

Reviewed-by: Adrian Perez de Castro <aperez@igalia.com>

> ---
>  .../gstreamer1/gst1-plugins-base/gst1-plugins-base.mk    | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk b/package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk
> index 66c136c36c..b572c0e992 100644
> --- a/package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk
> +++ b/package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk
> @@ -39,13 +39,18 @@ GST1_PLUGINS_BASE_CONF_OPTS += -Dorc=disabled
>  endif
>  
>  ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_OPENGL),y)
> -GST1_PLUGINS_BASE_GL_API_LIST = opengl
>  GST1_PLUGINS_BASE_CONF_OPTS += -Dgl=enabled
> -GST1_PLUGINS_BASE_DEPENDENCIES += libgl libglu
> +else ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_GLES2),y)
> +GST1_PLUGINS_BASE_CONF_OPTS += -Dgl=enabled
>  else
>  GST1_PLUGINS_BASE_CONF_OPTS += -Dgl=disabled
>  endif

I would probably do the check for both _OPENGL_OPENGL and _OPENGL_GLES2
in a single line, like this:

  ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_OPENGL)$(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_GLES2),)
  GST1_PLUGINS_BASE_CONF_OPTS += -Dgl=disabled
  else
  GST1_PLUGINS_BASE_CONF_OPTS += -Dgl=enabled
  endif

(Options which are disabled expand to the empty string, so if both are empty
the comparison with the empty string succeeds and we pass -Dgl=disabled to
Meson.)

> +ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_OPENGL),y)
> +GST1_PLUGINS_BASE_GL_API_LIST = opengl
> +GST1_PLUGINS_BASE_DEPENDENCIES += libgl libglu
> +endif
> +
>  ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_GLES2),y)
>  GST1_PLUGINS_BASE_GL_API_LIST += gles2
>  GST1_PLUGINS_BASE_DEPENDENCIES += libgles
> -- 
> 2.17.1

Cheers,
-Adrian
diff mbox series

Patch

diff --git a/package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk b/package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk
index 66c136c36c..b572c0e992 100644
--- a/package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk
+++ b/package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk
@@ -39,13 +39,18 @@  GST1_PLUGINS_BASE_CONF_OPTS += -Dorc=disabled
 endif
 
 ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_OPENGL),y)
-GST1_PLUGINS_BASE_GL_API_LIST = opengl
 GST1_PLUGINS_BASE_CONF_OPTS += -Dgl=enabled
-GST1_PLUGINS_BASE_DEPENDENCIES += libgl libglu
+else ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_GLES2),y)
+GST1_PLUGINS_BASE_CONF_OPTS += -Dgl=enabled
 else
 GST1_PLUGINS_BASE_CONF_OPTS += -Dgl=disabled
 endif
 
+ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_OPENGL),y)
+GST1_PLUGINS_BASE_GL_API_LIST = opengl
+GST1_PLUGINS_BASE_DEPENDENCIES += libgl libglu
+endif
+
 ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL_GLES2),y)
 GST1_PLUGINS_BASE_GL_API_LIST += gles2
 GST1_PLUGINS_BASE_DEPENDENCIES += libgles