diff --git a/mythtv/programs/mythtranscode/main.cpp b/mythtv/programs/mythtranscode/main.cpp
index 305271d..5dcbd89 100644
|
a
|
b
|
static void usage(char *progname)
|
| 66 | 66 | cerr << "\t or -ro: Pass a comma-separated list of\n"; |
| 67 | 67 | cerr << "\t recordingprofile options to override\n"; |
| 68 | 68 | cerr << "\t values in the database.\n"; |
| | 69 | cerr << "\t--queue or -q: Insert transcode job into the JobQueue rather than\n"; |
| | 70 | cerr << "\t running transcoding in the foreground\n"; |
| 69 | 71 | cerr << "\t--verbose level or -v: Use '-v help' for level info\n"; |
| 70 | 72 | cerr << "\t--help or -h: Prints this help statement.\n"; |
| 71 | 73 | } |
| … |
… |
static void UpdateJobQueue(float percent_done)
|
| 123 | 125 | .arg(percent_done, 0, 'f', 1)); |
| 124 | 126 | } |
| 125 | 127 | |
| | 128 | static int QueueTranscodeJob(ProgramInfo *pginfo) |
| | 129 | { |
| | 130 | bool result = JobQueue::QueueJob( |
| | 131 | JOB_TRANSCODE, pginfo->GetChanID(), pginfo->GetRecordingStartTime(), |
| | 132 | "", "Job Queued By MythTranscoder"); |
| | 133 | |
| | 134 | if (result) |
| | 135 | { |
| | 136 | VERBOSE(VB_IMPORTANT, |
| | 137 | QString("Queued transcode job for chanid %1 @ %2") |
| | 138 | .arg(pginfo->GetChanID()).arg(pginfo->GetRecordingStartTime().toString("yyyyMMddhhmmss"))); |
| | 139 | |
| | 140 | return TRANSCODE_EXIT_OK; |
| | 141 | } |
| | 142 | QString tmp = QString("Error queueing job for chanid %1 @ %2") |
| | 143 | .arg(pginfo->GetChanID()).arg(pginfo->GetRecordingStartTime().toString("yyyyMMddhhmmss")); |
| | 144 | cerr << tmp.toLocal8Bit().constData() << endl; |
| | 145 | return TRANSCODE_EXIT_DB_ERROR; |
| | 146 | } |
| | 147 | |
| 126 | 148 | static int CheckJobQueue() |
| 127 | 149 | { |
| 128 | 150 | if (JobQueue::GetJobCmd(glbl_jobID) == JOB_STOP) |
| … |
… |
int main(int argc, char *argv[])
|
| 143 | 165 | QDateTime startts; |
| 144 | 166 | int jobType = JOB_NONE; |
| 145 | 167 | int otype = REPLEX_MPEG2; |
| 146 | | bool useCutlist = false, keyframesonly = false; |
| | 168 | bool useCutlist = false, keyframesonly = false, queueJobInstead = false, foundProfileName = false; |
| 147 | 169 | bool build_index = false, fifosync = false, showprogress = false, mpeg2 = false; |
| 148 | 170 | QMap<QString, QString> settingsOverride; |
| 149 | 171 | frm_dir_map_t deleteMap; |
| … |
… |
int main(int argc, char *argv[])
|
| 284 | 306 | if (a.argc()-1 > argpos && a.argv()[argpos+1][0] != '-') |
| 285 | 307 | { |
| 286 | 308 | profilename = a.argv()[argpos + 1]; |
| | 309 | foundProfileName = true; |
| 287 | 310 | ++argpos; |
| 288 | 311 | } |
| 289 | 312 | else |
| … |
… |
int main(int argc, char *argv[])
|
| 474 | 497 | |
| 475 | 498 | ++argpos; |
| 476 | 499 | } |
| | 500 | else if (!strcmp(a.argv()[argpos],"-q") || |
| | 501 | !strcmp(a.argv()[argpos],"--queue")) |
| | 502 | { |
| | 503 | queueJobInstead = true; |
| | 504 | } |
| 477 | 505 | else if (!strcmp(a.argv()[argpos],"-h") || |
| 478 | 506 | !strcmp(a.argv()[argpos],"--help")) |
| 479 | 507 | { |
| … |
… |
int main(int argc, char *argv[])
|
| 562 | 590 | cerr << "Must specify --fifodir to use --fifosync\n"; |
| 563 | 591 | return TRANSCODE_EXIT_INVALID_CMDLINE; |
| 564 | 592 | } |
| | 593 | if (queueJobInstead && |
| | 594 | (found_infile || build_index || jobID >= 0 || !outfile.isEmpty() || |
| | 595 | !fifodir.isEmpty() || fifosync || showprogress || useCutlist || mpeg2 || |
| | 596 | isVideo || keyframesonly || !recorderOptions.isEmpty() || foundProfileName )) |
| | 597 | { |
| | 598 | cerr << "--queue can only be used with --chanid and --starttime \n"; |
| | 599 | return TRANSCODE_EXIT_INVALID_CMDLINE; |
| | 600 | } |
| 565 | 601 | |
| 566 | 602 | VERBOSE(VB_IMPORTANT, QString("Enabled verbose msgs: %1").arg(verboseString)); |
| 567 | 603 | |
| … |
… |
int main(int argc, char *argv[])
|
| 593 | 629 | return TRANSCODE_EXIT_NO_RECORDING_DATA; |
| 594 | 630 | } |
| 595 | 631 | |
| | 632 | if (queueJobInstead) |
| | 633 | { |
| | 634 | return QueueTranscodeJob(pginfo); |
| | 635 | } |
| | 636 | |
| 596 | 637 | infile = pginfo->GetPlaybackURL(false, true); |
| 597 | 638 | } |
| 598 | 639 | else |