AG_GST_PKG_CHECK_MODULES(OPENJPEG_2_2, libopenjp2 >= 2.2)
if test x"$HAVE_OPENJPEG_2_2" = x"yes"; then
AC_DEFINE([HAVE_OPENJPEG_2_2], 1, [Define if OpenJPEG 2.2 is used])
+
+ AG_GST_PKG_CHECK_MODULES(OPENJPEG_2_3, libopenjp2 >= 2.3 libopenjp2 < 2.4)
+ if test x"$HAVE_OPENJPEG_2_3" = x"yes"; then
+ AC_DEFINE([HAVE_OPENJPEG_2_3], 1, [Define if OpenJPEG 2.3 is used])
+ fi
fi
fi
else
#define OPJ_CPRL CPRL
#else
#include <stdio.h>
-# if defined(HAVE_OPENJPEG_2_2)
+# if defined(HAVE_OPENJPEG_2_3)
+# include <openjpeg-2.3/openjpeg.h>
+# elif defined(HAVE_OPENJPEG_2_2)
# include <openjpeg-2.2/openjpeg.h>
# elif defined(HAVE_OPENJPEG_2_1)
# include <openjpeg-2.1/openjpeg.h>
openjpeg_cargs = []
-# Check for 2.2, 2.1, then 2.0
-openjpeg_dep = dependency('libopenjp2', version : '>=2.2', required : false)
-if openjpeg_dep.found()
- openjpeg_cargs += ['-DHAVE_OPENJPEG_2_2', '-DHAVE_OPENJPEG_2_1']
-else
- openjpeg_dep = dependency('libopenjp2', version : '>=2.1', required : false)
+max_supported_version = '<2.4'
+supported_versions = [ '2.3', '2.2', '2.1' ]
+foreach version: supported_versions
+ openjpeg_dep = dependency('libopenjp2', version : ['>=' + version, max_supported_version],
+ required : false)
if openjpeg_dep.found()
- openjpeg_cargs += ['-DHAVE_OPENJPEG_2_1']
- else
+ openjpeg_cargs += ['-DHAVE_OPENJPEG_' + version.underscorify()]
+ endif
+endforeach
+
+if not openjpeg_dep.found()
openjpeg_dep = dependency('libopenjp2', required : false)
# Fallback to 1.5
if not openjpeg_dep.found()
openjpeg_dep = dependency('libopenjpeg1', required : false)
openjpeg_cargs += ['-DHAVE_OPENJPEG_1']
endif
- endif
endif
if openjpeg_dep.found()