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
10
11class AudioPlayer;
12
13enum AVSyncAudioPausedType : std::uint8_t
14{
18};
19
21{
22 public:
24
25 public:
26 void InitAVSync ();
27 std::chrono::microseconds AVSync (AudioPlayer* Audio, MythVideoFrame* Frame,
28 std::chrono::microseconds FrameInterval,
29 float PlaySpeed, bool HaveVideo, bool Force);
30 void WaitForFrame (std::chrono::microseconds FrameDue);
31 std::chrono::milliseconds& DisplayTimecode()
32 { return m_dispTimecode; }
34 { m_rtcBase = 0us; }
35 void GetAVSyncData (InfoMap& Map) const;
37 { return m_avsyncAudioPaused; }
39 { m_avsyncAudioPaused = Pause; }
41 void SetAVSyncMusicChoice(AudioPlayer* Audio); // remove
42 void SetRefreshInterval(std::chrono::microseconds interval)
43 { m_refreshInterval = interval; }
44
45 private:
46 QElapsedTimer m_avTimer;
48 int m_avsyncAvg { 0 };
49 std::chrono::milliseconds m_dispTimecode { 0ms };
50 std::chrono::microseconds m_rtcBase { 0us }; // real time clock base for presentation time
51 std::chrono::milliseconds m_maxTcVal { 0ms }; // maximum to date video tc
52 std::chrono::milliseconds m_priorAudioTimecode { 0ms }; // time code from prior frame
53 std::chrono::milliseconds m_priorVideoTimecode { 0ms }; // time code from prior frame
54 int m_maxTcFrames { 0 }; // number of frames seen since max to date tc
55 int m_numDroppedFrames { 0 }; // number of consecutive dropped frames.
56 float m_lastFix { 0.0F }; //last sync adjustment to prior frame]
57 std::chrono::microseconds m_refreshInterval { 0us };
58 std::chrono::microseconds m_shortFrameDeltas { 0us };
59};
60
61#endif
void SetAVSyncAudioPause(AVSyncAudioPausedType Pause)
std::chrono::microseconds m_refreshInterval
void SetAVSyncMusicChoice(AudioPlayer *Audio)
void GetAVSyncData(InfoMap &Map) const
std::chrono::milliseconds m_priorAudioTimecode
AVSyncAudioPausedType m_avsyncAudioPaused
std::chrono::microseconds AVSync(AudioPlayer *Audio, MythVideoFrame *Frame, std::chrono::microseconds FrameInterval, float PlaySpeed, bool HaveVideo, bool Force)
QElapsedTimer m_avTimer
std::chrono::milliseconds m_priorVideoTimecode
std::chrono::milliseconds m_dispTimecode
std::chrono::milliseconds m_maxTcVal
AVSyncAudioPausedType GetAVSyncAudioPause() const
void SetRefreshInterval(std::chrono::microseconds interval)
std::chrono::microseconds m_rtcBase
void ResetAVSyncForLiveTV(AudioPlayer *Audio)
void WaitForFrame(std::chrono::microseconds FrameDue)
std::chrono::milliseconds & DisplayTimecode()
std::chrono::microseconds m_shortFrameDeltas
AVSyncAudioPausedType
@ kAVSyncAudioPausedLiveTV
@ kAVSyncAudioPaused
@ kAVSyncAudioNotPaused
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15