Bug 214188 - emulators/kcemu: fails to build with ffmpeg 3.x
Summary: emulators/kcemu: fails to build with ffmpeg 3.x
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords: patch, patch-ready
Depends on:
Blocks: 207547
  Show dependency treegraph
 
Reported: 2016-11-04 04:33 UTC by Jan Beich
Modified: 2016-11-18 22:02 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (hardy.schumacher)


Attachments
fix, v1 (5.32 KB, patch)
2016-11-04 15:47 UTC, Jan Beich
jbeich: maintainer-approval? (hardy.schumacher)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2016-11-04 04:33:38 UTC
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,
                                                           ^

http://package23.nyi.freebsd.org/data/103i386-default-PR207547/2016-10-04_18h24m30s/logs/errors/kcemu-0.5.1_8.log
Comment 1 Jan Beich freebsd_committer 2016-11-04 15:47:58 UTC
Created attachment 176627 [details]
fix, v1

FreeBSD 10.1 i386 + ffmpeg 2.8 build log: http://sprunge.us/jICZ
Comment 2 commit-hook freebsd_committer 2016-11-18 22:01:38 UTC
A commit references this bug:

Author: jbeich
Date: Fri Nov 18 22:00:37 UTC 2016
New revision: 426344
URL: https://svnweb.freebsd.org/changeset/ports/426344

Log:
  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:	maintainer timeout (2 weeks)

Changes:
  head/emulators/kcemu/Makefile
  head/emulators/kcemu/files/patch-src-ui-gtk-ffmpeg.cc