summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2014-09-02 10:23:18 (GMT)
committerJochen Dolze <vdr@dolze.de>2014-09-02 10:23:18 (GMT)
commitc55f43f413dff8740f99d684e8879835d4409920 (patch)
tree3ac24aa4a9f059efb5778bcbdd271b45b539eec5
parent3c99d4782fa62a1e24aabb510ce6230dc00a5b31 (diff)
downloadvdr-plugin-markad-c55f43f413dff8740f99d684e8879835d4409920.tar.gz
vdr-plugin-markad-c55f43f413dff8740f99d684e8879835d4409920.tar.bz2
Added #ifdefs for AV_CODEC_IDs, should fix bug #1898
Added logo for ProSieben MAXX HD from MegaV0lt
-rw-r--r--command/decoder.cpp46
-rw-r--r--command/logos/ProSieben_MAXX_HD-A16_9-P0.pgm5
-rw-r--r--command/markad-standalone.cpp39
3 files changed, 55 insertions, 35 deletions
diff --git a/command/decoder.cpp b/command/decoder.cpp
index ed81b37..cbd8055 100644
--- a/command/decoder.cpp
+++ b/command/decoder.cpp
@@ -6,6 +6,7 @@
*/
#include <stdint.h>
+#include <stdio.h>
#include <sched.h>
#include <errno.h>
#include <sys/types.h>
@@ -101,6 +102,19 @@ fail:
}
#endif
+#ifndef AV_CODEC_ID_H264
+#define AV_CODEC_ID_H264 CODEC_ID_H264
+#endif
+#ifndef AV_CODEC_ID_MPEG2VIDEO
+#define AV_CODEC_ID_MPEG2VIDEO CODEC_ID_MPEG2VIDEO
+#endif
+#ifndef AV_CODEC_ID_MPEG2VIDEO_XVMC
+#define AV_CODEC_ID_MPEG2VIDEO_XVMC CODEC_ID_MPEG2VIDEO_XVMC
+#endif
+#ifndef AV_CODEC_ID_NONE
+#define AV_CODEC_ID_NONE CODEC_ID_NONE
+#endif
+
cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threads)
{
#if LIBAVCODEC_VERSION_INT < ((53<<16)+(7<<8)+1)
@@ -160,18 +174,18 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threads)
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);
}
@@ -190,7 +204,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threads)
video_context->flags2|=CODEC_FLAG2_FAST; // really?
video_context->skip_idct=AVDISCARD_ALL;
- if (video_codecid!=CODEC_ID_H264)
+ if (video_codecid!=AV_CODEC_ID_H264)
{
video_context->skip_frame=AVDISCARD_NONKEY; // just I-frames
} else {
@@ -208,15 +222,15 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threads)
#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)
@@ -235,13 +249,13 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threads)
{
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:
@@ -296,13 +310,13 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threads)
{
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:
@@ -398,14 +412,14 @@ bool cMarkAdDecoder::DecodeVideo(MarkAdContext *maContext,uchar *pkt, int plen)
if (!video_frame) return false;
maContext->Video.Data.Valid=false;
- if (video_context->codec_id==CODEC_ID_H264) {
+ if (video_context->codec_id==AV_CODEC_ID_H264) {
if (plen>=5) {
if (((pkt[4] & 0x1F)==9) && (pkt[5]==0x10)) addPkt=true;
}
if (!addPkt) return false;
}
- if (video_context->codec_id==CODEC_ID_MPEG2VIDEO) {
+ if (video_context->codec_id==AV_CODEC_ID_MPEG2VIDEO) {
if (plen>=5) {
if (!pkt[0] && !pkt[1] && (pkt[2]==1) && !pkt[3] && ((pkt[5] & 8)==8)) addPkt=true;
}
diff --git a/command/logos/ProSieben_MAXX_HD-A16_9-P0.pgm b/command/logos/ProSieben_MAXX_HD-A16_9-P0.pgm
new file mode 100644
index 0000000..d593a9e
--- /dev/null
+++ b/command/logos/ProSieben_MAXX_HD-A16_9-P0.pgm
@@ -0,0 +1,5 @@
+P5
+#C1
+299 156
+255
+
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp
index 70e6d84..4ca71cd 100644
--- a/command/markad-standalone.cpp
+++ b/command/markad-standalone.cpp
@@ -320,28 +320,29 @@ void cMarkAdStandalone::CheckStart()
}
macontext.Info.Channels=macontext.Audio.Info.Channels;
- if (macontext.Info.Channels==6)
- {
- isyslog("DolbyDigital5.1 audio detected. logo/border/aspect detection disabled");
- bDecodeVideo=false;
- macontext.Video.Options.IgnoreAspectRatio=true;
- macontext.Video.Options.IgnoreLogoDetection=true;
- marks.Del(MT_ASPECTSTART);
- marks.Del(MT_ASPECTSTOP);
- // start mark must be around istart
- begin=marks.GetAround(INT_MAX,iStart,MT_CHANNELSTART);
- }
- else
- {
- if (macontext.Info.DPid.Num)
+ if (macontext.Config->DecodeAudio) {
+ if (macontext.Info.Channels==6)
{
- if (macontext.Info.Channels)
- isyslog("broadcast with %i audio channels, disabling AC3 decoding",macontext.Info.Channels);
- macontext.Info.DPid.Num=0;
- demux->DisableDPid();
+ isyslog("DolbyDigital5.1 audio detected. logo/border/aspect detection disabled");
+ bDecodeVideo=false;
+ macontext.Video.Options.IgnoreAspectRatio=true;
+ macontext.Video.Options.IgnoreLogoDetection=true;
+ marks.Del(MT_ASPECTSTART);
+ marks.Del(MT_ASPECTSTOP);
+ // start mark must be around istart
+ begin=marks.GetAround(INT_MAX,iStart,MT_CHANNELSTART);
+ }
+ else
+ {
+ if (macontext.Info.DPid.Num)
+ {
+ if (macontext.Info.Channels)
+ isyslog("broadcast with %i audio channels, disabling AC3 decoding",macontext.Info.Channels);
+ macontext.Info.DPid.Num=0;
+ demux->DisableDPid();
+ }
}
}
-
if ((macontext.Info.AspectRatio.Num) && ((macontext.Info.AspectRatio.Num!=
macontext.Video.Info.AspectRatio.Num) || (macontext.Info.AspectRatio.Den!=
macontext.Video.Info.AspectRatio.Den)))