diff options
author | Jochen Dolze <vdr@dolze.de> | 2011-03-13 22:38:04 +0100 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2011-03-13 22:38:04 +0100 |
commit | ad13e186a657a6d2488dcc608ef670804107f4a7 (patch) | |
tree | 7b5a34fbce92b5038a4bf3cf1d31374f861568b2 | |
parent | a9829b55f99465d6194de0e8e8fb648d24d79317 (diff) | |
download | vdr-plugin-markad-ad13e186a657a6d2488dcc608ef670804107f4a7.tar.gz vdr-plugin-markad-ad13e186a657a6d2488dcc608ef670804107f4a7.tar.bz2 |
Changed order of detection modes in video.cpp
Changed position of start/stop detection
-rw-r--r-- | command/Makefile | 2 | ||||
-rw-r--r-- | command/markad-standalone.cpp | 17 | ||||
-rw-r--r-- | command/video.cpp | 49 |
3 files changed, 36 insertions, 32 deletions
diff --git a/command/Makefile b/command/Makefile index e1ab816..5173b3e 100644 --- a/command/Makefile +++ b/command/Makefile @@ -12,7 +12,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' ../version.h | awk '{ pr ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -g -rdynamic -O2 -Wall -Wextra -Woverloaded-virtual -Wno-parentheses +CXXFLAGS ?= -g -rdynamic -O3 -Wall -Wextra -Woverloaded-virtual -Wno-parentheses PKG-CONFIG ?= pkg-config STRIP ?= strip diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp index 3f38cf4..2db0fc6 100644 --- a/command/markad-standalone.cpp +++ b/command/markad-standalone.cpp @@ -974,14 +974,6 @@ bool cMarkAdStandalone::ProcessFile(int Number) iStop=lastiframe; iStopinBroadCast=inBroadCast; } - if (iStart>0) - { - if ((inBroadCast) && (lastiframe>chkSTART)) CheckStart(); - } - if (iStop>0) - { - if (lastiframe>chkSTOP) CheckStop(); - } iframe=framecnt-1; dRes=true; } @@ -1002,6 +994,15 @@ bool cMarkAdStandalone::ProcessFile(int Number) } } //SaveFrame(lastiframe); // TODO: JUST FOR DEBUGGING! + + if (iStart>0) + { + if ((inBroadCast) && (lastiframe>chkSTART)) CheckStart(); + } + if (iStop>0) + { + if (lastiframe>chkSTOP) CheckStop(); + } } } } diff --git a/command/video.cpp b/command/video.cpp index 31d0bdc..9233d9a 100644 --- a/command/video.cpp +++ b/command/video.cpp @@ -110,6 +110,7 @@ int cMarkAdLogo::Load(const char *directory, char *file, int plane) fclose(pFile); return -2; } + fclose(pFile); if (!area.mpixel[plane]) { @@ -126,7 +127,6 @@ int cMarkAdLogo::Load(const char *directory, char *file, int plane) LOGOHEIGHT=height; } - fclose(pFile); area.valid[plane]=true; return 0; } @@ -316,6 +316,7 @@ int cMarkAdLogo::Detect(int framenumber, int *logoframenumber) int rpixel=0,mpixel=0; int processed=0; *logoframenumber=-1; + if (area.corner==-1) return LOGO_NOCHANGE; for (int plane=0; plane<4; plane++) { @@ -354,7 +355,8 @@ int cMarkAdLogo::Detect(int framenumber, int *logoframenumber) { area.status=LOGO_INVISIBLE; } - *logoframenumber=area.framenumber; + area.framenumber=framenumber; + *logoframenumber=framenumber; } if (rpixel>=(mpixel*LOGO_VMARK)) @@ -856,27 +858,6 @@ MarkAdMarks *cMarkAdVideo::Process(int FrameNumber, int FrameNumberNext) resetmarks(); - if (!macontext->Video.Options.IgnoreLogoDetection) - { - int logoframenumber; - int lret=logo->Process(FrameNumber,&logoframenumber); - if ((lret>=-1) && (lret!=0) && (logoframenumber!=-1)) - { - if (lret>0) - { - addmark(MT_LOGOSTART,logoframenumber); - } - else - { - addmark(MT_LOGOSTOP,logoframenumber); - } - } - } - else - { - logo->SetStatusUninitialized(); - } - int hborderframenumber; int hret=hborder->Process(FrameNumber,&hborderframenumber); @@ -917,6 +898,28 @@ MarkAdMarks *cMarkAdVideo::Process(int FrameNumber, int FrameNumberNext) aspectratio.Num=macontext->Video.Info.AspectRatio.Num; aspectratio.Den=macontext->Video.Info.AspectRatio.Den; } + + if (!macontext->Video.Options.IgnoreLogoDetection) + { + int logoframenumber; + int lret=logo->Process(FrameNumber,&logoframenumber); + if ((lret>=-1) && (lret!=0) && (logoframenumber!=-1)) + { + if (lret>0) + { + addmark(MT_LOGOSTART,logoframenumber); + } + else + { + addmark(MT_LOGOSTOP,logoframenumber); + } + } + } + else + { + logo->SetStatusUninitialized(); + } + framelast=FrameNumberNext; framebeforelast=FrameNumber; if (marks.Count) |