-From 47923096270ca79f362d3809f387463f6bdc1213 Mon Sep 17 00:00:00 2001
+From b08b3ad2c4ca27519b34229b7430af5cb73cc7ef Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Thu, 19 Oct 2017 16:36:17 +0200
Subject: [PATCH] openjpeg: Support building with openjpeg 2.3, simpler
Upstream: https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=bff2d834a4a38f64e555cee3d0144fde6c515acd
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
- configure.ac | 5 -----
- ext/openjpeg/gstopenjpeg.h | 9 ++++-----
- ext/openjpeg/gstopenjpegdec.c | 4 ----
- ext/openjpeg/gstopenjpegenc.c | 4 ----
- ext/openjpeg/meson.build | 20 +++++++-------------
- 5 files changed, 11 insertions(+), 31 deletions(-)
+ configure.ac | 5 -----
+ ext/openjpeg/gstopenjpeg.h | 6 ++----
+ ext/openjpeg/meson.build | 20 +++++++-------------
+ 3 files changed, 9 insertions(+), 22 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7a8d752..f9727ac 100644
else
# Fallback to v1.5
diff --git a/ext/openjpeg/gstopenjpeg.h b/ext/openjpeg/gstopenjpeg.h
-index 52410a4..14e46d4 100644
+index 52410a4..f9ca74a 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
-@@ -38,10 +39,8 @@
+@@ -38,10 +38,8 @@
#define OPJ_CPRL CPRL
#else
#include <stdio.h>
# else
# include <openjpeg-2.0/openjpeg.h>
# endif
-diff --git a/ext/openjpeg/gstopenjpegdec.c b/ext/openjpeg/gstopenjpegdec.c
-index 881769b..e387f19 100644
---- a/ext/openjpeg/gstopenjpegdec.c
-+++ b/ext/openjpeg/gstopenjpegdec.c
-@@ -1036,11 +1036,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 7514a35..1b0bdf8 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 0d97ebb..14b8583 100644
--- a/ext/openjpeg/meson.build