From patchwork Thu Oct 5 16:36:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: hydra3333@gmail.com X-Patchwork-Id: 5429 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.76 with SMTP id m12csp2222243jah; Thu, 5 Oct 2017 09:36:36 -0700 (PDT) X-Received: by 10.223.166.146 with SMTP id t18mr2789311wrc.64.1507221396721; Thu, 05 Oct 2017 09:36:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507221396; cv=none; d=google.com; s=arc-20160816; b=wHKqJU/DT6G6YjEgnh30BXec1liu0GD/BfxmoyLbFUVatcTODRuj0wHt6gpaq24Xuo i1/Pzug/0P8ag5S6ljV5oPKUbNdBvNuzOE9/OdrQ8UML8XMRL8ObAz70fl8zIPLs88JN 1kVn0ZGnhaUe69OzT7K9QtwEA3LjWfCXDQQ1WbFMmogvXbq84unMjOqjj4qfuIY7Blws P9Z784phy7fTIjgeyRg7iaQLPS+mrc/eFzetF8+UGuPMo/gugBsqDGmvXKK3wdfi7E01 hO80egnUkrFlzxPep6ELoBqcv/0V4/VKKQI1VuZdrJSHv+mOTPdvUZ0s7ckwSov32LEV EDfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:importance:mime-version:date:in-reply-to :references:to:from:message-id:dkim-signature:delivered-to :arc-authentication-results; bh=yoUusT7JUKuBWWLwzDtr2LhdhWujijVDpYK/xuMrA/U=; b=S9pP9a4sUXIL983dWDTkPCE+T78PhrMeuo4m8AfyjgVR5t9FrqE8b2fXe2MlQUdyN1 O56JgAgUoEP0XpUgS5kOnEHXGaBhf2SFOrmoNQ0W+3ioxSNl+I2b5Xy2ihnvl32hV31f nDrfQMsdQ5pl98zRO+VUlRdf6heogDemAse62UkYrkqyBrbTyLmjJgXFdzOB54C2aP6u f8jI1kYqk7Kp1ApnKAqUWaXqJHCRiYkeMN6Ju6+vcZk5KBBCbVxpjbf7zRqf7eiZD161 EzYexfxtAKlcG21YNUTXGU2M2zlCph9id9y5WyMLYl7qbU8FNLlWf0W2bf10TrYw0NQJ crfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=DAUU6zUv; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 68si83171wmm.153.2017.10.05.09.36.35; Thu, 05 Oct 2017 09:36:36 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=DAUU6zUv; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7DD9968A377; Thu, 5 Oct 2017 19:36:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg0-f41.google.com (mail-pg0-f41.google.com [74.125.83.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 300CF68A288 for ; Thu, 5 Oct 2017 19:36:13 +0300 (EEST) Received: by mail-pg0-f41.google.com with SMTP id c137so8515580pga.11 for ; Thu, 05 Oct 2017 09:36:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:from:to:references:in-reply-to:subject:date:mime-version :importance:disposition-notification-to; bh=6lQKEEiFR2calrqxVEBueI6aFxvY4t0HzPMywhY8z9M=; b=DAUU6zUvBzO393zTuVYNgXGPVLAEGrd+HP92sUuWl52aMV/gp2mM0KIN+9nbe6TKnn 4tZcT8PHCrw25CaF0EfcSGkj1SC+jWcE/sYLeezu8PhqopU0W+kiTRL/ydevc7tFwOPO BDG9/NIIEHNaf+qtzm2ZIbzR8nY00TXD8G39oNXq9LM0Ctm5GRfSJEJnWzUjXk+xPcnI g1yd9dbX5xMMXs0HtlBKmIQSjrONdDTB3H0T7MJc6KPIqgBqEcb36jNzfewQblWVEDGb kYc4O3D7RSlILw0JWL7F4A7YE4uTQoTRtaEroMPXPSeqNj4LvnEmIxPMKp35IAWBQ4Qo rv4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:from:to:references:in-reply-to :subject:date:mime-version:importance:disposition-notification-to; bh=6lQKEEiFR2calrqxVEBueI6aFxvY4t0HzPMywhY8z9M=; b=i/BfwFCzoL71plIGACz9I+JIKToDkYUUr9WNM4btFwO6SxxsfcrfJ1m5BJE/CybyDn iM44iXHLLBBSJIWAE9gdRcUQy12URSs2OnpdqXUAgaPS8sz1gaKOcOiFanZlfrFU0qxS kNrXPfx++y6jjmIMoFZeU8R+CxyuDir4me/gRj+CJpxsQb3u179XiFdOjvS4REGA7Qgk 4scJmpv7R8FVJ4KY1ISUye04CjiNytxzWaz070IW008oBoyK+aq3LZnUikFrk8TYqHfF dxF/vaneTYQ5EtvlxsVBpEl9FLUmlCMCzFIhU7kKdXEOcaLHTh2PnGqBloE4BFCMWrAK PL4A== X-Gm-Message-State: AMCzsaVNgxaoBlbG0sF3RpL39uPCOOexNL7WHS1dpnZ44QRz8H5kBLS6 /8MxdYaJKSfFzJhdtY9wRKfGCQ== X-Google-Smtp-Source: AOwi7QDP3hMQuZgQXCgVkjEp38qLL4gOJV5D4m9a0bavycILgqYCzFyFEBwRBVn2MU1WAGEKt1vltw== X-Received: by 10.159.249.6 with SMTP id bf6mr11317505plb.36.1507221386533; Thu, 05 Oct 2017 09:36:26 -0700 (PDT) Received: from i3820w10a (CPE-58-175-84-137.bfcz1.lon.bigpond.net.au. [58.175.84.137]) by smtp.gmail.com with ESMTPSA id e13sm29364384pgt.14.2017.10.05.09.36.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2017 09:36:26 -0700 (PDT) Message-ID: <0DC15E9E74D6436CA39907EBBC2CAF5A@i3820w10a> From: To: References: <00B2A43923544EB0BC94E883CECCA258@i3820w10a> In-Reply-To: <00B2A43923544EB0BC94E883CECCA258@i3820w10a> Date: Fri, 6 Oct 2017 03:06:21 +1030 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] [PATCH] update ffmpeg to recognise and build with newest openjpeg available in its git, up from v2.2 to v2.3 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" OK please ignore/cancel this thread, Michael Bradshaw already got in with a patch that looks functionally the same. http://ffmpeg.org/pipermail/ffmpeg-devel/2017-October/217389.html From: Sent: Friday, October 6, 2017 2:49 AM To: ffmpeg-devel@ffmpeg.org Subject: [PATCH] update ffmpeg to recognise and build with newest openjpeg available in its git, up from v2.2 to v2.3 I have attempted to post my first patch suggestion per https://trac.ffmpeg.org/ticket/6719#comment:1 If I have done something wrong, please feel free to say so (and how to fix it, if possible). Openjpeg git at ​https://github.com/uclouvain/openjpeg is up from v2.2 to v2.3, which means that ffmpeg no longer builds with the openjpeg dependency as built from its git. The patch seems to fix ffmpeg so that it builds with openjpeg v2.3 as a dependency built from its git. From 80412c4b26d197e9627b097443e7032c106de4ff Mon Sep 17 00:00:00 2001 From: hydra3333 Date: Fri, 6 Oct 2017 02:19:34 +1030 Subject: [PATCH] update ffmpeg to recognise and build with newest openjpeg available in its git, up from v2.2 to v2.3 --- configure | 11 +++++++---- libavcodec/libopenjpegdec.c | 8 +++++--- libavcodec/libopenjpegenc.c | 10 ++++++---- 3 files changed, 18 insertions(+), 11 deletions(-) mode change 100755 => 100644 configure diff --git a/configure b/configure old mode 100755 new mode 100644 index 391c141e7a..3c8f84b0c8 --- a/configure +++ b/configure @@ -1930,6 +1930,7 @@ 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 @@ -5910,7 +5911,7 @@ enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && { check_lib libcelt celt/celt.h celt_decoder_create_custom -lcelt0 || die "ERROR: libcelt must be installed and version must be >= 0.11.0."; } -enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas +enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas -DCACA_STATIC && add_cppflags -DCACA_STATIC enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion enabled libfdk_aac && { use_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen || @@ -5937,7 +5938,7 @@ enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 0.8.1" kv # can find the libraries and headers through other means. enabled libmfx && { use_pkg_config libmfx libmfx "mfx/mfxvideo.h" MFXInit || { require libmfx "mfx/mfxvideo.h" MFXInit -llibmfx && warn "using libmfx without pkg-config"; } } -enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load +enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load -DMODPLUG_STATIC && add_cppflags -DMODPLUG_STATIC enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame enabled libmysofa && require libmysofa "mysofa.h" mysofa_load -lmysofa enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc || @@ -5950,7 +5951,9 @@ enabled libopencv && { check_header opencv2/core/core_c.h && require opencv 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.2/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || +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 || @@ -5980,7 +5983,7 @@ enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init -lspeex enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg -enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame && +enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame -DLIBTWOLAME_STATIC && add_cppflags -DLIBTWOLAME_STATIC && { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame || die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; } enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 1210123265..67d47bd6a0 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -34,7 +34,9 @@ #include "internal.h" #include "thread.h" -#if HAVE_OPENJPEG_2_2_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H +# include +#elif HAVE_OPENJPEG_2_2_OPENJPEG_H # include #elif HAVE_OPENJPEG_2_1_OPENJPEG_H # include @@ -46,7 +48,7 @@ # include #endif -#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H # define OPENJPEG_MAJOR_VERSION 2 # define OPJ(x) OPJ_##x #else @@ -431,7 +433,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, opj_stream_set_read_function(stream, stream_read); opj_stream_set_skip_function(stream, stream_skip); opj_stream_set_seek_function(stream, stream_seek); -#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H opj_stream_set_user_data(stream, &reader, NULL); #elif HAVE_OPENJPEG_2_0_OPENJPEG_H opj_stream_set_user_data(stream, &reader); diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index b67e533d1d..92b4433b04 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -32,7 +32,9 @@ #include "avcodec.h" #include "internal.h" -#if HAVE_OPENJPEG_2_2_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H +# include +#elif HAVE_OPENJPEG_2_2_OPENJPEG_H # include #elif HAVE_OPENJPEG_2_1_OPENJPEG_H # include @@ -44,7 +46,7 @@ # include #endif -#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H # define OPENJPEG_MAJOR_VERSION 2 # define OPJ(x) OPJ_##x #else @@ -307,7 +309,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx) opj_set_default_encoder_parameters(&ctx->enc_params); -#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H switch (ctx->cinema_mode) { case OPJ_CINEMA2K_24: ctx->enc_params.rsiz = OPJ_PROFILE_CINEMA_2K; @@ -771,7 +773,7 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, opj_stream_set_write_function(stream, stream_write); opj_stream_set_skip_function(stream, stream_skip); opj_stream_set_seek_function(stream, stream_seek); -#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H opj_stream_set_user_data(stream, &writer, NULL); #elif HAVE_OPENJPEG_2_0_OPENJPEG_H opj_stream_set_user_data(stream, &writer);