mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 04:22:27 +00:00
openjpeg: Remove compatibility with openjpeg 2.0
Everyone seems to be shipping 2.1 as the oldest v2 version, even debian oldstable (jessie). Also remove an unneeded (debug?) #include <stdio.h>. https://bugzilla.gnome.org/show_bug.cgi?id=788703
This commit is contained in:
parent
bff2d834a4
commit
e5977b8794
5 changed files with 8 additions and 33 deletions
10
configure.ac
10
configure.ac
|
@ -2864,14 +2864,8 @@ dnl *** OpenJPEG ***
|
||||||
translit(dnm, m, l) AM_CONDITIONAL(USE_OPENJPEG, true)
|
translit(dnm, m, l) AM_CONDITIONAL(USE_OPENJPEG, true)
|
||||||
AG_GST_CHECK_FEATURE(OPENJPEG, [openjpeg library], openjpeg, [
|
AG_GST_CHECK_FEATURE(OPENJPEG, [openjpeg library], openjpeg, [
|
||||||
HAVE_OPENJPEG="no"
|
HAVE_OPENJPEG="no"
|
||||||
AG_GST_PKG_CHECK_MODULES(OPENJPEG, libopenjp2 >= 2.0)
|
AG_GST_PKG_CHECK_MODULES(OPENJPEG, libopenjp2 >= 2.1)
|
||||||
if test x"$HAVE_OPENJPEG" = x"yes"; then
|
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
|
|
||||||
# Fallback to v1.5
|
# Fallback to v1.5
|
||||||
OPENJPEG_LIBS=""
|
OPENJPEG_LIBS=""
|
||||||
PKG_CHECK_MODULES(OPENJPEG, libopenjpeg1,
|
PKG_CHECK_MODULES(OPENJPEG, libopenjpeg1,
|
||||||
|
|
|
@ -21,8 +21,9 @@
|
||||||
#ifndef __GST_OPENJPEG_H__
|
#ifndef __GST_OPENJPEG_H__
|
||||||
#define __GST_OPENJPEG_H__
|
#define __GST_OPENJPEG_H__
|
||||||
|
|
||||||
#ifdef HAVE_OPENJPEG_1
|
|
||||||
#include <openjpeg.h>
|
#include <openjpeg.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_OPENJPEG_1
|
||||||
#define OPJ_CLRSPC_UNKNOWN CLRSPC_UNKNOWN
|
#define OPJ_CLRSPC_UNKNOWN CLRSPC_UNKNOWN
|
||||||
#define OPJ_CLRSPC_SRGB CLRSPC_SRGB
|
#define OPJ_CLRSPC_SRGB CLRSPC_SRGB
|
||||||
#define OPJ_CLRSPC_GRAY CLRSPC_GRAY
|
#define OPJ_CLRSPC_GRAY CLRSPC_GRAY
|
||||||
|
@ -36,13 +37,6 @@
|
||||||
#define OPJ_RPCL RPCL
|
#define OPJ_RPCL RPCL
|
||||||
#define OPJ_PCRL PCRL
|
#define OPJ_PCRL PCRL
|
||||||
#define OPJ_CPRL CPRL
|
#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
|
||||||
|
|
||||||
#endif /* __GST_OPENJPEG_H__ */
|
#endif /* __GST_OPENJPEG_H__ */
|
||||||
|
|
|
@ -1138,11 +1138,7 @@ gst_openjpeg_dec_handle_frame (GstVideoDecoder * decoder,
|
||||||
opj_stream_set_write_function (stream, write_fn);
|
opj_stream_set_write_function (stream, write_fn);
|
||||||
opj_stream_set_skip_function (stream, skip_fn);
|
opj_stream_set_skip_function (stream, skip_fn);
|
||||||
opj_stream_set_seek_function (stream, seek_fn);
|
opj_stream_set_seek_function (stream, seek_fn);
|
||||||
#ifdef HAVE_OPENJPEG_2_1
|
|
||||||
opj_stream_set_user_data (stream, &mstream, NULL);
|
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);
|
opj_stream_set_user_data_length (stream, mstream.size);
|
||||||
|
|
||||||
image = NULL;
|
image = NULL;
|
||||||
|
|
|
@ -958,11 +958,7 @@ gst_openjpeg_enc_handle_frame (GstVideoEncoder * encoder,
|
||||||
opj_stream_set_write_function (stream, write_fn);
|
opj_stream_set_write_function (stream, write_fn);
|
||||||
opj_stream_set_skip_function (stream, skip_fn);
|
opj_stream_set_skip_function (stream, skip_fn);
|
||||||
opj_stream_set_seek_function (stream, seek_fn);
|
opj_stream_set_seek_function (stream, seek_fn);
|
||||||
#ifdef HAVE_OPENJPEG_2_1
|
|
||||||
opj_stream_set_user_data (stream, &mstream, NULL);
|
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);
|
opj_stream_set_user_data_length (stream, mstream.size);
|
||||||
|
|
||||||
if (!opj_start_compress (enc, image, stream))
|
if (!opj_start_compress (enc, image, stream))
|
||||||
|
|
|
@ -6,16 +6,11 @@ openjpeg_sources = [
|
||||||
|
|
||||||
openjpeg_cargs = []
|
openjpeg_cargs = []
|
||||||
|
|
||||||
# Check for 2.1, then 2.0, then 1.5
|
|
||||||
openjpeg_dep = dependency('libopenjp2', version : '>=2.1', required : false)
|
openjpeg_dep = dependency('libopenjp2', version : '>=2.1', required : false)
|
||||||
if openjpeg_dep.found()
|
if not openjpeg_dep.found()
|
||||||
openjpeg_cargs += ['-DHAVE_OPENJPEG_2_1']
|
# Fallback to v1.5
|
||||||
else
|
openjpeg_dep = dependency('libopenjpeg1', required : false)
|
||||||
openjpeg_dep = dependency('libopenjp2', required : false)
|
openjpeg_cargs += ['-DHAVE_OPENJPEG_1']
|
||||||
if not openjpeg_dep.found()
|
|
||||||
openjpeg_dep = dependency('libopenjpeg1', required : false)
|
|
||||||
openjpeg_cargs += ['-DHAVE_OPENJPEG_1']
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if openjpeg_dep.found()
|
if openjpeg_dep.found()
|
||||||
|
|
Loading…
Reference in a new issue