Added support for VapourSynth r24+. Minimum required version is now r24!

This commit is contained in:
LoRd_MuldeR 2014-08-13 16:07:57 +02:00
parent ee5c384578
commit 6d7a0bc4ce
3 changed files with 26 additions and 9 deletions

View File

@ -31,7 +31,8 @@
#include <QDir> #include <QDir>
#include <QProcess> #include <QProcess>
static const unsigned int VER_X264_VSPIPE_VER = 22; static const unsigned int VER_X264_VSPIPE_API = 3;
static const unsigned int VER_X264_VSPIPE_VER = 24;
VapoursynthSource::VapoursynthSource(JobObject *jobObject, const OptionsModel *options, const SysinfoModel *const sysinfo, const PreferencesModel *const preferences, JobStatus &jobStatus, volatile bool *abort, volatile bool *pause, QSemaphore *semaphorePause, const QString &sourceFile) VapoursynthSource::VapoursynthSource(JobObject *jobObject, const OptionsModel *options, const SysinfoModel *const sysinfo, const PreferencesModel *const preferences, JobStatus &jobStatus, volatile bool *abort, volatile bool *pause, QSemaphore *semaphorePause, const QString &sourceFile)
: :
@ -68,7 +69,7 @@ bool VapoursynthSource::isSourceAvailable()
void VapoursynthSource::checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmdLine) void VapoursynthSource::checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmdLine)
{ {
cmdLine << "-version"; cmdLine << "--version";
patterns << new QRegExp("\\bVapourSynth\\b", Qt::CaseInsensitive); patterns << new QRegExp("\\bVapourSynth\\b", Qt::CaseInsensitive);
patterns << new QRegExp("\\bCore\\s+r(\\d+)\\b", Qt::CaseInsensitive); patterns << new QRegExp("\\bCore\\s+r(\\d+)\\b", Qt::CaseInsensitive);
patterns << new QRegExp("\\bAPI\\s+r(\\d+)\\b", Qt::CaseInsensitive); patterns << new QRegExp("\\bAPI\\s+r(\\d+)\\b", Qt::CaseInsensitive);
@ -110,12 +111,26 @@ bool VapoursynthSource::isVersionSupported(const unsigned int &revision, const b
unsigned int core, build; unsigned int core, build;
splitRevision(revision, core, build); splitRevision(revision, core, build);
if(build < VER_X264_VSPIPE_VER) if((build < VER_X264_VSPIPE_VER) || (core < VER_X264_VSPIPE_API))
{ {
log(tr("\nERROR: Your version of VapourSynth is unsupported (requires version r%1 or newer").arg(QString::number(VER_X264_VSPIPE_VER)));
if(core < VER_X264_VSPIPE_API)
{
log(tr("\nERROR: Your version of VapourSynth is unsupported! (requires API r%1 or newer)").arg(QString::number(VER_X264_VSPIPE_API)));
}
if(build < VER_X264_VSPIPE_VER)
{
log(tr("\nERROR: Your version of VapourSynth is unsupported! (requires version r%1 or newer)").arg(QString::number(VER_X264_VSPIPE_VER)));
}
log(tr("You can find the latest VapourSynth version at: http://www.vapoursynth.com/")); log(tr("You can find the latest VapourSynth version at: http://www.vapoursynth.com/"));
return false; return false;
} }
if(core != VER_X264_VSPIPE_API)
{
log(tr("\nWARNING: Running with an unknown VapourSynth API version, problem may appear! (this application works best with API r%1)").arg(QString::number(VER_X264_VSPIPE_API)));
}
return true; return true;
} }
@ -125,8 +140,9 @@ bool VapoursynthSource::isVersionSupported(const unsigned int &revision, const b
void VapoursynthSource::checkSourceProperties_init(QList<QRegExp*> &patterns, QStringList &cmdLine) void VapoursynthSource::checkSourceProperties_init(QList<QRegExp*> &patterns, QStringList &cmdLine)
{ {
cmdLine << "--info";
cmdLine << QDir::toNativeSeparators(x264_path2ansi(m_sourceFile, true)); cmdLine << QDir::toNativeSeparators(x264_path2ansi(m_sourceFile, true));
cmdLine << "-" << "-info"; cmdLine << "-";
patterns << new QRegExp("\\bFrames:\\s+(\\d+)\\b"); patterns << new QRegExp("\\bFrames:\\s+(\\d+)\\b");
patterns << new QRegExp("\\bWidth:\\s+(\\d+)\\b"); patterns << new QRegExp("\\bWidth:\\s+(\\d+)\\b");
@ -187,8 +203,9 @@ void VapoursynthSource::checkSourceProperties_parseLine(const QString &line, QLi
void VapoursynthSource::buildCommandLine(QStringList &cmdLine) void VapoursynthSource::buildCommandLine(QStringList &cmdLine)
{ {
cmdLine << "--y4m";
cmdLine << QDir::toNativeSeparators(x264_path2ansi(m_sourceFile, true)); cmdLine << QDir::toNativeSeparators(x264_path2ansi(m_sourceFile, true));
cmdLine << "-" << "-y4m"; cmdLine << "-";
} }
void VapoursynthSource::flushProcess(QProcess &processInput) void VapoursynthSource::flushProcess(QProcess &processInput)

View File

@ -285,7 +285,7 @@ bool VapourSynthCheckThread::checkVapourSynth(const QString vspipePath)
process.setReadChannel(QProcess::StandardOutput); process.setReadChannel(QProcess::StandardOutput);
//Try to start VSPIPE.EXE //Try to start VSPIPE.EXE
process.start(vspipePath, QStringList() << "-version"); process.start(vspipePath, QStringList() << "--version");
if(!process.waitForStarted()) if(!process.waitForStarted())
{ {
qWarning("Failed to launch VSPIPE.EXE -> %s", process.errorString().toUtf8().constData()); qWarning("Failed to launch VSPIPE.EXE -> %s", process.errorString().toUtf8().constData());

View File

@ -949,8 +949,8 @@ void MainWindow::init(void)
if(!m_preferences->getDisableWarnings()) if(!m_preferences->getDisableWarnings())
{ {
QString text = tr("It appears that VapourSynth is <b>not</b> currently installed on your computer.<br>Therefore VapourSynth (.vpy) input will <b>not</b> be working at all!").append("<br><br>"); QString text = tr("It appears that VapourSynth is <b>not</b> currently installed on your computer.<br>Therefore VapourSynth (.vpy) input will <b>not</b> be working at all!").append("<br><br>");
text += tr("Please download and install VapourSynth for Windows (R20 or later):").append("<br>").append(LINK(vsynth_url)).append("<br><br>"); text += tr("Please download and install VapourSynth for Windows (R24 or later):").append("<br>").append(LINK(vsynth_url)).append("<br><br>");
text += tr("Note that Python v3.x is a prerequisite for installing VapourSynth:").append("<br>").append(LINK(python_url)).append("<br>"); text += tr("Note that Python v3.4 is a prerequisite for installing VapourSynth:").append("<br>").append(LINK(python_url)).append("<br>");
const int val = QMessageBox::warning(this, tr("VapourSynth Missing"), QString("<nobr>%1</nobr>").arg(text).replace("-", "&minus;"), tr("Close"), tr("Disable this Warning")); const int val = QMessageBox::warning(this, tr("VapourSynth Missing"), QString("<nobr>%1</nobr>").arg(text).replace("-", "&minus;"), tr("Close"), tr("Disable this Warning"));
if(val == 1) if(val == 1)
{ {