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

#include <mythvideoscantracker.h>

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

Public Member Functions

 MythVideoScanTracker (MythPlayerUI *Parent)
 
virtual ~MythVideoScanTracker ()=default
 
FrameScanType NextScanOverride ()
 
void SetScanOverride (FrameScanType Scan)
 
FrameScanType GetScanTypeWithOverride () const
 

Protected Member Functions

void InitialiseScan (MythVideoOutput *VideoOutput)
 
void UnlockScan ()
 
void ResetTracker ()
 
void SetScanType (FrameScanType Scan, MythVideoOutput *VideoOutput, int FrameInterval)
 
FrameScanType GetScanForDisplay (MythVideoFrame *Frame, bool &SecondField)
 
FrameScanType GetScanType () const
 
virtual void AutoDeint (MythVideoFrame *Frame, MythVideoOutput *VideoOutput, int FrameInterval, bool AllowLock=true)
 Check whether deinterlacing should be enabled. More...
 
void CheckScanUpdate (MythVideoOutput *VideoOutput, int FrameInterval)
 
QString GetDeinterlacerName ()
 
FrameScanType DetectInterlace (FrameScanType NewScan, float Rate, int VideoHeight)
 

Private Attributes

MythPlayerUIm_parentPlayer { nullptr }
 
long long m_scanTracker { 0 }
 
FrameScanType m_resetScan { kScan_Ignore }
 
FrameScanType m_scan { kScan_Interlaced }
 
FrameScanType m_scanOverride { kScan_Detect }
 
bool m_scanLocked { false }
 
bool m_scanInitialized { false }
 
int m_lastFrameInterval { 0 }
 
bool m_lastDeinterlacer2x { false }
 
MythDeintType m_lastDeinterlacer { DEINT_NONE }
 
VideoFrameType m_lastFrameCodec { FMT_NONE }
 
QThread * m_mainThread { QThread::currentThread() }
 

Detailed Description

Definition at line 12 of file mythvideoscantracker.h.

Constructor & Destructor Documentation

◆ MythVideoScanTracker()

MythVideoScanTracker::MythVideoScanTracker ( MythPlayerUI Parent)

Definition at line 11 of file mythvideoscantracker.cpp.

◆ ~MythVideoScanTracker()

virtual MythVideoScanTracker::~MythVideoScanTracker ( )
virtualdefault

Member Function Documentation

◆ NextScanOverride()

FrameScanType MythVideoScanTracker::NextScanOverride ( )

Definition at line 45 of file mythvideoscantracker.cpp.

Referenced by TV::ActiveHandleAction().

◆ SetScanOverride()

void MythVideoScanTracker::SetScanOverride ( FrameScanType  Scan)

Definition at line 53 of file mythvideoscantracker.cpp.

Referenced by TV::OverrideScan().

◆ GetScanTypeWithOverride()

FrameScanType MythVideoScanTracker::GetScanTypeWithOverride ( ) const

Definition at line 104 of file mythvideoscantracker.cpp.

Referenced by TV::MenuItemDisplayPlayback(), and TV::OverrideScan().

◆ InitialiseScan()

void MythVideoScanTracker::InitialiseScan ( MythVideoOutput VideoOutput)
protected

Definition at line 16 of file mythvideoscantracker.cpp.

Referenced by MythPlayerUI::VideoStart().

◆ UnlockScan()

void MythVideoScanTracker::UnlockScan ( )
protected

◆ ResetTracker()

void MythVideoScanTracker::ResetTracker ( )
protected

Definition at line 39 of file mythvideoscantracker.cpp.

Referenced by MythPlayerUI::SetVideoParams().

◆ SetScanType()

void MythVideoScanTracker::SetScanType ( FrameScanType  Scan,
MythVideoOutput VideoOutput,
int  FrameInterval 
)
protected

◆ GetScanForDisplay()

FrameScanType MythVideoScanTracker::GetScanForDisplay ( MythVideoFrame Frame,
bool SecondField 
)
protected

Definition at line 67 of file mythvideoscantracker.cpp.

Referenced by MythPlayerUI::DoDisplayVideoFrame().

◆ GetScanType()

FrameScanType MythVideoScanTracker::GetScanType ( void  ) const
protected

◆ AutoDeint()

void MythVideoScanTracker::AutoDeint ( MythVideoFrame Frame,
MythVideoOutput VideoOutput,
int  FrameInterval,
bool  AllowLock = true 
)
protectedvirtual

