#include <jobqueue.h>
Definition at line 98 of file jobqueue.h.
Public Member Functions | |
| JobQueue (bool master) | |
| ~JobQueue (void) | |
| void | customEvent (QCustomEvent *e) |
Static Public Member Functions | |
| static bool | QueueRecordingJobs (ProgramInfo *pinfo, int jobTypes=JOB_NONE) |
| static bool | QueueJob (int jobType, QString chanid, QDateTime starttime, QString args="", QString comment="", QString host="", int flags=0, int status=JOB_QUEUED, QDateTime schedruntime=QDateTime()) |
| static bool | QueueJobs (int jobTypes, QString chanid, QDateTime starttime, QString args="", QString comment="", QString host="") |
| static int | GetJobID (int jobType, QString chanid, QDateTime starttime) |
| static bool | GetJobInfoFromID (int jobID, int &jobType, QString &chanid, QDateTime &starttime) |
| static bool | GetJobInfoFromID (int jobID, int &jobType, QString &chanid, QString &starttime) |
| static bool | ChangeJobCmds (int jobID, int newCmds) |
| static bool | ChangeJobCmds (int jobType, QString chanid, QDateTime starttime, 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, QString chanid, QDateTime starttime) |
| static bool | IsJobRunning (int jobType, QString chanid, QDateTime starttime) |
| static bool | IsJobRunning (int jobType, ProgramInfo *pginfo) |
| static bool | IsJobQueued (int jobType, QString chanid, QDateTime starttime) |
| 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, QString chanid, QDateTime starttime) |
| static QString | GetJobArgs (int jobID) |
| static int | UserJobTypeToIndex (int JobType) |
| static bool | DeleteAllJobs (QString chanid, QDateTime starttime) |
| 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 Member Functions | |
| void | RunQueueProcesser (void) |
| void | ProcessQueue (void) |
| void | ProcessJob (int id, int jobType, QString chanid, QDateTime starttime) |
| bool | AllowedToRun (JobQueueEntry job) |
| void | StartChildJob (void *(*start_routine)(void *), ProgramInfo *tmpInfo) |
| QString | GetJobDescription (int jobType) |
| QString | GetJobCommand (int id, int jobType, ProgramInfo *tmpInfo) |
| void | DoTranscodeThread (void) |
| void | DoFlagCommercialsThread (void) |
| void | DoUserJobThread (void) |
Static Private Member Functions | |
| static void * | QueueProcesserThread (void *param) |
| static bool | InJobRunWindow (int orStartingWithinMins=0) |
| static QString | GetJobQueueKey (QString chanid, QString startts) |
| static QString | GetJobQueueKey (QString chanid, QDateTime starttime) |
| static QString | GetJobQueueKey (ProgramInfo *pginfo) |
| static void * | TranscodeThread (void *param) |
| static QString | PrettyPrint (off_t bytes) |
| 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 |
| QMap< QString, int > | runningJobIDs |
| QMap< QString, int > | runningJobTypes |
| QMap< QString, QString > | runningJobDescs |
| QMap< QString, QString > | runningJobCommands |
| bool | childThreadStarted |
| bool | isMaster |
| pthread_t | queueThread |
| QWaitCondition | queueThreadCond |
| QMutex | queueThreadCondLock |
| JobQueue::JobQueue | ( | bool | master | ) |
Definition at line 29 of file jobqueue.cpp.
| JobQueue::~JobQueue | ( | void | ) |
Definition at line 51 of file jobqueue.cpp.
| void JobQueue::customEvent | ( | QCustomEvent * | e | ) |
Definition at line 59 of file jobqueue.cpp.
| bool JobQueue::QueueRecordingJobs | ( | ProgramInfo * | pinfo, | |
| int | jobTypes = JOB_NONE | |||
| ) | [static] |
Definition at line 467 of file jobqueue.cpp.
Referenced by TVRec::RunTV(), TVRec::TeardownRecorder(), and TVRec::TuningRestartRecorder().
| bool JobQueue::QueueJob | ( | int | jobType, | |
| QString | chanid, | |||
| QDateTime | starttime, | |||
| QString | args = "", |
|||
| QString | comment = "", |
|||
| QString | host = "", |
|||
| int | flags = 0, |
|||
| int | status = JOB_QUEUED, |
|||
| QDateTime | schedruntime = QDateTime() | |||
| ) | [static] |
Definition at line 494 of file jobqueue.cpp.
Referenced by PlaybackBox::doJobQueueJob(), PlaybackBox::doPlaylistJobQueueJob(), TV::DoQueueTranscode(), FlagCommercials(), init_jobs(), QueueCommFlagJob(), and QueueJobs().
| bool JobQueue::QueueJobs | ( | int | jobTypes, | |
| QString | chanid, | |||
| QDateTime | starttime, | |||
| QString | args = "", |
|||
| QString | comment = "", |
|||
| QString | host = "" | |||
| ) | [static] |
| int JobQueue::GetJobID | ( | int | jobType, | |
| QString | chanid, | |||
| QDateTime | starttime | |||
| ) | [static] |
Definition at line 617 of file jobqueue.cpp.
Referenced by DoFlagCommercials(), and FlagCommercials().
| bool JobQueue::GetJobInfoFromID | ( | int | jobID, | |
| int & | jobType, | |||
| QString & | chanid, | |||
| QDateTime & | starttime | |||
| ) | [static] |
Definition at line 644 of file jobqueue.cpp.
Referenced by customEvent(), GetJobInfoFromID(), and main().
| bool JobQueue::GetJobInfoFromID | ( | int | jobID, | |
| int & | jobType, | |||
| QString & | chanid, | |||
| QString & | starttime | |||
| ) | [static] |
Definition at line 675 of file jobqueue.cpp.
| bool JobQueue::ChangeJobCmds | ( | int | jobID, | |
| int | newCmds | |||
| ) | [static] |
Definition at line 877 of file jobqueue.cpp.
Referenced by PlaybackBox::doJobQueueJob(), TV::DoQueueTranscode(), PauseJob(), ProcessQueue(), RecoverQueue(), RestartJob(), ResumeJob(), StopJob(), and PlaybackBox::stopPlaylistJobQueueJob().
| bool JobQueue::ChangeJobCmds | ( | int | jobType, | |
| QString | chanid, | |||
| QDateTime | starttime, | |||
| int | newCmds | |||
| ) | [static] |
Definition at line 900 of file jobqueue.cpp.
| bool JobQueue::ChangeJobFlags | ( | int | jobID, | |
| int | newFlags | |||
| ) | [static] |
Definition at line 924 of file jobqueue.cpp.
| bool JobQueue::ChangeJobStatus | ( | int | jobID, | |
| int | newStatus, | |||
| QString | comment = "" | |||
| ) | [static] |
Definition at line 947 of file jobqueue.cpp.
Referenced by StatusBox::clicked(), commDetectorBreathe(), commDetectorStatusUpdate(), CompleteJob(), DoFlagCommercialsThread(), DoTranscodeThread(), DoUserJobThread(), FlagCommercials(), main(), ProcessJob(), ProcessQueue(), and RecoverQueue().
| bool JobQueue::ChangeJobHost | ( | int | jobID, | |
| QString | newHostname | |||
| ) | [static] |
| bool JobQueue::ChangeJobComment | ( | int | jobID, | |
| QString | comment = "" | |||
| ) | [static] |
Definition at line 975 of file jobqueue.cpp.
Referenced by BuildKeyframeIndex(), DoTranscodeThread(), Transcode::TranscodeFile(), and UpdateJobQueue().
| bool JobQueue::ChangeJobArgs | ( | int | jobID, | |
| QString | args = "" | |||
| ) | [static] |
| bool JobQueue::IsJobQueuedOrRunning | ( | int | jobType, | |
| QString | chanid, | |||
| QDateTime | starttime | |||
| ) | [static] |
Definition at line 1042 of file jobqueue.cpp.
Referenced by PlaybackBox::doJobQueueJob(), PlaybackBox::doPlaylistJobQueueJob(), TV::DoQueueTranscode(), TV::FillMenuPlaying(), PlaybackBox::showJobPopup(), PlaybackBox::showPlaylistJobPopup(), and PlaybackBox::stopPlaylistJobQueueJob().
| bool JobQueue::IsJobRunning | ( | int | jobType, | |
| QString | chanid, | |||
| QDateTime | starttime | |||
| ) | [static] |
Definition at line 1026 of file jobqueue.cpp.
Referenced by FlagCommercials(), ProgramList::FromRecorded(), PlaybackBox::getPixmap(), MainServer::HandleQueryRecordings(), IsJobRunning(), and Transcode::TranscodeFile().
| bool JobQueue::IsJobRunning | ( | int | jobType, | |
| ProgramInfo * | pginfo | |||
| ) | [static] |
Definition at line 1037 of file jobqueue.cpp.
| bool JobQueue::IsJobQueued | ( | int | jobType, | |
| QString | chanid, | |||
| QDateTime | starttime | |||
| ) | [static] |
Definition at line 1053 of file jobqueue.cpp.
| bool JobQueue::PauseJob | ( | int | jobID | ) | [static] |
| bool JobQueue::ResumeJob | ( | int | jobID | ) | [static] |
| bool JobQueue::RestartJob | ( | int | jobID | ) | [static] |
Definition at line 705 of file jobqueue.cpp.
| bool JobQueue::StopJob | ( | int | jobID | ) | [static] |
| bool JobQueue::DeleteJob | ( | int | jobID | ) | [static] |
| enum JobCmds JobQueue::GetJobCmd | ( | int | jobID | ) | [static] |
Definition at line 1417 of file jobqueue.cpp.
Referenced by BuildKeyframeIndex(), CheckJobQueue(), commDetectorBreathe(), and Transcode::TranscodeFile().
| enum JobFlags JobQueue::GetJobFlags | ( | int | jobID | ) | [static] |
| enum JobStatus JobQueue::GetJobStatus | ( | int | jobID | ) | [static] |
Definition at line 1486 of file jobqueue.cpp.
Referenced by StatusBox::clicked(), CompleteJob(), DoFlagCommercialsThread(), DoTranscodeThread(), IsJobQueued(), IsJobQueuedOrRunning(), and IsJobRunning().
| enum JobStatus JobQueue::GetJobStatus | ( | int | jobType, | |
| QString | chanid, | |||
| QDateTime | starttime | |||
| ) | [static] |
Definition at line 1508 of file jobqueue.cpp.
| QString JobQueue::GetJobArgs | ( | int | jobID | ) | [static] |
| int JobQueue::UserJobTypeToIndex | ( | int | JobType | ) | [static] |
Definition at line 2295 of file jobqueue.cpp.
Referenced by AllowedToRun(), GetJobCommand(), GetJobDescription(), GetJobsInQueue(), and JobText().
| bool JobQueue::DeleteAllJobs | ( | QString | chanid, | |
| QDateTime | starttime | |||
| ) | [static] |
| static void JobQueue::ClearJobMask | ( | int & | mask | ) | [inline, static] |
Definition at line 157 of file jobqueue.h.
| static bool JobQueue::JobIsInMask | ( | int | job, | |
| int | mask | |||
| ) | [inline, static] |
| static bool JobQueue::JobIsNotInMask | ( | int | job, | |
| int | mask | |||
| ) | [inline, static] |
| static void JobQueue::AddJobsToMask | ( | int | jobs, | |
| int & | mask | |||
| ) | [inline, static] |
| static void JobQueue::RemoveJobsFromMask | ( | int | jobs, | |
| int & | mask | |||
| ) | [inline, static] |
Definition at line 162 of file jobqueue.h.
Referenced by init_jobs(), TVRec::RunTV(), TVRec::TeardownRecorder(), and TVRec::TuningRestartRecorder().
| QString JobQueue::JobText | ( | int | jobType | ) | [static] |
Definition at line 1064 of file jobqueue.cpp.
Referenced by DeleteAllJobs(), StatusBox::doJobQueueStatus(), GetJobsInQueue(), HttpStatus::PrintJobQueue(), ProcessQueue(), and RecoverQueue().
| QString JobQueue::StatusText | ( | int | status | ) | [static] |
Definition at line 1082 of file jobqueue.cpp.
Referenced by ChangeJobStatus(), DeleteAllJobs(), DoFlagCommercialsThread(), StatusBox::doJobQueueStatus(), DoTranscodeThread(), GetJobsInQueue(), HttpStatus::PrintJobQueue(), ProcessQueue(), and RecoverQueue().
| bool JobQueue::HasRunningOrPendingJobs | ( | int | startingWithinMins = 0 |
) | [static] |
| int JobQueue::GetJobsInQueue | ( | QMap< int, JobQueueEntry > & | jobs, | |
| int | findJobs = JOB_LIST_NOT_DONE | |||
| ) | [static] |
Definition at line 1236 of file jobqueue.cpp.
Referenced by StatusBox::doJobQueueStatus(), HttpStatus::FillStatusXML(), HasRunningOrPendingJobs(), ProcessQueue(), and RecoverQueue().
| void JobQueue::RecoverQueue | ( | bool | justOld = false |
) | [static] |
| static void JobQueue::RecoverOldJobsInQueue | ( | ) | [inline, static] |
| void JobQueue::CleanupOldJobsInQueue | ( | ) | [static] |
| void * JobQueue::QueueProcesserThread | ( | void * | param | ) | [static, private] |
| void JobQueue::RunQueueProcesser | ( | void | ) | [private] |
| void JobQueue::ProcessQueue | ( | void | ) | [private] |
| void JobQueue::ProcessJob | ( | int | id, | |
| int | jobType, | |||
| QString | chanid, | |||
| QDateTime | starttime | |||
| ) | [private] |
| bool JobQueue::AllowedToRun | ( | JobQueueEntry | job | ) | [private] |
| bool JobQueue::InJobRunWindow | ( | int | orStartingWithinMins = 0 |
) | [static, private] |
Definition at line 1109 of file jobqueue.cpp.
Referenced by HasRunningOrPendingJobs(), and ProcessQueue().
| void JobQueue::StartChildJob | ( | void *(*)(void *) | start_routine, | |
| ProgramInfo * | tmpInfo | |||
| ) | [private] |
| QString JobQueue::GetJobQueueKey | ( | QString | chanid, | |
| QString | startts | |||
| ) | [static, private] |
Definition at line 1093 of file jobqueue.cpp.
Referenced by customEvent(), DeleteAllJobs(), DoFlagCommercialsThread(), DoTranscodeThread(), DoUserJobThread(), GetJobQueueKey(), ProcessJob(), and ProcessQueue().
| QString JobQueue::GetJobQueueKey | ( | QString | chanid, | |
| QDateTime | starttime | |||
| ) | [static, private] |
Definition at line 1098 of file jobqueue.cpp.
| QString JobQueue::GetJobQueueKey | ( | ProgramInfo * | pginfo | ) | [static, private] |
Definition at line 1104 of file jobqueue.cpp.
| QString JobQueue::GetJobDescription | ( | int | jobType | ) | [private] |
| QString JobQueue::GetJobCommand | ( | int | id, | |
| int | jobType, | |||
| ProgramInfo * | tmpInfo | |||
| ) | [private] |
| void * JobQueue::TranscodeThread | ( | void * | param | ) | [static, private] |
| QString JobQueue::PrettyPrint | ( | off_t | bytes | ) | [static, private] |
| void JobQueue::DoTranscodeThread | ( | void | ) | [private] |
| void * JobQueue::FlagCommercialsThread | ( | void * | param | ) | [static, private] |
| void JobQueue::DoFlagCommercialsThread | ( | void | ) | [private] |
| void * JobQueue::UserJobThread | ( | void * | param | ) | [static, private] |
| void JobQueue::DoUserJobThread | ( | void | ) | [private] |
QString JobQueue::m_hostname [private] |
Definition at line 207 of file jobqueue.h.
Referenced by AllowedToRun(), JobQueue(), and ProcessQueue().
int JobQueue::jobsRunning [private] |
int JobQueue::jobQueueCPU [private] |
Definition at line 210 of file jobqueue.h.
Referenced by DoTranscodeThread(), DoUserJobThread(), and JobQueue().
ProgramInfo* JobQueue::m_pginfo [private] |
Definition at line 212 of file jobqueue.h.
Referenced by DoFlagCommercialsThread(), DoTranscodeThread(), DoUserJobThread(), and StartChildJob().
QMutex JobQueue::controlFlagsLock [private] |
Definition at line 214 of file jobqueue.h.
Referenced by customEvent(), DoFlagCommercialsThread(), DoTranscodeThread(), DoUserJobThread(), ProcessJob(), and ProcessQueue().
QMap<QString, int *> JobQueue::jobControlFlags [private] |
Definition at line 215 of file jobqueue.h.
Referenced by customEvent(), DoFlagCommercialsThread(), DoTranscodeThread(), and ProcessQueue().
QMap<QString, int> JobQueue::runningJobIDs [private] |
Definition at line 217 of file jobqueue.h.
Referenced by DoFlagCommercialsThread(), DoTranscodeThread(), DoUserJobThread(), and ProcessJob().
QMap<QString, int> JobQueue::runningJobTypes [private] |
Definition at line 218 of file jobqueue.h.
Referenced by customEvent(), DoFlagCommercialsThread(), DoTranscodeThread(), DoUserJobThread(), and ProcessJob().
QMap<QString, QString> JobQueue::runningJobDescs [private] |
Definition at line 219 of file jobqueue.h.
Referenced by DoFlagCommercialsThread(), DoTranscodeThread(), DoUserJobThread(), and ProcessJob().
QMap<QString, QString> JobQueue::runningJobCommands [private] |
Definition at line 220 of file jobqueue.h.
Referenced by DoFlagCommercialsThread(), DoTranscodeThread(), DoUserJobThread(), and ProcessJob().
bool JobQueue::childThreadStarted [private] |
Definition at line 222 of file jobqueue.h.
Referenced by DoFlagCommercialsThread(), DoTranscodeThread(), DoUserJobThread(), and StartChildJob().
bool JobQueue::isMaster [private] |
pthread_t JobQueue::queueThread [private] |
QWaitCondition JobQueue::queueThreadCond [private] |
QMutex JobQueue::queueThreadCondLock [private] |
1.5.5