From owner-svn-ports-all@freebsd.org Wed May 2 13:26: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 AF9E5FA9762; Wed, 2 May 2018 13:26: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 5CC0777B1B; Wed, 2 May 2018 13:26:36 +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 566C4118AE; Wed, 2 May 2018 13:26:36 +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 w42DQaLh047172; Wed, 2 May 2018 13:26:36 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w42DQaOE047171; Wed, 2 May 2018 13:26:36 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201805021326.w42DQaOE047171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Wed, 2 May 2018 13:26:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r468834 - head/emulators/visualboyadvance-m/files X-SVN-Group: ports-head X-SVN-Commit-Author: jbeich X-SVN-Commit-Paths: head/emulators/visualboyadvance-m/files X-SVN-Commit-Revision: 468834 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: Wed, 02 May 2018 13:26:37 -0000 Author: jbeich Date: Wed May 2 13:26:36 2018 New Revision: 468834 URL: https://svnweb.freebsd.org/changeset/ports/468834 Log: emulators/visualboyadvance-m: unbreak with ffmpeg 4.0 src/common/ffmpeg.cpp:288:27: error: use of undeclared identifier 'FF_MIN_BUFFER_SIZE' audio_buf = (u8 *)malloc(AUDIO_BUF_LEN); ^ src/common/ffmpeg.cpp:88:36: note: expanded from macro 'AUDIO_BUF_LEN' ^ src/common/ffmpeg.cpp:288:27: error: use of undeclared identifier 'FF_MIN_BUFFER_SIZE' src/common/ffmpeg.cpp:88:69: note: expanded from macro 'AUDIO_BUF_LEN' ^ src/common/ffmpeg.cpp:307:27: error: use of undeclared identifier 'FF_MIN_BUFFER_SIZE' video_buf = (u8 *)malloc(VIDEO_BUF_LEN); ^ src/common/ffmpeg.cpp:90:24: note: expanded from macro 'VIDEO_BUF_LEN' ^ src/common/ffmpeg.cpp:438:29: error: use of undeclared identifier 'AVFMT_RAWPICTURE' if(oc->oformat->flags & AVFMT_RAWPICTURE) { ^ src/common/ffmpeg.cpp:447:20: error: use of undeclared identifier 'FF_MIN_BUFFER_SIZE' pkt.size = VIDEO_BUF_LEN; ^ src/common/ffmpeg.cpp:90:24: note: expanded from macro 'VIDEO_BUF_LEN' ^ src/common/ffmpeg.cpp:463:16: error: use of undeclared identifier 'FF_MIN_BUFFER_SIZE' if(pkt.size > VIDEO_BUF_LEN) { ^ src/common/ffmpeg.cpp:90:24: note: expanded from macro 'VIDEO_BUF_LEN' ^ PR: 227726 Reported by: antoine (via exp-run) Obtained from: upstream Modified: head/emulators/visualboyadvance-m/files/patch-src_common_ffmpeg.cpp (contents, props changed) Modified: head/emulators/visualboyadvance-m/files/patch-src_common_ffmpeg.cpp ============================================================================== --- head/emulators/visualboyadvance-m/files/patch-src_common_ffmpeg.cpp Wed May 2 13:26:23 2018 (r468833) +++ head/emulators/visualboyadvance-m/files/patch-src_common_ffmpeg.cpp Wed May 2 13:26:36 2018 (r468834) @@ -2,6 +2,7 @@ https://github.com/visualboyadvance-m/visualboyadvance https://github.com/visualboyadvance-m/visualboyadvance-m/commit/a3a07d2 https://github.com/visualboyadvance-m/visualboyadvance-m/commit/029a5fc https://github.com/visualboyadvance-m/visualboyadvance-m/commit/3f3c385 +https://github.com/visualboyadvance-m/visualboyadvance-m/commit/f3f6ee7 --- src/common/ffmpeg.cpp.orig 2015-09-19 15:58:26 UTC +++ src/common/ffmpeg.cpp @@ -32,7 +33,32 @@ https://github.com/visualboyadvance-m/visualboyadvance #define priv_AVFormatContext AVFormatContext #define priv_AVStream AVStream #define priv_AVOutputFormat AVOutputFormat -@@ -103,10 +123,16 @@ MediaRet MediaRecorder::setup_sound_stream(const char *fname, AVOutputFormat *fm +@@ -64,11 +84,22 @@ static void avformat_free_context(AVFormatContext *ctx) + // I have no idea what size to make these buffers + // I don't see any ffmpeg functions to guess the size, either + +-// use frame size, or FF_MIN_BUFFER_SIZE (that seems to be what it wants) ++#ifdef AV_INPUT_BUFFER_MIN_SIZE ++ ++ // use frame size, or AV_INPUT_BUFFER_MIN_SIZE (that seems to be what it wants) ++#define AUDIO_BUF_LEN (frame_len > AV_INPUT_BUFFER_MIN_SIZE ? frame_len : AV_INPUT_BUFFER_MIN_SIZE) ++ // use maximum frame size * 32 bpp * 2 for good measure ++#define VIDEO_BUF_LEN (AV_INPUT_BUFFER_MIN_SIZE + 256 * 244 * 4 * 2) ++ ++#else ++ ++ // use frame size, or FF_MIN_BUFFER_SIZE (that seems to be what it wants) + #define AUDIO_BUF_LEN (frame_len > FF_MIN_BUFFER_SIZE ? frame_len : FF_MIN_BUFFER_SIZE) +-// use maximum frame size * 32 bpp * 2 for good measure ++ // use maximum frame size * 32 bpp * 2 for good measure + #define VIDEO_BUF_LEN (FF_MIN_BUFFER_SIZE + 256 * 244 * 4 * 2) + ++#endif ++ + bool MediaRecorder::did_init = false; + + MediaRecorder::MediaRecorder() : oc(0), vid_st(0), aud_st(0), video_buf(0), +@@ -103,10 +134,16 @@ MediaRet MediaRecorder::setup_sound_stream(const char *fname, AVOutputFormat *fm oc = NULL; return MRET_ERR_NOMEM; } @@ -50,7 +76,7 @@ https://github.com/visualboyadvance-m/visualboyadvance ctx->bit_rate = 128000; // arbitrary; in case we're generating mp3 ctx->sample_rate = soundGetSampleRate(); ctx->channels = 2; -@@ -115,7 +141,6 @@ MediaRet MediaRecorder::setup_sound_stream(const char *fname, AVOutputFormat *fm +@@ -115,7 +152,6 @@ MediaRet MediaRecorder::setup_sound_stream(const char *fname, AVOutputFormat *fm if(fmt->flags & AVFMT_GLOBALHEADER) ctx->flags |= CODEC_FLAG_GLOBAL_HEADER; @@ -58,7 +84,7 @@ https://github.com/visualboyadvance-m/visualboyadvance #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53,6,0) if(!codec || avcodec_open(ctx, codec)) { #else -@@ -369,6 +394,7 @@ MediaRecorder::~MediaRecorder() +@@ -369,6 +405,7 @@ MediaRecorder::~MediaRecorder() Stop(); } @@ -66,7 +92,7 @@ https://github.com/visualboyadvance-m/visualboyadvance MediaRet MediaRecorder::AddFrame(const u8 *vid) { if(!oc || !vid_st) -@@ -376,6 +402,9 @@ MediaRet MediaRecorder::AddFrame(const u8 *vid) +@@ -376,6 +413,9 @@ MediaRet MediaRecorder::AddFrame(const u8 *vid) AVCodecContext *ctx = vid_st->codec; AVPacket pkt; @@ -76,10 +102,19 @@ https://github.com/visualboyadvance-m/visualboyadvance // strip borders. inconsistent between depths for some reason // but fortunately consistent between gb/gba. -@@ -413,7 +442,20 @@ MediaRet MediaRecorder::AddFrame(const u8 *vid) +@@ -406,6 +446,7 @@ MediaRet MediaRecorder::AddFrame(const u8 *vid) + } + av_init_packet(&pkt); + pkt.stream_index = vid_st->index; ++#ifdef AVFMT_RAWPICTURE + if(oc->oformat->flags & AVFMT_RAWPICTURE) { + // this won't work due to border + // not sure what formats set this, anyway +@@ -413,7 +454,21 @@ MediaRet MediaRecorder::AddFrame(const u8 *vid) pkt.data = f->data[0]; pkt.size = linesize * ctx->height; } else { ++#endif +#if LIBAVCODEC_VERSION_MAJOR > 56 + pkt.data = video_buf; + pkt.size = VIDEO_BUF_LEN; @@ -97,7 +132,17 @@ https://github.com/visualboyadvance-m/visualboyadvance if(!pkt.size) return MRET_OK; if(ctx->coded_frame && ctx->coded_frame->pts != AV_NOPTS_VALUE) -@@ -438,6 +480,53 @@ MediaRet MediaRecorder::AddFrame(const u8 *vid) +@@ -426,7 +481,9 @@ MediaRet MediaRecorder::AddFrame(const u8 *vid) + if(ctx->coded_frame->key_frame) + pkt.flags |= AV_PKT_FLAG_KEY; + pkt.data = video_buf; ++#ifdef AVFMT_RAWPICTURE + } ++#endif + if(av_interleaved_write_frame(oc, &pkt) < 0) { + avformat_free_context(oc); + oc = NULL; +@@ -438,6 +495,53 @@ MediaRet MediaRecorder::AddFrame(const u8 *vid) return MRET_OK; } @@ -151,7 +196,7 @@ https://github.com/visualboyadvance-m/visualboyadvance MediaRet MediaRecorder::AddFrame(const u16 *aud) { if(!oc || !aud_st) -@@ -465,13 +554,19 @@ MediaRet MediaRecorder::AddFrame(const u16 *aud) +@@ -465,13 +569,19 @@ MediaRet MediaRecorder::AddFrame(const u16 *aud) } while(len + in_audio_buf2 >= frame_len) { av_init_packet(&pkt);