MythTV  master
Public Member Functions | Private Attributes | List of all members
TemplateMatcher Class Reference

#include <mythcommflag/TemplateMatcher.h>

Inheritance diagram for TemplateMatcher:
[legend]
Collaboration diagram for TemplateMatcher:
[legend]

Public Member Functions

 TemplateMatcher (std::shared_ptr< PGMConverter > pgmc, std::shared_ptr< EdgeDetector > ed, TemplateFinder *tf, const QString &debugdir)
 
 ~TemplateMatcher (void) override
 
const char * name (void) const override
 
enum analyzeFrameResult MythPlayerInited (MythPlayer *player, long long nframes) override
 
enum analyzeFrameResult analyzeFrame (const MythVideoFrame *frame, long long frameno, long long *pNextFrame) override
 
int finished (long long nframes, bool final) override
 
int reportTime (void) const override
 
FrameMap GetMap (unsigned int) const override
 
int templateCoverage (long long nframes, bool final) const
 
const FrameAnalyzer::FrameMapgetBreaks (void) const
 
int adjustForBlanks (const BlankFrameDetector *blankFrameDetector, long long nframes)
 
int computeBreaks (FrameMap *breaks)
 
- Public Member Functions inherited from FrameAnalyzer
virtual ~FrameAnalyzer (void)=default
 
virtual enum analyzeFrameResult MythPlayerInited ([[maybe_unused]] MythPlayer *player, [[maybe_unused]] long long nframes)
 
virtual int finished ([[maybe_unused]] long long nframes, [[maybe_unused]] bool final)
 

Private Attributes

std::shared_ptr< PGMConverterm_pgmConverter {nullptr}
 
std::shared_ptr< EdgeDetectorm_edgeDetector {nullptr}
 
TemplateFinderm_templateFinder {nullptr}
 
const struct AVFramem_tmpl {nullptr}
 
int m_tmplRow {-1}
 
int m_tmplCol {-1}
 
int m_tmplWidth {-1}
 
int m_tmplHeight {-1}
 
unsigned short * m_matches {nullptr}
 
unsigned char * m_match {nullptr}
 
float m_fps {0.0F}
 
AVFrame m_cropped {}
 
FrameAnalyzer::FrameMap m_breakMap
 
int m_debugLevel {0}
 
QString m_debugDir
 
QString m_debugData
 
MythPlayerm_player {nullptr}
 
bool m_debugMatches {false}
 
bool m_debugRemoveRunts {false}
 
bool m_matchesDone {false}
 
std::chrono::microseconds m_analyzeTime {0us}
 

Additional Inherited Members

- Public Types inherited from FrameAnalyzer
enum  analyzeFrameResult : std::uint8_t { ANALYZE_OK, ANALYZE_ERROR, ANALYZE_FINISHED, ANALYZE_FATAL }
 
using FrameMap = QMap< long long, long long >
 
- Static Public Attributes inherited from FrameAnalyzer
static const long long kAnyFrame = LLONG_MAX
 
static const long long kNextFrame = -1
 

Detailed Description

Definition at line 31 of file TemplateMatcher.h.

Constructor & Destructor Documentation

◆ TemplateMatcher()

TemplateMatcher::TemplateMatcher ( std::shared_ptr< PGMConverter pgmc,
std::shared_ptr< EdgeDetector ed,
TemplateFinder tf,
const QString &  debugdir 
)

Definition at line 302 of file TemplateMatcher.cpp.

◆ ~TemplateMatcher()

TemplateMatcher::~TemplateMatcher ( void  )
override

Definition at line 332 of file TemplateMatcher.cpp.

Member Function Documentation

◆ name()

const char* TemplateMatcher::name ( void  ) const
inlineoverridevirtual

Implements FrameAnalyzer.

Definition at line 41 of file TemplateMatcher.h.

◆ MythPlayerInited()

enum FrameAnalyzer::analyzeFrameResult TemplateMatcher::MythPlayerInited ( MythPlayer player,
long long  nframes 
)
override

Definition at line 340 of file TemplateMatcher.cpp.

◆ analyzeFrame()

enum FrameAnalyzer::analyzeFrameResult TemplateMatcher::analyzeFrame ( const MythVideoFrame frame,
long long  frameno,
long long *  pNextFrame 
)
overridevirtual

Implements FrameAnalyzer.

Definition at line 395 of file TemplateMatcher.cpp.

◆ finished()

int TemplateMatcher::finished ( long long  nframes,
bool  final 
)
override

Definition at line 471 of file TemplateMatcher.cpp.

◆ reportTime()

int TemplateMatcher::reportTime ( void  ) const
overridevirtual

Reimplemented from FrameAnalyzer.

Definition at line 570 of file TemplateMatcher.cpp.

◆ GetMap()

FrameMap TemplateMatcher::GetMap ( unsigned int  ) const
inlineoverridevirtual

Implements FrameAnalyzer.

Definition at line 49 of file TemplateMatcher.h.

◆ templateCoverage()

int TemplateMatcher::templateCoverage ( long long  nframes,
bool  final 
) const

Definition at line 581 of file TemplateMatcher.cpp.

Referenced by CommDetector2::computeBreaks().

◆ getBreaks()