Check whether deinterlacing should be enabled.

If the user has triggered an override, this will always be used (until 'detect' is requested to turn it off again).

For H264 material, the decoder will signal when the current frame is on a new GOP boundary and if the frame's interlaced flag does not match the current scan type, the scan type is unlocked. This works well for all test clips with mixed progressive/interlaced sequences.

For all other material, we lock the scan type to interlaced when interlaced frames are seen - and do not unlock if we see progressive frames. This is primarily targetted at MPEG2 material where there is a lot of content where the scan type changes frequently - and for no obvious reason. This will result in 'false positives' in some cases but there is no clear approach that works for all cases. The previous behaviour is preserved (i.e. lock to interlaced if interlaced frames are seen) which results in less erratic playback (as the deinterlacers are not continually switched on and off) and correctly deinterlaces material that is not otherwise flagged correctly.

Reimplemented in MythDVDPlayer.

Definition at line 176 of file mythvideoscantracker.cpp.

Referenced by MythDVDPlayer::AutoDeint(), and MythPlayerUI::DisplayNormalFrame().

◆ CheckScanUpdate()

void MythVideoScanTracker::CheckScanUpdate ( MythVideoOutput VideoOutput,
int  FrameInterval 
)
protected

Definition at line 111 of file mythvideoscantracker.cpp.

Referenced by MythPlayerUI::EventLoop().

◆ GetDeinterlacerName()

QString MythVideoScanTracker::GetDeinterlacerName ( )
protected

Definition at line 117 of file mythvideoscantracker.cpp.

Referenced by MythPlayerUI::GetCodecDescription().

◆ DetectInterlace()

FrameScanType MythVideoScanTracker::DetectInterlace ( FrameScanType  NewScan,
float  Rate,
int  VideoHeight 
)
protected

Definition at line 242 of file mythvideoscantracker.cpp.

Referenced by MythPlayerUI::SetVideoParams().

Member Data Documentation

◆ m_parentPlayer

MythPlayerUI* MythVideoScanTracker::m_parentPlayer { nullptr }
private

Definition at line 37 of file mythvideoscantracker.h.

Referenced by InitialiseScan(), and SetScanType().

◆ m_scanTracker

long long MythVideoScanTracker::m_scanTracker { 0 }
private

Definition at line 38 of file mythvideoscantracker.h.

Referenced by AutoDeint(), InitialiseScan(), and ResetTracker().

◆ m_resetScan

FrameScanType MythVideoScanTracker::m_resetScan { kScan_Ignore }
private

Definition at line 39 of file mythvideoscantracker.h.

Referenced by CheckScanUpdate(), and SetScanType().

◆ m_scan

FrameScanType MythVideoScanTracker::m_scan { kScan_Interlaced }
private

◆ m_scanOverride

FrameScanType MythVideoScanTracker::m_scanOverride { kScan_Detect }
private

◆ m_scanLocked

bool MythVideoScanTracker::m_scanLocked { false }
private

◆ m_scanInitialized

bool MythVideoScanTracker::m_scanInitialized { false }
private

Definition at line 43 of file mythvideoscantracker.h.

Referenced by SetScanOverride(), SetScanType(), and UnlockScan().

◆ m_lastFrameInterval

int MythVideoScanTracker::m_lastFrameInterval { 0 }
private

Definition at line 44 of file mythvideoscantracker.h.

Referenced by SetScanType().

◆ m_lastDeinterlacer2x

bool MythVideoScanTracker::m_lastDeinterlacer2x { false }
private

Definition at line 45 of file mythvideoscantracker.h.

Referenced by GetDeinterlacerName(), and GetScanForDisplay().

◆ m_lastDeinterlacer

MythDeintType MythVideoScanTracker::m_lastDeinterlacer { DEINT_NONE }
private

Definition at line 46 of file mythvideoscantracker.h.

Referenced by GetDeinterlacerName(), and GetScanForDisplay().

◆ m_lastFrameCodec

VideoFrameType MythVideoScanTracker::m_lastFrameCodec { FMT_NONE }
private

Definition at line 47 of file mythvideoscantracker.h.

Referenced by GetDeinterlacerName(), and GetScanForDisplay().

◆ m_mainThread

QThread* MythVideoScanTracker::m_mainThread { QThread::currentThread() }
private

Definition at line 49 of file mythvideoscantracker.h.

Referenced by SetScanType().


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