Simple x264 Launcher development repository
修订版 | a348b67891c0dc90fedc5c7d7d423d024ad0cf79 (tree) |
---|---|
时间 | 2017-01-08 05:54:06 |
作者 | ![]() |
Commiter | lordmulder |
Fixed parsing of source properties for new Avs2YUV version.
@@ -87,7 +87,7 @@ protected: | ||
87 | 87 | virtual void buildCommandLine(QStringList &cmdLine, const bool &usePipe, const ClipInfo &clipInfo, const QString &indexFile, const int &pass, const QString &passLogFile) = 0; |
88 | 88 | |
89 | 89 | 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; | |
91 | 91 | |
92 | 92 | static double estimateSize(const QString &fileName, const double &progress); |
93 | 93 | static QString sizeToString(qint64 size); |
@@ -252,7 +252,7 @@ void NVEncEncoder::checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmd | ||
252 | 252 | patterns << new QRegExp("\\bNVEncC\\s+\\(x\\d+\\)\\s+(\\d)\\.(\\d+).*\\[NVENC\\s+API\\s+v(\\d+)\\.(\\d+)\\]", Qt::CaseInsensitive); |
253 | 253 | } |
254 | 254 | |
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) | |
256 | 256 | { |
257 | 257 | if(patterns[0]->lastIndexIn(line) >= 0) |
258 | 258 | { |
@@ -389,7 +389,7 @@ void NVEncEncoder::runEncodingPass_init(QList<QRegExp*> &patterns) | ||
389 | 389 | patterns << new QRegExp("nvEncodeAPI.dll\\s+does\\s+not\\s+exists\\s+in\\s+your\\s+system", Qt::CaseInsensitive); |
390 | 390 | } |
391 | 391 | |
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) | |
393 | 393 | { |
394 | 394 | int offset = -1; |
395 | 395 | if((offset = patterns[0]->lastIndexIn(line)) >= 0) |
@@ -42,9 +42,9 @@ protected: | ||
42 | 42 | virtual void buildCommandLine(QStringList &cmdLine, const bool &usePipe, const ClipInfo &clipInfo, const QString &indexFile, const int &pass, const QString &passLogFile); |
43 | 43 | |
44 | 44 | 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); | |
46 | 46 | virtual bool checkVersion_succeeded(const int &exitCode); |
47 | 47 | |
48 | 48 | 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); | |
50 | 50 | }; |
@@ -234,7 +234,7 @@ void X264Encoder::checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmdL | ||
234 | 234 | patterns << new QRegExp("\\bx264\\s+(\\d)\\.(\\d+)\\.(\\d+)", Qt::CaseInsensitive); |
235 | 235 | } |
236 | 236 | |
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) | |
238 | 238 | { |
239 | 239 | if(patterns[0]->lastIndexIn(line) >= 0) |
240 | 240 | { |
@@ -398,7 +398,7 @@ void X264Encoder::runEncodingPass_init(QList<QRegExp*> &patterns) | ||
398 | 398 | patterns << new QRegExp("\\[\\s*(\\d+)\\.(\\d+)%\\]\\s+(\\d+)/(\\d+)\\s(\\d+).(\\d+)\\s(\\d+).(\\d+)\\s+(\\d+):(\\d+):(\\d+)\\s+(\\d+):(\\d+):(\\d+)"); //regExpModified |
399 | 399 | } |
400 | 400 | |
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) | |
402 | 402 | { |
403 | 403 | int offset = -1; |
404 | 404 | if((offset = patterns[0]->lastIndexIn(line)) >= 0) |
@@ -42,9 +42,9 @@ protected: | ||
42 | 42 | virtual void buildCommandLine(QStringList &cmdLine, const bool &usePipe, const ClipInfo &clipInfo, const QString &indexFile, const int &pass, const QString &passLogFile); |
43 | 43 | |
44 | 44 | 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); | |
46 | 46 | |
47 | 47 | 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); | |
49 | 49 | |
50 | 50 | }; |
@@ -230,7 +230,7 @@ void X265Encoder::checkVersion_init(QList<QRegExp*> &patterns, QStringList &cmdL | ||
230 | 230 | patterns << new QRegExp("\\bHEVC\\s+encoder\\s+version\\s+(\\d)\\.(\\d+)\\b", Qt::CaseInsensitive); |
231 | 231 | } |
232 | 232 | |
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) | |
234 | 234 | { |
235 | 235 | int offset = -1; |
236 | 236 |
@@ -387,7 +387,7 @@ void X265Encoder::runEncodingPass_init(QList<QRegExp*> &patterns) | ||
387 | 387 | patterns << new QRegExp("\\[\\s*(\\d+)\\.(\\d+)%\\]\\s+(\\d+)/(\\d+)\\s(\\d+).(\\d+)\\s(\\d+).(\\d+)\\s+(\\d+):(\\d+):(\\d+)\\s+(\\d+):(\\d+):(\\d+)"); //regExpModified |
388 | 388 | } |
389 | 389 | |
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) | |
391 | 391 | { |
392 | 392 | int offset = -1; |
393 | 393 | if((offset = patterns[0]->lastIndexIn(line)) >= 0) |
@@ -42,8 +42,8 @@ protected: | ||
42 | 42 | virtual void buildCommandLine(QStringList &cmdLine, const bool &usePipe, const ClipInfo &clipInfo, const QString &indexFile, const int &pass, const QString &passLogFile); |
43 | 43 | |
44 | 44 | 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); | |
46 | 46 | |
47 | 47 | 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); | |
49 | 49 | }; |
@@ -51,7 +51,7 @@ public: | ||
51 | 51 | |
52 | 52 | protected: |
53 | 53 | 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; | |
55 | 55 | |
56 | 56 | virtual void buildCommandLine(QStringList &cmdLine) = 0; |
57 | 57 |
@@ -105,7 +105,7 @@ void AvisynthSource::checkVersion_init(QList<QRegExp*> &patterns, QStringList &c | ||
105 | 105 | patterns << new QRegExp("\\bAvs2YUV (\\d+).(\\d+)bm(\\d)\\b", Qt::CaseInsensitive); |
106 | 106 | } |
107 | 107 | |
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) | |
109 | 109 | { |
110 | 110 | int offset = -1; |
111 | 111 |
@@ -178,54 +178,30 @@ void AvisynthSource::checkSourceProperties_init(QList<QRegExp*> &patterns, QStri | ||
178 | 178 | cmdLine << "-frames" << "1"; |
179 | 179 | cmdLine << QDir::toNativeSeparators(x264_path2ansi(m_sourceFile, true)) << "NUL"; |
180 | 180 | |
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"); | |
183 | 183 | } |
184 | 184 | |
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) | |
186 | 186 | { |
187 | 187 | int offset = -1; |
188 | + quint32 temp[5]; | |
188 | 189 | |
189 | 190 | if((offset = patterns[0]->lastIndexIn(line)) >= 0) |
190 | 191 | { |
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)) | |
198 | 193 | { |
199 | 194 | clipInfo.setFrameSize(temp[0], temp[1]); |
200 | - } | |
201 | - if (ok[2]) | |
202 | - { | |
203 | 195 | clipInfo.setFrameRate(temp[2], 0); |
204 | - } | |
205 | - if (ok[3]) | |
206 | - { | |
207 | 196 | clipInfo.setFrameCount(temp[3]); |
208 | 197 | } |
209 | 198 | } |
210 | 199 | else if((offset = patterns[1]->lastIndexIn(line)) >= 0) |
211 | 200 | { |
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)) | |
220 | 202 | { |
221 | 203 | clipInfo.setFrameSize(temp[0], temp[1]); |
222 | - } | |
223 | - if (ok[2] && ok[3]) | |
224 | - { | |
225 | 204 | clipInfo.setFrameRate(temp[2], temp[3]); |
226 | - } | |
227 | - if (ok[4]) | |
228 | - { | |
229 | 205 | clipInfo.setFrameCount(temp[4]); |
230 | 206 | } |
231 | 207 | } |
@@ -43,11 +43,11 @@ public: | ||
43 | 43 | |
44 | 44 | protected: |
45 | 45 | 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); | |
47 | 47 | virtual bool checkVersion_succeeded(const int &exitCode); |
48 | 48 | |
49 | 49 | 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); | |
51 | 51 | |
52 | 52 | 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)))); } |
53 | 53 | 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)))); } |
@@ -95,7 +95,7 @@ void VapoursynthSource::checkVersion_init(QList<QRegExp*> &patterns, QStringList | ||
95 | 95 | patterns << new QRegExp("\\bAPI\\s+r(\\d+)\\b", Qt::CaseInsensitive); |
96 | 96 | } |
97 | 97 | |
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) | |
99 | 99 | { |
100 | 100 | int offset = -1; |
101 | 101 |
@@ -171,7 +171,7 @@ void VapoursynthSource::checkSourceProperties_init(QList<QRegExp*> &patterns, QS | ||
171 | 171 | patterns << new QRegExp("\\bFPS:\\s+(\\d+)/(\\d+)\\b"); |
172 | 172 | } |
173 | 173 | |
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) | |
175 | 175 | { |
176 | 176 | int offset = -1; |
177 | 177 |
@@ -43,10 +43,10 @@ public: | ||
43 | 43 | |
44 | 44 | protected: |
45 | 45 | 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); | |
47 | 47 | |
48 | 48 | 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); | |
50 | 50 | |
51 | 51 | 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)))); } |
52 | 52 | virtual void buildCommandLine(QStringList &cmdLine); |
@@ -67,7 +67,7 @@ protected: | ||
67 | 67 | virtual QStringList getExtraPaths(void) const { return QStringList(); } |
68 | 68 | |
69 | 69 | 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; | |
71 | 71 | virtual bool checkVersion_succeeded(const int &exitCode); |
72 | 72 | |
73 | 73 | void log(const QString &text) { emit messageLogged(text); } |
@@ -26,7 +26,7 @@ | ||
26 | 26 | #define VER_X264_MAJOR 2 |
27 | 27 | #define VER_X264_MINOR 7 |
28 | 28 | #define VER_X264_PATCH 8 |
29 | -#define VER_X264_BUILD 1082 | |
29 | +#define VER_X264_BUILD 1084 | |
30 | 30 | |
31 | 31 | #define VER_X264_PORTABLE_EDITION (0) |
32 | 32 |