const FrameAnalyzer::FrameMap* TemplateMatcher::getBreaks ( void  ) const
inline

Definition at line 54 of file TemplateMatcher.h.

Referenced by BlankFrameDetector::computeForLogoSurplus().

◆ adjustForBlanks()

int TemplateMatcher::adjustForBlanks ( const BlankFrameDetector blankFrameDetector,
long long  nframes 
)

Definition at line 641 of file TemplateMatcher.cpp.

Referenced by CommDetector2::computeBreaks().

◆ computeBreaks()

int TemplateMatcher::computeBreaks ( FrameAnalyzer::FrameMap breaks)

Definition at line 809 of file TemplateMatcher.cpp.

Referenced by CommDetector2::computeBreaks().

Member Data Documentation

◆ m_pgmConverter

std::shared_ptr<PGMConverter> TemplateMatcher::m_pgmConverter {nullptr}
private

Definition at line 59 of file TemplateMatcher.h.

Referenced by analyzeFrame(), MythPlayerInited(), and reportTime().

◆ m_edgeDetector

std::shared_ptr<EdgeDetector> TemplateMatcher::m_edgeDetector {nullptr}
private

Definition at line 60 of file TemplateMatcher.h.

Referenced by analyzeFrame().

◆ m_templateFinder

TemplateFinder* TemplateMatcher::m_templateFinder {nullptr}
private

Definition at line 61 of file TemplateMatcher.h.

Referenced by MythPlayerInited().

◆ m_tmpl

const struct AVFrame* TemplateMatcher::m_tmpl {nullptr}
private

Definition at line 62 of file TemplateMatcher.h.

Referenced by analyzeFrame(), finished(), MythPlayerInited(), and templateCoverage().

◆ m_tmplRow

int TemplateMatcher::m_tmplRow {-1}
private

Definition at line 63 of file TemplateMatcher.h.

Referenced by analyzeFrame(), finished(), and MythPlayerInited().

◆ m_tmplCol

int TemplateMatcher::m_tmplCol {-1}
private

Definition at line 64 of file TemplateMatcher.h.

Referenced by analyzeFrame(), finished(), and MythPlayerInited().

◆ m_tmplWidth

int TemplateMatcher::m_tmplWidth {-1}
private

Definition at line 65 of file TemplateMatcher.h.

Referenced by analyzeFrame(), finished(), and MythPlayerInited().

◆ m_tmplHeight

int TemplateMatcher::m_tmplHeight {-1}
private

Definition at line 66 of file TemplateMatcher.h.

Referenced by analyzeFrame(), finished(), and MythPlayerInited().

◆ m_matches

unsigned short* TemplateMatcher::m_matches {nullptr}
private

Definition at line 69 of file TemplateMatcher.h.

Referenced by analyzeFrame(), finished(), MythPlayerInited(), and ~TemplateMatcher().

◆ m_match

unsigned char* TemplateMatcher::m_match {nullptr}
private

Definition at line 70 of file TemplateMatcher.h.

Referenced by finished(), MythPlayerInited(), and ~TemplateMatcher().

◆ m_fps

float TemplateMatcher::m_fps {0.0F}
private

Definition at line 72 of file TemplateMatcher.h.

Referenced by adjustForBlanks(), finished(), and MythPlayerInited().

◆ m_cropped

AVFrame TemplateMatcher::m_cropped {}
private

Definition at line 73 of file TemplateMatcher.h.

Referenced by analyzeFrame(), MythPlayerInited(), and ~TemplateMatcher().

◆ m_breakMap

FrameAnalyzer::FrameMap TemplateMatcher::m_breakMap
private

◆ m_debugLevel

int TemplateMatcher::m_debugLevel {0}
private

Definition at line 77 of file TemplateMatcher.h.

Referenced by finished(), templateCoverage(), and TemplateMatcher().

◆ m_debugDir

QString TemplateMatcher::m_debugDir
private

Definition at line 78 of file TemplateMatcher.h.

Referenced by TemplateMatcher().

◆ m_debugData

QString TemplateMatcher::m_debugData
private

Definition at line 79 of file TemplateMatcher.h.

Referenced by finished(), and MythPlayerInited().

◆ m_player

MythPlayer* TemplateMatcher::m_player {nullptr}
private

Definition at line 80 of file TemplateMatcher.h.

Referenced by MythPlayerInited().

◆ m_debugMatches

bool TemplateMatcher::m_debugMatches {false}
private

Definition at line 81 of file TemplateMatcher.h.

Referenced by finished(), MythPlayerInited(), and TemplateMatcher().

◆ m_debugRemoveRunts

bool TemplateMatcher::m_debugRemoveRunts {false}
private

Definition at line 82 of file TemplateMatcher.h.

Referenced by finished(), and TemplateMatcher().

◆ m_matchesDone

bool TemplateMatcher::m_matchesDone {false}
private

Definition at line 83 of file TemplateMatcher.h.

Referenced by finished(), and MythPlayerInited().

◆ m_analyzeTime

std::chrono::microseconds TemplateMatcher::m_analyzeTime {0us}
private

Definition at line 84 of file TemplateMatcher.h.

Referenced by analyzeFrame(), and reportTime().


The documentation for this class was generated from the following files: