9 #include <QApplication> 37 int runfor,
bool deint,
bool gpu)
38 : file(filename), novideosync(novsync), decodeonly(onlydecode),
39 secondstorun(runfor), deinterlace(deint), allowgpu(gpu), ctx(nullptr)
43 if (secondstorun > 3600)
57 LOG(VB_GENERAL, LOG_INFO,
"Will attempt to disable sync-to-vblank.");
64 ctx->SetRingBuffer(rb);
72 LOG(VB_GENERAL, LOG_ERR,
"Failed to start playback.");
79 LOG(VB_GENERAL, LOG_ERR,
"No video output.");
83 LOG(VB_GENERAL, LOG_INFO,
"-----------------------------------");
84 LOG(VB_GENERAL, LOG_INFO,
"Ensure Sync to VBlank is disabled.");
85 LOG(VB_GENERAL, LOG_INFO,
"Otherwise rate will be limited to that of the display.");
86 LOG(VB_GENERAL, LOG_INFO,
"-----------------------------------");
87 LOG(VB_GENERAL, LOG_INFO, QString(
"Starting video performance test for '%1'.")
89 LOG(VB_GENERAL, LOG_INFO, QString(
"Test will run for %1 seconds.")
93 LOG(VB_GENERAL, LOG_INFO,
"Decoding frames only - skipping display.");
98 LOG(VB_GENERAL, LOG_INFO, QString(
"Deinterlacing: %1")
99 .arg(doublerate ?
"doublerate" :
"singlerate"));
101 LOG(VB_GENERAL, LOG_INFO,
"Output will show fields per second");
105 LOG(VB_GENERAL, LOG_INFO,
"Deinterlacing disabled");
114 int ms = secondstorun * 1000;
115 QTime start = QTime::currentTime();
118 int duration = start.msecsTo(QTime::currentTime());
119 if (duration < 0 || duration > ms)
121 LOG(VB_GENERAL, LOG_INFO,
"Complete.");
127 LOG(VB_GENERAL, LOG_ERR,
"Playback error.");
133 LOG(VB_GENERAL, LOG_INFO,
"End of file.");
160 LOG(VB_GENERAL, LOG_INFO,
"-----------------------------------");
174 int main(
int argc,
char *argv[])
178 setenv(
"QT_XCB_GL_INTEGRATION",
"none",0);
182 qputenv(
"vblank_mode",
"0");
183 qputenv(
"__GL_SYNC_TO_VBLANK",
"0");
204 QApplication a(argc, argv);
221 QString filename =
"";
230 LOG(VB_GENERAL, LOG_ERR,
"Failed to init MythContext, exiting.");
240 QString msg = QString(
"Fatal Error: Couldn't find theme '%1'.")
242 LOG(VB_GENERAL, LOG_ERR, msg);
248 #if defined(Q_OS_MACX) 252 if (auddevice.isEmpty())
254 LOG(VB_GENERAL, LOG_ERR,
"Fatal Error: Audio not configured, you need " 255 "to run 'mythfrontend', not 'mythtv'.");
268 QList<int> signallist;
269 signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
272 signallist << SIGRTMIN;
297 LOG(VB_GENERAL, LOG_ERR,
"Fatal Error: Incorrect database schema.");
302 if (filename.isEmpty())
Startup context for MythTV.
QString FindThemeDir(const QString &themename, bool doFallback=true)
Returns the full path to the theme denoted by themename.
bool UpgradeTVDatabaseSchema(const bool upgradeAllowed, const bool upgradeIfNoUI, const bool informSystemd)
Called from outside dbcheck.cpp to update the schema.
def scan(profile, smoonURL, gate)
QMap< MythPlayer *, PIPLocation > PIPMap
#define GENERIC_EXIT_OK
Exited with no error.
VideoOutput * GetVideoOutput(void)
void setHttpProxy(void)
Get network proxy settings from OS, and use for [Q]Http[Comms].
virtual bool NeedsDoubleFramerate(void) const
Should Prepare() and Show() be called twice for every ProcessFrame().
void SetAudioInfo(const QString &main_device, const QString &passthru_device, uint samplerate, int bitrate=-1)
Set audio output device parameters.
virtual bool StartPlaying(void)
void PrintHelp(void) const
Print command line option help.
static void Init(QList< int > &signallist, QObject *parent=nullptr)
virtual void PrepareFrame(VideoFrame *buffer, FrameScanType, OSD *osd)=0
void DestroyMythMainWindow(void)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
static RingBuffer * Create(const QString &xfilename, bool write, bool usereadahead=true, int timeout_ms=kDefaultOpenTimeout, bool stream_only=false)
Creates a RingBuffer instance.
bool toBool(QString key) const
Returns stored QVariant as a boolean.
MythContext * gContext
This global variable contains the MythContext instance for the application.
int main(int argc, char *argv[])
static void SetX11Display(const QString &display)
This needs to be set before MythUIHelper is initialized so that the MythUIHelper::Init() can detect X...
virtual void StartDisplayingFrame(void)
Tell GetLastShownFrame() to return the next frame from the head of the queue of frames to display.
void ApplySettingsOverride(void)
Apply all overrides to the global context.
This class serves as the base class for all video output methods.
Holds information on recordings and videos.
bool Init(const bool gui=true, const bool promptForBackend=false, const bool bypassAutoDiscovery=false, const bool ignoreDB=false)
QStringList GetArgs(void) const
Return list of additional values provided on the command line independent of any keyword.
AudioPlayer * GetAudio(void)
void Init(QString forcedpainter=QString(), bool mayReInit=true)
QString GetSetting(const QString &key, const QString &defaultval="")
float GetFrameRate(void) const
EofState GetEof(void) const
static void ParseGeometryOverride(const QString &geometry)
Parse an X11 style command line geometry string.
virtual void ProcessFrame(VideoFrame *frame, OSD *osd, FilterChain *filterList, const PIPMap &pipPlayers, FrameScanType scan=kScan_Ignore)=0
virtual QString GetCodecDecoderName(void) const =0
QString toString(QString key) const
Returns stored QVariant as a QString, falling to default if not provided.
bool IsErrored(void) const
MythCommFlagCommandLineParser cmdline
MythUIHelper * GetMythUI()
virtual void Show(FrameScanType)=0
MythMainWindow * GetMythMainWindow(void)
static bool StartTV(ProgramInfo *tvrec, uint flags, const ChannelInfoList &selection=ChannelInfoList())
returns true if the recording completed when exiting.
virtual void DoneDisplayingFrame(VideoFrame *frame)
Releases frame returned from GetLastShownFrame() onto the queue of frames ready for decoding onto.
void SetPlayerInfo(TV *tv, QWidget *widget, PlayerContext *ctx)
#define LOG(_MASK_, _LEVEL_, _STRING_)
#define MYTH_APPNAME_MYTHAVTEST
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
virtual VideoFrame * GetLastShownFrame(void)
Returns frame from the head of the ready to be displayed queue, if StartDisplayingFrame has been call...
void SetBuffering(bool new_buffering)
#define GENERIC_EXIT_SETUP_ERROR
Incorrectly setup system.
#define MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
virtual bool PrebufferEnoughFrames(int min_buffers=0)
int toInt(QString key) const
Returns stored QVariant as an integer, falling to default if not provided.
Implements a file/stream reader/writer.
#define GENERIC_EXIT_NO_THEME
No Theme available.
int ConfigureLogging(QString mask="general", unsigned int progress=0)
Read in logging options and initialize the logging interface.
#define GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.
#define GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
static void InitKeys(void)
void PrintVersion(void) const
Print application version information.
DecoderBase * GetDecoder(void)
Returns the stream decoder currently in use.
void CheckAspectRatio(VideoFrame *frame)
#define GENERIC_EXIT_DB_OUTOFDATE
Database needs upgrade.