Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #6445 from popcornmix/omx_codec_info

[omxplayer] Add some info about hdmi sync to codec overlay
  • Loading branch information...
commit 03f78a622330928cd620a01e2647b4161581f341 2 parents 01c6958 + fb621c7
@MartijnKaijser MartijnKaijser authored
View
8 xbmc/cores/omxplayer/OMXPlayerVideo.cpp
@@ -618,12 +618,18 @@ void OMXPlayerVideo::SetSpeed(int speed)
std::string OMXPlayerVideo::GetPlayerInfo()
{
+ double match = 0.0f, phase = 0.0f, pll = 0.0f;
std::ostringstream s;
s << "fr:" << fixed << setprecision(3) << m_fFrameRate;
s << ", vq:" << setw(2) << min(99,GetLevel()) << "%";
s << ", dc:" << m_codecname;
s << ", Mb/s:" << fixed << setprecision(2) << (double)GetVideoBitrate() / (1024.0*1024.0);
-
+ if (m_omxVideo.GetPlayerInfo(match, phase, pll))
+ {
+ s << ", match:" << fixed << setprecision(2) << match;
+ s << ", phase:" << fixed << setprecision(2) << phase;
+ s << ", pll:" << fixed << setprecision(5) << pll;
+ }
return s.str();
}
View
24 xbmc/cores/omxplayer/OMXVideo.cpp
@@ -759,6 +759,30 @@ unsigned int COMXVideo::GetSize()
return m_omx_decoder.GetInputBufferSize();
}
+bool COMXVideo::GetPlayerInfo(double &match, double &phase, double &pll)
+{
+ CSingleLock lock (m_critSection);
+ OMX_ERRORTYPE omx_err;
+ OMX_CONFIG_BRCMRENDERSTATSTYPE renderstats;
+
+ if (!m_hdmi_clock_sync || !m_omx_render.IsInitialized())
+ return false;
+ OMX_INIT_STRUCTURE(renderstats);
+ renderstats.nPortIndex = m_omx_render.GetInputPort();
+
+ omx_err = m_omx_render.GetParameter(OMX_IndexConfigBrcmRenderStats, &renderstats);
+ if(omx_err != OMX_ErrorNone)
+ {
+ CLog::Log(LOGERROR, "COMXVideo::GetPlayerInfo error GetParameter OMX_IndexParamPortDefinition omx_err(0x%08x)\n", omx_err);
+ return false;
+ }
+ match = renderstats.nMatch * 1e-6;
+ phase = (double)renderstats.nPhase / (double)renderstats.nPeriod;
+ pll = (double)renderstats.nPixelClock / (double)renderstats.nPixelClockNominal;
+ return true;
+}
+
+
int COMXVideo::Decode(uint8_t *pData, int iSize, double pts)
{
CSingleLock lock (m_critSection);
View
1  xbmc/cores/omxplayer/OMXVideo.h
@@ -61,6 +61,7 @@ class COMXVideo
std::string GetDecoderName() { return m_video_codec_name; };
void SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER_STEREO_MODE video_mode, RENDER_STEREO_MODE display_mode);
int GetInputBufferSize();
+ bool GetPlayerInfo(double &match, double &phase, double &pll);
void SubmitEOS();
bool IsEOS();
bool SubmittedEOS() const { return m_submitted_eos; }
Please sign in to comment.
Something went wrong with that request. Please try again.