Commit d1cbeb4f authored by Jan Alexander Steffens (heftig)'s avatar Jan Alexander Steffens (heftig) Committed by Sebastian Dröge

Revert "openjpeg: Support building with openjpeg 2.3"

This reverts commit ef4d6b93.

A better fix follows.

https://bugzilla.gnome.org/show_bug.cgi?id=788703
parent 9cff4f69
......@@ -2874,11 +2874,6 @@ AG_GST_CHECK_FEATURE(OPENJPEG, [openjpeg library], openjpeg, [
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
......
......@@ -38,9 +38,7 @@
#define OPJ_CPRL CPRL
#else
#include <stdio.h>
# if defined(HAVE_OPENJPEG_2_3)
# include <openjpeg-2.3/openjpeg.h>
# elif defined(HAVE_OPENJPEG_2_2)
# if defined(HAVE_OPENJPEG_2_2)
# include <openjpeg-2.2/openjpeg.h>
# elif defined(HAVE_OPENJPEG_2_1)
# include <openjpeg-2.1/openjpeg.h>
......
......@@ -6,23 +6,22 @@ openjpeg_sources = [
openjpeg_cargs = []
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)
# 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)
if openjpeg_dep.found()
openjpeg_cargs += ['-DHAVE_OPENJPEG_' + version.underscorify()]
endif
endforeach
if not openjpeg_dep.found()
openjpeg_cargs += ['-DHAVE_OPENJPEG_2_1']
else
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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment