Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 May 2018 19:50:40 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r468981 - in head/multimedia/vdr-plugin-markad: . files
Message-ID:  <201805031950.w43JoeV4077552@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Thu May  3 19:50:40 2018
New Revision: 468981
URL: https://svnweb.freebsd.org/changeset/ports/468981

Log:
  multimedia/vdr-plugin-markad: unbreak with ffmpeg 4.0
  
  decoder.cpp:175:23: error: use of undeclared identifier 'AV_CODEC_ID_MPEG2VIDEO_XVMC'; did you mean 'AV_CODEC_ID_MPEG2VIDEO'?
          video_codecid=AV_CODEC_ID_MPEG2VIDEO_XVMC;
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                        AV_CODEC_ID_MPEG2VIDEO
  /usr/local/include/libavcodec/avcodec.h:220:5: note: 'AV_CODEC_ID_MPEG2VIDEO' declared here
      AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
      ^
  decoder.cpp:179:43: error: use of undeclared identifier 'AV_CODEC_ID_MPEG2VIDEO_XVMC'; did you mean 'AV_CODEC_ID_MPEG2VIDEO'?
      if ((!video_codec) && (video_codecid==AV_CODEC_ID_MPEG2VIDEO_XVMC))
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                            AV_CODEC_ID_MPEG2VIDEO
  /usr/local/include/libavcodec/avcodec.h:220:5: note: 'AV_CODEC_ID_MPEG2VIDEO' declared here
      AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
      ^
  decoder.cpp:191:45: error: use of undeclared identifier 'CODEC_CAP_TRUNCATED'
              if (video_codec->capabilities & CODEC_CAP_TRUNCATED)
                                              ^
  decoder.cpp:192:39: error: use of undeclared identifier 'CODEC_FLAG_TRUNCATED'
                  video_context->flags|=CODEC_FLAG_TRUNCATED; // we do not send complete frames
                                        ^
  decoder.cpp:194:36: error: use of undeclared identifier 'CODEC_FLAG2_FAST'
              video_context->flags2|=CODEC_FLAG2_FAST; // really?
                                     ^
  decoder.cpp:201:40: error: use of undeclared identifier 'CODEC_FLAG2_CHUNKS'
                  video_context->flags2|=CODEC_FLAG2_CHUNKS; // needed for H264!
                                         ^
  decoder.cpp:214:46: error: use of undeclared identifier 'AV_CODEC_ID_MPEG2VIDEO_XVMC'; did you mean 'AV_CODEC_ID_MPEG2VIDEO'?
              if ((ret < 0) && (video_codecid==AV_CODEC_ID_MPEG2VIDEO_XVMC))
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                               AV_CODEC_ID_MPEG2VIDEO
  /usr/local/include/libavcodec/avcodec.h:220:5: note: 'AV_CODEC_ID_MPEG2VIDEO' declared here
      AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
      ^
  decoder.cpp:224:43: error: no member named 'codec_name' in 'AVCodecContext'; did you mean 'coded_frame'?
                      memset(video_context->codec_name,0,sizeof(video_context->codec_name));
                                            ^~~~~~~~~~
                                            coded_frame
  /usr/local/include/libavcodec/avcodec.h:2760:35: note: 'coded_frame' declared here
      attribute_deprecated AVFrame *coded_frame;
                                    ^
  decoder.cpp:224:78: error: no member named 'codec_name' in 'AVCodecContext'
                      memset(video_context->codec_name,0,sizeof(video_context->codec_name));
                                                                ~~~~~~~~~~~~~  ^
  decoder.cpp:244:22: error: use of undeclared identifier 'AV_CODEC_ID_MPEG2VIDEO_XVMC'; did you mean 'AV_CODEC_ID_MPEG2VIDEO'?
                  case AV_CODEC_ID_MPEG2VIDEO_XVMC:
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                       AV_CODEC_ID_MPEG2VIDEO
  /usr/local/include/libavcodec/avcodec.h:220:5: note: 'AV_CODEC_ID_MPEG2VIDEO' declared here
      AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
      ^
  decoder.cpp:247:22: error: duplicate case value 'AV_CODEC_ID_MPEG2VIDEO'
                  case AV_CODEC_ID_MPEG2VIDEO:
                       ^
  decoder.cpp:244:22: note: previous case defined here
                  case AV_CODEC_ID_MPEG2VIDEO_XVMC:
                       ^
  decoder.cpp:305:14: error: use of undeclared identifier 'AV_CODEC_ID_MPEG2VIDEO_XVMC'; did you mean 'AV_CODEC_ID_MPEG2VIDEO'?
          case AV_CODEC_ID_MPEG2VIDEO_XVMC:
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
               AV_CODEC_ID_MPEG2VIDEO
  /usr/local/include/libavcodec/avcodec.h:220:5: note: 'AV_CODEC_ID_MPEG2VIDEO' declared here
      AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
      ^
  decoder.cpp:308:14: error: duplicate case value 'AV_CODEC_ID_MPEG2VIDEO'
          case AV_CODEC_ID_MPEG2VIDEO:
               ^
  decoder.cpp:305:14: note: previous case defined here
          case AV_CODEC_ID_MPEG2VIDEO_XVMC:
               ^
  
  PR:		227726
  Reported by:	antoine (via exp-run)

