8 #include <QCoreApplication> 19 #include "ringbuffer.h" 40 QString(
"Only locally accessible files are supported (%1).")
42 cerr << qPrintable(msg) << endl;
49 QString(
"Could not open input file (%1).").arg(
filename)) << endl;
56 cerr << qPrintable(QString(
"Unable to create RingBuffer for %1")
63 cout <<
"Program will end @ " 75 ctx->SetPlayingInfo(&program_info);
76 ctx->SetRingBuffer(tmprbuf);
79 ccp->SetPlayerInfo(
nullptr,
nullptr, ctx);
80 if (ccp->OpenFile() < 0)
82 cerr <<
"Failed to open " << qPrintable(
filename) << endl;
87 cerr <<
"Failed to decode " << qPrintable(
filename) << endl;
96 int main(
int argc,
char *argv[])
98 QCoreApplication a(argc, argv);
126 if (infile.isEmpty())
128 cerr <<
"The input file --infile is required" << endl;
134 bool useDB = !QFile::exists(infile);
139 QList<int> signallist;
140 signallist << SIGINT << SIGTERM << SIGSEGV << SIGABRT << SIGBUS << SIGFPE
143 signallist << SIGRTMIN;
154 cerr <<
"Failed to init MythContext, exiting." << endl;
Startup context for MythTV.
const char * kCCExtractorInUseID
#define GENERIC_EXIT_OK
Exited with no error.
#define GENERIC_EXIT_PERMISSIONS_ERROR
File permissions error.
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
static void PrintVersion(void)
Print application version information.
void PrintHelp(void) const
Print command line option help.
static void Init(QList< int > &signallist, QObject *parent=nullptr)
static RingBuffer * Create(const QString &xfilename, bool write, bool usereadahead=true, int timeout_ms=kDefaultOpenTimeout, bool stream_only=false)
Creates a RingBuffer instance.
MythContext * gContext
This global variable contains the MythContext instance for the application.
#define MYTH_APPNAME_MYTHCCEXTRACTOR
Holds information on recordings and videos.
void SetWaitForWrite(void)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
QString toString(const QString &key) const
Returns stored QVariant as a QString, falling to default if not provided.
static void SetHandler(int signum, SigHandlerFunc handler)
MythCommFlagCommandLineParser cmdline
static int RunCCExtract(ProgramInfo &program_info, const QString &destdir)
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
#define MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
int main(int argc, char *argv[])
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
static QString cleanup(const QString &str)
bool Init(const bool gui=true, const bool promptForBackend=false, const bool disableAutoDiscovery=false, const bool ignoreDB=false)
Implements a file/stream reader/writer.
#define GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.
QString GetPlaybackURL(bool checkMaster=false, bool forceCheckLocal=false)
Returns filename or URL to be used to play back this recording.
#define GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
#define GENERIC_EXIT_NOT_OK
Exited with error.
QString GetPathname(void) const
int ConfigureLogging(const QString &mask="general", unsigned int progress=0)
Read in logging options and initialize the logging interface.