MythTV  master
mythplayeravsync.h
Go to the documentation of this file.
1 #ifndef MYTHPLAYERAVSYNC_H
2 #define MYTHPLAYERAVSYNC_H
3 
4 // Qt
5 #include <QElapsedTimer>
6 
7 // MythTV
8 #include "mythtypes.h"
9 #include "mythframe.h"
10 
11 class AudioPlayer;
12 
14 {
15  public:
17 
18  public:
19  void InitAVSync ();
20  std::chrono::microseconds AVSync (AudioPlayer* Audio, MythVideoFrame* Frame,
21  std::chrono::microseconds FrameInterval,
22  float PlaySpeed, bool HaveVideo, bool Force);
23  void WaitForFrame (std::chrono::microseconds FrameDue);
24  std::chrono::milliseconds& DisplayTimecode ();
25  void ResetAVSyncClockBase();
26  void GetAVSyncData (InfoMap& Map) const;
27  bool GetAVSyncAudioPause () const;
28  void SetAVSyncAudioPause (bool Pause);
29  bool ResetAVSyncForLiveTV(AudioPlayer* Audio);
30  void SetAVSyncMusicChoice(AudioPlayer* Audio); // remove
31 
32  private:
33  QElapsedTimer m_avTimer;
34  bool m_avsyncAudioPaused { false };
35  int m_avsyncAvg { 0 };
36  std::chrono::milliseconds m_dispTimecode { 0ms };
37  std::chrono::microseconds m_rtcBase { 0us }; // real time clock base for presentation time
38  std::chrono::milliseconds m_maxTcVal { 0ms }; // maximum to date video tc
39  std::chrono::milliseconds m_priorAudioTimecode { 0ms }; // time code from prior frame
40  std::chrono::milliseconds m_priorVideoTimecode { 0ms }; // time code from prior frame
41  int m_maxTcFrames { 0 }; // number of frames seen since max to date tc
42  int m_numDroppedFrames { 0 }; // number of consecutive dropped frames.
43  float m_lastFix { 0.0F }; //last sync adjustment to prior frame]
44 };
45 
46 #endif
MythPlayerAVSync::m_priorVideoTimecode
std::chrono::milliseconds m_priorVideoTimecode
Definition: mythplayeravsync.h:40
MythPlayerAVSync
Definition: mythplayeravsync.h:13
AudioPlayer
Definition: audioplayer.h:26
Frame
Definition: zmdefines.h:93
MythPlayerAVSync::m_priorAudioTimecode
std::chrono::milliseconds m_priorAudioTimecode
Definition: mythplayeravsync.h:39
mythframe.h
MythPlayerAVSync::DisplayTimecode
std::chrono::milliseconds & DisplayTimecode()
Definition: mythplayeravsync.cpp:35
MythPlayerAVSync::ResetAVSyncForLiveTV
bool ResetAVSyncForLiveTV(AudioPlayer *Audio)
Definition: mythplayeravsync.cpp:55
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
MythPlayerAVSync::MythPlayerAVSync
MythPlayerAVSync()
Definition: mythplayeravsync.cpp:11
MythPlayerAVSync::GetAVSyncAudioPause
bool GetAVSyncAudioPause() const
Definition: mythplayeravsync.cpp:45
MythPlayerAVSync::m_numDroppedFrames
int m_numDroppedFrames
Definition: mythplayeravsync.h:42
mythtypes.h
MythPlayerAVSync::m_maxTcVal
std::chrono::milliseconds m_maxTcVal
Definition: mythplayeravsync.h:38
MythPlayerAVSync::m_rtcBase
std::chrono::microseconds m_rtcBase
Definition: mythplayeravsync.h:37
MythPlayerAVSync::SetAVSyncMusicChoice
void SetAVSyncMusicChoice(AudioPlayer *Audio)
Definition: mythplayeravsync.cpp:64
MythPlayerAVSync::WaitForFrame
void WaitForFrame(std::chrono::microseconds FrameDue)
Definition: mythplayeravsync.cpp:27
MythPlayerAVSync::GetAVSyncData
void GetAVSyncData(InfoMap &Map) const
Definition: mythplayeravsync.cpp:70
MythPlayerAVSync::ResetAVSyncClockBase
void ResetAVSyncClockBase()
Definition: mythplayeravsync.cpp:40
MythPlayerAVSync::InitAVSync
void InitAVSync()
Definition: mythplayeravsync.cpp:17
MythPlayerAVSync::m_avsyncAvg
int m_avsyncAvg
Definition: mythplayeravsync.h:35
MythPlayerAVSync::m_dispTimecode
std::chrono::milliseconds m_dispTimecode
Definition: mythplayeravsync.h:36
MythPlayerAVSync::m_maxTcFrames
int m_maxTcFrames
Definition: mythplayeravsync.h:41
MythVideoFrame
Definition: mythframe.h:88
MythPlayerAVSync::AVSync
std::chrono::microseconds AVSync(AudioPlayer *Audio, MythVideoFrame *Frame, std::chrono::microseconds FrameInterval, float PlaySpeed, bool HaveVideo, bool Force)
Definition: mythplayeravsync.cpp:76
MythPlayerAVSync::SetAVSyncAudioPause
void SetAVSyncAudioPause(bool Pause)
Definition: mythplayeravsync.cpp:50
MythPlayerAVSync::m_avsyncAudioPaused
bool m_avsyncAudioPaused
Definition: mythplayeravsync.h:34
MythPlayerAVSync::m_lastFix
float m_lastFix
Definition: mythplayeravsync.h:43
MythPlayerAVSync::m_avTimer
QElapsedTimer m_avTimer
Definition: mythplayeravsync.h:33