Modified:
  head/multimedia/vdr-plugin-markad/Makefile   (contents, props changed)
  head/multimedia/vdr-plugin-markad/files/patch-command_decoder.cpp   (contents, props changed)

Modified: head/multimedia/vdr-plugin-markad/Makefile
==============================================================================
--- head/multimedia/vdr-plugin-markad/Makefile	Thu May  3 19:46:00 2018	(r468980)
+++ head/multimedia/vdr-plugin-markad/Makefile	Thu May  3 19:50:40 2018	(r468981)
@@ -14,8 +14,6 @@ COMMENT=	Video Disk Recorder - MarkAd plugin
 LICENSE=	GPLv2+
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-BROKEN=		fails to build with ffmpeg 4.0
-
 LIB_DEPENDS=	libavcodec.so:multimedia/ffmpeg
 
 RESTRICTED=	Installs station logos

Modified: head/multimedia/vdr-plugin-markad/files/patch-command_decoder.cpp
==============================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-command_decoder.cpp	Thu May  3 19:46:00 2018	(r468980)
+++ head/multimedia/vdr-plugin-markad/files/patch-command_decoder.cpp	Thu May  3 19:50:40 2018	(r468981)
@@ -18,7 +18,7 @@
  
  #include "decoder.h"
  
-@@ -113,6 +119,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+@@ -113,6 +119,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threa
  
      noticeERRVID=false;
  
@@ -26,7 +26,7 @@
      cpu_set_t cpumask;
      uint len = sizeof(cpumask);
      int cpucount=1;
-@@ -120,6 +127,12 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+@@ -120,6 +127,12 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threa
      {
          cpucount=CPU_COUNT(&cpumask);
      }
@@ -39,7 +39,7 @@
  
      if (Threads==-1)
      {
-@@ -151,28 +164,28 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+@@ -151,41 +164,47 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threa
      }
  
      video_codec=NULL;
@@ -54,11 +54,16 @@
      else
      {
 -        video_codecid=CODEC_ID_MPEG2VIDEO_XVMC;
++#ifdef AV_CODEC_ID_MPEG2VIDEO_XVMC
 +        video_codecid=AV_CODEC_ID_MPEG2VIDEO_XVMC;
++#else
++        video_codecid=AV_CODEC_ID_MPEG2VIDEO;
++#endif
      }
  
      video_codec = avcodec_find_decoder(video_codecid);
 -    if ((!video_codec) && (video_codecid==CODEC_ID_MPEG2VIDEO_XVMC))
++#ifdef AV_CODEC_ID_MPEG2VIDEO_XVMC
 +    if ((!video_codec) && (video_codecid==AV_CODEC_ID_MPEG2VIDEO_XVMC))
      {
          // fallback to MPEG2VIDEO
@@ -66,6 +71,7 @@
 +        video_codecid=AV_CODEC_ID_MPEG2VIDEO;
          video_codec=avcodec_find_decoder(video_codecid);
      }
