MythTV  master
BlankFrameDetector.h
Go to the documentation of this file.
1 /*
2  * BlankFrameDetector
3  *
4  * Detect blank frames based on histogram analysis.
5  */
6 
7 #ifndef __BLANKFRAMEDETECTOR_H__
8 #define __BLANKFRAMEDETECTOR_H__
9 
10 #include "FrameAnalyzer.h"
11 
12 class HistogramAnalyzer;
13 class TemplateMatcher;
14 
16 {
17 public:
18  /* Ctor/dtor. */
19  BlankFrameDetector(HistogramAnalyzer *ha, QString debugdir);
20 
21  /* FrameAnalyzer interface. */
22  const char *name(void) const override // FrameAnalyzer
23  { return "BlankFrameDetector"; }
25  long long nframes) override; // FrameAnalyzer
26  enum analyzeFrameResult analyzeFrame(const VideoFrame *frame,
27  long long frameno, long long *pNextFrame) override; // FrameAnalyzer
28  int finished(long long nframes, bool final) override; // FrameAnalyzer
29  int reportTime(void) const override; // FrameAnalyzer
30  FrameMap GetMap(unsigned int index) const override // FrameAnalyzer
31  { return (index) ? m_blankMap : m_breakMap; }
32 
33  /* BlankFrameDetector interface. */
34  const FrameAnalyzer::FrameMap *getBlanks(void) const { return &m_blankMap; }
35  int computeForLogoSurplus(const TemplateMatcher *templateMatcher);
36  int computeForLogoDeficit(const TemplateMatcher *templateMatcher);
37  int computeBreaks(FrameMap *breaks);
38 
39 private:
41  float m_fps {0.0F};
42 
45 
46  /* Debugging */
47  int m_debugLevel {0};
48 };
49 
50 #endif /* !__BLANKFRAMEDETECTOR_H__ */
51 
52 /* vim: set expandtab tabstop=4 shiftwidth=4: */
int reportTime(void) const override
FrameAnalyzer::FrameMap m_blankMap
HistogramAnalyzer * m_histogramAnalyzer
int finished(long long nframes, bool final) override
enum analyzeFrameResult MythPlayerInited(MythPlayer *player, long long nframes) override
int computeForLogoSurplus(const TemplateMatcher *templateMatcher)
QMap< int, FrameList * > FrameMap
Definition: mpeg2fix.h:115
const FrameAnalyzer::FrameMap * getBlanks(void) const
FrameMap GetMap(unsigned int index) const override
BlankFrameDetector(HistogramAnalyzer *ha, QString debugdir)
enum analyzeFrameResult analyzeFrame(const VideoFrame *frame, long long frameno, long long *pNextFrame) override
const char * name(void) const override
int computeForLogoDeficit(const TemplateMatcher *templateMatcher)
QMap< long long, long long > FrameMap
Definition: FrameAnalyzer.h:44
FrameAnalyzer::FrameMap m_breakMap
int computeBreaks(FrameMap *breaks)