diff --git a/gst-libs/gst/vaapi/gstvaapicodec_objects.h b/gst-libs/gst/vaapi/gstvaapicodec_objects.h index 163ebf773f..2d081bde44 100644 --- a/gst-libs/gst/vaapi/gstvaapicodec_objects.h +++ b/gst-libs/gst/vaapi/gstvaapicodec_objects.h @@ -27,9 +27,6 @@ #include #include -#if USE_VP8_DECODER -#include -#endif G_BEGIN_DECLS diff --git a/gst-libs/gst/vaapi/gstvaapicompat.h b/gst-libs/gst/vaapi/gstvaapicompat.h index 781e30d610..1e5a302503 100644 --- a/gst-libs/gst/vaapi/gstvaapicompat.h +++ b/gst-libs/gst/vaapi/gstvaapicompat.h @@ -46,8 +46,41 @@ #include #endif +/* VA-API < 0.37 doesn't include sub core APIs in va.h */ +#if !VA_CHECK_VERSION(0,37,0) #ifdef HAVE_VA_VA_DEC_HEVC_H # include #endif +#ifdef HAVE_VA_VA_DEC_JPEG_H +# include +#endif +#ifdef HAVE_VA_VA_DEC_VP8_H +# include +#endif +#ifdef HAVE_VA_VA_DEC_VP9_H +# include +#endif +#ifdef HAVE_VA_VA_ENC_HEVC_H +# include +#endif +#ifdef HAVE_VA_VA_ENC_H264_H +# include +#endif +#ifdef HAVE_VA_VA_ENC_JPEG_H +# include +#endif +#ifdef HAVE_VA_VA_ENC_MPEG2_H +# include +#endif +#ifdef HAVE_VA_VA_ENC_VP8_H +# include +#endif +#ifdef HAVE_VA_VA_ENC_VP9_H +# include +#endif +#ifdef HAVE_VA_VA_VPP_H +# include +#endif +#endif #endif /* GST_VAAPI_COMPAT_H */ diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c b/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c index bef1eb71f2..51d9aeb1a9 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c @@ -36,10 +36,6 @@ #include "gstvaapidisplay_priv.h" #include "gstvaapiobject_priv.h" -#ifdef HAVE_VA_VA_DEC_JPEG_H -# include -#endif - #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_vp8.c b/gst-libs/gst/vaapi/gstvaapidecoder_vp8.c index cac5036a18..1503458001 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_vp8.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_vp8.c @@ -35,9 +35,6 @@ #include "gstvaapiobject_priv.h" #include "gstvaapicompat.h" -#ifdef HAVE_VA_VA_DEC_VP8_H -#include -#endif #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c b/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c index 1376834810..c2cc928473 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c @@ -34,9 +34,6 @@ #include "gstvaapiobject_priv.h" #include "gstvaapicompat.h" -#ifdef HAVE_VA_VA_DEC_VP9_H -#include -#endif #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c index dab3c1494a..04560aacf1 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c @@ -28,7 +28,6 @@ #include "sysdeps.h" #include -#include #include #include #include "gstvaapicompat.h" diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h265.c b/gst-libs/gst/vaapi/gstvaapiencoder_h265.c index 673145c728..5309c22f06 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h265.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h265.c @@ -23,7 +23,6 @@ #include "sysdeps.h" #include #include -#include #include #include #include "gstvaapicompat.h" diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c b/gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c index 73bee563ee..399696c69a 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_jpeg.c @@ -22,7 +22,6 @@ #include "sysdeps.h" #include -#include #include #include #include "gstvaapicompat.h" diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c index 04fbd0dccb..1f8b516e81 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c @@ -24,7 +24,6 @@ #include "sysdeps.h" #include #include -#include #include #include "gstvaapicompat.h" #include "gstvaapiencoder_mpeg2.h" diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c b/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c index a448df8e3f..088ca1d360 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c @@ -22,7 +22,6 @@ #include "sysdeps.h" #include -#include #include #include #include "gstvaapicompat.h" diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_vp9.c b/gst-libs/gst/vaapi/gstvaapiencoder_vp9.c index 64ef1f314c..af433cd899 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_vp9.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_vp9.c @@ -22,7 +22,6 @@ #include "sysdeps.h" #include -#include #include #include #include "gstvaapicompat.h" diff --git a/gst-libs/gst/vaapi/gstvaapifilter.c b/gst-libs/gst/vaapi/gstvaapifilter.c index da6f733ea7..388fff3ded 100644 --- a/gst-libs/gst/vaapi/gstvaapifilter.c +++ b/gst-libs/gst/vaapi/gstvaapifilter.c @@ -21,6 +21,7 @@ */ #include "sysdeps.h" +#include "gstvaapicompat.h" #include "gstvaapifilter.h" #include "gstvaapiutils.h" #include "gstvaapivalue.h" @@ -29,10 +30,6 @@ #include "gstvaapisurface_priv.h" #include "gstvaapiutils_core.h" -#if USE_VA_VPP -# include -#endif - #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/gst-libs/gst/vaapi/gstvaapiutils.c b/gst-libs/gst/vaapi/gstvaapiutils.c index c24bed7b6b..616a63839e 100644 --- a/gst-libs/gst/vaapi/gstvaapiutils.c +++ b/gst-libs/gst/vaapi/gstvaapiutils.c @@ -31,10 +31,6 @@ #include #include -#if USE_VA_VPP -# include -#endif - #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/meson.build b/meson.build index 6f335b372c..310e61d7d3 100644 --- a/meson.build +++ b/meson.build @@ -135,6 +135,37 @@ if runcmd.returncode() == 0 cdata.set('VA_DRIVERS_PATH', '"@0@"'.format(runcmd.stdout().strip())) endif +if libva_dep.version().version_compare('< 0.38.0') + check_headers = [ + [USE_H265_DECODER, 'HAVE_VA_VA_DEC_HEVC_H'], + [USE_H265_ENCODER, 'HAVE_VA_VA_ENC_HEVC_H'], + [USE_JPEG_DECODER, 'HAVE_VA_VA_DEC_JPEG_H'], + [USE_JPEG_ENCODER, 'HAVE_VA_VA_ENC_JPEG_H'], + [USE_VP8_DECODER, 'HAVE_VA_VA_DEC_VP8_H'], + [USE_VP8_ENCODER, 'HAVE_VA_VA_ENC_VP8_H'], + [USE_VP9_DECODER, 'HAVE_VA_VA_DEC_VP9_H'], + [USE_VP9_ENCODER, 'HAVE_VA_VA_DEC_VP9_H'], + [USE_VPP, 'HAVE_VA_VA_VPP_H'], + ] + foreach h : check_headers + if h.get(0) + cdata.set(h.get(1), 1) + endif + endforeach + + if USE_ENCODERS + check_headers = [ + ['HAVE_VA_VA_ENC_MPEG2_H', 'va/va_enc_mpeg2.h'], + ['HAVE_VA_VA_ENC_H264_H', 'va/va_enc_h264.h'], + ] + foreach h : check_headers + if cc.has_header(h.get(1), dependencies: libva_dep, prefix: '#include ') + cdata.set(h.get(0), 1) + endif + endforeach + endif +endif + api_version = '1.0' soversion = 0 # maintaining compatibility with the previous libtool versioning