Skip to content
Permalink
Browse files

VideoPlayer: write clockSync state to ProcessInfo

  • Loading branch information
FernetMenta authored and popcornmix committed Aug 3, 2016
1 parent 1191d6f commit 19fab66133b7733855746646211be5303c39d27d
@@ -206,3 +206,17 @@ int CDataCacheCore::GetAudioBitsPerSampe()

return m_playerAudioInfo.bitsPerSample;
}

void CDataCacheCore::SetRenderClockSync(bool enable)
{
CSingleLock lock(m_renderSection);

m_renderInfo.m_isClockSync = enable;
}

bool CDataCacheCore::IsRenderClockSync()
{
CSingleLock lock(m_renderSection);

return m_renderInfo.m_isClockSync;
}
@@ -58,7 +58,11 @@ class CDataCacheCore
int GetAudioSampleRate();
void SetAudioBitsPerSample(int bitsPerSample);
int GetAudioBitsPerSampe();


// render info
void SetRenderClockSync(bool enabled);
bool IsRenderClockSync();

protected:
std::atomic_bool m_hasAVInfoChanges;

@@ -83,4 +87,10 @@ class CDataCacheCore
int sampleRate;
int bitsPerSample;
} m_playerAudioInfo;

CCriticalSection m_renderSection;
struct SRenderInfo
{
bool m_isClockSync;
} m_renderInfo;
};
@@ -259,3 +259,19 @@ int CProcessInfo::GetAudioBitsPerSampe()

return m_audioBitsPerSample;
}

void CProcessInfo::SetRenderClockSync(bool enabled)
{
CSingleLock lock(m_renderSection);

m_isClockSync = enabled;

CServiceBroker::GetDataCacheCore().SetRenderClockSync(enabled);
}

bool CProcessInfo::IsRenderClockSync()
{
CSingleLock lock(m_renderSection);

return m_isClockSync;
}
@@ -58,6 +58,10 @@ class CProcessInfo
void SetAudioBitsPerSample(int bitsPerSample);
int GetAudioBitsPerSampe();

// render info
void SetRenderClockSync(bool enabled);
bool IsRenderClockSync();

protected:
CProcessInfo();

@@ -78,4 +82,8 @@ class CProcessInfo
int m_audioSampleRate;
int m_audioBitsPerSample;
CCriticalSection m_audioCodecSection;

// render info
CCriticalSection m_renderSection;
bool m_isClockSync;
};
@@ -5168,6 +5168,11 @@ void CVideoPlayer::GetDebugInfo(std::string &audio, std::string &video, std::str
GetGeneralInfo(general);
}

void CVideoPlayer::UpdateClockSync(bool enabled)
{
m_processInfo->SetRenderClockSync(enabled);
}

// IDispResource interface
void CVideoPlayer::OnLostDisplay()
{
@@ -360,6 +360,7 @@ class CVideoPlayer : public IPlayer, public CThread, public IVideoPlayer, public
virtual void Process();
virtual void VideoParamsChange() override;
virtual void GetDebugInfo(std::string &audio, std::string &video, std::string &general) override;
virtual void UpdateClockSync(bool enabled) override;

void CreatePlayers();
void DestroyPlayers();
@@ -57,6 +57,7 @@ class IRenderMsg
protected:
virtual void VideoParamsChange() = 0;
virtual void GetDebugInfo(std::string &audio, std::string &video, std::string &general) = 0;
virtual void UpdateClockSync(bool enabled) = 0;
};

class CRenderManager

0 comments on commit 19fab66

Please sign in to comment.
You can’t perform that action at this time.