MythTV
master
|
#include <libmythtv/jobqueue.h>
Classes | |
struct | JobThreadStruct |
Public Member Functions | |
JobQueue (bool master) | |
~JobQueue (void) override | |
void | customEvent (QEvent *e) override |
int | GetRunningJobID (uint chanid, const QDateTime &recstartts) |
Static Public Member Functions | |
static bool | QueueRecordingJobs (const RecordingInfo &recinfo, int jobTypes=JOB_NONE) |
static bool | QueueJob (int jobType, uint chanid, const QDateTime &recstartts, const QString &args="", const QString &comment="", QString host="", int flags=0, int status=JOB_QUEUED, QDateTime schedruntime=QDateTime()) |
static bool | QueueJobs (int jobTypes, uint chanid, const QDateTime &recstartts, const QString &args="", const QString &comment="", const QString &host="") |
static int | GetJobID (int jobType, uint chanid, const QDateTime &recstartts) |
static bool | GetJobInfoFromID (int jobID, int &jobType, uint &chanid, QDateTime &recstartts) |
static bool | GetJobInfoFromID (int jobID, int &jobType, uint &chanid, QString &recstartts) |
static int | GetJobTypeFromName (const QString &name) |
static bool | ChangeJobCmds (int jobID, int newCmds) |
static bool | ChangeJobCmds (int jobType, uint chanid, const QDateTime &recstartts, int newCmds) |
static bool | ChangeJobFlags (int jobID, int newFlags) |
static bool | ChangeJobStatus (int jobID, int newStatus, const QString &comment="") |
static bool | ChangeJobHost (int jobID, const QString &newHostname) |
static bool | ChangeJobComment (int jobID, const QString &comment="") |
static bool | ChangeJobArgs (int jobID, const QString &args="") |
static bool | IsJobQueuedOrRunning (int jobType, uint chanid, const QDateTime &recstartts) |
static bool | IsJobRunning (int jobType, uint chanid, const QDateTime &recstartts) |
static bool | IsJobRunning (int jobType, const ProgramInfo &pginfo) |
static bool | IsJobQueued (int jobType, uint chanid, const QDateTime &recstartts) |
static bool | IsJobStatusQueued (int status) |
static bool | IsJobStatusRunning (int status) |
static bool | PauseJob (int jobID) |
static bool | ResumeJob (int jobID) |
static bool | RestartJob (int jobID) |
static bool | StopJob (int jobID) |
static bool | DeleteJob (int jobID) |
static bool | SafeDeleteJob (int jobID, int jobType, int chanid, const QDateTime &recstartts) |
static enum JobCmds | GetJobCmd (int jobID) |
static enum JobFlags | GetJobFlags (int jobID) |
static enum JobStatus | GetJobStatus (int jobID) |
static enum JobStatus | GetJobStatus (int jobType, uint chanid, const QDateTime &recstartts) |
static QString | GetJobArgs (int jobID) |
static int | UserJobTypeToIndex (int JobType) |
static bool | DeleteAllJobs (uint chanid, const QDateTime &recstartts) |
static void | ClearJobMask (int &mask) |
static bool | JobIsInMask (int job, int mask) |
static bool | JobIsNotInMask (int job, int mask) |
static void | AddJobsToMask (int jobs, int &mask) |
static void | RemoveJobsFromMask (int jobs, int &mask) |
static QString | JobText (int jobType) |
static QString | StatusText (int status) |
static bool | HasRunningOrPendingJobs (std::chrono::minutes startingWithinMins=0min) |
static int | GetJobsInQueue (QMap< int, JobQueueEntry > &jobs, int findJobs=JOB_LIST_NOT_DONE) |
static void | RecoverQueue (bool justOld=false) |
static void | RecoverOldJobsInQueue () |
static void | CleanupOldJobsInQueue () |
static bool | InJobRunWindow (QDateTime jobstarttsRaw) |
Private Member Functions | |
void | run (void) override |
void | ProcessQueue (void) |
void | ProcessJob (const JobQueueEntry &job) |
bool | AllowedToRun (const JobQueueEntry &job) |
void | StartChildJob (void *(*ChildThreadRoutine)(void *), int jobID) |
void | RemoveRunningJob (int id) |
void | DoTranscodeThread (int jobID) |
void | DoMetadataLookupThread (int jobID) |
void | DoFlagCommercialsThread (int jobID) |
void | DoUserJobThread (int jobID) |
Static Private Member Functions | |
static bool | InJobRunWindow (std::chrono::minutes orStartsWithinMins=0min) |
static QString | GetJobDescription (int jobType) |
static QString | GetJobCommand (int id, int jobType, ProgramInfo *tmpInfo) |
static QString | PrettyPrint (off_t bytes) |
static void * | TranscodeThread (void *param) |
static void * | MetadataLookupThread (void *param) |
static void * | FlagCommercialsThread (void *param) |
static void * | UserJobThread (void *param) |
Private Attributes | |
QString | m_hostname |
int | m_jobsRunning {0} |
int | m_jobQueueCPU {0} |
ProgramInfo * | m_pginfo {nullptr} |
QRecursiveMutex * | m_runningJobsLock {nullptr} |
QMap< int, RunningJobInfo > | m_runningJobs |
bool | m_isMaster |
MThread * | m_queueThread {nullptr} |
QWaitCondition | m_queueThreadCond |
QMutex | m_queueThreadCondLock |
bool | m_processQueue {false} |
Friends | |
class | QueueProcessorThread |
Definition at line 128 of file jobqueue.h.
|
explicit |
Definition at line 40 of file jobqueue.cpp.
|
override |
Definition at line 62 of file jobqueue.cpp.
|
override |
Definition at line 78 of file jobqueue.cpp.
|
static |
Definition at line 486 of file jobqueue.cpp.
Referenced by TVRec::FinishedRecording().
|
static |
Definition at line 508 of file jobqueue.cpp.
Referenced by PlaybackBox::doJobQueueJob(), PlaybackBox::doPlaylistJobQueueJob(), TV::DoQueueTranscode(), init_jobs(), V2Dvr::ManageJobQueue(), QueueCommFlagJob(), QueueJob(), QueueJobs(), and QueueTranscodeJob().
|
static |
Definition at line 592 of file jobqueue.cpp.
Referenced by QueueRecordingJobs().
|
static |
Definition at line 644 of file jobqueue.cpp.
Referenced by customEvent(), V2Dvr::ManageJobQueue(), and SafeDeleteJob().
|
static |
Definition at line 665 of file jobqueue.cpp.
Referenced by GetJobInfoFromID(), and main().
|
static |
Definition at line 690 of file jobqueue.cpp.
|
static |
Definition at line 704 of file jobqueue.cpp.
Referenced by V2Dvr::ManageJobQueue().
|
static |
Definition at line 919 of file jobqueue.cpp.
Referenced by PlaybackBox::doJobQueueJob(), TV::DoQueueTranscode(), PauseJob(), ProcessQueue(), RecoverQueue(), RestartJob(), ResumeJob(), StopJob(), and PlaybackBox::stopPlaylistJobQueueJob().
|
static |
Definition at line 940 of file jobqueue.cpp.
|
static |
Definition at line 962 of file jobqueue.cpp.
|
static |
Definition at line 983 of file jobqueue.cpp.
Referenced by commDetectorBreathe(), commDetectorStatusUpdate(), CompleteJob(), StatusBox::customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), main(), ProcessJob(), ProcessQueue(), and RecoverQueue().
|
static |
Definition at line 1401 of file jobqueue.cpp.
Referenced by ProcessQueue(), and RecoverQueue().
|
static |
Definition at line 1010 of file jobqueue.cpp.
Referenced by BuildKeyframeIndex(), commDetectorStatusUpdate(), DoTranscodeThread(), Transcode::TranscodeFile(), and UpdateJobQueue().
|
static |
Definition at line 1035 of file jobqueue.cpp.
Referenced by main().
|
static |
Definition at line 1098 of file jobqueue.cpp.
Referenced by PlaybackBox::createJobMenu(), PlaybackBox::createPlaylistJobMenu(), PlaybackBox::doJobQueueJob(), PlaybackBox::doPlaylistJobQueueJob(), TV::DoQueueTranscode(), TV::PlaybackMenuInit(), and PlaybackBox::stopPlaylistJobQueueJob().
int JobQueue::GetRunningJobID | ( | uint | chanid, |
const QDateTime & | recstartts | ||
) |
Definition at line 1057 of file jobqueue.cpp.
Referenced by ProcessQueue().
Definition at line 1086 of file jobqueue.cpp.
Referenced by FlagCommercials(), IsJobRunning(), SafeDeleteJob(), and Transcode::TranscodeFile().
|
static |
Definition at line 1092 of file jobqueue.cpp.
Definition at line 1106 of file jobqueue.cpp.
|
static |
Definition at line 1075 of file jobqueue.cpp.
Referenced by IsJobQueued(), and PlaybackBox::PbbJobQueue::IsJobQueued().
|
static |
Definition at line 1080 of file jobqueue.cpp.
Referenced by IsJobRunning(), and PlaybackBox::PbbJobQueue::IsJobRunning().
|
static |
Definition at line 715 of file jobqueue.cpp.
Referenced by StatusBox::customEvent().
|
static |
Definition at line 724 of file jobqueue.cpp.
Referenced by StatusBox::customEvent().
|
static |
Definition at line 733 of file jobqueue.cpp.
|
static |
Definition at line 742 of file jobqueue.cpp.
Referenced by StatusBox::customEvent().
|
static |
Definition at line 872 of file jobqueue.cpp.
Referenced by StatusBox::customEvent(), and QueueJob().
|
static |
Definition at line 877 of file jobqueue.cpp.
Referenced by DeleteJob(), and V2Dvr::ManageJobQueue().
|
static |
Definition at line 1465 of file jobqueue.cpp.
Referenced by BuildKeyframeIndex(), CheckJobQueue(), commDetectorBreathe(), and Transcode::TranscodeFile().
|
static |
Definition at line 1507 of file jobqueue.cpp.
Referenced by DoTranscodeThread(), and main().
|
static |
Definition at line 1528 of file jobqueue.cpp.
Referenced by StatusBox::clicked(), CompleteJob(), StatusBox::customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), IsJobQueued(), IsJobQueuedOrRunning(), and IsJobRunning().
|
static |
Definition at line 1548 of file jobqueue.cpp.
|
static |
Definition at line 1486 of file jobqueue.cpp.
Referenced by CompleteJob().
|
static |
Definition at line 2500 of file jobqueue.cpp.
Referenced by AllowedToRun(), GetJobCommand(), GetJobDescription(), GetJobsInQueue(), and JobText().
Definition at line 751 of file jobqueue.cpp.
Referenced by MainServer::DoDeleteThread().
|
inlinestatic |
Definition at line 197 of file jobqueue.h.
|
inlinestatic |
Definition at line 198 of file jobqueue.h.
Referenced by init_jobs().
|
inlinestatic |
Definition at line 199 of file jobqueue.h.
Referenced by init_jobs().
|
inlinestatic |
Definition at line 201 of file jobqueue.h.
Referenced by init_jobs().
|
inlinestatic |
Definition at line 202 of file jobqueue.h.
Referenced by TVRec::FinishedRecording(), and init_jobs().
|
static |
Definition at line 1112 of file jobqueue.cpp.
Referenced by DeleteAllJobs(), StatusBox::doJobQueueStatus(), V2Status::GetBackendStatus(), GetJobsInQueue(), HttpStatus::PrintJobQueue(), V2Status::PrintJobQueue(), ProcessQueue(), and RecoverQueue().
|
static |
Definition at line 1135 of file jobqueue.cpp.
Referenced by ChangeJobStatus(), DeleteAllJobs(), DoFlagCommercialsThread(), StatusBox::doJobQueueStatus(), DoMetadataLookupThread(), DoTranscodeThread(), V2Status::GetBackendStatus(), GetJobsInQueue(), HttpStatus::PrintJobQueue(), V2Status::PrintJobQueue(), ProcessQueue(), and RecoverQueue().
|
static |
Definition at line 1230 of file jobqueue.cpp.
Referenced by getStatus(), and Scheduler::HandleIdleShutdown().
|
static |
Definition at line 1282 of file jobqueue.cpp.
Referenced by StatusBox::doJobQueueStatus(), HttpStatus::FillStatusXML(), V2Status::FillStatusXML(), V2Status::GetBackendStatus(), HasRunningOrPendingJobs(), ProcessQueue(), RecoverQueue(), and PlaybackBox::PbbJobQueue::Update().
Definition at line 1572 of file jobqueue.cpp.
Referenced by run().
|
inlinestatic |
Definition at line 213 of file jobqueue.h.
Referenced by JobQueueRecoverTask::DoRun().
|
static |
Definition at line 1635 of file jobqueue.cpp.
Referenced by CleanupTask::DoRun().
|
static |
Definition at line 1660 of file jobqueue.cpp.
Referenced by HasRunningOrPendingJobs(), V2Dvr::ManageJobQueue(), and ProcessQueue().
|
overrideprivate |
Definition at line 144 of file jobqueue.cpp.
|
private |
Definition at line 159 of file jobqueue.cpp.
Referenced by run().
|
private |
Definition at line 1690 of file jobqueue.cpp.
Referenced by ProcessQueue().
|
private |
Definition at line 1433 of file jobqueue.cpp.
Referenced by ProcessQueue().
|
staticprivate |
Definition at line 1145 of file jobqueue.cpp.
|
private |
Definition at line 1778 of file jobqueue.cpp.
Referenced by ProcessJob().
|
staticprivate |
Definition at line 1792 of file jobqueue.cpp.
Referenced by ProcessJob().
|
staticprivate |
Definition at line 1807 of file jobqueue.cpp.
Referenced by ProcessJob().
|
private |
Definition at line 1857 of file jobqueue.cpp.
Referenced by DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), and ProcessJob().
|
staticprivate |
Definition at line 1876 of file jobqueue.cpp.
Referenced by DoTranscodeThread().
|
staticprivate |
Definition at line 1909 of file jobqueue.cpp.
Referenced by ProcessJob().
|
private |
Definition at line 1923 of file jobqueue.cpp.
Referenced by TranscodeThread().
|
staticprivate |
Definition at line 2135 of file jobqueue.cpp.
Referenced by ProcessJob().
|
private |
Definition at line 2149 of file jobqueue.cpp.
Referenced by MetadataLookupThread().
|
staticprivate |
Definition at line 2255 of file jobqueue.cpp.
Referenced by ProcessJob().
|
private |
Definition at line 2269 of file jobqueue.cpp.
Referenced by FlagCommercialsThread().
|
staticprivate |
Definition at line 2397 of file jobqueue.cpp.
Referenced by ProcessJob().
|
private |
Definition at line 2411 of file jobqueue.cpp.
Referenced by UserJobThread().
|
friend |
Definition at line 132 of file jobqueue.h.
|
private |
Definition at line 255 of file jobqueue.h.
Referenced by AllowedToRun(), and ProcessQueue().
|
private |
Definition at line 257 of file jobqueue.h.
Referenced by ProcessQueue().
|
private |
Definition at line 258 of file jobqueue.h.
Referenced by DoTranscodeThread(), DoUserJobThread(), and JobQueue().
|
private |
Definition at line 260 of file jobqueue.h.
|
private |
Definition at line 265 of file jobqueue.h.
Referenced by customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), GetRunningJobID(), ProcessJob(), ProcessQueue(), RemoveRunningJob(), and ~JobQueue().
|
private |
Definition at line 266 of file jobqueue.h.
Referenced by customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), GetRunningJobID(), ProcessJob(), ProcessQueue(), and RemoveRunningJob().
|
private |
Definition at line 268 of file jobqueue.h.
|
private |
Definition at line 270 of file jobqueue.h.
Referenced by JobQueue(), and ~JobQueue().
|
private |
Definition at line 271 of file jobqueue.h.
Referenced by ProcessQueue(), run(), and ~JobQueue().
|
private |
Definition at line 272 of file jobqueue.h.
Referenced by JobQueue(), ProcessQueue(), run(), and ~JobQueue().
Definition at line 273 of file jobqueue.h.
Referenced by JobQueue(), ProcessQueue(), and ~JobQueue().