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(std::shared_ptr<HistogramAnalyzer> ha, const QString& debugdir);
20 
21  /* FrameAnalyzer interface. */
22  const char *name(void) const override // FrameAnalyzer
23  { return "BlankFrameDetector"; }
25  long long nframes) override; // FrameAnalyzer
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  static int computeForLogoDeficit(const TemplateMatcher *templateMatcher);
37  int computeBreaks(FrameMap *breaks);
38 
39 private:
40  std::shared_ptr<HistogramAnalyzer> m_histogramAnalyzer;
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: */
FrameMap
QMap< int, FrameList * > FrameMap
Definition: mpeg2fix.h:120
FrameAnalyzer::FrameMap
QMap< long long, long long > FrameMap
Definition: FrameAnalyzer.h:45
HistogramAnalyzer
Definition: HistogramAnalyzer.h:16
MythPlayer
Definition: mythplayer.h:83
BlankFrameDetector::reportTime
int reportTime(void) const override
Definition: BlankFrameDetector.cpp:652
BlankFrameDetector::analyzeFrame
enum analyzeFrameResult analyzeFrame(const MythVideoFrame *frame, long long frameno, long long *pNextFrame) override
Definition: BlankFrameDetector.cpp:414
BlankFrameDetector::m_histogramAnalyzer
std::shared_ptr< HistogramAnalyzer > m_histogramAnalyzer
Definition: BlankFrameDetector.h:40
FrameAnalyzer
Definition: FrameAnalyzer.h:28
BlankFrameDetector::computeForLogoSurplus
int computeForLogoSurplus(const TemplateMatcher *templateMatcher)
Definition: BlankFrameDetector.cpp:449
BlankFrameDetector::m_blankMap
FrameAnalyzer::FrameMap m_blankMap
Definition: BlankFrameDetector.h:43
BlankFrameDetector::GetMap
FrameMap GetMap(unsigned int index) const override
Definition: BlankFrameDetector.h:30
BlankFrameDetector::BlankFrameDetector
BlankFrameDetector(std::shared_ptr< HistogramAnalyzer > ha, const QString &debugdir)
Definition: BlankFrameDetector.cpp:379
BlankFrameDetector::computeBreaks
int computeBreaks(FrameMap *breaks)
Definition: BlankFrameDetector.cpp:635
FrameAnalyzer::analyzeFrameResult
analyzeFrameResult
Definition: FrameAnalyzer.h:36
FrameAnalyzer.h
BlankFrameDetector::finished
int finished(long long nframes, bool final) override
Definition: BlankFrameDetector.cpp:430
BlankFrameDetector
Definition: BlankFrameDetector.h:15
BlankFrameDetector::getBlanks
const FrameAnalyzer::FrameMap * getBlanks(void) const
Definition: BlankFrameDetector.h:34
BlankFrameDetector::m_fps
float m_fps
Definition: BlankFrameDetector.h:41
BlankFrameDetector::m_breakMap
FrameAnalyzer::FrameMap m_breakMap
Definition: BlankFrameDetector.h:44
MythVideoFrame
Definition: mythframe.h:88
BlankFrameDetector::MythPlayerInited
enum analyzeFrameResult MythPlayerInited(MythPlayer *player, long long nframes) override
Definition: BlankFrameDetector.cpp:396
BlankFrameDetector::computeForLogoDeficit
static int computeForLogoDeficit(const TemplateMatcher *templateMatcher)
Definition: BlankFrameDetector.cpp:626
TemplateMatcher
Definition: TemplateMatcher.h:31
BlankFrameDetector::m_debugLevel
int m_debugLevel
Definition: BlankFrameDetector.h:47
BlankFrameDetector::name
const char * name(void) const override
Definition: BlankFrameDetector.h:22