Skip to content
Permalink
Browse files

Adds a --queue parameter to mythtranscode. This requires the use of

--chanid and --starttime, and can be used in combination with --profile
and --honorcutlist. This parameter allows an optional string that
defines which host to run the job on.

Based off original patch by Doug Haber.
Fixes #9409.
  • Loading branch information
wagnerrp committed Jun 26, 2011
1 parent a38f7a2 commit 153e5b6544eca1a1613d3fd52fce691ebf512fb4
Showing with 37 additions and 1 deletion.
  1. +5 −1 mythtv/libs/libmyth/mythcommandlineparser.cpp
  2. +32 −0 mythtv/programs/mythtranscode/main.cpp
@@ -1554,6 +1554,10 @@ void MythTranscodeCommandLineParser::LoadArguments(void)
"Specifies that a lossless transcode should be used.", "");
add(QStringList( QStringList() << "-e" << "--ostream" ), "ostream", ""
"Output stream type: dvd, ps", "");
add("--queue", "queue", "",
"Add a new transcoding job of the specified recording and "
"profile to the jobqueue. Accepts an optional string to define "
"the hostname.", "");
}

MythMediaServerCommandLineParser::MythMediaServerCommandLineParser() :
@@ -1562,7 +1566,7 @@ MythMediaServerCommandLineParser::MythMediaServerCommandLineParser() :

QString MythMediaServerCommandLineParser::GetHelpHeader(void) const
{
return "MythMediaServer is daemon implementing the backend file server. \n"
return "MythMediaServer is a daemon implementing the backend file server. \n"
"It is intended to allow access to remote file storage on machines \n"
"that do not have tuners, and as such cannot run a backend.";
}
@@ -25,6 +25,7 @@ using namespace std;
#include "mythtranslation.h"
#include "mythlogging.h"
#include "mythcommandlineparser.h"
#include "recordinginfo.h"

static void CompleteJob(int jobID, ProgramInfo *pginfo, bool useCutlist,
frm_dir_map_t *deleteMap, int &resultCode);
@@ -95,6 +96,31 @@ static int CheckJobQueue()
return 0;
}

static int QueueTranscodeJob(ProgramInfo *pginfo, QString profile,
QString hostname, bool usecutlist)
{
RecordingInfo recinfo(*pginfo);
if (!profile.isEmpty())
recinfo.ApplyTranscoderProfileChange(profile);

if (JobQueue::QueueJob(JOB_TRANSCODE,
pginfo->GetChanID(),
pginfo->GetRecordingStartTime(),
hostname, "", "",
usecutlist ? JOB_USE_CUTLIST : 0))
{
VERBOSE(VB_IMPORTANT, QString("Queued transcode job for chanid %1 @ %2")
.arg(pginfo->GetChanID())
.arg(pginfo->GetRecordingStartTime().toString("yyyyMMddhhmmss")));
return GENERIC_EXIT_OK;
}

VERBOSE(VB_IMPORTANT, QString("Error queuing job for chanid %1 @ %2")
.arg(pginfo->GetChanID())
.arg(pginfo->GetRecordingStartTime().toString("yyyyMMddhhmmss")));
return GENERIC_EXIT_DB_ERROR;
}

int main(int argc, char *argv[])
{
uint chanid;
@@ -426,6 +452,12 @@ int main(int argc, char *argv[])
return GENERIC_EXIT_NO_RECORDING_DATA;
}

if (cmdline.toBool("queue"))
{
QString hostname = cmdline.toString("queue");
return QueueTranscodeJob(pginfo, profilename, hostname, useCutlist);
}

if (infile.left(7) == "myth://" && (outfile.isNull() || outfile != "-"))
{
VERBOSE(VB_IMPORTANT, QString("Attempted to transcode %1. "

0 comments on commit 153e5b6

Please sign in to comment.
You can’t perform that action at this time.