Commit 759ca9bb authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Dynamically update max number of concurrent proxy/transcode jobs, don't show...

Dynamically update max number of concurrent proxy/transcode jobs, don't show error message on job abort
BUG: 432365
parent 212f3a58
Pipeline #69202 canceled with stage
......@@ -1202,6 +1202,13 @@ void KdenliveSettingsDialog::updateSettings()
std::sort(mimes.begin(), mimes.end());
m_configEnv.supportedmimes->setPlainText(mimes.join(QLatin1Char(' ')));
}
// procx/transcode max concurrent jobs
if (m_configEnv.kcfg_proxythreads->value() != KdenliveSettings::proxythreads()) {
KdenliveSettings::setProxythreads(m_configEnv.kcfg_proxythreads->value());
pCore->taskManager.updateConcurrency();
}
KConfigDialog::settingsChangedSlot();
// KConfigDialog::updateSettings();
......
......@@ -700,9 +700,7 @@ void ClipLoadTask::abort()
void ClipLoadTask::doProposeTranscode(const QString &resource)
{
QAction *ac = new QAction(i18n("Transcode"), m_object);
qDebug()<<"=== PREPARING TRANSCODE!!!";
QObject::connect(ac, &QAction::triggered, [resource]() {
//QMetaObject::invokeMethod(pCore.get(), "transcodeFile", Qt::QueuedConnection, Q_ARG(QString, resource));
pCore->transcodeFile(resource);
});
QList<QAction*>actions = {ac};
......
......@@ -382,8 +382,10 @@ void ProxyTask::run()
} else {
// Proxy process crashed
QFile::remove(dest);
QMetaObject::invokeMethod(pCore.get(), "displayBinLogMessage", Qt::QueuedConnection, Q_ARG(QString, i18n("Failed to create proxy clip.")),
if (!m_isCanceled) {
QMetaObject::invokeMethod(pCore.get(), "displayBinLogMessage", Qt::QueuedConnection, Q_ARG(QString, i18n("Failed to create proxy clip.")),
Q_ARG(int, int(KMessageWidget::Warning)), Q_ARG(QString, m_logDetails));
}
}
return;
}
......
......@@ -39,7 +39,6 @@ TaskManager::TaskManager(QObject *parent)
{
int maxThreads = qMin(4, QThread::idealThreadCount() - 1);
m_taskPool.setMaxThreadCount(qMax(maxThreads, 1));
// TODO: make configurable for user to adjust to GPU
m_transcodePool.setMaxThreadCount(KdenliveSettings::proxythreads());
}
......@@ -48,6 +47,11 @@ TaskManager::~TaskManager()
slotCancelJobs();
}
void TaskManager::updateConcurrency()
{
m_transcodePool.setMaxThreadCount(KdenliveSettings::proxythreads());
}
void TaskManager::discardJobs(const ObjectId &owner, AbstractTask::JOBTYPE type, bool softDelete)
{
qDebug()<<"========== READY FOR TASK DELETION ON: "<<owner.second;
......
......@@ -73,6 +73,9 @@ public:
/** @brief Remove a finished task */
void taskDone(int cid, AbstractTask *task);
/** @brief Update the number of concurrent jobs allowed */
void updateConcurrency();
/** @brief return the message of a given job on a given clip (message, detailed log)*/
//QPair<QString, QString> getJobMessageForClip(int jobId, const QString &binId) const;
......
......@@ -228,9 +228,11 @@ void TranscodeTask::run()
}
} else {
// Proxy process crashed
QFile::remove(destUrl);;
QMetaObject::invokeMethod(pCore.get(), "displayBinLogMessage", Qt::QueuedConnection, Q_ARG(QString, i18n("Failed to create file.")),
QFile::remove(destUrl);
if (!m_isCanceled) {
QMetaObject::invokeMethod(pCore.get(), "displayBinLogMessage", Qt::QueuedConnection, Q_ARG(QString, i18n("Failed to create file.")),
Q_ARG(int, int(KMessageWidget::Warning)), Q_ARG(QString, m_logDetails));
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment