FreeBSD Bugzilla – Attachment 176627 Details for
Bug 214188
emulators/kcemu: fails to build with ffmpeg 3.x
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
fix, v1
kcemu.ffmpeg30.diff (text/plain), 5.32 KB, created by
Jan Beich
on 2016-11-04 15:47:58 UTC
(
hide
)
Description:
fix, v1
Filename:
MIME Type:
Creator:
Jan Beich
Created:
2016-11-04 15:47:58 UTC
Size:
5.32 KB
patch
obsolete
>From 25aff404f55b3f52bb66f6f2c2b5dd54351196d1 Mon Sep 17 00:00:00 2001 >From: Jan Beich <jbeich@FreeBSD.org> >Date: Fri, 4 Nov 2016 15:22:05 +0000 >Subject: emulators/kcemu: unbreak build with ffmpeg 3.x > >ffmpeg.cc:79:29: error: use of undeclared identifier 'PIX_FMT_YUV420P'; did you mean 'AV_PIX_FMT_YUV420P'? > _stream->codec->pix_fmt = PIX_FMT_YUV420P; > ^~~~~~~~~~~~~~~ > AV_PIX_FMT_YUV420P >/usr/local/include/libavutil/pixfmt.h:62:5: note: 'AV_PIX_FMT_YUV420P' declared here > AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) > ^ >ffmpeg.cc:100:12: error: use of undeclared identifier 'avcodec_alloc_frame' > _frame = avcodec_alloc_frame(); > ^ >ffmpeg.cc:159:18: error: use of undeclared identifier 'avcodec_encode_video'; did you mean 'avcodec_encode_video2'? > int out_size = avcodec_encode_video(_stream->codec, _buf, _bufsize, _frame); > ^~~~~~~~~~~~~~~~~~~~ > avcodec_encode_video2 >/usr/local/include/libavcodec/avcodec.h:5261:5: note: 'avcodec_encode_video2' declared here >int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, > ^ >ffmpeg.cc:159:55: error: cannot initialize a parameter of type 'AVPacket *' with an lvalue of type 'byte_t *' (aka 'unsigned char *') > int out_size = avcodec_encode_video(_stream->codec, _buf, _bufsize, _frame); > ^~~~ >/usr/local/include/libavcodec/avcodec.h:5261:60: note: passing argument to parameter 'avpkt' here >int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, > ^ > >PR: 214188 >Approved by: Hardy Schumacher <hardy.schumacher@gmx.de> (maintainer) >--- > emulators/kcemu/Makefile | 2 +- > emulators/kcemu/files/patch-src-ui-gtk-ffmpeg.cc | 52 ++++++++++++++++++++---- > 2 files changed, 45 insertions(+), 9 deletions(-) > >diff --git a/emulators/kcemu/Makefile b/emulators/kcemu/Makefile >index 7b6674b..2ad062e 100644 >--- a/emulators/kcemu/Makefile >+++ b/emulators/kcemu/Makefile >@@ -3,7 +3,7 @@ > > PORTNAME= kcemu > PORTVERSION= 0.5.1 >-PORTREVISION= 8 >+PORTREVISION= 9 > CATEGORIES= emulators > MASTER_SITES= SF/${PORTNAME}/KCemu/KCemu-${PORTVERSION} > DISTNAME= KCemu-${PORTVERSION} >diff --git a/emulators/kcemu/files/patch-src-ui-gtk-ffmpeg.cc b/emulators/kcemu/files/patch-src-ui-gtk-ffmpeg.cc >index 8ee8646..e606888 100644 >--- a/emulators/kcemu/files/patch-src-ui-gtk-ffmpeg.cc >+++ b/emulators/kcemu/files/patch-src-ui-gtk-ffmpeg.cc >@@ -1,5 +1,5 @@ >---- src/ui/gtk/ffmpeg.cc.orig 2010-03-07 20:50:23.000000000 +0100 >-+++ src/ui/gtk/ffmpeg.cc 2015-07-03 22:59:12.842256554 +0200 >+--- src/ui/gtk/ffmpeg.cc.orig 2010-03-07 19:50:23 UTC >++++ src/ui/gtk/ffmpeg.cc > @@ -48,7 +48,7 @@ FfmpegVideoEncoder::init(const char *fil > > av_register_all(); >@@ -27,7 +27,14 @@ > _stream->codec->codec_tag = MKTAG('D', 'X', '5', '0'); > > _stream->codec->bit_rate = 79000 + 1000 * pow(1.4, quality * 20.0); >-@@ -81,14 +82,8 @@ FfmpegVideoEncoder::init(const char *fil >+@@ -75,20 +76,14 @@ FfmpegVideoEncoder::init(const char *fil >+ _stream->codec->time_base.den = 50; >+ _stream->codec->time_base.num = fps_den; >+ _stream->codec->gop_size = 100 / fps_den; >+- _stream->codec->pix_fmt = PIX_FMT_YUV420P; >++ _stream->codec->pix_fmt = AV_PIX_FMT_YUV420P; >+ >+ // some formats want stream headers to be separate > if (_context->oformat->flags & AVFMT_GLOBALHEADER) > _stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER; > >@@ -43,6 +50,15 @@ > { > close(); > return false; >+@@ -102,7 +97,7 @@ FfmpegVideoEncoder::init(const char *fil >+ return false; >+ } >+ >+- _frame = avcodec_alloc_frame(); >++ _frame = av_frame_alloc(); >+ if (_frame == NULL) >+ { >+ close(); > @@ -119,14 +114,14 @@ FfmpegVideoEncoder::init(const char *fil > > avpicture_fill((AVPicture *) _frame, buf, _stream->codec->pix_fmt, width, height); >@@ -60,16 +76,36 @@ > return true; > } > >-@@ -171,7 +166,7 @@ FfmpegVideoEncoder::encode(byte_t *image >+@@ -161,20 +156,21 @@ FfmpegVideoEncoder::encode(byte_t *image >+ } >+ } >+ >+- int out_size = avcodec_encode_video(_stream->codec, _buf, _bufsize, _frame); >+- if (out_size == 0) >+- return true; >+- >+ AVPacket pkt; >+ av_init_packet(&pkt); >++ pkt.data = _buf; >++ pkt.size = _bufsize; >++ >++ int got_packet = 0; >++ int ret = avcodec_encode_video2(_stream->codec, &pkt, _frame, &got_packet); >++ if (ret < 0 || !got_packet || pkt.size <= 0) >++ return true; >+ > if (_stream->codec->coded_frame->pts != AV_NOPTS_VALUE) > pkt.pts = av_rescale_q(_stream->codec->coded_frame->pts, _stream->codec->time_base, _stream->time_base); > if (_stream->codec->coded_frame->key_frame) > - pkt.flags |= PKT_FLAG_KEY; > + pkt.flags |= AV_PKT_FLAG_KEY; > pkt.stream_index = _stream->index; >- pkt.data = _buf; >- pkt.size = out_size; >-@@ -197,7 +192,7 @@ FfmpegVideoEncoder::close(void) >+- pkt.data = _buf; >+- pkt.size = out_size; >+ >+ return av_interleaved_write_frame(_context, &pkt) == 0; >+ } >+@@ -197,7 +193,7 @@ FfmpegVideoEncoder::close(void) > av_freep(&_context->streams[i]->codec); > av_freep(&_context->streams[i]); > } >@@ -78,7 +114,7 @@ > > av_free(_context); > >-@@ -207,4 +202,4 @@ FfmpegVideoEncoder::close(void) >+@@ -207,4 +203,4 @@ FfmpegVideoEncoder::close(void) > _buf = NULL; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
jbeich
:
maintainer-approval?
(hardy.schumacher)
Actions:
View
|
Diff
Attachments on
bug 214188
: 176627