Commit 2f60cb22 authored by Eden Abitbol's avatar Eden Abitbol Committed by Andreas Traczyk

A/V settings: Add toggle switch for enabling hardware acceleration

Slot for ui connection when enable toggle is clicked was added.

Harware acceleration setting is imported and applied every time
the A/V settings are pupulated.

Change-Id: Ic7b5989541b980d3a4f60695abd2d846ca0e074f
parent 0d4cee6f
...@@ -775,6 +775,8 @@ void SettingsWidget::setConnections() ...@@ -775,6 +775,8 @@ void SettingsWidget::setConnections()
// audio / visual settings // audio / visual settings
connect(ui->recordPathButton, &QPushButton::clicked, this, &SettingsWidget::openRecordFolderSlot); connect(ui->recordPathButton, &QPushButton::clicked, this, &SettingsWidget::openRecordFolderSlot);
connect(ui->hardwareAccelCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::slotSetHardwareAccel);
} }
// ************************* General Settings ************************* // ************************* General Settings *************************
...@@ -940,6 +942,9 @@ void SettingsWidget::populateAVSettings() ...@@ -940,6 +942,9 @@ void SettingsWidget::populateAVSettings()
if (shouldReinitializePreview) { if (shouldReinitializePreview) {
showPreview(); showPreview();
} }
auto encodeAccel = LRCInstance::avModel().getHardwareAcceleration();
ui->hardwareAccelCheckBox->setChecked(encodeAccel);
} }
void SettingsWidget::outputDevIndexChangedSlot(int index) void SettingsWidget::outputDevIndexChangedSlot(int index)
...@@ -1046,3 +1051,8 @@ void SettingsWidget::setFormatListForDevice(const std::string& device) ...@@ -1046,3 +1051,8 @@ void SettingsWidget::setFormatListForDevice(const std::string& device)
ui->formatBox->blockSignals(false); ui->formatBox->blockSignals(false);
} }
void SettingsWidget::slotSetHardwareAccel(bool state)
{
LRCInstance::avModel().setHardwareAcceleration(state);
}
...@@ -136,4 +136,5 @@ private slots: ...@@ -136,4 +136,5 @@ private slots:
void inputdevIndexChangedSlot(int index); void inputdevIndexChangedSlot(int index);
void slotDeviceBoxCurrentIndexChanged(int index); void slotDeviceBoxCurrentIndexChanged(int index);
void slotFormatBoxCurrentIndexChanged(int index); void slotFormatBoxCurrentIndexChanged(int index);
void slotSetHardwareAccel(bool state);
}; };
...@@ -3343,7 +3343,7 @@ ...@@ -3343,7 +3343,7 @@
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_8" stretch="0,0,2,0,0,0,0,2,1,5"> <layout class="QVBoxLayout" name="verticalLayout_8" stretch="0,0,2,0,0,0,0,2,1,0,5">
<property name="spacing"> <property name="spacing">
<number>7</number> <number>7</number>
</property> </property>
...@@ -3941,6 +3941,18 @@ ...@@ -3941,6 +3941,18 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0">
<widget class="ToggleSwitch" name="hardwareAccelCheckBox" native="false">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="text" stdset="0">
<string>Enable hardware acceleration</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer_24"> <spacer name="verticalSpacer_24">
<property name="orientation"> <property name="orientation">
......
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