diff options
author | woodsb02 <woodsb02@FreeBSD.org> | 2016-05-10 23:35:19 +0800 |
---|---|---|
committer | woodsb02 <woodsb02@FreeBSD.org> | 2016-05-10 23:35:19 +0800 |
commit | c465997b6da112f817f30a0d3ed94bc00c31008f (patch) | |
tree | 01273598056c1692ec32443b05a21fc2388f4b57 /multimedia | |
parent | 02d48b1e204858beafd4f35797b6489ec10dbf97 (diff) | |
download | freebsd-ports-gnome-c465997b6da112f817f30a0d3ed94bc00c31008f.tar.gz freebsd-ports-gnome-c465997b6da112f817f30a0d3ed94bc00c31008f.tar.zst freebsd-ports-gnome-c465997b6da112f817f30a0d3ed94bc00c31008f.zip |
multimedia/vdr-plugin-markad: Fix build with ffmpeg 3.0.x
- Update patch of command/decoder.cpp to allow vdr-plugin-markad to
build successfully once multimedia/ffmpeg is updated to 3.0.x.
Note that multimedia/ffmpeg is currently still on the 2.8.x branch,
however this patch is backwards compatible with ffmpeg 2.8.x.
The additional changes to this file were based on upstream bug
report #1898 [1], and also the requirement to replace
s/avcodec_alloc_frame/av_frame_alloc/g.
- Regenerate patches with makepatch (pet portlint), and remove
PATCH_STRIP=-p1 from Makefile.
[1] https://projects.vdr-developer.org/issues/1898
PR: 209386
Reported by: antoine (PR207547)
Reviewed by: mat (mentor)
Approved by: adamw (mentor)
Differential Revision: https://reviews.freebsd.org/D6283
Diffstat (limited to 'multimedia')
12 files changed, 187 insertions, 100 deletions
diff --git a/multimedia/vdr-plugin-markad/Makefile b/multimedia/vdr-plugin-markad/Makefile index 2ab72615df76..8c9a3ff5c531 100644 --- a/multimedia/vdr-plugin-markad/Makefile +++ b/multimedia/vdr-plugin-markad/Makefile @@ -13,7 +13,6 @@ COMMENT= Video Disk Recorder - MarkAd plugin LIB_DEPENDS+= libavcodec.so:multimedia/ffmpeg USES= execinfo pkgconfig tar:tgz -PATCH_STRIP= -p1 HAVE_CONFIGURE= yes PORTDOCS= COPYING README HISTORY PORTDATA= logos diff --git a/multimedia/vdr-plugin-markad/files/patch-Makefile b/multimedia/vdr-plugin-markad/files/patch-Makefile index ea88f18e6a83..19c2fd44c3a1 100644 --- a/multimedia/vdr-plugin-markad/files/patch-Makefile +++ b/multimedia/vdr-plugin-markad/files/patch-Makefile @@ -1,5 +1,5 @@ ---- a/Makefile -+++ b/Makefile +--- Makefile.orig 2012-09-11 07:55:41 UTC ++++ Makefile @@ -13,10 +13,10 @@ ARCHIVE = markad-$(VERSION) PACKAGE = vdr-$(ARCHIVE) diff --git a/multimedia/vdr-plugin-markad/files/patch-command-decoder.cpp b/multimedia/vdr-plugin-markad/files/patch-command-decoder.cpp deleted file mode 100644 index d66a0b13e4f7..000000000000 --- a/multimedia/vdr-plugin-markad/files/patch-command-decoder.cpp +++ /dev/null @@ -1,36 +0,0 @@ ---- a/command/decoder.cpp -+++ b/command/decoder.cpp -@@ -6,7 +6,12 @@ - */ - - #include <stdint.h> -+#ifndef __FreeBSD__ - #include <sched.h> -+#else -+#include <sys/types.h> -+#include <sys/sysctl.h> -+#endif - #include <errno.h> - #include <sys/types.h> - #include <string.h> -@@ -107,6 +112,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH - noticeERRMP2=false; - noticeERRAC3=false; - -+#ifndef __FreeBSD__ - cpu_set_t cpumask; - uint len = sizeof(cpumask); - int cpucount; -@@ -118,6 +124,12 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH - { - cpucount=CPU_COUNT(&cpumask); - } -+#else -+ int cpucount; -+ size_t cpus_size = sizeof(cpucount); -+ if (sysctlbyname("hw.ncpu", &cpucount, &cpus_size, NULL, 0) == -1) -+ cpucount = 1; -+#endif - - if (Threads==-1) - { diff --git a/multimedia/vdr-plugin-markad/files/patch-command-decoder.cpp-ffmpeg1 b/multimedia/vdr-plugin-markad/files/patch-command-decoder.cpp-ffmpeg1 deleted file mode 100644 index 22203237a4cd..000000000000 --- a/multimedia/vdr-plugin-markad/files/patch-command-decoder.cpp-ffmpeg1 +++ /dev/null @@ -1,11 +0,0 @@ ---- a/command/decoder.cpp -+++ b/command/decoder.cpp -@@ -164,7 +164,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH - } - - video_codec=NULL; -- CodecID video_codecid; -+ AVCodecID video_codecid; - - if (useH264) - { diff --git a/multimedia/vdr-plugin-markad/files/patch-command-Makefile b/multimedia/vdr-plugin-markad/files/patch-command_Makefile index a2982c81f707..d849bfda235c 100644 --- a/multimedia/vdr-plugin-markad/files/patch-command-Makefile +++ b/multimedia/vdr-plugin-markad/files/patch-command_Makefile @@ -1,5 +1,5 @@ ---- a/command/Makefile -+++ b/command/Makefile +--- command/Makefile.orig 2012-09-11 07:54:03 UTC ++++ command/Makefile @@ -16,6 +16,10 @@ CXXFLAGS ?= -g -rdynamic -O3 -funroll-lo PKG-CONFIG ?= pkg-config STRIP ?= strip diff --git a/multimedia/vdr-plugin-markad/files/patch-command_decoder.cpp b/multimedia/vdr-plugin-markad/files/patch-command_decoder.cpp new file mode 100644 index 000000000000..b426eaf4567a --- /dev/null +++ b/multimedia/vdr-plugin-markad/files/patch-command_decoder.cpp @@ -0,0 +1,165 @@ +--- command/decoder.cpp.orig 2012-04-02 19:41:15 UTC ++++ command/decoder.cpp +@@ -6,11 +6,17 @@ + */ + + #include <stdint.h> ++#ifndef __FreeBSD__ + #include <sched.h> ++#else ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#endif + #include <errno.h> + #include <sys/types.h> + #include <string.h> + #include <cstdlib> ++#include <stdio.h> + + #include "decoder.h" + +@@ -113,6 +119,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH + + noticeERRVID=false; + ++#ifndef __FreeBSD__ + cpu_set_t cpumask; + uint len = sizeof(cpumask); + int cpucount=1; +@@ -120,6 +127,12 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH + { + cpucount=CPU_COUNT(&cpumask); + } ++#else ++ int cpucount; ++ size_t cpus_size = sizeof(cpucount); ++ if (sysctlbyname("hw.ncpu", &cpucount, &cpus_size, NULL, 0) == -1) ++ cpucount = 1; ++#endif + + if (Threads==-1) + { +@@ -151,28 +164,28 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH + } + + video_codec=NULL; +- CodecID video_codecid; ++ AVCodecID video_codecid; + + if (useH264) + { +- video_codecid=CODEC_ID_H264; ++ video_codecid=AV_CODEC_ID_H264; + } + else + { +- video_codecid=CODEC_ID_MPEG2VIDEO_XVMC; ++ video_codecid=AV_CODEC_ID_MPEG2VIDEO_XVMC; + } + + video_codec = avcodec_find_decoder(video_codecid); +- if ((!video_codec) && (video_codecid==CODEC_ID_MPEG2VIDEO_XVMC)) ++ if ((!video_codec) && (video_codecid==AV_CODEC_ID_MPEG2VIDEO_XVMC)) + { + // fallback to MPEG2VIDEO +- video_codecid=CODEC_ID_MPEG2VIDEO; ++ video_codecid=AV_CODEC_ID_MPEG2VIDEO; + video_codec=avcodec_find_decoder(video_codecid); + } + + if (video_codec) + { +- video_context = avcodec_alloc_context(); ++ video_context = avcodec_alloc_context3(NULL); + if (video_context) + { + if (video_codec->capabilities & CODEC_CAP_TRUNCATED) +@@ -183,7 +196,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH + + 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! + } +@@ -198,15 +211,15 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH + #else + int ret=avcodec_open(video_context, video_codec); + #endif +- if ((ret < 0) && (video_codecid==CODEC_ID_MPEG2VIDEO_XVMC)) ++ if ((ret < 0) && (video_codecid==AV_CODEC_ID_MPEG2VIDEO_XVMC)) + { + // fallback to MPEG2VIDEO +- video_codecid=CODEC_ID_MPEG2VIDEO; ++ video_codecid=AV_CODEC_ID_MPEG2VIDEO; + video_codec=avcodec_find_decoder(video_codecid); + if (video_codec) + { + video_context->codec_type=AVMEDIA_TYPE_UNKNOWN; +- video_context->codec_id=CODEC_ID_NONE; ++ video_context->codec_id=AV_CODEC_ID_NONE; + video_context->codec_tag=0; + memset(video_context->codec_name,0,sizeof(video_context->codec_name)); + #if LIBAVCODEC_VERSION_INT >= ((53<<16)+(5<<8)+0) +@@ -225,13 +238,13 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH + { + switch (video_codecid) + { +- case CODEC_ID_H264: ++ case AV_CODEC_ID_H264: + esyslog("could not open codec for H264"); + break; +- case CODEC_ID_MPEG2VIDEO_XVMC: ++ case AV_CODEC_ID_MPEG2VIDEO_XVMC: + esyslog("could not open codec MPEG2 (XVMC)"); + break; +- case CODEC_ID_MPEG2VIDEO: ++ case AV_CODEC_ID_MPEG2VIDEO: + esyslog("could not open codec MPEG2"); + break; + default: +@@ -256,7 +269,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH + } + #endif + +- video_frame = avcodec_alloc_frame(); ++ video_frame = av_frame_alloc(); + if (!video_frame) + { + esyslog("could not allocate frame"); +@@ -286,13 +299,13 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH + { + switch (video_codecid) + { +- case CODEC_ID_H264: ++ case AV_CODEC_ID_H264: + esyslog("codec for H264 not found"); + break; +- case CODEC_ID_MPEG2VIDEO_XVMC: ++ case AV_CODEC_ID_MPEG2VIDEO_XVMC: + esyslog("codec for MPEG2 (XVMC) not found"); + break; +- case CODEC_ID_MPEG2VIDEO: ++ case AV_CODEC_ID_MPEG2VIDEO: + esyslog("codec for MPEG2 not found"); + break; + default: +@@ -321,7 +334,7 @@ bool cMarkAdDecoder::Clear() + { + avcodec_flush_buffers(video_context); + AVCodecContext *dest; +- dest=avcodec_alloc_context(); ++ dest=avcodec_alloc_context3(NULL); + if (dest) + { + if (avcodec_copy_context(dest,video_context)!=0) ret=false; +@@ -384,7 +397,7 @@ bool cMarkAdDecoder::DecodeVideo(MarkAdC + if (!video_frame) return false; + maContext->Video.Data.Valid=false; + +- if ((video_context->codec_id==CODEC_ID_H264) && (!video_context->skip_frame)) ++ if ((video_context->codec_id==AV_CODEC_ID_H264) && (!video_context->skip_frame)) + { + // with H264 we cannot set skip_frame just to NONKEY, is depends on Interlaced... + if (maContext->Video.Info.Height) diff --git a/multimedia/vdr-plugin-markad/files/patch-command_decoder.h b/multimedia/vdr-plugin-markad/files/patch-command_decoder.h new file mode 100644 index 000000000000..52e1c7124424 --- /dev/null +++ b/multimedia/vdr-plugin-markad/files/patch-command_decoder.h @@ -0,0 +1,10 @@ +--- command/decoder.h.orig 2012-02-24 20:08:34 UTC ++++ command/decoder.h +@@ -18,6 +18,7 @@ extern "C" + #include <avcodec.h> + #else + #include <libavcodec/avcodec.h> ++#include <libavutil/mem.h> + #endif + + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) diff --git a/multimedia/vdr-plugin-markad/files/patch-command-markad-standalone.cpp b/multimedia/vdr-plugin-markad/files/patch-command_markad-standalone.cpp index 6a2c72b5fb6c..3417fbdee961 100644 --- a/multimedia/vdr-plugin-markad/files/patch-command-markad-standalone.cpp +++ b/multimedia/vdr-plugin-markad/files/patch-command_markad-standalone.cpp @@ -1,5 +1,5 @@ ---- a/command/markad-standalone.cpp -+++ b/command/markad-standalone.cpp +--- command/markad-standalone.cpp.orig 2012-09-11 11:06:28 UTC ++++ command/markad-standalone.cpp @@ -24,7 +24,13 @@ #include <locale.h> #include <libintl.h> diff --git a/multimedia/vdr-plugin-markad/files/patch-plugin-Makefile b/multimedia/vdr-plugin-markad/files/patch-plugin_Makefile index 528e9cc30d1a..6471e82124d7 100644 --- a/multimedia/vdr-plugin-markad/files/patch-plugin-Makefile +++ b/multimedia/vdr-plugin-markad/files/patch-plugin_Makefile @@ -1,5 +1,5 @@ ---- a/plugin/Makefile -+++ b/plugin/Makefile +--- plugin/Makefile.orig 2012-02-13 19:32:27 UTC ++++ plugin/Makefile @@ -99,11 +99,19 @@ i18n: $(I18Nmsgs) $(I18Npot) ### Targets: diff --git a/multimedia/vdr-plugin-markad/files/patch-plugin-markad.cpp b/multimedia/vdr-plugin-markad/files/patch-plugin_markad.cpp index 3bafd37e0f4b..86a4a947806e 100644 --- a/multimedia/vdr-plugin-markad/files/patch-plugin-markad.cpp +++ b/multimedia/vdr-plugin-markad/files/patch-plugin_markad.cpp @@ -1,5 +1,5 @@ ---- a/plugin/markad.cpp -+++ b/plugin/markad.cpp +--- plugin/markad.cpp.orig 2012-09-10 12:45:12 UTC ++++ plugin/markad.cpp @@ -15,8 +15,16 @@ #include "markad.h" diff --git a/multimedia/vdr-plugin-markad/files/patch-plugin-status.cpp b/multimedia/vdr-plugin-markad/files/patch-plugin_status.cpp index 3d0d09b8d64c..82f6f6224b82 100644 --- a/multimedia/vdr-plugin-markad/files/patch-plugin-status.cpp +++ b/multimedia/vdr-plugin-markad/files/patch-plugin_status.cpp @@ -1,5 +1,5 @@ ---- a/plugin/status.cpp -+++ b/plugin/status.cpp +--- plugin/status.cpp.orig 2012-09-09 23:00:32 UTC ++++ plugin/status.cpp @@ -6,6 +6,12 @@ */ diff --git a/multimedia/vdr-plugin-markad/files/patch-vdr-markad-0.1.4-libav9 b/multimedia/vdr-plugin-markad/files/patch-vdr-markad-0.1.4-libav9 deleted file mode 100644 index fca9cbb49e35..000000000000 --- a/multimedia/vdr-plugin-markad/files/patch-vdr-markad-0.1.4-libav9 +++ /dev/null @@ -1,40 +0,0 @@ -diff -urN markad-0.1.4.old/command/decoder.cpp markad-0.1.4/command/decoder.cpp ---- markad-0.1.4.old/command/decoder.cpp 2013-06-17 21:52:44.333367552 +0200 -+++ markad-0.1.4/command/decoder.cpp 2013-06-17 21:53:03.708366863 +0200 -@@ -11,6 +11,7 @@ - #include <sys/types.h> - #include <string.h> - #include <cstdlib> -+#include <stdio.h> - - #include "decoder.h" - -@@ -172,7 +173,7 @@ - - if (video_codec) - { -- video_context = avcodec_alloc_context(); -+ video_context = avcodec_alloc_context3(NULL); - if (video_context) - { - if (video_codec->capabilities & CODEC_CAP_TRUNCATED) -@@ -321,7 +322,7 @@ - { - avcodec_flush_buffers(video_context); - AVCodecContext *dest; -- dest=avcodec_alloc_context(); -+ dest=avcodec_alloc_context3(NULL); - if (dest) - { - if (avcodec_copy_context(dest,video_context)!=0) ret=false; -diff -urN markad-0.1.4.old/command/decoder.h markad-0.1.4/command/decoder.h ---- markad-0.1.4.old/command/decoder.h 2013-06-17 21:52:44.333367552 +0200 -+++ markad-0.1.4/command/decoder.h 2013-06-17 21:53:03.708366863 +0200 -@@ -18,6 +18,7 @@ - #include <avcodec.h> - #else - #include <libavcodec/avcodec.h> -+#include <libavutil/mem.h> - #endif - - #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) |