Commit 75d3a9e2 authored by Julius Künzel's avatar Julius Künzel 💬
Browse files

[Rendering] Allow for custom processing thread count

BUG: 430193
FIXED-IN: 22.08
parent 4ca161d5
Pipeline #185988 passed with stage
in 6 minutes and 9 seconds
......@@ -216,14 +216,19 @@ RenderWidget::RenderWidget(bool enableProxy, QWidget *parent)
connect(m_view.rescale_width, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &RenderWidget::slotUpdateRescaleWidth);
connect(m_view.rescale_height, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &RenderWidget::slotUpdateRescaleHeight);
connect(m_view.rescale_keep, &QAbstractButton::clicked, this, &RenderWidget::slotSwitchAspectRatio);
m_view.parallel_process->setChecked(KdenliveSettings::parallelrender());
connect(m_view.parallel_process, &QCheckBox::stateChanged, [&](int state) {
m_view.processing_threads->setMaximum(QThread::idealThreadCount() - 1);
m_view.processing_threads->setValue(KdenliveSettings::processingthreads());
connect(m_view.processing_threads, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &KdenliveSettings::setProcessingthreads);
connect(m_view.processing_threads, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &RenderWidget::refreshParams);
m_view.processing_box->setChecked(KdenliveSettings::parallelrender());
connect(m_view.processing_box, &QGroupBox::toggled, [&](int state) {
KdenliveSettings::setParallelrender(state == Qt::Checked);
refreshParams();
});
if (KdenliveSettings::gpu_accel()) {
// Disable parallel rendering for movit
m_view.parallel_process->setEnabled(false);
m_view.processing_box->setChecked(false);
m_view.processing_box->setEnabled(false);
}
connect(m_view.export_meta, &QCheckBox::stateChanged, this, &RenderWidget::refreshParams);
connect(m_view.checkTwoPass, &QCheckBox::stateChanged, this, &RenderWidget::refreshParams);
......@@ -1295,11 +1300,9 @@ void RenderWidget::refreshParams()
}
// Parallel Processing
int threadCount = QThread::idealThreadCount();
if (threadCount < 2 || !m_view.parallel_process->isChecked() || !m_view.parallel_process->isEnabled()) {
int threadCount = KdenliveSettings::processingthreads();
if (!m_view.processing_box->isChecked() || !m_view.processing_box->isEnabled()) {
threadCount = 1;
} else {
threadCount = qMin(4, threadCount - 1);
}
newParams.append(QStringLiteral("real_time=%1").arg(-threadCount));
......
......@@ -532,9 +532,9 @@
<default></default>
</entry>
<entry name="mltthreads" type="Int">
<label>Mlt processing thread count.</label>
<default>1</default>
<entry name="processingthreads" type="Int">
<label>Processing thread count.</label>
<default>4</default>
</entry>
<entry name="proxythreads" type="Int">
......
......@@ -444,8 +444,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>334</width>
<height>855</height>
<width>313</width>
<height>924</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
......@@ -658,7 +658,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="encoder_box">
<property name="title">
<string>Encoder</string>
</property>
......@@ -698,6 +698,13 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="threadsLabel">
<property name="text">
<string>Threads:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="encoder_threads">
<property name="sizePolicy">
......@@ -714,17 +721,45 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="threadsLabel">
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="processing_box">
<property name="title">
<string>Parallel Processing</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QFormLayout" name="formLayout_3">
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Threads:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="parallel_process">
<item row="1" column="1">
<widget class="QSpinBox" name="processing_threads">
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="KMessageWidget" name="processing_warning">
<property name="text">
<string>Parallel Processing (experimental!)</string>
<string>Parallel processing may cause render artifacts</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="closeButtonVisible">
<bool>false</bool>
</property>
<property name="messageType">
<enum>KMessageWidget::Information</enum>
</property>
</widget>
</item>
......@@ -761,12 +796,6 @@
</item>
<item>
<widget class="QTextEdit" name="advanced_params">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
......@@ -775,19 +804,6 @@
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
......
Supports Markdown
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