#include <jobqueue.h>
Classes | |
| struct | jobthreadstruct |
Public Member Functions | |
| JobQueue (bool master) | |
| ~JobQueue (void) | |
| void | customEvent (QEvent *e) |
| int | GetRunningJobID (uint chanid, const QDateTime &recstartts) |
Static Public Member Functions | |
| static bool | QueueRecordingJobs (const RecordingInfo &, int jobTypes=JOB_NONE) |
| static bool | QueueJob (int jobType, uint chanid, const QDateTime &recstartts, QString args="", QString comment="", QString host="", int flags=0, int status=JOB_QUEUED, QDateTime schedruntime=QDateTime()) |
| static bool | QueueJobs (int jobTypes, uint chanid, const QDateTime &recstartts, QString args="", QString comment="", 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 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, QString comment="") |
| static bool | ChangeJobHost (int jobID, QString newHostname) |
| static bool | ChangeJobComment (int jobID, QString comment="") |
| static bool | ChangeJobArgs (int jobID, 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 | PauseJob (int jobID) |
| static bool | ResumeJob (int jobID) |
| static bool | RestartJob (int jobID) |
| static bool | StopJob (int jobID) |
| static bool | DeleteJob (int jobID) |
| 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 (int startingWithinMins=0) |
| 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 () |
Private Types | |
| typedef struct JobQueue::jobthreadstruct | JobThreadStruct |
Private Member Functions | |
| void | run (void) |
| void | ProcessQueue (void) |
| void | ProcessJob (JobQueueEntry job) |
| bool | AllowedToRun (JobQueueEntry job) |
| void | StartChildJob (void *(*start_routine)(void *), int jobID) |
| QString | GetJobDescription (int jobType) |
| QString | GetJobCommand (int id, int jobType, ProgramInfo *tmpInfo) |
| 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 (int orStartingWithinMins=0) |
| 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 | jobsRunning |
| int | jobQueueCPU |
| ProgramInfo * | m_pginfo |
| QMutex | controlFlagsLock |
| QMap< QString, int * > | jobControlFlags |
| QMutex * | runningJobsLock |
| QMap< int, RunningJobInfo > | runningJobs |
| bool | isMaster |
| MThread * | queueThread |
| QWaitCondition | queueThreadCond |
| QMutex | queueThreadCondLock |
| bool | processQueue |
Friends | |
| class | QueueProcessorThread |
Definition at line 116 of file jobqueue.h.
typedef struct JobQueue::jobthreadstruct JobQueue::JobThreadStruct [private] |
| JobQueue::JobQueue | ( | bool | master | ) |
Definition at line 44 of file jobqueue.cpp.
| JobQueue::~JobQueue | ( | void | ) |
Definition at line 69 of file jobqueue.cpp.
| void JobQueue::customEvent | ( | QEvent * | e | ) |
Definition at line 85 of file jobqueue.cpp.
| bool JobQueue::QueueRecordingJobs | ( | const RecordingInfo & | recinfo, | |
| int | jobTypes = JOB_NONE | |||
| ) | [static] |
Definition at line 501 of file jobqueue.cpp.
Referenced by TVRec::FinishedRecording().
| bool JobQueue::QueueJob | ( | int | jobType, | |
| uint | chanid, | |||
| const QDateTime & | recstartts, | |||
| QString | args = "", |
|||
| QString | comment = "", |
|||
| QString | host = "", |
|||
| int | flags = 0, |
|||
| int | status = JOB_QUEUED, |
|||
| QDateTime | schedruntime = QDateTime() | |||
| ) | [static] |
Definition at line 526 of file jobqueue.cpp.
Referenced by TV::DoQueueTranscode(), init_jobs(), QueueCommFlagJob(), QueueJob(), QueueJobs(), and QueueTranscodeJob().
| bool JobQueue::QueueJobs | ( | int | jobTypes, | |
| uint | chanid, | |||
| const QDateTime & | recstartts, | |||
| QString | args = "", |
|||
| QString | comment = "", |
|||
| QString | host = "" | |||
| ) | [static] |
Definition at line 613 of file jobqueue.cpp.
Referenced by QueueRecordingJobs().
| int JobQueue::GetJobID | ( | int | jobType, | |
| uint | chanid, | |||
| const QDateTime & | recstartts | |||
| ) | [static] |
Definition at line 659 of file jobqueue.cpp.
Referenced by customEvent().
| bool JobQueue::GetJobInfoFromID | ( | int | jobID, | |
| int & | jobType, | |||
| uint & | chanid, | |||
| QDateTime & | recstartts | |||
| ) | [static] |
Definition at line 684 of file jobqueue.cpp.
Referenced by GetJobInfoFromID(), and main().
| bool JobQueue::GetJobInfoFromID | ( | int | jobID, | |
| int & | jobType, | |||
| uint & | chanid, | |||
| QString & | recstartts | |||
| ) | [static] |
Definition at line 713 of file jobqueue.cpp.
| bool JobQueue::ChangeJobCmds | ( | int | jobID, | |
| int | newCmds | |||
| ) | [static] |
Definition at line 904 of file jobqueue.cpp.
Referenced by PlaybackBox::doJobQueueJob(), TV::DoQueueTranscode(), PauseJob(), ProcessQueue(), RecoverQueue(), RestartJob(), ResumeJob(), StopJob(), and PlaybackBox::stopPlaylistJobQueueJob().
| bool JobQueue::ChangeJobCmds | ( | int | jobType, | |
| uint | chanid, | |||
| const QDateTime & | recstartts, | |||
| int | newCmds | |||
| ) | [static] |
Definition at line 925 of file jobqueue.cpp.
| bool JobQueue::ChangeJobFlags | ( | int | jobID, | |
| int | newFlags | |||
| ) | [static] |
Definition at line 947 of file jobqueue.cpp.
| bool JobQueue::ChangeJobStatus | ( | int | jobID, | |
| int | newStatus, | |||
| QString | comment = "" | |||
| ) | [static] |
Definition at line 968 of file jobqueue.cpp.
Referenced by commDetectorBreathe(), commDetectorStatusUpdate(), CompleteJob(), StatusBox::customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), main(), ProcessJob(), ProcessQueue(), and RecoverQueue().
| bool JobQueue::ChangeJobHost | ( | int | jobID, | |
| QString | newHostname | |||
| ) | [static] |
Definition at line 1382 of file jobqueue.cpp.
Referenced by ProcessQueue(), and RecoverQueue().
| bool JobQueue::ChangeJobComment | ( | int | jobID, | |
| QString | comment = "" | |||
| ) | [static] |
Definition at line 995 of file jobqueue.cpp.
Referenced by BuildKeyframeIndex(), commDetectorStatusUpdate(), DoTranscodeThread(), Transcode::TranscodeFile(), and UpdateJobQueue().
| bool JobQueue::ChangeJobArgs | ( | int | jobID, | |
| QString | args = "" | |||
| ) | [static] |
Definition at line 1020 of file jobqueue.cpp.
Referenced by main().
| bool JobQueue::IsJobQueuedOrRunning | ( | int | jobType, | |
| uint | chanid, | |||
| const QDateTime & | recstartts | |||
| ) | [static] |
Definition at line 1081 of file jobqueue.cpp.
Referenced by PlaybackBox::createJobMenu(), PlaybackBox::createPlaylistJobMenu(), PlaybackBox::doJobQueueJob(), PlaybackBox::doPlaylistJobQueueJob(), TV::DoQueueTranscode(), extract_job_state(), TV::FillOSDMenuJobs(), and PlaybackBox::stopPlaylistJobQueueJob().
| int JobQueue::GetRunningJobID | ( | uint | chanid, | |
| const QDateTime & | recstartts | |||
| ) |
Definition at line 1042 of file jobqueue.cpp.
Referenced by ProcessQueue().
Definition at line 1063 of file jobqueue.cpp.
Referenced by extract_commflag_state(), FlagCommercials(), IsJobRunning(), and Transcode::TranscodeFile().
| bool JobQueue::IsJobRunning | ( | int | jobType, | |
| const ProgramInfo & | pginfo | |||
| ) | [static] |
Definition at line 1075 of file jobqueue.cpp.
Definition at line 1092 of file jobqueue.cpp.
Referenced by extract_commflag_state().
| bool JobQueue::PauseJob | ( | int | jobID | ) | [static] |
Definition at line 727 of file jobqueue.cpp.
Referenced by StatusBox::customEvent().
| bool JobQueue::ResumeJob | ( | int | jobID | ) | [static] |
Definition at line 736 of file jobqueue.cpp.
Referenced by StatusBox::customEvent().
| bool JobQueue::RestartJob | ( | int | jobID | ) | [static] |
Definition at line 745 of file jobqueue.cpp.
| bool JobQueue::StopJob | ( | int | jobID | ) | [static] |
Definition at line 754 of file jobqueue.cpp.
Referenced by StatusBox::customEvent().
| bool JobQueue::DeleteJob | ( | int | jobID | ) | [static] |
Definition at line 884 of file jobqueue.cpp.
Referenced by StatusBox::customEvent(), and QueueJob().
| enum JobCmds JobQueue::GetJobCmd | ( | int | jobID | ) | [static] |
Definition at line 1450 of file jobqueue.cpp.
Referenced by BuildKeyframeIndex(), CheckJobQueue(), commDetectorBreathe(), and Transcode::TranscodeFile().
| enum JobFlags JobQueue::GetJobFlags | ( | int | jobID | ) | [static] |
Definition at line 1492 of file jobqueue.cpp.
Referenced by DoTranscodeThread(), and main().
| enum JobStatus JobQueue::GetJobStatus | ( | int | jobID | ) | [static] |
Definition at line 1513 of file jobqueue.cpp.
Referenced by StatusBox::clicked(), CompleteJob(), StatusBox::customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), IsJobQueued(), IsJobQueuedOrRunning(), and IsJobRunning().
| enum JobStatus JobQueue::GetJobStatus | ( | int | jobType, | |
| uint | chanid, | |||
| const QDateTime & | recstartts | |||
| ) | [static] |
Definition at line 1533 of file jobqueue.cpp.
| QString JobQueue::GetJobArgs | ( | int | jobID | ) | [static] |
Definition at line 1471 of file jobqueue.cpp.
Referenced by CompleteJob().
| int JobQueue::UserJobTypeToIndex | ( | int | JobType | ) | [static] |
Definition at line 2467 of file jobqueue.cpp.
Referenced by AllowedToRun(), GetJobCommand(), GetJobDescription(), GetJobsInQueue(), and JobText().
Definition at line 763 of file jobqueue.cpp.
Referenced by MainServer::DoDeleteThread().
| static void JobQueue::ClearJobMask | ( | int & | mask | ) | [inline, static] |
Definition at line 180 of file jobqueue.h.
| static bool JobQueue::JobIsInMask | ( | int | job, | |
| int | mask | |||
| ) | [inline, static] |
Definition at line 181 of file jobqueue.h.
Referenced by init_jobs().
| static bool JobQueue::JobIsNotInMask | ( | int | job, | |
| int | mask | |||
| ) | [inline, static] |
Definition at line 182 of file jobqueue.h.
Referenced by init_jobs().
| static void JobQueue::AddJobsToMask | ( | int | jobs, | |
| int & | mask | |||
| ) | [inline, static] |
Definition at line 184 of file jobqueue.h.
Referenced by init_jobs().
| static void JobQueue::RemoveJobsFromMask | ( | int | jobs, | |
| int & | mask | |||
| ) | [inline, static] |
Definition at line 185 of file jobqueue.h.
Referenced by TVRec::FinishedRecording(), and init_jobs().
| QString JobQueue::JobText | ( | int | jobType | ) | [static] |
Definition at line 1103 of file jobqueue.cpp.
Referenced by DeleteAllJobs(), StatusBox::doJobQueueStatus(), GetJobsInQueue(), HttpStatus::PrintJobQueue(), ProcessQueue(), and RecoverQueue().
| QString JobQueue::StatusText | ( | int | status | ) | [static] |
Definition at line 1122 of file jobqueue.cpp.
Referenced by ChangeJobStatus(), DeleteAllJobs(), DoFlagCommercialsThread(), StatusBox::doJobQueueStatus(), DoMetadataLookupThread(), DoTranscodeThread(), GetJobsInQueue(), HttpStatus::PrintJobQueue(), ProcessQueue(), and RecoverQueue().
| bool JobQueue::HasRunningOrPendingJobs | ( | int | startingWithinMins = 0 |
) | [static] |
Definition at line 1212 of file jobqueue.cpp.
Referenced by getStatus().
| int JobQueue::GetJobsInQueue | ( | QMap< int, JobQueueEntry > & | jobs, | |
| int | findJobs = JOB_LIST_NOT_DONE | |||
| ) | [static] |
Definition at line 1264 of file jobqueue.cpp.
Referenced by StatusBox::doJobQueueStatus(), HttpStatus::FillStatusXML(), HasRunningOrPendingJobs(), ProcessQueue(), and RecoverQueue().
| void JobQueue::RecoverQueue | ( | bool | justOld = false |
) | [static] |
Definition at line 1557 of file jobqueue.cpp.
Referenced by run().
| static void JobQueue::RecoverOldJobsInQueue | ( | ) | [inline, static] |
Definition at line 196 of file jobqueue.h.
Referenced by HouseKeeper::RunHouseKeeping().
| void JobQueue::CleanupOldJobsInQueue | ( | ) | [static] |
Definition at line 1622 of file jobqueue.cpp.
Referenced by HouseKeeper::RunHouseKeeping().
| void JobQueue::run | ( | void | ) | [private] |
Definition at line 149 of file jobqueue.cpp.
| void JobQueue::ProcessQueue | ( | void | ) | [private] |
Definition at line 164 of file jobqueue.cpp.
Referenced by run().
| void JobQueue::ProcessJob | ( | JobQueueEntry | job | ) | [private] |
Definition at line 1647 of file jobqueue.cpp.
Referenced by ProcessQueue().
| bool JobQueue::AllowedToRun | ( | JobQueueEntry | job | ) | [private] |
Definition at line 1417 of file jobqueue.cpp.
Referenced by ProcessQueue().
| bool JobQueue::InJobRunWindow | ( | int | orStartingWithinMins = 0 |
) | [static, private] |
Definition at line 1133 of file jobqueue.cpp.
Referenced by HasRunningOrPendingJobs(), and ProcessQueue().
| void JobQueue::StartChildJob | ( | void *(*)(void *) | start_routine, | |
| int | jobID | |||
| ) | [private] |
Definition at line 1735 of file jobqueue.cpp.
Referenced by ProcessJob().
| QString JobQueue::GetJobDescription | ( | int | jobType | ) | [private] |
Definition at line 1749 of file jobqueue.cpp.
Referenced by ProcessJob().
| QString JobQueue::GetJobCommand | ( | int | id, | |
| int | jobType, | |||
| ProgramInfo * | tmpInfo | |||
| ) | [private] |
Definition at line 1764 of file jobqueue.cpp.
Referenced by ProcessJob().
| void JobQueue::RemoveRunningJob | ( | int | id | ) | [private] |
Definition at line 1814 of file jobqueue.cpp.
Referenced by DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), and ProcessJob().
| QString JobQueue::PrettyPrint | ( | off_t | bytes | ) | [static, private] |
Definition at line 1833 of file jobqueue.cpp.
Referenced by DoTranscodeThread().
| void * JobQueue::TranscodeThread | ( | void * | param | ) | [static, private] |
Definition at line 1866 of file jobqueue.cpp.
Referenced by ProcessJob().
| void JobQueue::DoTranscodeThread | ( | int | jobID | ) | [private] |
Definition at line 1880 of file jobqueue.cpp.
Referenced by TranscodeThread().
| void * JobQueue::MetadataLookupThread | ( | void * | param | ) | [static, private] |
Definition at line 2096 of file jobqueue.cpp.
Referenced by ProcessJob().
| void JobQueue::DoMetadataLookupThread | ( | int | jobID | ) | [private] |
Definition at line 2110 of file jobqueue.cpp.
Referenced by MetadataLookupThread().
| void * JobQueue::FlagCommercialsThread | ( | void * | param | ) | [static, private] |
Definition at line 2221 of file jobqueue.cpp.
Referenced by ProcessJob().
| void JobQueue::DoFlagCommercialsThread | ( | int | jobID | ) | [private] |
Definition at line 2235 of file jobqueue.cpp.
Referenced by FlagCommercialsThread().
| void * JobQueue::UserJobThread | ( | void * | param | ) | [static, private] |
Definition at line 2368 of file jobqueue.cpp.
Referenced by ProcessJob().
| void JobQueue::DoUserJobThread | ( | int | jobID | ) | [private] |
Definition at line 2382 of file jobqueue.cpp.
Referenced by UserJobThread().
friend class QueueProcessorThread [friend] |
Definition at line 120 of file jobqueue.h.
QString JobQueue::m_hostname [private] |
Definition at line 236 of file jobqueue.h.
Referenced by AllowedToRun(), and ProcessQueue().
int JobQueue::jobsRunning [private] |
Definition at line 238 of file jobqueue.h.
Referenced by ProcessQueue().
int JobQueue::jobQueueCPU [private] |
Definition at line 239 of file jobqueue.h.
Referenced by DoTranscodeThread(), DoUserJobThread(), and JobQueue().
ProgramInfo* JobQueue::m_pginfo [private] |
Definition at line 241 of file jobqueue.h.
QMutex JobQueue::controlFlagsLock [private] |
Definition at line 243 of file jobqueue.h.
QMap<QString, int *> JobQueue::jobControlFlags [private] |
Definition at line 244 of file jobqueue.h.
QMutex* JobQueue::runningJobsLock [private] |
Definition at line 246 of file jobqueue.h.
Referenced by customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), GetRunningJobID(), ProcessJob(), ProcessQueue(), RemoveRunningJob(), and ~JobQueue().
QMap<int, RunningJobInfo> JobQueue::runningJobs [private] |
Definition at line 247 of file jobqueue.h.
Referenced by customEvent(), DoFlagCommercialsThread(), DoMetadataLookupThread(), DoTranscodeThread(), DoUserJobThread(), GetRunningJobID(), ProcessJob(), ProcessQueue(), and RemoveRunningJob().
bool JobQueue::isMaster [private] |
Definition at line 249 of file jobqueue.h.
MThread* JobQueue::queueThread [private] |
Definition at line 251 of file jobqueue.h.
Referenced by JobQueue(), and ~JobQueue().
QWaitCondition JobQueue::queueThreadCond [private] |
Definition at line 252 of file jobqueue.h.
Referenced by ProcessQueue(), run(), and ~JobQueue().
QMutex JobQueue::queueThreadCondLock [private] |
Definition at line 253 of file jobqueue.h.
Referenced by JobQueue(), ProcessQueue(), run(), and ~JobQueue().
bool JobQueue::processQueue [private] |
Definition at line 254 of file jobqueue.h.
Referenced by JobQueue(), ProcessQueue(), and ~JobQueue().
1.6.3