Go to the documentation of this file.
6 #include <QApplication>
9 #include <QSurfaceFormat>
19 #include "libmythbase/mythversion.h"
36 std::chrono::seconds runfor,
bool deint,
bool gpu)
56 mp->GetAudio()->SetAudioInfo(
"NULL",
"NULL", 0, 0);
57 mp->GetAudio()->SetNoAudio();
65 if (!mp->StartPlaying())
67 LOG(VB_GENERAL, LOG_ERR,
"Failed to start playback.");
74 LOG(VB_GENERAL, LOG_ERR,
"No video output.");
78 LOG(VB_GENERAL, LOG_INFO,
"-----------------------------------");
79 LOG(VB_GENERAL, LOG_INFO,
"Ensure Sync to VBlank is disabled.");
80 LOG(VB_GENERAL, LOG_INFO,
"Otherwise rate will be limited to that of the display.");
81 LOG(VB_GENERAL, LOG_INFO,
"-----------------------------------");
82 LOG(VB_GENERAL, LOG_INFO, QString(
"Starting video performance test for '%1'.")
84 LOG(VB_GENERAL, LOG_INFO, QString(
"Test will run for %1 seconds.")
88 LOG(VB_GENERAL, LOG_INFO,
"No decode after startup - checking display performance");
90 LOG(VB_GENERAL, LOG_INFO,
"Decoding frames only - skipping display.");
95 auto *jitter =
new Jitterometer(
"Performance: ",
static_cast<int>(mp->GetFrameRate()));
97 QTime start = QTime::currentTime();
101 mp->ProcessCallbacks();
102 auto duration = std::chrono::milliseconds(start.msecsTo(QTime::currentTime()));
105 LOG(VB_GENERAL, LOG_INFO,
"Complete.");
111 LOG(VB_GENERAL, LOG_ERR,
"Playback error.");
117 LOG(VB_GENERAL, LOG_INFO,
"End of file.");
121 if (!mp->PrebufferEnoughFrames())
124 mp->SetBuffering(
false);
128 mp->CheckAspectRatio(frame);
141 if (doubledeint && !other)
149 jitter->RecordCycleTime();
151 LOG(VB_GENERAL, LOG_INFO,
"-----------------------------------");
165 int main(
int argc,
char *argv[])
186 int swapinterval = 1;
190 qputenv(
"vblank_mode",
"0");
191 qputenv(
"__GL_SYNC_TO_VBLANK",
"0");
201 QApplication a(argc, argv);
220 LOG(VB_GENERAL, LOG_ERR,
"Failed to init MythContext, exiting.");
230 QString msg = QString(
"Fatal Error: Couldn't find theme '%1'.")
232 LOG(VB_GENERAL, LOG_ERR, msg);
236 #if defined(Q_OS_MACOS)
240 if (auddevice.isEmpty())
242 LOG(VB_GENERAL, LOG_ERR,
"Fatal Error: Audio not configured, you need "
243 "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.");
@ GENERIC_EXIT_SETUP_ERROR
Incorrectly setup system.
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
bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, const bool upgradeIfNoUI, const bool informSystemd)
Called from outside dbcheck.cpp to update the schema.
MythCommFlagCommandLineParser cmdline
Startup context for MythTV.
virtual void PrepareFrame(MythVideoFrame *Frame, FrameScanType Scan=kScan_Ignore)=0
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
@ GENERIC_EXIT_OK
Exited with no error.
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_NO_MYTHCONTEXT
No MythContext available.
QStringList GetArgs(void) const
Return list of additional values provided on the command line independent of any keyword.
void DestroyMythMainWindow(void)
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_NO_THEME
No Theme available.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
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.
static void Init(QObject *parent=nullptr)
static constexpr const char * MYTH_APPNAME_MYTHAVTEST
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.
void SetPlayer(MythPlayer *newplayer)
void SetRingBuffer(MythMediaBuffer *Buffer)
@ GENERIC_EXIT_DB_OUTOFDATE
Database needs upgrade.
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_INVALID_CMDLINE
Command line parse error.
MythContext * gContext
This global variable contains the MythContext instance for the application.
bool Init(bool gui=true, bool promptForBackend=false, bool disableAutoDiscovery=false, bool ignoreDB=false)
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.