++#endif
  
      if (video_codec)
      {
@@ -73,22 +79,35 @@
 +        video_context = avcodec_alloc_context3(NULL);
          if (video_context)
          {
-             if (video_codec->capabilities & CODEC_CAP_TRUNCATED)
-@@ -183,7 +196,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+-            if (video_codec->capabilities & CODEC_CAP_TRUNCATED)
+-                video_context->flags|=CODEC_FLAG_TRUNCATED; // we do not send complete frames
++            if (video_codec->capabilities & AV_CODEC_CAP_TRUNCATED)
++                video_context->flags|=AV_CODEC_FLAG_TRUNCATED; // we do not send complete frames
  
+-            video_context->flags2|=CODEC_FLAG2_FAST; // really?
++            video_context->flags2|=AV_CODEC_FLAG2_FAST; // really?
+             video_context->skip_idct=AVDISCARD_ALL;
+ 
              av_log_set_level(AV_LOG_FATAL); // silence decoder output
  
 -            if (video_codecid==CODEC_ID_H264)
 +            if (video_codecid==AV_CODEC_ID_H264)
              {
-                 video_context->flags2|=CODEC_FLAG2_CHUNKS; // needed for H264!
+-                video_context->flags2|=CODEC_FLAG2_CHUNKS; // needed for H264!
++                video_context->flags2|=AV_CODEC_FLAG2_CHUNKS; // needed for H264!
              }
-@@ -198,15 +211,15 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+             else
+             {
+@@ -198,17 +217,23 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threa
  #else
              int ret=avcodec_open(video_context, video_codec);
  #endif
 -            if ((ret < 0) && (video_codecid==CODEC_ID_MPEG2VIDEO_XVMC))
++#ifdef AV_CODEC_ID_MPEG2VIDEO_XVMC
 +            if ((ret < 0) && (video_codecid==AV_CODEC_ID_MPEG2VIDEO_XVMC))
++#else
++            if (ret < 0)
++#endif
              {
                  // fallback to MPEG2VIDEO
 -                video_codecid=CODEC_ID_MPEG2VIDEO;
@@ -100,9 +119,13 @@
 -                    video_context->codec_id=CODEC_ID_NONE;
 +                    video_context->codec_id=AV_CODEC_ID_NONE;
                      video_context->codec_tag=0;
++#if LIBAVCODEC_VERSION_INT < ((58<<16)+(0<<8)+0)
                      memset(video_context->codec_name,0,sizeof(video_context->codec_name));
++#endif
  #if LIBAVCODEC_VERSION_INT >= ((53<<16)+(5<<8)+0)
-@@ -225,13 +238,13 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+                     video_context->thread_count=threadcount;
+                     ret=avcodec_open2(video_context, video_codec, NULL);
+@@ -225,13 +250,15 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threa
              {
                  switch (video_codecid)
                  {
@@ -111,15 +134,17 @@
                      esyslog("could not open codec for H264");
                      break;
 -                case CODEC_ID_MPEG2VIDEO_XVMC:
++#ifdef AV_CODEC_ID_MPEG2VIDEO_XVMC
 +                case AV_CODEC_ID_MPEG2VIDEO_XVMC:
                      esyslog("could not open codec MPEG2 (XVMC)");
                      break;
 -                case CODEC_ID_MPEG2VIDEO:
++#endif
 +                case AV_CODEC_ID_MPEG2VIDEO:
                      esyslog("could not open codec MPEG2");
                      break;
                  default:
-@@ -256,7 +269,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+@@ -256,7 +283,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threa
                  }
  #endif
  
@@ -128,7 +153,7 @@
                  if (!video_frame)
                  {
                      esyslog("could not allocate frame");
-@@ -286,13 +299,13 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+@@ -286,13 +313,15 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threa
      {
          switch (video_codecid)
          {
@@ -137,15 +162,17 @@
              esyslog("codec for H264 not found");
              break;
 -        case CODEC_ID_MPEG2VIDEO_XVMC:
++#ifdef AV_CODEC_ID_MPEG2VIDEO_XVMC
 +        case AV_CODEC_ID_MPEG2VIDEO_XVMC:
              esyslog("codec for MPEG2 (XVMC) not found");
              break;
 -        case CODEC_ID_MPEG2VIDEO:
++#endif
 +        case AV_CODEC_ID_MPEG2VIDEO:
              esyslog("codec for MPEG2 not found");
              break;
          default:
-@@ -321,7 +334,7 @@ bool cMarkAdDecoder::Clear()
+@@ -321,7 +350,7 @@ bool cMarkAdDecoder::Clear()
      {
          avcodec_flush_buffers(video_context);
          AVCodecContext *dest;
@@ -154,7 +181,7 @@
          if (dest)
          {
              if (avcodec_copy_context(dest,video_context)!=0) ret=false;
-@@ -384,7 +397,7 @@ bool cMarkAdDecoder::DecodeVideo(MarkAdC
+@@ -384,7 +413,7 @@ bool cMarkAdDecoder::DecodeVideo(MarkAdContext *maCont
      if (!video_frame) return false;
      maContext->Video.Data.Valid=false;
  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805031950.w43JoeV4077552>