gl: Fix libdrm dependency detection and usage
authorNirbheek Chauhan <nirbheek@centricular.com>
Mon, 27 May 2024 22:53:01 +0000 (04:23 +0530)
committerBackport Bot <gitlab-backport-bot@gstreamer-foundation.org>
Sun, 27 Oct 2024 12:29:08 +0000 (12:29 +0000)
drm_fourcc.h should be picked up via the pkgconfig dep, not the system
includedir directly. All this allows it to be picked up consistently
(via the subproject, for example).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7760>

subprojects/gst-plugins-base/ext/gl/meson.build
subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c
subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c
subprojects/gst-plugins-base/gst-libs/gst/gl/meson.build

index ad514014e9a3fd13e9e8be3c2fd516a6d660b8b8..2715a3712940ae8dff6bfa947302c338a3d25eec 100644 (file)
@@ -114,8 +114,8 @@ if bcm_host_dep.found()
   optional_deps += bcm_host_dep
 endif
 
-if egl_dep.found() and cc.has_header('libdrm/drm_fourcc.h')
-  optional_deps += allocators_dep
+if egl_dep.found() and cc.has_header('drm_fourcc.h', dependencies: libdrm_dep)
+  optional_deps += [allocators_dep, libdrm_dep]
 endif
 
 if ['darwin', 'ios'].contains(host_system)
index b70fd59fe5488bc7fdfd8ac5b33ea93cbba848ac..c3ee82afdb139898e1263022f67cd12baa643171 100644 (file)
@@ -52,7 +52,9 @@
 
 #if GST_GL_HAVE_DMABUF
 #include <gst/allocators/gstdmabuf.h>
-#include <libdrm/drm_fourcc.h>
+#ifdef HAVE_LIBDRM
+#include <drm_fourcc.h>
+#endif
 
 #ifndef DRM_FORMAT_R8
 #define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ')
index d91898a1fc9242fe2b0e61df993e422213ac476b..bafd804fe819b7ba5408694ca7f600e23f1ea79b 100644 (file)
@@ -38,7 +38,9 @@
 
 #if GST_GL_HAVE_DMABUF
 #include <gst/allocators/gstdmabuf.h>
-#include <libdrm/drm_fourcc.h>
+#ifdef HAVE_LIBDRM
+#include <drm_fourcc.h>
+#endif
 #else
 /* to avoid ifdef in _gst_gl_upload_set_caps_unlocked() */
 #define DRM_FORMAT_MOD_LINEAR  0ULL
index b97ec0c049b542db1fcc2bb96a4fde1f92f94b25..57af08ced34374d31fca60e24a7e8b4554905e64 100644 (file)
@@ -566,8 +566,8 @@ if need_platform_egl != 'no'
     gl_platform_deps += egl_dep
     glconf.set('GST_GL_HAVE_PLATFORM_EGL', 1)
 
-    if cc.has_header('libdrm/drm_fourcc.h')
-      gl_misc_deps += allocators_dep
+    if cc.has_header('drm_fourcc.h', dependencies: libdrm_dep)
+      gl_misc_deps += [allocators_dep, libdrm_dep]
       glconf.set('GST_GL_HAVE_DMABUF', 1)
     endif
 
@@ -1103,8 +1103,8 @@ if build_gstgl
     soversion : soversion,
     darwin_versions : osxversion,
     install : true,
-    dependencies : [gst_base_dep, video_dep, allocators_dep, gmodule_dep,
-                    gl_lib_deps, gl_platform_deps, gl_winsys_deps, gl_misc_deps],
+    dependencies : [gst_base_dep, video_dep, gmodule_dep, gl_lib_deps,
+                    gl_platform_deps, gl_winsys_deps, gl_misc_deps],
     # don't confuse EGL/egl.h with gst-libs/gl/egl/egl.h on case-insensitive file systems
     implicit_include_directories : false)