summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2010-03-16 11:05:15 +0100
committerJochen Dolze <vdr@dolze.de>2010-03-16 11:05:15 +0100
commitc0712181cc47bd4ae2b082973635dc51880eebe8 (patch)
treeb1a4e4f9ff746dce210158b9b5f08491c9a45ed3
parentb962f42b4e19855ae6a39b305e132d041a76154c (diff)
downloadvdr-plugin-markad-c0712181cc47bd4ae2b082973635dc51880eebe8.tar.gz
vdr-plugin-markad-c0712181cc47bd4ae2b082973635dc51880eebe8.tar.bz2
Changed logo naming scheme to match with Microsoft Windows
l---------logos/C-40984-1089-12060-A16_9.pgm1
-rw-r--r--logos/S19.2E-1-1057-61200-A16_9.pgm (renamed from logos/S19.2E-1-1057-61200-A16:9.pgm)0
-rw-r--r--logos/S19_2E-1-1017-61302-A16_9.pgm (renamed from logos/S19.2E-1-1017-61302-A16:9.pgm)0
-rw-r--r--logos/S19_2E-1-1089-12003-A16_9.pgm (renamed from logos/S19.2E-1-1089-12003-A16:9.pgm)bin10518 -> 10518 bytes
-rw-r--r--logos/S19_2E-1-1089-12060-A16_9.pgm (renamed from logos/S19.2E-1-1089-12060-A16:9.pgm)bin10218 -> 10218 bytes
-rw-r--r--logos/S19_2E-1-1107-17500-A16_9.pgm (renamed from logos/S19.2E-1-1107-17500-A16:9.pgm)bin10020 -> 10020 bytes
-rw-r--r--logos/S19_2E-1-1107-17502-A16_9.pgm (renamed from logos/S19.2E-1-1107-17502-A16:9.pgm)bin10019 -> 10019 bytes
-rw-r--r--markad-standalone.cpp7
-rw-r--r--video.cpp18
-rw-r--r--video.h2
10 files changed, 21 insertions, 7 deletions
diff --git a/logos/C-40984-1089-12060-A16_9.pgm b/logos/C-40984-1089-12060-A16_9.pgm
new file mode 120000
index 0000000..490670f
--- /dev/null
+++ b/logos/C-40984-1089-12060-A16_9.pgm
@@ -0,0 +1 @@
+S19_2E-1-1089-12060-A16_9.pgm \ No newline at end of file
diff --git a/logos/S19.2E-1-1057-61200-A16:9.pgm b/logos/S19.2E-1-1057-61200-A16_9.pgm
index bca729e..bca729e 100644
--- a/logos/S19.2E-1-1057-61200-A16:9.pgm
+++ b/logos/S19.2E-1-1057-61200-A16_9.pgm
diff --git a/logos/S19.2E-1-1017-61302-A16:9.pgm b/logos/S19_2E-1-1017-61302-A16_9.pgm
index b4c4469..b4c4469 100644
--- a/logos/S19.2E-1-1017-61302-A16:9.pgm
+++ b/logos/S19_2E-1-1017-61302-A16_9.pgm
diff --git a/logos/S19.2E-1-1089-12003-A16:9.pgm b/logos/S19_2E-1-1089-12003-A16_9.pgm
index d47aa76..d47aa76 100644
--- a/logos/S19.2E-1-1089-12003-A16:9.pgm
+++ b/logos/S19_2E-1-1089-12003-A16_9.pgm
Binary files differ
diff --git a/logos/S19.2E-1-1089-12060-A16:9.pgm b/logos/S19_2E-1-1089-12060-A16_9.pgm
index 85596d3..85596d3 100644
--- a/logos/S19.2E-1-1089-12060-A16:9.pgm
+++ b/logos/S19_2E-1-1089-12060-A16_9.pgm
Binary files differ
diff --git a/logos/S19.2E-1-1107-17500-A16:9.pgm b/logos/S19_2E-1-1107-17500-A16_9.pgm
index d547efa..d547efa 100644
--- a/logos/S19.2E-1-1107-17500-A16:9.pgm
+++ b/logos/S19_2E-1-1107-17500-A16_9.pgm
Binary files differ
diff --git a/logos/S19.2E-1-1107-17502-A16:9.pgm b/logos/S19_2E-1-1107-17502-A16_9.pgm
index 4df56f1..4df56f1 100644
--- a/logos/S19.2E-1-1107-17502-A16:9.pgm
+++ b/logos/S19_2E-1-1107-17502-A16_9.pgm
Binary files differ
diff --git a/markad-standalone.cpp b/markad-standalone.cpp
index 1453993..9dc0e45 100644
--- a/markad-standalone.cpp
+++ b/markad-standalone.cpp
@@ -328,6 +328,13 @@ bool cMarkAdStandalone::LoadInfo(const char *Directory)
{
int result=sscanf(line,"%*c %as %*s",&macontext.General.ChannelID);
if (result==0 || result==EOF) macontext.General.ChannelID=NULL;
+ if (macontext.General.ChannelID)
+ {
+ for (int i=0; i<(int) strlen(macontext.General.ChannelID); i++)
+ {
+ if (macontext.General.ChannelID[i]=='.') macontext.General.ChannelID[i]='_';
+ }
+ }
if ((bIgnoreAudioInfo) && (bIgnoreVideoInfo)) break;
}
if (line[0]=='X')
diff --git a/video.cpp b/video.cpp
index ca6d3fa..250c05e 100644
--- a/video.cpp
+++ b/video.cpp
@@ -3,7 +3,6 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id$
*/
#include "video.h"
@@ -93,7 +92,7 @@ void cMarkAdLogo::Save(int lastiframe, uchar *picture)
char *buf=NULL;
- if (asprintf(&buf,"%s/%06d-%s-A%i:%i.pgm","/tmp/",lastiframe,
+ if (asprintf(&buf,"%s/%06d-%s-A%i_%i.pgm","/tmp/",lastiframe,
macontext->General.ChannelID,
area.aspectratio.Num,area.aspectratio.Den)!=-1)
{
@@ -260,6 +259,8 @@ int cMarkAdLogo::Detect(int lastiframe, int *logoiframe)
}
if (macontext->StandAlone.LogoExtraction==-1)
{
+ //printf("%i %i %i %i\n",lastiframe,area.rpixel,area.mpixel,(area.rpixel<(area.mpixel*0.01)));
+
if (area.status==UNINITIALIZED)
{
// Initialize
@@ -277,7 +278,7 @@ int cMarkAdLogo::Detect(int lastiframe, int *logoiframe)
{
if (area.status==NOLOGO)
{
- if (area.counter>LOGO_MAXCOUNT)
+ if (area.counter>=LOGO_MAXCOUNT)
{
area.status=ret=LOGO;
*logoiframe=area.lastiframe;
@@ -299,7 +300,12 @@ int cMarkAdLogo::Detect(int lastiframe, int *logoiframe)
{
if (area.status==LOGO)
{
- if (area.counter>LOGO_MAXCOUNT)
+ if ((area.counter==LOGO_MINCOUNT) && (area.rpixel<(area.mpixel*0.01)))
+ {
+ area.counter=LOGO_MAXCOUNT;
+ }
+
+ if (area.counter>=LOGO_MAXCOUNT)
{
area.status=ret=NOLOGO;
*logoiframe=area.lastiframe;
@@ -316,7 +322,7 @@ int cMarkAdLogo::Detect(int lastiframe, int *logoiframe)
area.counter=0;
}
}
- // Save(lastiframe,area.sobel); // TODO: JUST FOR DEBUGGING!
+ //Save(lastiframe,area.sobel); // TODO: JUST FOR DEBUGGING!
}
else
{
@@ -342,7 +348,7 @@ int cMarkAdLogo::Process(int LastIFrame, int *LogoIFrame)
{
area.valid=false; // just to be sure!
char *buf=NULL;
- if (asprintf(&buf,"%s/%s-A%i:%i.pgm",macontext->LogoDir,macontext->General.ChannelID,
+ if (asprintf(&buf,"%s/%s-A%i_%i.pgm",macontext->LogoDir,macontext->General.ChannelID,
macontext->Video.Info.AspectRatio.Num,macontext->Video.Info.AspectRatio.Den)!=-1)
{
int ret=Load(buf);
diff --git a/video.h b/video.h
index 50e76d0..593165e 100644
--- a/video.h
+++ b/video.h
@@ -3,7 +3,6 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id$
*/
#ifndef __video_h_
@@ -22,6 +21,7 @@
#define LOGO_DEFWIDTH 192
#define LOGO_MAXCOUNT 3
+#define LOGO_MINCOUNT 1
class cMarkAdLogo
{