summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2016-09-25 10:13:45 +0200
committerJochen Dolze <vdr@dolze.de>2016-09-25 10:13:45 +0200
commitc3ca6bd8fc34f048499f8915c63c8eba710b89bd (patch)
treec4e50564b68e3b1aa1cc7119efdf9f76f3f96b19
parent74e2a8c5382fa8bfacd12274899112724a1e0d51 (diff)
downloadvdr-plugin-markad-c3ca6bd8fc34f048499f8915c63c8eba710b89bd.tar.gz
vdr-plugin-markad-c3ca6bd8fc34f048499f8915c63c8eba710b89bd.tar.bz2
Added new/updated logos: ServusTV, Pro7MAXX, EinsPlus
Updated vertical border detection
-rw-r--r--command/global.h48
-rw-r--r--command/logos/EinsPlus-A16_9-P0.pgmbin0 -> 13618 bytes
-rw-r--r--command/logos/EinsPlus-A16_9-P1.pgmbin19254 -> 3418 bytes
l---------command/logos/Pro7_MAXX-A16_9-P0.pgm1
-rw-r--r--command/logos/ServusTV_Deutschland-A16_9-P0.pgmbin0 -> 12019 bytes
-rw-r--r--command/logos/ServusTV_Deutschland-A16_9-P2.pgmbin0 -> 3017 bytes
-rw-r--r--command/markad-standalone.cpp59
-rw-r--r--command/marks.cpp1
-rw-r--r--command/video.cpp16
-rw-r--r--command/video.h2
10 files changed, 89 insertions, 38 deletions
diff --git a/command/global.h b/command/global.h
index 22cee6a..311d25b 100644
--- a/command/global.h
+++ b/command/global.h
@@ -22,37 +22,37 @@ typedef unsigned char uchar;
#define MA_SP_TYPE 6
#define MA_BI_TYPE 7
-#define MT_START 1
-#define MT_STOP 2
+#define MT_START (unsigned char) 1
+#define MT_STOP (unsigned char) 2
-#define MT_ASSUMED 0x10
-#define MT_ASSUMEDSTART 0x11
-#define MT_ASSUMEDSTOP 0x12
+#define MT_ASSUMED (unsigned char) 0x10
+#define MT_ASSUMEDSTART (unsigned char) 0x11
+#define MT_ASSUMEDSTOP (unsigned char) 0x12
-#define MT_LOGOCHANGE 0x20
-#define MT_LOGOSTART 0x21
-#define MT_LOGOSTOP 0x22
+#define MT_LOGOCHANGE (unsigned char) 0x20
+#define MT_LOGOSTART (unsigned char) 0x21
+#define MT_LOGOSTOP (unsigned char) 0x22
-#define MT_HBORDERCHANGE 0x30
-#define MT_HBORDERSTART 0x31
-#define MT_HBORDERSTOP 0x32
+#define MT_HBORDERCHANGE (unsigned char) 0x30
+#define MT_HBORDERSTART (unsigned char) 0x31
+#define MT_HBORDERSTOP (unsigned char) 0x32
-#define MT_VBORDERCHANGE 0x40
-#define MT_VBORDERSTART 0x41
-#define MT_VBORDERSTOP 0x42
+#define MT_VBORDERCHANGE (unsigned char) 0x40
+#define MT_VBORDERSTART (unsigned char) 0x41
+#define MT_VBORDERSTOP (unsigned char) 0x42
-#define MT_ASPECTCHANGE 0x50
-#define MT_ASPECTSTART 0x51
-#define MT_ASPECTSTOP 0x52
+#define MT_ASPECTCHANGE (unsigned char) 0x50
+#define MT_ASPECTSTART (unsigned char) 0x51
+#define MT_ASPECTSTOP (unsigned char) 0x52
-#define MT_CHANNELCHANGE 0x60
-#define MT_CHANNELSTART 0x61
-#define MT_CHANNELSTOP 0x62
+#define MT_CHANNELCHANGE (unsigned char) 0x60
+#define MT_CHANNELSTART (unsigned char) 0x61
+#define MT_CHANNELSTOP (unsigned char) 0x62
-#define MT_RECORDINGSTART 0xD1
-#define MT_RECORDINGSTOP 0xD2
-#define MT_MOVED 0xE0
-#define MT_ALL 0xFF
+#define MT_RECORDINGSTART (unsigned char) 0xD1
+#define MT_RECORDINGSTOP (unsigned char) 0xD2
+#define MT_MOVED (unsigned char) 0xE0
+#define MT_ALL (unsigned char) 0xFF
typedef struct config
{
diff --git a/command/logos/EinsPlus-A16_9-P0.pgm b/command/logos/EinsPlus-A16_9-P0.pgm
new file mode 100644
index 0000000..a80940c
--- /dev/null
+++ b/command/logos/EinsPlus-A16_9-P0.pgm
Binary files differ
diff --git a/command/logos/EinsPlus-A16_9-P1.pgm b/command/logos/EinsPlus-A16_9-P1.pgm
index 9845de6..1906b85 100644
--- a/command/logos/EinsPlus-A16_9-P1.pgm
+++ b/command/logos/EinsPlus-A16_9-P1.pgm
Binary files differ
diff --git a/command/logos/Pro7_MAXX-A16_9-P0.pgm b/command/logos/Pro7_MAXX-A16_9-P0.pgm
new file mode 120000
index 0000000..a67c9b9
--- /dev/null
+++ b/command/logos/Pro7_MAXX-A16_9-P0.pgm
@@ -0,0 +1 @@
+ProSieben_MAXX-A16_9-P0.pgm \ No newline at end of file
diff --git a/command/logos/ServusTV_Deutschland-A16_9-P0.pgm b/command/logos/ServusTV_Deutschland-A16_9-P0.pgm
new file mode 100644
index 0000000..c63479c
--- /dev/null
+++ b/command/logos/ServusTV_Deutschland-A16_9-P0.pgm
Binary files differ
diff --git a/command/logos/ServusTV_Deutschland-A16_9-P2.pgm b/command/logos/ServusTV_Deutschland-A16_9-P2.pgm
new file mode 100644
index 0000000..49e3e48
--- /dev/null
+++ b/command/logos/ServusTV_Deutschland-A16_9-P2.pgm
Binary files differ
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp
index 498c6df..1356ab7 100644
--- a/command/markad-standalone.cpp
+++ b/command/markad-standalone.cpp
@@ -239,7 +239,8 @@ void cMarkAdStandalone::CalculateCheckPositions(int startframe)
iStart=-startframe;
iStop=-(startframe+len_in_frames);
iStopA=-(startframe+len_in_framesA);
- chkSTART=-iStart+(1.1*delta);
+ //chkSTART=-iStart+(1.1*delta);
+ chkSTART=-iStart+delta;
dsyslog("chkSTART set to %i",chkSTART);
chkSTOP=-iStop+(3*delta);
}
@@ -339,6 +340,8 @@ void cMarkAdStandalone::CheckStart()
{
if ((macontext.Info.Channels) && (macontext.Audio.Options.IgnoreDolbyDetection==false))
isyslog("broadcast with %i audio channels, disabling AC3 decoding",macontext.Info.Channels);
+ if (macontext.Audio.Options.IgnoreDolbyDetection==true)
+ isyslog("disabling AC3 decoding (from logo)");
macontext.Info.DPid.Num=0;
demux->DisableDPid();
}
@@ -399,12 +402,39 @@ void cMarkAdStandalone::CheckStart()
if (!begin)
{
begin=marks.GetAround(macontext.Video.Info.FramesPerSecond*(MAXRANGE*2),iStart,MT_START,0x0F);
+ if (begin) {
+ clMark *begin2=marks.GetAround(macontext.Video.Info.FramesPerSecond*MAXRANGE,begin->position,MT_START,0x0F);
+ if (begin2) {
+ if (begin2->type>begin->type) {
+ if (begin2->type==MT_ASPECTSTART) {
+ // special case, only take this mark if aspectratio is 4:3
+ if ((macontext.Video.Info.AspectRatio.Num==4) &&
+ (macontext.Video.Info.AspectRatio.Den==3)) {
+ isyslog("mark on position %i stronger than mark on position %i as start mark",begin2->position,begin->position);
+ begin=begin2;
+ }
+ } else {
+ isyslog("mark on position %i stronger than mark on position %i as start mark",begin2->position,begin->position);
+ begin=begin2;
+ }
+ }
+ }
+ }
}
if (begin)
{
marks.DelTill(begin->position);
CalculateCheckPositions(begin->position);
isyslog("using mark on position %i as start mark",begin->position);
+
+ if ((begin->type==MT_VBORDERSTART) || (begin->type==MT_HBORDERSTART))
+ {
+ isyslog("%s borders, logo detection disabled",(begin->type==MT_HBORDERSTART) ? "horizontal" : "vertical");
+ macontext.Video.Options.IgnoreLogoDetection=true;
+ marks.Del(MT_LOGOSTART);
+ marks.Del(MT_LOGOSTOP);
+ }
+
}
else
{
@@ -524,6 +554,25 @@ void cMarkAdStandalone::AddMark(MarkAdMark *Mark)
if (comment) isyslog("%s",comment);
+ clMark *prev=marks.GetLast();
+ if (prev) {
+ if (prev->position==Mark->Position) {
+ if (prev->type>Mark->Type)
+ {
+ isyslog("previous mark (%i) stronger than actual mark on same position, deleting %i",
+ prev->position, Mark->Position);
+ if (comment) free(comment);
+ return;
+ }
+ else
+ {
+ isyslog("actual mark stronger then previous mark on same position, deleting %i",prev->position);
+ marks.Del(prev);
+ }
+ }
+ }
+
+ /*
if ((Mark->Type==MT_LOGOSTART) && (!iStart) && (Mark->Position<abs(iStop)))
{
clMark *prev=marks.GetPrev(Mark->Position,MT_LOGOSTOP);
@@ -541,8 +590,9 @@ void cMarkAdStandalone::AddMark(MarkAdMark *Mark)
return;
}
}
- }
-
+ }
+ */
+
if (((Mark->Type & 0x0F)==MT_STOP) && (!iStart) && (Mark->Position<abs(iStop)))
{
clMark *prev=marks.GetPrev(Mark->Position,(Mark->Type & 0xF0)|MT_START);
@@ -570,7 +620,7 @@ void cMarkAdStandalone::AddMark(MarkAdMark *Mark)
}
}
- clMark *prev=marks.GetLast();
+ prev=marks.GetLast();
if (prev)
{
if ((prev->type & 0x0F)==(Mark->Type & 0x0F))
@@ -695,7 +745,6 @@ void cMarkAdStandalone::CheckIndexGrowing()
double slepttime=0;
while ((unsigned int)slepttime<sleeptime) {
while (sleeptime>0) {
- errno=0;
unsigned int ret=sleep(sleeptime); // now we sleep and hopefully the index will grow
if ((errno) && (ret)) {
if (abort) return;
diff --git a/command/marks.cpp b/command/marks.cpp
index b212ef0..c6649ac 100644
--- a/command/marks.cpp
+++ b/command/marks.cpp
@@ -17,7 +17,6 @@
#include "marks.h"
-
clMark::clMark(int Type, int Position, const char *Comment)
{
type=Type;
diff --git a/command/video.cpp b/command/video.cpp
index b828c0c..1bf3ec9 100644
--- a/command/video.cpp
+++ b/command/video.cpp
@@ -338,7 +338,7 @@ int cMarkAdLogo::Detect(int framenumber, int *logoframenumber)
if (extract) return LOGO_NOCHANGE;
if (!processed) return LOGO_ERROR;
- tsyslog("rp=%5i mp=%5i mpV=%5.f mpI=%5.f i=%3i s=%i",rpixel,mpixel,(mpixel*LOGO_VMARK),(mpixel*LOGO_IMARK),area.intensity,area.status);
+ //tsyslog("rp=%5i mp=%5i mpV=%5.f mpI=%5.f i=%3i s=%i",rpixel,mpixel,(mpixel*LOGO_VMARK),(mpixel*LOGO_IMARK),area.intensity,area.status);
if (processed==1)
{
@@ -547,7 +547,7 @@ int cMarkAdBlackBordersHoriz::Process(int FrameNumber, int *BorderIFrame)
borderframenumber=FrameNumber;
} else {
if (borderstatus!=HBORDER_VISIBLE) {
- if (FrameNumber>(borderframenumber+macontext->Video.Info.FramesPerSecond*MINSECS))
+ if (FrameNumber>(borderframenumber+macontext->Video.Info.FramesPerSecond*MINBORDERSECS))
{
*BorderIFrame=borderframenumber;
borderstatus=HBORDER_VISIBLE;
@@ -586,6 +586,7 @@ int cMarkAdBlackBordersVert::Process(int FrameNumber, int *BorderIFrame)
#define CHECKWIDTH 32
#define BRIGHTNESS 20
#define HOFFSET 50
+#define VOFFSET_ 120
if (!macontext) return 0;
if (!macontext->Video.Data.Valid) return 0;
if (macontext->Video.Info.FramesPerSecond==0) return 0;
@@ -596,8 +597,8 @@ int cMarkAdBlackBordersVert::Process(int FrameNumber, int *BorderIFrame)
bool fleft=true,fright=true;
int val=0,cnt=0;
- int end=macontext->Video.Data.PlaneLinesize[0]*macontext->Video.Info.Height;
- int i=0;
+ int end=macontext->Video.Data.PlaneLinesize[0]*(macontext->Video.Info.Height-VOFFSET_);
+ int i=VOFFSET_*macontext->Video.Data.PlaneLinesize[0];
while (i<end) {
for (int x=0; x<CHECKWIDTH; x++)
{
@@ -611,8 +612,9 @@ int cMarkAdBlackBordersVert::Process(int FrameNumber, int *BorderIFrame)
if (fleft)
{
- val=cnt=i=0;
- int w=macontext->Video.Info.Width-HOFFSET;
+ val=cnt=0;
+ i=VOFFSET_*macontext->Video.Data.PlaneLinesize[0];
+ int w=macontext->Video.Info.Width-HOFFSET-CHECKWIDTH;
while (i<end) {
for (int x=0; x<CHECKWIDTH; x++)
{
@@ -630,7 +632,7 @@ int cMarkAdBlackBordersVert::Process(int FrameNumber, int *BorderIFrame)
borderframenumber=FrameNumber;
} else {
if (borderstatus!=VBORDER_VISIBLE) {
- if (FrameNumber>(borderframenumber+macontext->Video.Info.FramesPerSecond*MINSECS))
+ if (FrameNumber>(borderframenumber+macontext->Video.Info.FramesPerSecond*MINBORDERSECS))
{
*BorderIFrame=borderframenumber;
borderstatus=VBORDER_VISIBLE;
diff --git a/command/video.h b/command/video.h
index 05ad796..85138ca 100644
--- a/command/video.h
+++ b/command/video.h
@@ -46,7 +46,7 @@ enum
VBORDER_VISIBLE=1
};
-#define MINSECS 240
+#define MINBORDERSECS 60
enum
{