6#if QT_VERSION >= QT_VERSION_CHECK(6,5,0)
7#include <QtEnvironmentVariables>
12#include <QSurfaceFormat>
24#include "libmythbase/mythversion.h"
40 std::chrono::seconds runfor,
bool deint,
bool gpu)
60 mp->GetAudio()->SetAudioInfo(
"NULL",
"NULL", 0, 0);
61 mp->GetAudio()->SetNoAudio();
69 if (!mp->StartPlaying())
71 LOG(VB_GENERAL, LOG_ERR,
"Failed to start playback.");
78 LOG(VB_GENERAL, LOG_ERR,
"No video output.");
82 LOG(VB_GENERAL, LOG_INFO,
"-----------------------------------");
83 LOG(VB_GENERAL, LOG_INFO,
"Ensure Sync to VBlank is disabled.");
84 LOG(VB_GENERAL, LOG_INFO,
"Otherwise rate will be limited to that of the display.");
85 LOG(VB_GENERAL, LOG_INFO,
"-----------------------------------");
86 LOG(VB_GENERAL, LOG_INFO, QString(
"Starting video performance test for '%1'.")
88 LOG(VB_GENERAL, LOG_INFO, QString(
"Test will run for %1 seconds.")
92 LOG(VB_GENERAL, LOG_INFO,
"No decode after startup - checking display performance");
94 LOG(VB_GENERAL, LOG_INFO,
"Decoding frames only - skipping display.");
99 auto *jitter =
new Jitterometer(
"Performance: ",
static_cast<int>(mp->GetFrameRate()));
101 QTime start = QTime::currentTime();
105 mp->ProcessCallbacks();
106 auto duration = std::chrono::milliseconds(start.msecsTo(QTime::currentTime()));
109 LOG(VB_GENERAL, LOG_INFO,
"Complete.");
115 LOG(VB_GENERAL, LOG_ERR,
"Playback error.");
121 LOG(VB_GENERAL, LOG_INFO,
"End of file.");
125 if (!mp->PrebufferEnoughFrames())
128 mp->SetBuffering(
false);
132 mp->CheckAspectRatio(frame);
145 if (doubledeint && !other)
153 jitter->RecordCycleTime();
155 LOG(VB_GENERAL, LOG_INFO,
"-----------------------------------");
169int main(
int argc,
char *argv[])
190 int swapinterval = 1;
194 qputenv(
"vblank_mode",
"0");
195 qputenv(
"__GL_SYNC_TO_VBLANK",
"0");
205 QApplication a(argc, argv);
224 LOG(VB_GENERAL, LOG_ERR,
"Failed to init MythContext, exiting.");
234 QString msg = QString(
"Fatal Error: Couldn't find theme '%1'.")
236 LOG(VB_GENERAL, LOG_ERR, msg);
244 if (auddevice.isEmpty())
246 LOG(VB_GENERAL, LOG_ERR,
"Fatal Error: Audio not configured, you need "
247 "to run 'mythfrontend', not 'mythtv'.");
257 std::chrono::seconds seconds = 5s;
259 seconds = std::chrono::seconds(
cmdline.
toInt(
"seconds"));
275 LOG(VB_GENERAL, LOG_ERR,
"Fatal Error: Incorrect database schema.");
virtual QString GetCodecDecoderName(void) const =0
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
int toInt(const QString &key) const
Returns stored QVariant as an integer, falling to default if not provided.
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
void ApplySettingsOverride(void)
Apply all overrides to the global context.
int ConfigureLogging(const QString &mask="general", bool progress=false)
Read in logging options and initialize the logging interface.
QString toString(const QString &key) const
Returns stored QVariant as a QString, falling to default if not provided.
static void PrintVersion(void)
Print application version information.
QStringList GetArgs(void) const
Return list of additional values provided on the command line independent of any keyword.
void PrintHelp(void) const
Print command line option help.
Startup context for MythTV.
QString GetSetting(const QString &key, const QString &defaultval="")
static void ConfigureQtGUI(int SwapInterval, const MythCommandLineParser &CmdLine)
Shared static initialisation code for all MythTV GUI applications.
void Init(bool MayReInit=true)
static void ParseGeometryOverride(const QString &Geometry)
Parse an X11 style command line geometry string.
QString FindThemeDir(const QString &ThemeName, bool Fallback=true)
Returns the full path to the theme denoted by themename.
MythDeintType GetDoubleRateOption(MythDeintType Type, MythDeintType Override=DEINT_NONE) const
virtual void StartDisplayingFrame()
Tell GetLastShownFrame() to return the next frame from the head of the queue of frames to display.
virtual void EndFrame()=0
virtual void PrepareFrame(MythVideoFrame *Frame, FrameScanType Scan=kScan_Ignore)=0
virtual MythVideoFrame * GetLastShownFrame()
Returns frame from the head of the ready to be displayed queue, if StartDisplayingFrame has been call...
virtual void DoneDisplayingFrame(MythVideoFrame *Frame)
Releases frame returned from GetLastShownFrame() onto the queue of frames ready for decoding onto.
virtual void RenderFrame(MythVideoFrame *Frame, FrameScanType)=0
void SetRingBuffer(MythMediaBuffer *Buffer)
void SetPlayingInfo(const ProgramInfo *info)
assign programinfo to the context
void SetPlayer(MythPlayer *newplayer)
Holds information on recordings and videos.
static bool StartTV(ProgramInfo *TVRec, uint Flags, const ChannelInfoList &Selection=ChannelInfoList())
Start playback of media.
bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, const bool upgradeIfNoUI, const bool informSystemd)
Called from outside dbcheck.cpp to update the schema.
@ GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.
@ GENERIC_EXIT_DB_OUTOFDATE
Database needs upgrade.
@ GENERIC_EXIT_OK
Exited with no error.
@ GENERIC_EXIT_SETUP_ERROR
Incorrectly setup system.
@ GENERIC_EXIT_NO_THEME
No Theme available.
@ GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
static constexpr const char * MYTH_APPNAME_MYTHAVTEST
int main(int argc, char *argv[])
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
void setHttpProxy(void)
Get network proxy settings from OS, and use for [Q]Http[Comms].
MythUIHelper * GetMythUI()
MythCommFlagCommandLineParser cmdline
def scan(profile, smoonURL, gate)
static eu8 clamp(eu8 value, eu8 low, eu8 high)