diff options
author | Jochen Dolze <vdr@dolze.de> | 2010-03-16 11:05:15 +0100 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2010-03-16 11:05:15 +0100 |
commit | c0712181cc47bd4ae2b082973635dc51880eebe8 (patch) | |
tree | b1a4e4f9ff746dce210158b9b5f08491c9a45ed3 | |
parent | b962f42b4e19855ae6a39b305e132d041a76154c (diff) | |
download | vdr-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.pgm | 1 | ||||
-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) | bin | 10518 -> 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) | bin | 10218 -> 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) | bin | 10020 -> 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) | bin | 10019 -> 10019 bytes | |||
-rw-r--r-- | markad-standalone.cpp | 7 | ||||
-rw-r--r-- | video.cpp | 18 | ||||
-rw-r--r-- | video.h | 2 |
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 Binary files differindex d47aa76..d47aa76 100644 --- a/logos/S19.2E-1-1089-12003-A16:9.pgm +++ b/logos/S19_2E-1-1089-12003-A16_9.pgm diff --git a/logos/S19.2E-1-1089-12060-A16:9.pgm b/logos/S19_2E-1-1089-12060-A16_9.pgm Binary files differindex 85596d3..85596d3 100644 --- a/logos/S19.2E-1-1089-12060-A16:9.pgm +++ b/logos/S19_2E-1-1089-12060-A16_9.pgm diff --git a/logos/S19.2E-1-1107-17500-A16:9.pgm b/logos/S19_2E-1-1107-17500-A16_9.pgm Binary files differindex d547efa..d547efa 100644 --- a/logos/S19.2E-1-1107-17500-A16:9.pgm +++ b/logos/S19_2E-1-1107-17500-A16_9.pgm diff --git a/logos/S19.2E-1-1107-17502-A16:9.pgm b/logos/S19_2E-1-1107-17502-A16_9.pgm Binary files differindex 4df56f1..4df56f1 100644 --- a/logos/S19.2E-1-1107-17502-A16:9.pgm +++ b/logos/S19_2E-1-1107-17502-A16_9.pgm 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') @@ -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); @@ -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 { |