diff options
author | Jochen Dolze <vdr@dolze.de> | 2009-10-06 06:08:32 +0200 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2009-10-06 06:08:32 +0200 |
commit | 58a1c5990bc6b2961b4bb23c288232f69ce4058b (patch) | |
tree | aea7f26e653ddfa663cc3f0b1c6e575ccd28a69f /markad-standalone.cpp | |
parent | c11caab8aa7f1e296694e2eaa4477d299adcd1e6 (diff) | |
download | vdr-plugin-markad-58a1c5990bc6b2961b4bb23c288232f69ce4058b.tar.gz vdr-plugin-markad-58a1c5990bc6b2961b4bb23c288232f69ce4058b.tar.bz2 |
Started logo detection (edge detect)
Diffstat (limited to 'markad-standalone.cpp')
-rw-r--r-- | markad-standalone.cpp | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/markad-standalone.cpp b/markad-standalone.cpp index 94c0d22..2b47d33 100644 --- a/markad-standalone.cpp +++ b/markad-standalone.cpp @@ -87,15 +87,15 @@ bool cMarkAdStandalone::ProcessFile(const char *Directory, int Number) { if (pkt) { - decoder->FindVideoInfos(&macontext,pkt,pktlen); if (decoder->DecodeVideo(&macontext,pkt,pktlen)) { if (macontext.Video.Info.Pict_Type==MA_I_TYPE) { lastiframe=framecnt; - mark=video->Process(lastiframe); - AddMark(mark); } + mark=video->Process(framecnt); + AddMark(mark); + framecnt++; } } @@ -155,7 +155,6 @@ bool cMarkAdStandalone::ProcessFile(const char *Directory, int Number) { if (pkt) { - decoder->FindAC3AudioInfos(&macontext,pkt,pktlen); if (decoder->DecodeAC3(&macontext,pkt,pktlen)) { mark=audio->Process(lastiframe); @@ -233,14 +232,19 @@ bool cMarkAdStandalone::CheckPATPMT(const char *Directory) free(buf); if (fd==-1) return false; - uchar patpmt[376]; + uchar patpmt_buf[564]; + uchar *patpmt; - if (read(fd,patpmt,sizeof(patpmt))!=sizeof(patpmt)) + if (read(fd,patpmt_buf,sizeof(patpmt_buf))!=sizeof(patpmt_buf)) { close(fd); return false; } close(fd); + patpmt=patpmt_buf; + + if ((patpmt[0]==0x47) && ((patpmt[1] & 0x5F)==0x40) && (patpmt[2]==0x11) && + ((patpmt[3] & 0x10)==0x10)) patpmt+=188; // skip SDT // some checks if ((patpmt[0]!=0x47) || (patpmt[188]!=0x47)) return false; // no TS-Sync @@ -398,11 +402,21 @@ cMarkAdStandalone::cMarkAdStandalone(const char *Directory) ac3_demux=NULL; } - decoder = new cMarkAdDecoder(recvnumber,macontext.General.VPid.Type==MARKAD_PIDTYPE_VIDEO_H264, - macontext.General.DPid.Num!=0); - video = new cMarkAdVideo(recvnumber,&macontext); - audio = new cMarkAdAudio(recvnumber,&macontext); - common = new cMarkAdCommon(recvnumber,&macontext); + if (!abort) + { + decoder = new cMarkAdDecoder(recvnumber,macontext.General.VPid.Type==MARKAD_PIDTYPE_VIDEO_H264, + macontext.General.DPid.Num!=0); + video = new cMarkAdVideo(recvnumber,&macontext); + audio = new cMarkAdAudio(recvnumber,&macontext); + common = new cMarkAdCommon(recvnumber,&macontext); + } + else + { + decoder=NULL; + video=NULL; + audio=NULL; + common=NULL; + } framecnt=0; } |