MythTV
master
|
#include <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 130 of file jobqueue.h.
|
explicit |
Definition at line 38 of file jobqueue.cpp.
|
override |
Definition at line 63 of file jobqueue.cpp.
|
override |
Definition at line 79 of file jobqueue.cpp.
|
static |
Definition at line 491 of file jobqueue.cpp.
Referenced by TVRec::FinishedRecording().
|
static |
Definition at line 513 of file jobqueue.cpp.
Referenced by PlaybackBox::doJobQueueJob(), PlaybackBox::doPlaylistJobQueueJob(), TV::DoQueueTranscode(), init_jobs(), Dvr::ManageJobQueue(), V2Dvr::ManageJobQueue(), QueueCommFlagJob(), QueueJob(), QueueJobs(), and QueueTranscodeJob().
|
static |
Definition at line 597 of file jobqueue.cpp.
Referenced by QueueRecordingJobs().
|
static |
Definition at line 643 of file jobqueue.cpp.
Referenced by customEvent(), Dvr::ManageJobQueue(), V2Dvr::ManageJobQueue(), and SafeDeleteJob().
|
static |
Definition at line 664 of file jobqueue.cpp.
Referenced by GetJobInfoFromID(), and main().
|
static |
Definition at line 689 of file jobqueue.cpp.
|
static |
Definition at line 703 of file jobqueue.cpp.
Referenced by Dvr::ManageJobQueue(), and V2Dvr::ManageJobQueue().
|
static |
Definition at line 918 of file jobqueue.cpp.
Referenced by PlaybackBox::doJobQueueJob(), TV::DoQueueTranscode(), PauseJob(), ProcessQueue(), RecoverQueue(), RestartJob(), ResumeJob(), StopJob(), and PlaybackBox::stopPlaylistJobQueueJob().
|
static |
Definition at line 939 of file jobqueue.cpp.
|
static |
Definition at line 961 of file jobqueue.cpp.
|
static |
Definition at line 982 of file jobqueue.cpp.
Referenced by commDetectorBreathe(), commDetectorStatusUpdate(), CompleteJob(), StatusBox::customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), main(), ProcessJob(), ProcessQueue(), and RecoverQueue().
|
static |
Definition at line 1394 of file jobqueue.cpp.
Referenced by ProcessQueue(), and RecoverQueue().
|
static |
Definition at line 1009 of file jobqueue.cpp.
Referenced by BuildKeyframeIndex(), commDetectorStatusUpdate(), DoTranscodeThread(), Transcode::TranscodeFile(), and UpdateJobQueue().
|
static |
Definition at line 1034 of file jobqueue.cpp.
Referenced by main().
|
static |
Definition at line 1097 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 1056 of file jobqueue.cpp.
Referenced by ProcessQueue().
Definition at line 1085 of file jobqueue.cpp.
Referenced by FlagCommercials(), IsJobRunning(), SafeDeleteJob(), and Transcode::TranscodeFile().
|
static |
Definition at line 1091 of file jobqueue.cpp.
Definition at line 1105 of file jobqueue.cpp.
|
static |
Definition at line 1074 of file jobqueue.cpp.
Referenced by IsJobQueued(), and PlaybackBox::PbbJobQueue::IsJobQueued().
|
static |
Definition at line 1079 of file jobqueue.cpp.
Referenced by IsJobRunning(), and PlaybackBox::PbbJobQueue::IsJobRunning().
|
static |
Definition at line 714 of file jobqueue.cpp.
Referenced by StatusBox::customEvent().
|
static |
Definition at line 723 of file jobqueue.cpp.
Referenced by StatusBox::customEvent().
|
static |
Definition at line 732 of file jobqueue.cpp.
|
static |
Definition at line 741 of file jobqueue.cpp.
Referenced by StatusBox::customEvent().
|
static |
Definition at line 871 of file jobqueue.cpp.
Referenced by StatusBox::customEvent(), and QueueJob().
|
static |
Definition at line 876 of file jobqueue.cpp.
Referenced by DeleteJob(), Dvr::ManageJobQueue(), and V2Dvr::ManageJobQueue().
|
static |
Definition at line 1458 of file jobqueue.cpp.
Referenced by BuildKeyframeIndex(), CheckJobQueue(), commDetectorBreathe(), and Transcode::TranscodeFile().
|
static |
Definition at line 1500 of file jobqueue.cpp.
Referenced by DoTranscodeThread(), and main().
|
static |
Definition at line 1521 of file jobqueue.cpp.
Referenced by StatusBox::clicked(), CompleteJob(), StatusBox::customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), IsJobQueued(), IsJobQueuedOrRunning(), and IsJobRunning().
|
static |
Definition at line 1541 of file jobqueue.cpp.
|
static |
Definition at line 1479 of file jobqueue.cpp.
Referenced by CompleteJob().
|
static |
Definition at line 2497 of file jobqueue.cpp.
Referenced by AllowedToRun(), GetJobCommand(), GetJobDescription(), GetJobsInQueue(), and JobText().
Definition at line 750 of file jobqueue.cpp.
Referenced by MainServer::DoDeleteThread().
|
inlinestatic |
Definition at line 199 of file jobqueue.h.
|
inlinestatic |
Definition at line 200 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 203 of file jobqueue.h.
Referenced by init_jobs().
|
inlinestatic |
Definition at line 204 of file jobqueue.h.
Referenced by TVRec::FinishedRecording(), and init_jobs().
|
static |
Definition at line 1111 of file jobqueue.cpp.
Referenced by DeleteAllJobs(), StatusBox::doJobQueueStatus(), V2Status::GetBackendStatus(), GetJobsInQueue(), HttpStatus::PrintJobQueue(), V2Status::PrintJobQueue(), ProcessQueue(), and RecoverQueue().
|
static |
Definition at line 1134 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 1223 of file jobqueue.cpp.
Referenced by getStatus(), and Scheduler::HandleIdleShutdown().
|
static |
Definition at line 1275 of file jobqueue.cpp.
Referenced by StatusBox::doJobQueueStatus(), HttpStatus::FillStatusXML(), V2Status::FillStatusXML(), V2Status::GetBackendStatus(), HasRunningOrPendingJobs(), ProcessQueue(), RecoverQueue(), and PlaybackBox::PbbJobQueue::Update().
Definition at line 1565 of file jobqueue.cpp.
Referenced by run().
|
inlinestatic |
Definition at line 215 of file jobqueue.h.
Referenced by JobQueueRecoverTask::DoRun().
|
static |
Definition at line 1628 of file jobqueue.cpp.
Referenced by CleanupTask::DoRun().
|
static |
Definition at line 1653 of file jobqueue.cpp.
Referenced by HasRunningOrPendingJobs(), Dvr::ManageJobQueue(), V2Dvr::ManageJobQueue(), and ProcessQueue().
|
overrideprivate |
Definition at line 149 of file jobqueue.cpp.
|
private |
Definition at line 164 of file jobqueue.cpp.
Referenced by run().
|
private |
Definition at line 1683 of file jobqueue.cpp.
Referenced by ProcessQueue().
|
private |
Definition at line 1426 of file jobqueue.cpp.
Referenced by ProcessQueue().
|
staticprivate |
Definition at line 1144 of file jobqueue.cpp.
|
private |
Definition at line 1771 of file jobqueue.cpp.
Referenced by ProcessJob().
|
staticprivate |
Definition at line 1785 of file jobqueue.cpp.
Referenced by ProcessJob().
|
staticprivate |
Definition at line 1800 of file jobqueue.cpp.
Referenced by ProcessJob().
|
private |
Definition at line 1850 of file jobqueue.cpp.
Referenced by DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), and ProcessJob().
|
staticprivate |
Definition at line 1869 of file jobqueue.cpp.
Referenced by DoTranscodeThread().
|
staticprivate |
Definition at line 1902 of file jobqueue.cpp.
Referenced by ProcessJob().
|
private |
Definition at line 1916 of file jobqueue.cpp.
Referenced by TranscodeThread().
|
staticprivate |
Definition at line 2132 of file jobqueue.cpp.
Referenced by ProcessJob().
|
private |
Definition at line 2146 of file jobqueue.cpp.
Referenced by MetadataLookupThread().
|
staticprivate |
Definition at line 2252 of file jobqueue.cpp.
Referenced by ProcessJob().
|
private |
Definition at line 2266 of file jobqueue.cpp.
Referenced by FlagCommercialsThread().
|
staticprivate |
Definition at line 2398 of file jobqueue.cpp.
Referenced by ProcessJob().
|
private |
Definition at line 2412 of file jobqueue.cpp.
Referenced by UserJobThread().
|
friend |
Definition at line 134 of file jobqueue.h.
|
private |
Definition at line 257 of file jobqueue.h.
Referenced by AllowedToRun(), and ProcessQueue().
|
private |
Definition at line 259 of file jobqueue.h.
Referenced by ProcessQueue().
|
private |
Definition at line 260 of file jobqueue.h.
Referenced by DoTranscodeThread(), DoUserJobThread(), and JobQueue().
|
private |
Definition at line 262 of file jobqueue.h.
|
private |
Definition at line 270 of file jobqueue.h.
Referenced by customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), GetRunningJobID(), ProcessJob(), ProcessQueue(), RemoveRunningJob(), and ~JobQueue().
|
private |
Definition at line 272 of file jobqueue.h.
Referenced by customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), GetRunningJobID(), ProcessJob(), ProcessQueue(), and RemoveRunningJob().
|
private |
Definition at line 274 of file jobqueue.h.
|
private |
Definition at line 276 of file jobqueue.h.
Referenced by JobQueue(), and ~JobQueue().
|
private |
Definition at line 277 of file jobqueue.h.
Referenced by ProcessQueue(), run(), and ~JobQueue().
|
private |
Definition at line 278 of file jobqueue.h.
Referenced by JobQueue(), ProcessQueue(), run(), and ~JobQueue().
Definition at line 279 of file jobqueue.h.
Referenced by JobQueue(), ProcessQueue(), and ~JobQueue().