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,
"-----------------------------------");
166int 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.");
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[])
MythCommFlagCommandLineParser cmdline
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()
def scan(profile, smoonURL, gate)
static eu8 clamp(eu8 value, eu8 low, eu8 high)