Skip to content

Commit

Permalink
Show display frequency
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kmdewaal committed Nov 23, 2024
1 parent 447ea61 commit c53beb0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mythtv/libs/libmythtv/mythplayerui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions mythtv/libs/libmythtv/mythplayerui.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "jitterometer.h"
#include "mythplayer.h"

class MythDisplay;

class MTV_PUBLIC MythPlayerUI : public MythPlayerEditorUI, public MythVideoScanTracker
{
Q_OBJECT
Expand Down Expand Up @@ -66,6 +68,8 @@ class MTV_PUBLIC MythPlayerUI : public MythPlayerEditorUI, public MythVideoScanT

bool m_osdDebug { false };
QTimer m_osdDebugTimer;

MythDisplay *m_display { nullptr };
};

#endif
11 changes: 11 additions & 0 deletions mythtv/themes/default-wide/osd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@
<area>805,80,250,25</area>
<align>left,vcenter</align>
</textarea>
<textarea name="display">
<font>medium</font>
<area>650,105,150,25</area>
<align>right,vcenter</align>
<value>Display :</value>
</textarea>
<textarea name="displayfps">
<font>medium</font>
<area>805,105,200,25</area>
<align>left,vcenter</align>
</textarea>

<textarea name="audio">
<font>medium</font>
Expand Down

0 comments on commit c53beb0

Please sign in to comment.