Go to the documentation of this file.
5 #include <QApplication>
9 #include <QSurfaceFormat>
37 int runfor,
bool deint,
bool gpu)
62 mp->GetAudio()->SetAudioInfo(
"NULL",
"NULL", 0, 0);
63 mp->GetAudio()->SetNoAudio();
71 if (!mp->StartPlaying())
73 LOG(VB_GENERAL, LOG_ERR,
"Failed to start playback.");
80 LOG(VB_GENERAL, LOG_ERR,
"No video output.");
84 LOG(VB_GENERAL, LOG_INFO,
"-----------------------------------");
85 LOG(VB_GENERAL, LOG_INFO,
"Ensure Sync to VBlank is disabled.");
86 LOG(VB_GENERAL, LOG_INFO,
"Otherwise rate will be limited to that of the display.");
87 LOG(VB_GENERAL, LOG_INFO,
"-----------------------------------");
88 LOG(VB_GENERAL, LOG_INFO, QString(
"Starting video performance test for '%1'.")
90 LOG(VB_GENERAL, LOG_INFO, QString(
"Test will run for %1 seconds.")
94 LOG(VB_GENERAL, LOG_INFO,
"No decode after startup - checking display performance");
96 LOG(VB_GENERAL, LOG_INFO,
"Decoding frames only - skipping display.");
101 auto *jitter =
new Jitterometer(
"Performance: ",
static_cast<int>(mp->GetFrameRate()));
104 QTime start = QTime::currentTime();
108 mp->ProcessCallbacks();
109 int duration = start.msecsTo(QTime::currentTime());
110 if (duration < 0 || duration > ms)
112 LOG(VB_GENERAL, LOG_INFO,
"Complete.");
118 LOG(VB_GENERAL, LOG_ERR,
"Playback error.");
124 LOG(VB_GENERAL, LOG_INFO,
"End of file.");
128 if (!mp->PrebufferEnoughFrames())
131 mp->SetBuffering(
false);
135 mp->CheckAspectRatio(frame);
148 if (doubledeint && !other)
156 jitter->RecordCycleTime();
158 LOG(VB_GENERAL, LOG_INFO,
"-----------------------------------");
172 int main(
int argc,
char *argv[])
193 int swapinterval = 1;
197 qputenv(
"vblank_mode",
"0");
198 qputenv(
"__GL_SYNC_TO_VBLANK",
"0");
208 QApplication a(argc, argv);
227 LOG(VB_GENERAL, LOG_ERR,
"Failed to init MythContext, exiting.");
237 QString msg = QString(
"Fatal Error: Couldn't find theme '%1'.")
239 LOG(VB_GENERAL, LOG_ERR, msg);
243 #if defined(Q_OS_MACX)
247 if (auddevice.isEmpty())
249 LOG(VB_GENERAL, LOG_ERR,
"Fatal Error: Audio not configured, you need "
250 "to run 'mythfrontend', not 'mythtv'.");
259 QList<int> signallist;
260 signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
263 signallist << SIGRTMIN;
289 LOG(VB_GENERAL, LOG_ERR,
"Fatal Error: Incorrect database schema.");
#define GENERIC_EXIT_OK
Exited with no error.
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.
Startup context for MythTV.
virtual void PrepareFrame(MythVideoFrame *Frame, FrameScanType Scan=kScan_Ignore)=0
arg(title).arg(filename).arg(doDelete))
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
#define GENERIC_EXIT_INVALID_CMDLINE
Command line parse 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 initialistaion code for all MythTV GUI applications.
int main(int argc, char *argv[])
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
QStringList GetArgs(void) const
Return list of additional values provided on the command line independent of any keyword.
#define GENERIC_EXIT_SETUP_ERROR
Incorrectly setup system.
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.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
void ApplySettingsOverride(void)
Apply all overrides to the global context.
#define MYTH_APPNAME_MYTHAVTEST
virtual void StartDisplayingFrame()
Tell GetLastShownFrame() to return the next frame from the head of the queue of frames to display.
#define MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
virtual void RenderFrame(MythVideoFrame *Frame, FrameScanType)=0
MythCommFlagCommandLineParser cmdline
Holds information on recordings and videos.
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)
#define GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.
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...
#define GENERIC_EXIT_NO_THEME
No Theme available.
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.
static void Init(QList< int > &signallist, QObject *parent=nullptr)
#define GENERIC_EXIT_DB_OUTOFDATE
Database needs upgrade.