MCPcopy Create free account
hub / github.com/Tencent/libpag / readEndParam

Method readEndParam

exporter/src/export/encode/OfflineVideoEncoder.cpp:239–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239bool OfflineVideoEncoder::readEndParam(bool& hasEnd, bool& earlyExit, const std::string& filePath) {
240 QFile file(filePath.data());
241 if (!file.open(QIODevice::ReadOnly)) {
242 return false;
243 }
244
245 QJsonParseError parseError;
246 QJsonDocument doc = QJsonDocument::fromJson(file.readAll(), &parseError);
247 file.close();
248 if (parseError.error != QJsonParseError::NoError) {
249 return false;
250 }
251
252 if (doc.isObject()) {
253 QJsonObject obj = doc.object();
254 hasEnd = obj.value("HasEnd").toInt() == 1;
255 earlyExit = obj.value("EarlyExit").toInt() == 1;
256 return true;
257 }
258 return false;
259}
260
261bool OfflineVideoEncoder::writeEndParam(bool hasEnd, bool earlyExit, const std::string& filePath) {
262 std::string endData = QString(R"({ "HasEnd": %1, "EarlyExit": %2 })")

Callers

nothing calls this directly

Calls 4

valueMethod · 0.80
dataMethod · 0.45
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected