From owner-svn-ports-all@freebsd.org Tue Apr 24 00:17:36 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21304FAEF22; Tue, 24 Apr 2018 00:17:36 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C72276EE81; Tue, 24 Apr 2018 00:17:35 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1D5B364D; Tue, 24 Apr 2018 00:17:35 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3O0HZka019720; Tue, 24 Apr 2018 00:17:35 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O0HZiI019719; Tue, 24 Apr 2018 00:17:35 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201804240017.w3O0HZiI019719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Tue, 24 Apr 2018 00:17:35 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r468157 - head/graphics/opencv/files X-SVN-Group: ports-head X-SVN-Commit-Author: jbeich X-SVN-Commit-Paths: head/graphics/opencv/files X-SVN-Commit-Revision: 468157 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 00:17:36 -0000 Author: jbeich Date: Tue Apr 24 00:17:35 2018 New Revision: 468157 URL: https://svnweb.freebsd.org/changeset/ports/468157 Log: graphics/opencv: unbreak with ffmpeg 4.0 In file included from modules/highgui/src/cap_ffmpeg.cpp:45: modules/highgui/src/cap_ffmpeg_impl.hpp:1481:21: error: use of undeclared identifier 'CODEC_FLAG_GLOBAL_HEADER' c->flags |= CODEC_FLAG_GLOBAL_HEADER; ^ modules/highgui/src/cap_ffmpeg_impl.hpp:1505:30: error: use of undeclared identifier 'AVFMT_RAWPICTURE' if (oc->oformat->flags & AVFMT_RAWPICTURE) { ^ modules/highgui/src/cap_ffmpeg_impl.hpp:1679:35: error: use of undeclared identifier 'AVFMT_RAWPICTURE' if( (oc->oformat->flags & AVFMT_RAWPICTURE) == 0 ) ^ modules/highgui/src/cap_ffmpeg_impl.hpp:1913:32: error: use of undeclared identifier 'AVFMT_RAWPICTURE' if (!(oc->oformat->flags & AVFMT_RAWPICTURE)) { ^ modules/highgui/src/cap_ffmpeg_impl.hpp:2207:25: error: use of undeclared identifier 'CODEC_FLAG_GLOBAL_HEADER' c->flags |= CODEC_FLAG_GLOBAL_HEADER; ^ PR: 227726 Obtained from: upstream (via Homebrew) Added: head/graphics/opencv/files/patch-modules_highgui_src_cap__ffmpeg__impl.hpp (contents, props changed) Added: head/graphics/opencv/files/patch-modules_highgui_src_cap__ffmpeg__impl.hpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/opencv/files/patch-modules_highgui_src_cap__ffmpeg__impl.hpp Tue Apr 24 00:17:35 2018 (r468157) @@ -0,0 +1,94 @@ +https://github.com/opencv/opencv/commit/99091a62463e + +--- modules/highgui/src/cap_ffmpeg_impl.hpp.orig 2016-09-16 15:55:58 UTC ++++ modules/highgui/src/cap_ffmpeg_impl.hpp +@@ -170,6 +170,10 @@ extern "C" { + #define AV_PIX_FMT_GRAY16BE PIX_FMT_GRAY16BE + #endif + ++#ifndef PKT_FLAG_KEY ++#define PKT_FLAG_KEY AV_PKT_FLAG_KEY ++#endif ++ + #if LIBAVUTIL_BUILD >= (LIBAVUTIL_VERSION_MICRO >= 100 \ + ? CALC_FFMPEG_VERSION(52, 38, 100) : CALC_FFMPEG_VERSION(52, 13, 0)) + #define USE_AV_FRAME_GET_BUFFER 1 +@@ -1478,7 +1482,11 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatC + // some formats want stream headers to be seperate + if(oc->oformat->flags & AVFMT_GLOBALHEADER) + { ++#if LIBAVCODEC_BUILD > CALC_FFMPEG_VERSION(56, 35, 0) ++ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; ++#else + c->flags |= CODEC_FLAG_GLOBAL_HEADER; ++#endif + } + #endif + +@@ -1502,23 +1510,24 @@ static int icv_av_write_frame_FFMPEG( AVFormatContext + #endif + int ret = OPENCV_NO_FRAMES_WRITTEN_CODE; + +- if (oc->oformat->flags & AVFMT_RAWPICTURE) { ++#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(57, 0, 0) ++ if (oc->oformat->flags & AVFMT_RAWPICTURE) ++ { + /* raw video case. The API will change slightly in the near + futur for that */ + AVPacket pkt; + av_init_packet(&pkt); + +-#ifndef PKT_FLAG_KEY +-#define PKT_FLAG_KEY AV_PKT_FLAG_KEY +-#endif +- + pkt.flags |= PKT_FLAG_KEY; + pkt.stream_index= video_st->index; + pkt.data= (uint8_t *)picture; + pkt.size= sizeof(AVPicture); + + ret = av_write_frame(oc, &pkt); +- } else { ++ } ++ else ++#endif ++ { + /* encode the image */ + AVPacket pkt; + av_init_packet(&pkt); +@@ -1676,7 +1685,9 @@ void CvVideoWriter_FFMPEG::close() + /* write the trailer, if any */ + if(ok && oc) + { +- if( (oc->oformat->flags & AVFMT_RAWPICTURE) == 0 ) ++#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(57, 0, 0) ++ if (!(oc->oformat->flags & AVFMT_RAWPICTURE)) ++#endif + { + for(;;) + { +@@ -1910,7 +1921,10 @@ bool CvVideoWriter_FFMPEG::open( const char * filename + + outbuf = NULL; + +- if (!(oc->oformat->flags & AVFMT_RAWPICTURE)) { ++#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(57, 0, 0) ++ if (!(oc->oformat->flags & AVFMT_RAWPICTURE)) ++#endif ++ { + /* allocate output buffer */ + /* assume we will never get codec output with more than 4 bytes per pixel... */ + outbuf_size = width*height*4; +@@ -2204,7 +2218,11 @@ AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVF + // some formats want stream headers to be seperate + if (oc->oformat->flags & AVFMT_GLOBALHEADER) + { +- c->flags |= CODEC_FLAG_GLOBAL_HEADER; ++ #if LIBAVCODEC_BUILD > CALC_FFMPEG_VERSION(56, 35, 0) ++ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; ++ #else ++ c->flags |= CODEC_FLAG_GLOBAL_HEADER; ++ #endif + } + #endif +