From c53beb04dd1bfbee7d37b78158ecf58725c3b5df Mon Sep 17 00:00:00 2001 From: Klaas de Waal Date: Sat, 23 Nov 2024 10:37:50 +0100 Subject: [PATCH] Show display frequency Show the display frequency in the Playback Data popup window. This is useful to verify whether the video output is configured to match the frames-per-second of the video stream. The popup window it is shown when video is playing and then the "Playback Menu / Playback / Playback Data" is chosen --- mythtv/libs/libmythtv/mythplayerui.cpp | 8 ++++++++ mythtv/libs/libmythtv/mythplayerui.h | 4 ++++ mythtv/themes/default-wide/osd.xml | 11 +++++++++++ 3 files changed, 23 insertions(+) diff --git a/mythtv/libs/libmythtv/mythplayerui.cpp b/mythtv/libs/libmythtv/mythplayerui.cpp index 813b4291ff8..898af9688c5 100644 --- a/mythtv/libs/libmythtv/mythplayerui.cpp +++ b/mythtv/libs/libmythtv/mythplayerui.cpp @@ -21,6 +21,8 @@ MythPlayerUI::MythPlayerUI(MythMainWindow* MainWindow, TV* Tv, : MythPlayerEditorUI(MainWindow, Tv, Context, Flags), MythVideoScanTracker(this) { + m_display = MainWindow->GetDisplay(); + // Finish setting up the overlays m_osd.SetPlayer(this); m_captionsOverlay.SetPlayer(this); @@ -840,6 +842,12 @@ void MythPlayerUI::GetPlaybackData(InfoMap& Map) Map["load"] = m_outputJmeter.GetLastCPUStats(); GetCodecDescription(Map); + + QString displayfps = QString("%1x%2@%3Hz") + .arg(m_display->GetResolution().width()) + .arg(m_display->GetResolution().height()) + .arg(m_display->GetRefreshRate(), 0, 'f', 2); + Map["displayfps"] = displayfps; } void MythPlayerUI::GetCodecDescription(InfoMap& Map) diff --git a/mythtv/libs/libmythtv/mythplayerui.h b/mythtv/libs/libmythtv/mythplayerui.h index 2d90af6d8fe..401b8062e8e 100644 --- a/mythtv/libs/libmythtv/mythplayerui.h +++ b/mythtv/libs/libmythtv/mythplayerui.h @@ -7,6 +7,8 @@ #include "jitterometer.h" #include "mythplayer.h" +class MythDisplay; + class MTV_PUBLIC MythPlayerUI : public MythPlayerEditorUI, public MythVideoScanTracker { Q_OBJECT @@ -66,6 +68,8 @@ class MTV_PUBLIC MythPlayerUI : public MythPlayerEditorUI, public MythVideoScanT bool m_osdDebug { false }; QTimer m_osdDebugTimer; + + MythDisplay *m_display { nullptr }; }; #endif diff --git a/mythtv/themes/default-wide/osd.xml b/mythtv/themes/default-wide/osd.xml index f894f60ff6a..bd504901164 100644 --- a/mythtv/themes/default-wide/osd.xml +++ b/mythtv/themes/default-wide/osd.xml @@ -140,6 +140,17 @@ 805,80,250,25 left,vcenter + +