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