[FFmpeg-devel] [PATCH] lavc: drop support for OpenJPEG 1.3-2.0

James Almer jamrial at gmail.com
Wed Oct 18 22:26:03 EEST 2017


On 10/18/2017 3:43 PM, Michael Bradshaw wrote:
> Hi,
> 
> Attached patch drops support for OpenJPEG 1.3, 1.4, 1.5, and 2.0. After
> this patch, only versions 2.1 and above will be supported (and will require
> pkg-config).
> 
> Tested locally on macOS with OpenJPEG 2.3 by both encoding and decoding a
> jp2 file.
> 
> Please review.
> 
> Thanks,
> 
> --Michael

Add a line to Changelog about dropping support for OpenJPEG <= 2.0.

> From b1f10da6e945c361b181364f396c5051410afcc4 Mon Sep 17 00:00:00 2001
> From: Michael Bradshaw <mjbshaw at google.com>
> Date: Wed, 18 Oct 2017 11:34:06 -0700
> Subject: [PATCH] lavc: drop support for OpenJPEG 1.3-2.0
> 
> We now require 2.1+ with pkg-config.
> 
> Signed-off-by: Michael Bradshaw <mjbshaw at google.com>
> ---
>  configure                   |  16 +----
>  libavcodec/libopenjpegdec.c | 103 ++---------------------------
>  libavcodec/libopenjpegenc.c | 156 +++++++-------------------------------------
>  3 files changed, 32 insertions(+), 243 deletions(-)
> 
> diff --git a/configure b/configure
> index e4c4567138..95e7f83e79 100755
> --- a/configure
> +++ b/configure
> @@ -1938,11 +1938,6 @@ HEADERS_LIST="
>      machine_ioctl_meteor_h
>      malloc_h
>      opencv2_core_core_c_h
> -    openjpeg_2_3_openjpeg_h
> -    openjpeg_2_2_openjpeg_h
> -    openjpeg_2_1_openjpeg_h
> -    openjpeg_2_0_openjpeg_h
> -    openjpeg_1_5_openjpeg_h
>      OpenGL_gl3_h
>      poll_h
>      soundcard_h
> @@ -6034,16 +6029,7 @@ enabled libopencv         && { check_header opencv2/core/core_c.h &&
>                                   require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
>                                 require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
>  enabled libopenh264       && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
> -enabled libopenjpeg       && { { check_lib libopenjpeg openjpeg-2.3/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
> -                               check_lib libopenjpeg openjpeg-2.3/openjpeg.h opj_version -lopenjp2 ||
> -                               { check_lib libopenjpeg openjpeg-2.2/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
> -                               check_lib libopenjpeg openjpeg-2.2/openjpeg.h opj_version -lopenjp2 ||
> -                               { check_lib libopenjpeg openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
> -                               check_lib libopenjpeg openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
> -                               { check_lib libopenjpeg openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
> -                               { check_lib libopenjpeg openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
> -                               { check_lib libopenjpeg openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
> -                               die "ERROR: libopenjpeg not found"; }
> +enabled libopenjpeg       && require_pkg_config libopenjpeg libopenjp2 openjpeg.h opj_version

OpenJPEG 2.0.1 ships a pkg-config file, so change the second argument to
"libopenjp2 >= 2.1.0".

Aside from that LGTM. It's nice to see all the bloat gone and every
future 2.x version being supported without further changes from now on.


More information about the ffmpeg-devel mailing list