From 6d7a0bc4ce57128bafcdf2f193d1b68b52a35d00 Mon Sep 17 00:00:00 2001 From: lordmulder Date: Wed, 13 Aug 2014 16:07:57 +0200 Subject: [PATCH] Added support for VapourSynth r24+. Minimum required version is now r24! --- src/source_vapoursynth.cpp | 29 +++++++++++++++++++++++------ src/thread_vapoursynth.cpp | 2 +- src/win_main.cpp | 4 ++-- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/source_vapoursynth.cpp b/src/source_vapoursynth.cpp index 2dc8cb7..eef15f8 100644 --- a/src/source_vapoursynth.cpp +++ b/src/source_vapoursynth.cpp @@ -31,7 +31,8 @@ #include #include -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) : @@ -68,7 +69,7 @@ bool VapoursynthSource::isSourceAvailable() void VapoursynthSource::checkVersion_init(QList &patterns, QStringList &cmdLine) { - cmdLine << "-version"; + cmdLine << "--version"; patterns << new QRegExp("\\bVapourSynth\\b", Qt::CaseInsensitive); patterns << new QRegExp("\\bCore\\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; 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/")); 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; } @@ -125,8 +140,9 @@ bool VapoursynthSource::isVersionSupported(const unsigned int &revision, const b void VapoursynthSource::checkSourceProperties_init(QList &patterns, QStringList &cmdLine) { + cmdLine << "--info"; cmdLine << QDir::toNativeSeparators(x264_path2ansi(m_sourceFile, true)); - cmdLine << "-" << "-info"; + cmdLine << "-"; patterns << new QRegExp("\\bFrames:\\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) { + cmdLine << "--y4m"; cmdLine << QDir::toNativeSeparators(x264_path2ansi(m_sourceFile, true)); - cmdLine << "-" << "-y4m"; + cmdLine << "-"; } void VapoursynthSource::flushProcess(QProcess &processInput) diff --git a/src/thread_vapoursynth.cpp b/src/thread_vapoursynth.cpp index 3108817..2ed28a3 100644 --- a/src/thread_vapoursynth.cpp +++ b/src/thread_vapoursynth.cpp @@ -285,7 +285,7 @@ bool VapourSynthCheckThread::checkVapourSynth(const QString vspipePath) process.setReadChannel(QProcess::StandardOutput); //Try to start VSPIPE.EXE - process.start(vspipePath, QStringList() << "-version"); + process.start(vspipePath, QStringList() << "--version"); if(!process.waitForStarted()) { qWarning("Failed to launch VSPIPE.EXE -> %s", process.errorString().toUtf8().constData()); diff --git a/src/win_main.cpp b/src/win_main.cpp index 6e856ba..7f95692 100644 --- a/src/win_main.cpp +++ b/src/win_main.cpp @@ -949,8 +949,8 @@ void MainWindow::init(void) if(!m_preferences->getDisableWarnings()) { QString text = tr("It appears that VapourSynth is not currently installed on your computer.
Therefore VapourSynth (.vpy) input will not be working at all!").append("

"); - text += tr("Please download and install VapourSynth for Windows (R20 or later):").append("
").append(LINK(vsynth_url)).append("

"); - text += tr("Note that Python v3.x is a prerequisite for installing VapourSynth:").append("
").append(LINK(python_url)).append("
"); + text += tr("Please download and install VapourSynth for Windows (R24 or later):").append("
").append(LINK(vsynth_url)).append("

"); + text += tr("Note that Python v3.4 is a prerequisite for installing VapourSynth:").append("
").append(LINK(python_url)).append("
"); const int val = QMessageBox::warning(this, tr("VapourSynth Missing"), QString("%1").arg(text).replace("-", "−"), tr("Close"), tr("Disable this Warning")); if(val == 1) {