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

#include <TemplateFinder.h>

Inheritance diagram for TemplateFinder:
Inheritance graph
[legend]
Collaboration diagram for TemplateFinder:
Collaboration graph
[legend]

Classes

struct  m_analyzeTime
 

Public Member Functions

 TemplateFinder (std::shared_ptr< PGMConverter > pgmc, std::shared_ptr< BorderDetector > bd, std::shared_ptr< EdgeDetector > ed, MythPlayer *player, int proglen, const QString &debugdir)
 
 ~TemplateFinder (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
 
const struct AVFramegetTemplate (int *prow, int *pcol, int *pwidth, int *pheight) const
 
- Public Member Functions inherited from FrameAnalyzer
virtual ~FrameAnalyzer (void)=default
 

Private Member Functions

int resetBuffers (int newwidth, int newheight)
 

Private Attributes

std::shared_ptr< PGMConverterm_pgmConverter {nullptr}
 
std::shared_ptr< BorderDetectorm_borderDetector {nullptr}
 
std::shared_ptr< EdgeDetectorm_edgeDetector {nullptr}
 
unsigned int m_sampleTime {20 * 60}
 
int m_frameInterval
 
long long m_endFrame {0}
 
long long m_nextFrame {0}
 
int m_width {-1}
 
int m_height {-1}
 
unsigned int * m_scores {nullptr}
 
int m_minContentRow {INT_MAX}
 
int m_minContentCol {INT_MAX}
 
int m_maxContentRow1 {INT_MAX}
 
int m_maxContentCol1 {INT_MAX}
 
AVFrame m_tmpl {}
 
int m_tmplRow {-1}
 
int m_tmplCol {-1}
 
int m_tmplWidth {-1}
 
int m_tmplHeight {-1}
 
AVFrame m_cropped {}
 
int m_cwidth {-1}
 
int m_cheight {-1}
 
int m_debugLevel {0}
 
QString m_debugDir
 
QString m_debugData
 
QString m_debugTmpl
 
bool m_debugTemplate {false}
 
bool m_debugEdgeCounts {false}
 
bool m_debugFrames {false}
 
bool m_tmplValid {false}
 
bool m_tmplDone {false}
 

Additional Inherited Members

- Public Types inherited from FrameAnalyzer
enum  analyzeFrameResult { 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 30 of file TemplateFinder.h.

Constructor & Destructor Documentation

◆ TemplateFinder()

TemplateFinder::TemplateFinder ( std::shared_ptr< PGMConverter pgmc,
std::shared_ptr< BorderDetector bd,
std::shared_ptr< EdgeDetector ed,
MythPlayer player,
int  proglen,
const QString &  debugdir 
)

Definition at line 699 of file TemplateFinder.cpp.

◆ ~TemplateFinder()

TemplateFinder::~TemplateFinder ( void  )
override

Definition at line 764 of file TemplateFinder.cpp.

Member Function Documentation

◆ name()

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

Implements FrameAnalyzer.

Definition at line 41 of file TemplateFinder.h.

◆ MythPlayerInited()

enum FrameAnalyzer::analyzeFrameResult TemplateFinder::MythPlayerInited ( MythPlayer player,
long long  nframes 
)
overridevirtual

Reimplemented from FrameAnalyzer.

Definition at line 764 of file TemplateFinder.cpp.

◆ analyzeFrame()

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

Implements FrameAnalyzer.

Definition at line 839 of file TemplateFinder.cpp.

◆ finished()

int TemplateFinder::finished ( long long  nframes,
bool  final 
)
overridevirtual

Reimplemented from FrameAnalyzer.

Definition at line 990 of file TemplateFinder.cpp.

◆ reportTime()

int TemplateFinder::reportTime ( void  ) const
overridevirtual

Reimplemented from FrameAnalyzer.

Definition at line 1035 of file TemplateFinder.cpp.

◆ GetMap()

FrameMap TemplateFinder::GetMap ( unsigned int  ) const
inlineoverridevirtual

Implements FrameAnalyzer.

Definition at line 49 of file TemplateFinder.h.

Referenced by CommDetector2::PrintFullMap().

◆ getTemplate()

const struct AVFrame * TemplateFinder::getTemplate ( int *  prow,
int *  pcol,
int *  pwidth,
int *  pheight 
) const

Definition at line 1049 of file TemplateFinder.cpp.

Referenced by CommDetector2::computeBreaks().

◆ resetBuffers()

int TemplateFinder::resetBuffers ( int  newwidth,
int  newheight 
)
private

Definition at line 839 of file TemplateFinder.cpp.

Member Data Documentation

◆ m_pgmConverter

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

Definition at line 59 of file TemplateFinder.h.

Referenced by reportTime().

◆ m_borderDetector

std::shared_ptr<BorderDetector> TemplateFinder::m_borderDetector {nullptr}
private

Definition at line 60 of file TemplateFinder.h.

Referenced by finished(), and reportTime().

◆ m_edgeDetector

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

Definition at line 61 of file TemplateFinder.h.

◆ m_sampleTime

unsigned int TemplateFinder::m_sampleTime {20 * 60}
private

Definition at line 63 of file TemplateFinder.h.

Referenced by TemplateFinder().

◆ m_frameInterval

int TemplateFinder::m_frameInterval
private

Definition at line 64 of file TemplateFinder.h.

Referenced by TemplateFinder().

◆ m_endFrame

long long TemplateFinder::m_endFrame {0}
private

Definition at line 65 of file TemplateFinder.h.

Referenced by TemplateFinder().

◆ m_nextFrame

long long TemplateFinder::m_nextFrame {0}
private

Definition at line 66 of file TemplateFinder.h.

◆ m_width

int TemplateFinder::m_width {-1}
private

Definition at line 68 of file TemplateFinder.h.

Referenced by finished().

◆ m_height

int TemplateFinder::m_height {-1}
private

Definition at line 69 of file TemplateFinder.h.

Referenced by finished().

◆ m_scores

unsigned int* TemplateFinder::m_scores {nullptr}
private

Definition at line 70 of file TemplateFinder.h.

Referenced by finished(), and ~TemplateFinder().

◆ m_minContentRow

int TemplateFinder::m_minContentRow {INT_MAX}
private

Definition at line 72 of file TemplateFinder.h.

Referenced by finished().

◆ m_minContentCol

int TemplateFinder::m_minContentCol {INT_MAX}
private

Definition at line 73 of file TemplateFinder.h.

Referenced by finished().

◆ m_maxContentRow1

int TemplateFinder::m_maxContentRow1 {INT_MAX}
private

Definition at line 74 of file TemplateFinder.h.

Referenced by finished().

◆ m_maxContentCol1

int TemplateFinder::m_maxContentCol1 {INT_MAX}
private

Definition at line 75 of file TemplateFinder.h.

Referenced by finished().

◆ m_tmpl

AVFrame TemplateFinder::m_tmpl {}
private

Definition at line 77 of file TemplateFinder.h.

Referenced by finished(), getTemplate(), and ~TemplateFinder().

◆ m_tmplRow

int TemplateFinder::m_tmplRow {-1}
private

Definition at line 78 of file TemplateFinder.h.

Referenced by finished(), and getTemplate().

◆ m_tmplCol

int TemplateFinder::m_tmplCol {-1}
private

Definition at line 79 of file TemplateFinder.h.

Referenced by finished(), and getTemplate().

◆ m_tmplWidth

int TemplateFinder::m_tmplWidth {-1}
private

Definition at line 80 of file TemplateFinder.h.

Referenced by finished(), and getTemplate().

◆ m_tmplHeight

int TemplateFinder::m_tmplHeight {-1}
private

Definition at line 81 of file TemplateFinder.h.

Referenced by finished(), and getTemplate().

◆ m_cropped

AVFrame TemplateFinder::m_cropped {}
private

Definition at line 83 of file TemplateFinder.h.

Referenced by resetBuffers(), and ~TemplateFinder().

◆ m_cwidth

int TemplateFinder::m_cwidth {-1}
private

Definition at line 84 of file TemplateFinder.h.

Referenced by resetBuffers().

◆ m_cheight

int TemplateFinder::m_cheight {-1}
private

Definition at line 85 of file TemplateFinder.h.

Referenced by resetBuffers().

◆ m_debugLevel

int TemplateFinder::m_debugLevel {0}
private

Definition at line 88 of file TemplateFinder.h.

Referenced by TemplateFinder().

◆ m_debugDir

QString TemplateFinder::m_debugDir
private

Definition at line 89 of file TemplateFinder.h.

Referenced by finished(), and TemplateFinder().

◆ m_debugData

QString TemplateFinder::m_debugData
private

Definition at line 90 of file TemplateFinder.h.

Referenced by finished().

◆ m_debugTmpl

QString TemplateFinder::m_debugTmpl
private

Definition at line 91 of file TemplateFinder.h.

Referenced by finished().

◆ m_debugTemplate

bool TemplateFinder::m_debugTemplate {false}
private

Definition at line 92 of file TemplateFinder.h.

Referenced by finished(), and TemplateFinder().

◆ m_debugEdgeCounts

bool TemplateFinder::m_debugEdgeCounts {false}
private

Definition at line 93 of file TemplateFinder.h.

Referenced by finished(), and TemplateFinder().

◆ m_debugFrames

bool TemplateFinder::m_debugFrames {false}
private

Definition at line 94 of file TemplateFinder.h.

Referenced by TemplateFinder().

◆ m_tmplValid

bool TemplateFinder::m_tmplValid {false}
private

Definition at line 95 of file TemplateFinder.h.

Referenced by finished(), and getTemplate().

◆ m_tmplDone

bool TemplateFinder::m_tmplDone {false}
private

Definition at line 96 of file TemplateFinder.h.

Referenced by finished().


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