Add option to turn off playbin3
This commit is contained in:
@@ -33,6 +33,7 @@ constexpr char kOutputU[] = "Output";
|
||||
constexpr char kDevice[] = "device";
|
||||
constexpr char kDeviceU[] = "Device";
|
||||
constexpr char kALSAPlugin[] = "alsaplugin";
|
||||
constexpr char kPlaybin3[] = "playbin3";
|
||||
constexpr char kExclusiveMode[] = "exclusive_mode";
|
||||
constexpr char kVolumeControl[] = "volume_control";
|
||||
constexpr char kChannelsEnabled[] = "channels_enabled";
|
||||
|
||||
@@ -46,6 +46,7 @@ using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
EngineBase::EngineBase(QObject *parent)
|
||||
: QObject(parent),
|
||||
playbin3_enabled_(true),
|
||||
exclusive_mode_(false),
|
||||
volume_control_(true),
|
||||
volume_(100),
|
||||
@@ -156,6 +157,8 @@ void EngineBase::ReloadSettings() {
|
||||
device_ = s.value(BackendSettings::kDevice);
|
||||
}
|
||||
|
||||
playbin3_enabled_ = s.value(BackendSettings::kPlaybin3, true).toBool();
|
||||
|
||||
exclusive_mode_ = s.value(BackendSettings::kExclusiveMode, false).toBool();
|
||||
|
||||
volume_control_ = s.value(BackendSettings::kVolumeControl, true).toBool();
|
||||
|
||||
@@ -176,6 +176,7 @@ class EngineBase : public QObject {
|
||||
void Finished();
|
||||
|
||||
protected:
|
||||
bool playbin3_enabled_;
|
||||
bool exclusive_mode_;
|
||||
bool volume_control_;
|
||||
uint volume_;
|
||||
|
||||
@@ -899,6 +899,7 @@ GstEnginePipelinePtr GstEngine::CreatePipeline() {
|
||||
|
||||
GstEnginePipelinePtr pipeline = GstEnginePipelinePtr(new GstEnginePipeline);
|
||||
pipeline->set_output_device(output_, device_);
|
||||
pipeline->set_playbin3_enabled(playbin3_enabled_);
|
||||
pipeline->set_exclusive_mode(exclusive_mode_);
|
||||
pipeline->set_volume_enabled(volume_control_);
|
||||
pipeline->set_stereo_balancer_enabled(stereo_balancer_enabled_);
|
||||
|
||||
@@ -103,6 +103,7 @@ GstEnginePipeline::GstEnginePipeline(QObject *parent)
|
||||
id_(sId++),
|
||||
playbin3_support_(false),
|
||||
volume_full_range_support_(false),
|
||||
playbin3_enabled_(true),
|
||||
exclusive_mode_(false),
|
||||
volume_enabled_(true),
|
||||
fading_enabled_(false),
|
||||
@@ -221,6 +222,10 @@ void GstEnginePipeline::set_output_device(const QString &output, const QVariant
|
||||
|
||||
}
|
||||
|
||||
void GstEnginePipeline::set_playbin3_enabled(const bool playbin3_enabled) {
|
||||
playbin3_enabled_ = playbin3_enabled;
|
||||
}
|
||||
|
||||
void GstEnginePipeline::set_exclusive_mode(const bool exclusive_mode) {
|
||||
exclusive_mode_ = exclusive_mode;
|
||||
}
|
||||
@@ -450,7 +455,9 @@ bool GstEnginePipeline::InitFromUrl(const QUrl &media_url, const QUrl &stream_ur
|
||||
end_offset_nanosec_ = end_offset_nanosec;
|
||||
ebur128_loudness_normalizing_gain_db_ = ebur128_loudness_normalizing_gain_db;
|
||||
|
||||
pipeline_ = CreateElement(playbin3_support_ ? u"playbin3"_s : u"playbin"_s, u"pipeline"_s, nullptr, error);
|
||||
const QString playbin_name = playbin3_support_ && playbin3_enabled_ ? u"playbin3"_s : u"playbin"_s;
|
||||
qLog(Debug) << "Using" << playbin_name << "for pipeline";
|
||||
pipeline_ = CreateElement(playbin_name, u"pipeline"_s, nullptr, error);
|
||||
if (!pipeline_) return false;
|
||||
|
||||
pad_added_cb_id_ = CHECKED_GCONNECT(G_OBJECT(pipeline_), "pad-added", &PadAddedCallback, this);
|
||||
|
||||
@@ -65,6 +65,7 @@ class GstEnginePipeline : public QObject {
|
||||
|
||||
// Call these setters before Init
|
||||
void set_output_device(const QString &output, const QVariant &device);
|
||||
void set_playbin3_enabled(const bool playbin3_enabled);
|
||||
void set_exclusive_mode(const bool exclusive_mode);
|
||||
void set_volume_enabled(const bool enabled);
|
||||
void set_stereo_balancer_enabled(const bool enabled);
|
||||
@@ -219,6 +220,8 @@ class GstEnginePipeline : public QObject {
|
||||
bool playbin3_support_;
|
||||
bool volume_full_range_support_;
|
||||
|
||||
bool playbin3_enabled_;
|
||||
|
||||
// General settings for the pipeline
|
||||
QString output_;
|
||||
QVariant device_;
|
||||
|
||||
@@ -178,6 +178,8 @@ void BackendSettingsPage::Load() {
|
||||
|
||||
ui_->checkbox_bs2b->setChecked(s.value(kBS2B, false).toBool());
|
||||
|
||||
ui_->checkbox_playbin3->setChecked(s.value(kPlaybin3, true).toBool());
|
||||
|
||||
ui_->checkbox_http2->setChecked(s.value(kHTTP2, false).toBool());
|
||||
ui_->checkbox_strict_ssl->setChecked(s.value(kStrictSSL, false).toBool());
|
||||
|
||||
@@ -440,6 +442,8 @@ void BackendSettingsPage::Save() {
|
||||
|
||||
s.setValue(kBS2B, ui_->checkbox_bs2b->isChecked());
|
||||
|
||||
s.setValue(kPlaybin3, ui_->checkbox_playbin3->isChecked());
|
||||
|
||||
s.setValue(kHTTP2, ui_->checkbox_http2->isChecked());
|
||||
s.setValue(kStrictSSL, ui_->checkbox_strict_ssl->isChecked());
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
<item>
|
||||
<spacer name="spacer_alsaplugin">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -173,7 +173,7 @@
|
||||
<item>
|
||||
<spacer name="spacer_exclusive_mode">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -265,7 +265,7 @@
|
||||
<item>
|
||||
<spacer name="spacer_channels">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -285,6 +285,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkbox_playbin3">
|
||||
<property name="text">
|
||||
<string>Use playbin3 when available</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkbox_http2">
|
||||
<property name="toolTip">
|
||||
@@ -379,7 +386,7 @@
|
||||
<item row="2" column="2">
|
||||
<spacer name="spacer_buffer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -392,7 +399,7 @@
|
||||
<item row="1" column="2">
|
||||
<spacer name="spacer_buffer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -405,7 +412,7 @@
|
||||
<item row="0" column="2">
|
||||
<spacer name="spacer_buffer_1">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -429,7 +436,7 @@
|
||||
<item>
|
||||
<spacer name="spacer_buffer_defaults">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -545,7 +552,7 @@
|
||||
<number>600</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sticky_center" stdset="0">
|
||||
<number>600</number>
|
||||
@@ -578,7 +585,7 @@
|
||||
<number>600</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sticky_center" stdset="0">
|
||||
<number>600</number>
|
||||
@@ -664,7 +671,7 @@
|
||||
<number>-230</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sticky_center" stdset="0">
|
||||
<number>-230</number>
|
||||
@@ -769,7 +776,7 @@
|
||||
<item>
|
||||
<spacer name="spacer_fading_1">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -820,7 +827,7 @@
|
||||
<item>
|
||||
<spacer name="spacer_fading_duration_1">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -838,7 +845,7 @@
|
||||
<item>
|
||||
<spacer name="spacer_bottom">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -873,6 +880,7 @@
|
||||
<tabstop>checkbox_channels</tabstop>
|
||||
<tabstop>spinbox_channels</tabstop>
|
||||
<tabstop>checkbox_bs2b</tabstop>
|
||||
<tabstop>checkbox_playbin3</tabstop>
|
||||
<tabstop>checkbox_http2</tabstop>
|
||||
<tabstop>checkbox_strict_ssl</tabstop>
|
||||
<tabstop>spinbox_bufferduration</tabstop>
|
||||
|
||||
Reference in New Issue
Block a user