+
+ if (QString(args.at(0)).startsWith("-locale:")) {
+ locale = QString(args.at(0)).section(':', 1);
+ args.removeFirst();
+ }
+ if (args.at(0).startsWith("in="))
+ in = args.takeFirst().section('=', -1).toInt();
+ if (args.at(0).startsWith("out="))
+ out = args.takeFirst().section('=', -1).toInt();
+ if (args.at(0).startsWith("preargs="))
+ preargs = args.takeFirst().section('=', 1).split(' ', QString::SkipEmptyParts);
+
+ QString render = args.takeFirst();
+ QString profile = args.takeFirst();
+ QString rendermodule = args.takeFirst();
+ QString player = args.takeFirst();
+ QByteArray srcString = args.takeFirst().toUtf8();
+ QUrl srcurl = QUrl::fromEncoded(srcString);
+ QString src = srcurl.path();
+ // The QUrl path() strips the consumer: protocol, so re-add it if necessary
+ if (srcString.startsWith("consumer:"))
+ src.prepend("consumer:");
+ QUrl desturl = QUrl::fromEncoded(args.takeFirst().toUtf8());
+ QString dest = desturl.path();
+ bool dualpass = false;
+ bool doerase;
+ QString vpre;
+
+ int vprepos = args.indexOf(QRegExp("vpre=.*"));
+ if (vprepos >= 0) {
+ vpre=args.at(vprepos);
+ }
+ QStringList vprelist = vpre.replace("vpre=", "").split(',');
+ if (vprelist.size() > 0) {
+ args.replaceInStrings(QRegExp("^vpre=.*"), QString("vpre=").append(vprelist.at(0)));
+ }
+
+ if (args.contains("pass=2")) {
+ // dual pass encoding
+ dualpass = true;
+ doerase = false;
+ args.replace(args.indexOf("pass=2"), "pass=1");
+ if (args.contains("vcodec=libx264")) args << QString("passlogfile=%1").arg(dest + ".log");
+ } else {
+ args.removeAll("pass=1");
+ doerase = erase;
+ }
+
+ // Decode metadata
+ for (int i = 0; i < args.count(); ++i) {
+ if (args.at(i).startsWith("meta.attr")) {
+ QString data = args.at(i);
+ args.replace(i, data.section('=', 0, 0) + "=\"" + QUrl::fromPercentEncoding(data.section('=', 1).toUtf8()) + "\"");
+ }
+ }
+
+ qDebug() << "//STARTING RENDERING: " << erase << "," << usekuiserver << "," << render << "," << profile << "," << rendermodule << "," << player << "," << src << "," << dest << "," << preargs << "," << args << "," << in << "," << out ;
+ RenderJob *job = new RenderJob(doerase, usekuiserver, pid, render, profile, rendermodule, player, src, dest, preargs, args, in, out);
+ if (!locale.isEmpty()) job->setLocale(locale);