|
MythTV master
|
#include <libmythtv/jobqueue.h>
Classes | |
| struct | JobThreadStruct |
Public Member Functions | |
| JobQueue (bool master) | |
| ~JobQueue (void) override | |
| void | run (void) 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) |
Protected Member Functions | |
| void | customEvent (QEvent *e) override |
Private Member Functions | |
| 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 50 of file jobqueue.cpp.
|
override |
Definition at line 72 of file jobqueue.cpp.
|
inlinestatic |
Definition at line 201 of file jobqueue.h.
Referenced by init_jobs().
|
private |
Definition at line 1445 of file jobqueue.cpp.
Referenced by ProcessQueue().
|
static |
Definition at line 1047 of file jobqueue.cpp.
Referenced by main().
|
static |
Definition at line 931 of file jobqueue.cpp.
Referenced by PlaybackBox::doJobQueueJob(), TV::DoQueueTranscode(), PauseJob(), ProcessQueue(), RecoverQueue(), RestartJob(), ResumeJob(), StopJob(), and PlaybackBox::stopPlaylistJobQueueJob().
|
static |
Definition at line 952 of file jobqueue.cpp.
|
static |
Definition at line 1022 of file jobqueue.cpp.
Referenced by BuildKeyframeIndex(), commDetectorStatusUpdate(), DoTranscodeThread(), Transcode::TranscodeFile(), and UpdateJobQueue().
|
static |
Definition at line 974 of file jobqueue.cpp.
|
static |
Definition at line 1413 of file jobqueue.cpp.
Referenced by ProcessQueue(), and RecoverQueue().
|
static |
Definition at line 995 of file jobqueue.cpp.
Referenced by commDetectorBreathe(), commDetectorStatusUpdate(), CompleteJob(), StatusBox::customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), main(), ProcessJob(), ProcessQueue(), and RecoverQueue().
|
static |
Definition at line 1647 of file jobqueue.cpp.
Referenced by CleanupTask::DoRun().
|
inlinestatic |
Definition at line 197 of file jobqueue.h.
|
overrideprotected |
Definition at line 88 of file jobqueue.cpp.
|
static |
Definition at line 763 of file jobqueue.cpp.
Referenced by MainServer::DoDeleteThread().
|
static |
Definition at line 884 of file jobqueue.cpp.
Referenced by StatusBox::customEvent(), and QueueJob().
|
private |
Definition at line 2281 of file jobqueue.cpp.
Referenced by FlagCommercialsThread().
|
private |
Definition at line 2161 of file jobqueue.cpp.
Referenced by MetadataLookupThread().
|
private |
Definition at line 1935 of file jobqueue.cpp.
Referenced by TranscodeThread().
|
private |
Definition at line 2423 of file jobqueue.cpp.
Referenced by UserJobThread().
|
staticprivate |
Definition at line 2267 of file jobqueue.cpp.
Referenced by ProcessJob().
|
static |
Definition at line 1498 of file jobqueue.cpp.
Referenced by CompleteJob().
|
static |
Definition at line 1477 of file jobqueue.cpp.
Referenced by BuildKeyframeIndex(), CheckJobQueue(), commDetectorBreathe(), and Transcode::TranscodeFile().
|
staticprivate |
Definition at line 1819 of file jobqueue.cpp.
Referenced by ProcessJob().
|
staticprivate |
Definition at line 1804 of file jobqueue.cpp.
Referenced by ProcessJob().
|
static |
Definition at line 1519 of file jobqueue.cpp.
Referenced by DoTranscodeThread(), and main().
|
static |
Definition at line 656 of file jobqueue.cpp.
Referenced by customEvent(), V2Dvr::ManageJobQueue(), and SafeDeleteJob().
|
static |
Definition at line 677 of file jobqueue.cpp.
Referenced by GetJobInfoFromID(), and main().
|
static |
Definition at line 702 of file jobqueue.cpp.
|
static |
Definition at line 1294 of file jobqueue.cpp.
Referenced by StatusBox::doJobQueueStatus(), HttpStatus::FillStatusXML(), V2Status::FillStatusXML(), V2Status::GetBackendStatus(), HasRunningOrPendingJobs(), ProcessQueue(), RecoverQueue(), and PlaybackBox::PbbJobQueue::Update().
|
static |
Definition at line 1540 of file jobqueue.cpp.
Referenced by StatusBox::clicked(), CompleteJob(), StatusBox::customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), IsJobQueued(), IsJobQueuedOrRunning(), and IsJobRunning().
|
static |
Definition at line 1560 of file jobqueue.cpp.
|
static |
Definition at line 716 of file jobqueue.cpp.
Referenced by V2Dvr::ManageJobQueue().
| int JobQueue::GetRunningJobID | ( | uint | chanid, |
| const QDateTime & | recstartts | ||
| ) |
Definition at line 1069 of file jobqueue.cpp.
Referenced by ProcessQueue().
|
static |
Definition at line 1242 of file jobqueue.cpp.
Referenced by getStatus(), and Scheduler::HandleIdleShutdown().
|
static |
Definition at line 1672 of file jobqueue.cpp.
Referenced by HasRunningOrPendingJobs(), V2Dvr::ManageJobQueue(), and ProcessQueue().
|
staticprivate |
Definition at line 1157 of file jobqueue.cpp.
|
static |
Definition at line 1118 of file jobqueue.cpp.
|
static |
Definition at line 1110 of file jobqueue.cpp.
Referenced by PlaybackBox::createJobMenu(), PlaybackBox::createPlaylistJobMenu(), PlaybackBox::doJobQueueJob(), PlaybackBox::doPlaylistJobQueueJob(), TV::DoQueueTranscode(), TV::PlaybackMenuInit(), and PlaybackBox::stopPlaylistJobQueueJob().
|
static |
Definition at line 1104 of file jobqueue.cpp.
|
static |
Definition at line 1098 of file jobqueue.cpp.
Referenced by FlagCommercials(), IsJobRunning(), SafeDeleteJob(), and Transcode::TranscodeFile().
|
static |
Definition at line 1087 of file jobqueue.cpp.
Referenced by IsJobQueued(), and PlaybackBox::PbbJobQueue::IsJobQueued().
|
static |
Definition at line 1092 of file jobqueue.cpp.
Referenced by IsJobRunning(), and PlaybackBox::PbbJobQueue::IsJobRunning().
|
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().
|
static |
Definition at line 1124 of file jobqueue.cpp.
Referenced by DeleteAllJobs(), StatusBox::doJobQueueStatus(), V2Status::GetBackendStatus(), GetJobsInQueue(), HttpStatus::PrintJobQueue(), V2Status::PrintJobQueue(), ProcessQueue(), and RecoverQueue().
|
staticprivate |
Definition at line 2147 of file jobqueue.cpp.
Referenced by ProcessJob().
|
static |
Definition at line 727 of file jobqueue.cpp.
Referenced by StatusBox::customEvent().
|
staticprivate |
Definition at line 1888 of file jobqueue.cpp.
Referenced by DoTranscodeThread().
|
private |
Definition at line 1702 of file jobqueue.cpp.
Referenced by ProcessQueue().
|
private |
Definition at line 171 of file jobqueue.cpp.
Referenced by run().
|
static |
Definition at line 520 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 604 of file jobqueue.cpp.
Referenced by QueueRecordingJobs().
|
static |
Definition at line 498 of file jobqueue.cpp.
Referenced by TVRec::FinishedRecording().
|
inlinestatic |
Definition at line 213 of file jobqueue.h.
Referenced by JobQueueRecoverTask::DoRun().
|
static |
Definition at line 1584 of file jobqueue.cpp.
Referenced by run().
|
inlinestatic |
Definition at line 202 of file jobqueue.h.
Referenced by TVRec::FinishedRecording(), and init_jobs().
|
private |
Definition at line 1869 of file jobqueue.cpp.
Referenced by DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), and ProcessJob().
|
static |
Definition at line 745 of file jobqueue.cpp.
|
static |
Definition at line 736 of file jobqueue.cpp.
Referenced by StatusBox::customEvent().
|
override |
Definition at line 156 of file jobqueue.cpp.
|
static |
Definition at line 889 of file jobqueue.cpp.
Referenced by DeleteJob(), and V2Dvr::ManageJobQueue().
|
private |
Definition at line 1790 of file jobqueue.cpp.
Referenced by ProcessJob().
|
static |
Definition at line 1147 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 754 of file jobqueue.cpp.
Referenced by StatusBox::customEvent().
|
staticprivate |
Definition at line 1921 of file jobqueue.cpp.
Referenced by ProcessJob().
|
staticprivate |
Definition at line 2409 of file jobqueue.cpp.
Referenced by ProcessJob().
|
static |
Definition at line 2512 of file jobqueue.cpp.
Referenced by AllowedToRun(), GetJobCommand(), GetJobDescription(), GetJobsInQueue(), and JobText().
|
friend |
Definition at line 132 of file jobqueue.h.
|
private |
Definition at line 257 of file jobqueue.h.
Referenced by AllowedToRun(), and ProcessQueue().
|
private |
Definition at line 270 of file jobqueue.h.
|
private |
Definition at line 260 of file jobqueue.h.
Referenced by DoTranscodeThread(), DoUserJobThread(), and JobQueue().
|
private |
Definition at line 259 of file jobqueue.h.
Referenced by ProcessQueue().
|
private |
Definition at line 262 of file jobqueue.h.
|
private |
Definition at line 275 of file jobqueue.h.
Referenced by JobQueue(), ProcessQueue(), and ~JobQueue().
|
private |
Definition at line 272 of file jobqueue.h.
Referenced by JobQueue(), and ~JobQueue().
|
private |
Definition at line 273 of file jobqueue.h.
Referenced by ProcessQueue(), run(), and ~JobQueue().
|
private |
Definition at line 274 of file jobqueue.h.
Referenced by JobQueue(), ProcessQueue(), run(), and ~JobQueue().
|
private |
Definition at line 268 of file jobqueue.h.
Referenced by customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), GetRunningJobID(), ProcessJob(), ProcessQueue(), and RemoveRunningJob().
|
private |
Definition at line 267 of file jobqueue.h.
Referenced by customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), GetRunningJobID(), ProcessJob(), ProcessQueue(), RemoveRunningJob(), and ~JobQueue().