From da86a92a2d7abf565e9df1cd372e0e8fda995aba Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 28 May 2024 04:14:15 +0530 Subject: [PATCH] msdk: Fix libdrm dependency detection and usage drm_fourcc.h should be picked up via the pkgconfig include, not the system includedir directly. Also consolidate the libdrm usage in va and msdk. All this allows it to be picked up consistently (via the subproject, for example). Part-of: --- .../gst-plugins-bad/gst-libs/gst/va/meson.build | 2 -- subprojects/gst-plugins-bad/meson.build | 11 +++++++++++ .../gst-plugins-bad/sys/msdk/gstmsdkallocator_libva.c | 2 +- subprojects/gst-plugins-bad/sys/msdk/gstmsdkcaps.c | 2 +- subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c | 2 +- subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c | 2 +- subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpp.c | 2 +- subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpputil.c | 2 +- subprojects/gst-plugins-bad/sys/msdk/meson.build | 1 - 9 files changed, 17 insertions(+), 9 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/va/meson.build b/subprojects/gst-plugins-bad/gst-libs/gst/va/meson.build index b9a8ae7066..d83b9e3f3f 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/meson.build +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/meson.build @@ -81,10 +81,8 @@ if host_system == 'linux' endif platform_deps += [libva_drm_dep] - libdrm_dep = dependency('libdrm', version: '>=2.4', required: get_option('drm')) if libdrm_dep.found() platform_deps += [libdrm_dep] - extra_args += ['-DHAVE_LIBDRM'] endif va_sources += va_linux_sources diff --git a/subprojects/gst-plugins-bad/meson.build b/subprojects/gst-plugins-bad/meson.build index eeb7a29722..9c431f1224 100644 --- a/subprojects/gst-plugins-bad/meson.build +++ b/subprojects/gst-plugins-bad/meson.build @@ -398,6 +398,17 @@ if x11_dep.found() cdata.set('HAVE_X11', 1) endif +# Optional dep of msdk and va +if host_system not in ['darwin', 'ios', 'android', 'windows'] + libdrm_dep = dependency('libdrm', version : '>=2.4.50', + required : get_option('drm').enabled() or get_option('msdk').enabled(), + ) + cdata.set('HAVE_LIBDRM', libdrm_dep.found()) +else + libdrm_dep = dependency('', required: false) +endif + + # # Solaris and Illumos distros split a lot of networking-related code # into '-lsocket -lnsl'. Anything that calls socketpair(), getifaddr(), diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkallocator_libva.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkallocator_libva.c index eab8001602..d9b99542ce 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkallocator_libva.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkallocator_libva.c @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include "gstmsdkallocator.h" #include "gstmsdkallocator_libva.h" diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkcaps.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkcaps.c index 590cbba612..ad5119cf47 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkcaps.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkcaps.c @@ -32,7 +32,7 @@ #include "gstmsdkcaps.h" #ifndef _WIN32 -#include +#include #include #include "gstmsdkallocator_libva.h" #include diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c index 4932ad9334..c20b73bd3b 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c @@ -41,7 +41,7 @@ #include "gstmsdkcaps.h" #ifndef _WIN32 -#include +#include #include #include #else diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c index 1f4be287c0..ac9c7335f0 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c @@ -51,7 +51,7 @@ #include "gstmsdkcaps.h" #ifndef _WIN32 -#include +#include #include "gstmsdkallocator_libva.h" #include #else diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpp.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpp.c index be97f07ced..5f23fa2088 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpp.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpp.c @@ -60,7 +60,7 @@ #include "gstmsdkallocator.h" #ifndef _WIN32 -#include +#include #include "gstmsdkallocator_libva.h" #include #include diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpputil.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpputil.c index b4667438a8..ced67e6362 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpputil.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpputil.c @@ -30,7 +30,7 @@ #include "gstmsdkcaps.h" #ifndef _WIN32 -#include +#include #include #else #include diff --git a/subprojects/gst-plugins-bad/sys/msdk/meson.build b/subprojects/gst-plugins-bad/sys/msdk/meson.build index 51bf953a0e..b73370cda1 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/meson.build +++ b/subprojects/gst-plugins-bad/sys/msdk/meson.build @@ -184,7 +184,6 @@ if host_machine.system() == 'windows' else libdl_dep = cc.find_library('dl', required: get_option('msdk')) libgudev_dep = dependency('gudev-1.0', required: get_option('msdk'), allow_fallback: true) - libdrm_dep = dependency('libdrm', required: get_option('msdk')) msdk_deps = declare_dependency(dependencies: [gstva_dep, libdl_dep, libgudev_dep, libdrm_dep]) msdk_deps_found = gstva_dep.found() and libdl_dep.found() and libgudev_dep.found() and libdrm_dep.found() endif