• R/O
  • HTTP
  • SSH
  • HTTPS

x264-launcher: Commit

Simple x264 Launcher development repository


Commit MetaInfo

Revisiona348b67891c0dc90fedc5c7d7d423d024ad0cf79 (tree)
Zeit2017-01-08 05:54:06
Autorlordmulder <mulder2@gmx....>
Commiterlordmulder

Log Message

Fixed parsing of source properties for new Avs2YUV version.

Ändern Zusammenfassung

Diff

--- a/src/encoder_abstract.h
+++ b/src/encoder_abstract.h
@@ -87,7 +87,7 @@ protected:
8787 virtual void buildCommandLine(QStringList &cmdLine, const bool &usePipe, const ClipInfo &clipInfo, const QString &indexFile, const int &pass, const QString &passLogFile) = 0;
8888
8989 virtual void runEncodingPass_init(QList<QRegExp*> &patterns) = 0;
90- virtual void runEncodingPass_parseLine(const QString &line, QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate) = 0;
90+ virtual void runEncodingPass_parseLine(const QString &line, const QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate) = 0;
9191
9292 static double estimateSize(const QString &fileName, const double &progress);
9393 static QString sizeToString(qint64 size);
--- a/src/encoder_nvenc.cpp
+++ b/src/encoder_nvenc.cpp
@@ -252,7 +252,7 @@ void NVEncEncoder::checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmd
252252 patterns << new QRegExp("\\bNVEncC\\s+\\(x\\d+\\)\\s+(\\d)\\.(\\d+).*\\[NVENC\\s+API\\s+v(\\d+)\\.(\\d+)\\]", Qt::CaseInsensitive);
253253 }
254254
255-void NVEncEncoder::checkVersion_parseLine(const QString &line, QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified)
255+void NVEncEncoder::checkVersion_parseLine(const QString &line, const QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified)
256256 {
257257 if(patterns[0]->lastIndexIn(line) >= 0)
258258 {
@@ -389,7 +389,7 @@ void NVEncEncoder::runEncodingPass_init(QList<QRegExp*> &patterns)
389389 patterns << new QRegExp("nvEncodeAPI.dll\\s+does\\s+not\\s+exists\\s+in\\s+your\\s+system", Qt::CaseInsensitive);
390390 }
391391
392-void NVEncEncoder::runEncodingPass_parseLine(const QString &line, QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate)
392+void NVEncEncoder::runEncodingPass_parseLine(const QString &line, const QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate)
393393 {
394394 int offset = -1;
395395 if((offset = patterns[0]->lastIndexIn(line)) >= 0)
--- a/src/encoder_nvenc.h
+++ b/src/encoder_nvenc.h
@@ -42,9 +42,9 @@ protected:
4242 virtual void buildCommandLine(QStringList &cmdLine, const bool &usePipe, const ClipInfo &clipInfo, const QString &indexFile, const int &pass, const QString &passLogFile);
4343
4444 virtual void checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmdLine);
45- virtual void checkVersion_parseLine(const QString &line, QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified);
45+ virtual void checkVersion_parseLine(const QString &line, const QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified);
4646 virtual bool checkVersion_succeeded(const int &exitCode);
4747
4848 virtual void runEncodingPass_init(QList<QRegExp*> &patterns);
49- virtual void runEncodingPass_parseLine(const QString &line, QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate);
49+ virtual void runEncodingPass_parseLine(const QString &line, const QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate);
5050 };
--- a/src/encoder_x264.cpp
+++ b/src/encoder_x264.cpp
@@ -234,7 +234,7 @@ void X264Encoder::checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmdL
234234 patterns << new QRegExp("\\bx264\\s+(\\d)\\.(\\d+)\\.(\\d+)", Qt::CaseInsensitive);
235235 }
236236
237-void X264Encoder::checkVersion_parseLine(const QString &line, QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified)
237+void X264Encoder::checkVersion_parseLine(const QString &line, const QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified)
238238 {
239239 if(patterns[0]->lastIndexIn(line) >= 0)
240240 {
@@ -398,7 +398,7 @@ void X264Encoder::runEncodingPass_init(QList<QRegExp*> &patterns)
398398 patterns << new QRegExp("\\[\\s*(\\d+)\\.(\\d+)%\\]\\s+(\\d+)/(\\d+)\\s(\\d+).(\\d+)\\s(\\d+).(\\d+)\\s+(\\d+):(\\d+):(\\d+)\\s+(\\d+):(\\d+):(\\d+)"); //regExpModified
399399 }
400400
401-void X264Encoder::runEncodingPass_parseLine(const QString &line, QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate)
401+void X264Encoder::runEncodingPass_parseLine(const QString &line, const QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate)
402402 {
403403 int offset = -1;
404404 if((offset = patterns[0]->lastIndexIn(line)) >= 0)
--- a/src/encoder_x264.h
+++ b/src/encoder_x264.h
@@ -42,9 +42,9 @@ protected:
4242 virtual void buildCommandLine(QStringList &cmdLine, const bool &usePipe, const ClipInfo &clipInfo, const QString &indexFile, const int &pass, const QString &passLogFile);
4343
4444 virtual void checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmdLine);
45- virtual void checkVersion_parseLine(const QString &line, QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified);
45+ virtual void checkVersion_parseLine(const QString &line, const QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified);
4646
4747 virtual void runEncodingPass_init(QList<QRegExp*> &patterns);
48- virtual void runEncodingPass_parseLine(const QString &line, QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate);
48+ virtual void runEncodingPass_parseLine(const QString &line, const QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate);
4949
5050 };
--- a/src/encoder_x265.cpp
+++ b/src/encoder_x265.cpp
@@ -230,7 +230,7 @@ void X265Encoder::checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmdL
230230 patterns << new QRegExp("\\bHEVC\\s+encoder\\s+version\\s+(\\d)\\.(\\d+)\\b", Qt::CaseInsensitive);
231231 }
232232
233-void X265Encoder::checkVersion_parseLine(const QString &line, QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified)
233+void X265Encoder::checkVersion_parseLine(const QString &line, const QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified)
234234 {
235235 int offset = -1;
236236
@@ -387,7 +387,7 @@ void X265Encoder::runEncodingPass_init(QList<QRegExp*> &patterns)
387387 patterns << new QRegExp("\\[\\s*(\\d+)\\.(\\d+)%\\]\\s+(\\d+)/(\\d+)\\s(\\d+).(\\d+)\\s(\\d+).(\\d+)\\s+(\\d+):(\\d+):(\\d+)\\s+(\\d+):(\\d+):(\\d+)"); //regExpModified
388388 }
389389
390-void X265Encoder::runEncodingPass_parseLine(const QString &line, QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate)
390+void X265Encoder::runEncodingPass_parseLine(const QString &line, const QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate)
391391 {
392392 int offset = -1;
393393 if((offset = patterns[0]->lastIndexIn(line)) >= 0)
--- a/src/encoder_x265.h
+++ b/src/encoder_x265.h
@@ -42,8 +42,8 @@ protected:
4242 virtual void buildCommandLine(QStringList &cmdLine, const bool &usePipe, const ClipInfo &clipInfo, const QString &indexFile, const int &pass, const QString &passLogFile);
4343
4444 virtual void checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmdLine);
45- virtual void checkVersion_parseLine(const QString &line, QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified);
45+ virtual void checkVersion_parseLine(const QString &line, const QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified);
4646
4747 virtual void runEncodingPass_init(QList<QRegExp*> &patterns);
48- virtual void runEncodingPass_parseLine(const QString &line, QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate);
48+ virtual void runEncodingPass_parseLine(const QString &line, const QList<QRegExp*> &patterns, const ClipInfo &clipInfo, const int &pass, double &last_progress, double &size_estimate);
4949 };
--- a/src/source_abstract.h
+++ b/src/source_abstract.h
@@ -51,7 +51,7 @@ public:
5151
5252 protected:
5353 virtual void checkSourceProperties_init(QList<QRegExp*> &patterns, QStringList &cmdLine) = 0;
54- virtual void checkSourceProperties_parseLine(const QString &line, QList<QRegExp*> &patterns, ClipInfo &clipInfo) = 0;
54+ virtual void checkSourceProperties_parseLine(const QString &line, const QList<QRegExp*> &patterns, ClipInfo &clipInfo) = 0;
5555
5656 virtual void buildCommandLine(QStringList &cmdLine) = 0;
5757
--- a/src/source_avisynth.cpp
+++ b/src/source_avisynth.cpp
@@ -105,7 +105,7 @@ void AvisynthSource::checkVersion_init(QList<QRegExp*> &patterns, QStringList &c
105105 patterns << new QRegExp("\\bAvs2YUV (\\d+).(\\d+)bm(\\d)\\b", Qt::CaseInsensitive);
106106 }
107107
108-void AvisynthSource::checkVersion_parseLine(const QString &line, QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified)
108+void AvisynthSource::checkVersion_parseLine(const QString &line, const QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified)
109109 {
110110 int offset = -1;
111111
@@ -178,54 +178,30 @@ void AvisynthSource::checkSourceProperties_init(QList<QRegExp*> &patterns, QStri
178178 cmdLine << "-frames" << "1";
179179 cmdLine << QDir::toNativeSeparators(x264_path2ansi(m_sourceFile, true)) << "NUL";
180180
181- patterns << new QRegExp(": (\\d+)x(\\d+), (\\d+) fps, (\\d+) frames");
182- patterns << new QRegExp(": (\\d+)x(\\d+), (\\d+)/(\\d+) fps, (\\d+) frames");
181+ patterns << new QRegExp(":\\s+(\\d+)\\s*x\\s*(\\d+)\\s*,\\s+\\w+\\s*,\\s+\\d+-bits\\s*,\\s+\\w+\\s*,\\s+(\\d+)\\s+fps\\s*,\\s+(\\d+)\\s+frames");
182+ patterns << new QRegExp(":\\s+(\\d+)\\s*x\\s*(\\d+)\\s*,\\s+\\w+\\s*,\\s+\\d+-bits\\s*,\\s+\\w+\\s*,\\s+(\\d+)\\s*/\\s*(\\d+)\\s+fps\\s*,\\s+(\\d+)\\s+frames");
183183 }
184184
185-void AvisynthSource::checkSourceProperties_parseLine(const QString &line, QList<QRegExp*> &patterns, ClipInfo &clipInfo)
185+void AvisynthSource::checkSourceProperties_parseLine(const QString &line, const QList<QRegExp*> &patterns, ClipInfo &clipInfo)
186186 {
187187 int offset = -1;
188+ quint32 temp[5];
188189
189190 if((offset = patterns[0]->lastIndexIn(line)) >= 0)
190191 {
191- bool ok[4] = { false, false, false, false };
192- quint32 temp[4];
193- temp[0] = patterns[0]->cap(1).toUInt(&ok[0]);
194- temp[1] = patterns[0]->cap(2).toUInt(&ok[1]);
195- temp[2] = patterns[0]->cap(3).toUInt(&ok[2]);
196- temp[3] = patterns[0]->cap(4).toUInt(&ok[3]);
197- if (ok[0] && ok[1])
192+ if (MUtils::regexp_parse_uint32((*patterns[0]), temp, 4))
198193 {
199194 clipInfo.setFrameSize(temp[0], temp[1]);
200- }
201- if (ok[2])
202- {
203195 clipInfo.setFrameRate(temp[2], 0);
204- }
205- if (ok[3])
206- {
207196 clipInfo.setFrameCount(temp[3]);
208197 }
209198 }
210199 else if((offset = patterns[1]->lastIndexIn(line)) >= 0)
211200 {
212- bool ok[5] = { false, false, false, false, false };
213- quint32 temp[5];
214- temp[0] = patterns[1]->cap(1).toUInt(&ok[0]);
215- temp[1] = patterns[1]->cap(2).toUInt(&ok[1]);
216- temp[2] = patterns[1]->cap(3).toUInt(&ok[2]);
217- temp[3] = patterns[1]->cap(4).toUInt(&ok[3]);
218- temp[4] = patterns[1]->cap(5).toUInt(&ok[4]);
219- if (ok[0] && ok[1])
201+ if (MUtils::regexp_parse_uint32((*patterns[1]), temp, 5))
220202 {
221203 clipInfo.setFrameSize(temp[0], temp[1]);
222- }
223- if (ok[2] && ok[3])
224- {
225204 clipInfo.setFrameRate(temp[2], temp[3]);
226- }
227- if (ok[4])
228- {
229205 clipInfo.setFrameCount(temp[4]);
230206 }
231207 }
--- a/src/source_avisynth.h
+++ b/src/source_avisynth.h
@@ -43,11 +43,11 @@ public:
4343
4444 protected:
4545 virtual void checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmdLine);
46- virtual void checkVersion_parseLine(const QString &line, QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified);
46+ virtual void checkVersion_parseLine(const QString &line, const QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified);
4747 virtual bool checkVersion_succeeded(const int &exitCode);
4848
4949 virtual void checkSourceProperties_init(QList<QRegExp*> &patterns, QStringList &cmdLine);
50- virtual void checkSourceProperties_parseLine(const QString &line, QList<QRegExp*> &patterns, ClipInfo &clipInfo);
50+ virtual void checkSourceProperties_parseLine(const QString &line, const QList<QRegExp*> &patterns, ClipInfo &clipInfo);
5151
5252 virtual QString getBinaryPath(void) const { return getSourceInfo().getBinaryPath(m_sysinfo, m_sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64) && m_sysinfo->getAvisynth(SysinfoModel::Avisynth_X64) && (m_preferences->getPrefer64BitSource() || (!m_sysinfo->getAvisynth(SysinfoModel::Avisynth_X86)))); }
5353 virtual QStringList getExtraPath(void) const { return getSourceInfo().getExtraPaths(m_sysinfo, m_sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64) && m_sysinfo->getAvisynth(SysinfoModel::Avisynth_X64) && (m_preferences->getPrefer64BitSource() || (!m_sysinfo->getAvisynth(SysinfoModel::Avisynth_X86)))); }
--- a/src/source_vapoursynth.cpp
+++ b/src/source_vapoursynth.cpp
@@ -95,7 +95,7 @@ void VapoursynthSource::checkVersion_init(QList<QRegExp*> &patterns, QStringList
9595 patterns << new QRegExp("\\bAPI\\s+r(\\d+)\\b", Qt::CaseInsensitive);
9696 }
9797
98-void VapoursynthSource::checkVersion_parseLine(const QString &line, QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified)
98+void VapoursynthSource::checkVersion_parseLine(const QString &line, const QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified)
9999 {
100100 int offset = -1;
101101
@@ -171,7 +171,7 @@ void VapoursynthSource::checkSourceProperties_init(QList<QRegExp*> &patterns, QS
171171 patterns << new QRegExp("\\bFPS:\\s+(\\d+)/(\\d+)\\b");
172172 }
173173
174-void VapoursynthSource::checkSourceProperties_parseLine(const QString &line, QList<QRegExp*> &patterns, ClipInfo &clipInfo)
174+void VapoursynthSource::checkSourceProperties_parseLine(const QString &line, const QList<QRegExp*> &patterns, ClipInfo &clipInfo)
175175 {
176176 int offset = -1;
177177
--- a/src/source_vapoursynth.h
+++ b/src/source_vapoursynth.h
@@ -43,10 +43,10 @@ public:
4343
4444 protected:
4545 virtual void checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmdLine);
46- virtual void checkVersion_parseLine(const QString &line, QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified);
46+ virtual void checkVersion_parseLine(const QString &line, const QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified);
4747
4848 virtual void checkSourceProperties_init(QList<QRegExp*> &patterns, QStringList &cmdLine);
49- virtual void checkSourceProperties_parseLine(const QString &line, QList<QRegExp*> &patterns, ClipInfo &clipInfo);
49+ virtual void checkSourceProperties_parseLine(const QString &line, const QList<QRegExp*> &patterns, ClipInfo &clipInfo);
5050
5151 virtual QString getBinaryPath() const { return getSourceInfo().getBinaryPath(m_sysinfo, m_sysinfo->getCPUFeatures(SysinfoModel::CPUFeatures_X64) && m_sysinfo->getVapourSynth(SysinfoModel::VapourSynth_X64) && (m_preferences->getPrefer64BitSource() || (!m_sysinfo->getVapourSynth(SysinfoModel::VapourSynth_X86)))); }
5252 virtual void buildCommandLine(QStringList &cmdLine);
--- a/src/tool_abstract.h
+++ b/src/tool_abstract.h
@@ -67,7 +67,7 @@ protected:
6767 virtual QStringList getExtraPaths(void) const { return QStringList(); }
6868
6969 virtual void checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmdLine) = 0;
70- virtual void checkVersion_parseLine(const QString &line, QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified) = 0;
70+ virtual void checkVersion_parseLine(const QString &line, const QList<QRegExp*> &patterns, unsigned int &core, unsigned int &build, bool &modified) = 0;
7171 virtual bool checkVersion_succeeded(const int &exitCode);
7272
7373 void log(const QString &text) { emit messageLogged(text); }
--- a/src/version.h
+++ b/src/version.h
@@ -26,7 +26,7 @@
2626 #define VER_X264_MAJOR 2
2727 #define VER_X264_MINOR 7
2828 #define VER_X264_PATCH 8
29-#define VER_X264_BUILD 1082
29+#define VER_X264_BUILD 1084
3030
3131 #define VER_X264_PORTABLE_EDITION (0)
3232
Show on old repository browser