GstEnginePipeline: Set device-clsid

This commit is contained in:
Jonas Kvinge 2024-02-16 21:38:33 +01:00
parent cb44c71733
commit a354f6bdc5
1 changed files with 32 additions and 1 deletions

View File

@ -448,7 +448,38 @@ bool GstEnginePipeline::InitAudioBin(QString &error) {
break;
}
}
else if (g_object_class_find_property(G_OBJECT_GET_CLASS(audiosink_), "device-clsid")) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
switch (device_.metaType().id()) {
#else
switch (device_.type()) {
#endif
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
case QMetaType::QString:{
#else
case QVariant::String:{
#endif
QString device = device_.toString();
if (!device.isEmpty()) {
qLog(Debug) << "Setting device-clsid" << device << "for" << output_;
g_object_set(G_OBJECT(audiosink_), "device-clsid", device.toUtf8().constData(), nullptr);
}
break;
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
case QMetaType::QByteArray:{
#else
case QVariant::ByteArray:{
#endif
QByteArray device = device_.toByteArray();
if (!device.isEmpty()) {
qLog(Debug) << "Setting device-clsid" << device_ << "for" << output_;
g_object_set(G_OBJECT(audiosink_), "device-clsid", device.constData(), nullptr);
}
break;
}
}
}
else if (g_object_class_find_property(G_OBJECT_GET_CLASS(audiosink_), "port-pattern")) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
switch (device_.metaType().id()) {