diff options
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | ext/openjpeg/gstopenjpeg.h | 10 | ||||
-rw-r--r-- | ext/openjpeg/gstopenjpegdec.c | 4 | ||||
-rw-r--r-- | ext/openjpeg/gstopenjpegenc.c | 4 | ||||
-rw-r--r-- | ext/openjpeg/meson.build | 13 |
5 files changed, 8 insertions, 33 deletions
diff --git a/configure.ac b/configure.ac index 7bef68816..744c9cd43 100644 --- a/configure.ac +++ b/configure.ac @@ -2864,14 +2864,8 @@ dnl *** OpenJPEG *** translit(dnm, m, l) AM_CONDITIONAL(USE_OPENJPEG, true) AG_GST_CHECK_FEATURE(OPENJPEG, [openjpeg library], openjpeg, [ HAVE_OPENJPEG="no" - AG_GST_PKG_CHECK_MODULES(OPENJPEG, libopenjp2 >= 2.0) - if test x"$HAVE_OPENJPEG" = x"yes"; then - dnl minor API changes in v2.1 - AG_GST_PKG_CHECK_MODULES(OPENJPEG_2_1, libopenjp2 >= 2.1) - if test x"$HAVE_OPENJPEG_2_1" = x"yes"; then - AC_DEFINE([HAVE_OPENJPEG_2_1], 1, [Define if OpenJPEG 2.1 is used]) - fi - else + AG_GST_PKG_CHECK_MODULES(OPENJPEG, libopenjp2 >= 2.1) + if test x"$HAVE_OPENJPEG" != x"yes"; then # Fallback to v1.5 OPENJPEG_LIBS="" PKG_CHECK_MODULES(OPENJPEG, libopenjpeg1, diff --git a/ext/openjpeg/gstopenjpeg.h b/ext/openjpeg/gstopenjpeg.h index f9ca74a2f..5985f8437 100644 --- a/ext/openjpeg/gstopenjpeg.h +++ b/ext/openjpeg/gstopenjpeg.h @@ -21,8 +21,9 @@ #ifndef __GST_OPENJPEG_H__ #define __GST_OPENJPEG_H__ -#ifdef HAVE_OPENJPEG_1 #include <openjpeg.h> + +#ifdef HAVE_OPENJPEG_1 #define OPJ_CLRSPC_UNKNOWN CLRSPC_UNKNOWN #define OPJ_CLRSPC_SRGB CLRSPC_SRGB #define OPJ_CLRSPC_GRAY CLRSPC_GRAY @@ -36,13 +37,6 @@ #define OPJ_RPCL RPCL #define OPJ_PCRL PCRL #define OPJ_CPRL CPRL -#else -#include <stdio.h> -# if defined(HAVE_OPENJPEG_2_1) -# include <openjpeg.h> -# else -# include <openjpeg-2.0/openjpeg.h> -# endif #endif #endif /* __GST_OPENJPEG_H__ */ diff --git a/ext/openjpeg/gstopenjpegdec.c b/ext/openjpeg/gstopenjpegdec.c index 881094f1a..da5dedfa2 100644 --- a/ext/openjpeg/gstopenjpegdec.c +++ b/ext/openjpeg/gstopenjpegdec.c @@ -1138,11 +1138,7 @@ gst_openjpeg_dec_handle_frame (GstVideoDecoder * decoder, opj_stream_set_write_function (stream, write_fn); opj_stream_set_skip_function (stream, skip_fn); opj_stream_set_seek_function (stream, seek_fn); -#ifdef HAVE_OPENJPEG_2_1 opj_stream_set_user_data (stream, &mstream, NULL); -#else - opj_stream_set_user_data (stream, &mstream); -#endif opj_stream_set_user_data_length (stream, mstream.size); image = NULL; diff --git a/ext/openjpeg/gstopenjpegenc.c b/ext/openjpeg/gstopenjpegenc.c index 7514a3592..1b0bdf8d4 100644 --- a/ext/openjpeg/gstopenjpegenc.c +++ b/ext/openjpeg/gstopenjpegenc.c @@ -958,11 +958,7 @@ gst_openjpeg_enc_handle_frame (GstVideoEncoder * encoder, opj_stream_set_write_function (stream, write_fn); opj_stream_set_skip_function (stream, skip_fn); opj_stream_set_seek_function (stream, seek_fn); -#ifdef HAVE_OPENJPEG_2_1 opj_stream_set_user_data (stream, &mstream, NULL); -#else - opj_stream_set_user_data (stream, &mstream); -#endif opj_stream_set_user_data_length (stream, mstream.size); if (!opj_start_compress (enc, image, stream)) diff --git a/ext/openjpeg/meson.build b/ext/openjpeg/meson.build index 14b858317..dc64ec62b 100644 --- a/ext/openjpeg/meson.build +++ b/ext/openjpeg/meson.build @@ -6,16 +6,11 @@ openjpeg_sources = [ openjpeg_cargs = [] -# Check for 2.1, then 2.0, then 1.5 openjpeg_dep = dependency('libopenjp2', version : '>=2.1', required : false) -if openjpeg_dep.found() - openjpeg_cargs += ['-DHAVE_OPENJPEG_2_1'] -else - openjpeg_dep = dependency('libopenjp2', required : false) - if not openjpeg_dep.found() - openjpeg_dep = dependency('libopenjpeg1', required : false) - openjpeg_cargs += ['-DHAVE_OPENJPEG_1'] - endif +if not openjpeg_dep.found() + # Fallback to v1.5 + openjpeg_dep = dependency('libopenjpeg1', required : false) + openjpeg_cargs += ['-DHAVE_OPENJPEG_1'] endif if openjpeg_dep.found() |