start virtmic with no target when audio capture is requested
This commit is contained in:
parent
a814d9cc1b
commit
6492cb9a35
|
@ -63,6 +63,15 @@ void DiscordPage::featurePermissionRequested(const QUrl &securityOrigin,
|
||||||
// Allow every permission asked
|
// Allow every permission asked
|
||||||
setFeaturePermission(securityOrigin, feature,
|
setFeaturePermission(securityOrigin, feature,
|
||||||
QWebEnginePage::PermissionGrantedByUser);
|
QWebEnginePage::PermissionGrantedByUser);
|
||||||
|
|
||||||
|
if (feature == QWebEnginePage::Feature::MediaAudioCapture) {
|
||||||
|
if (m_virtmicProcess.state() == QProcess::NotRunning) {
|
||||||
|
qDebug() << "[virtmic] Starting Virtmic with no target to make sure "
|
||||||
|
"Discord can find all the audio devices";
|
||||||
|
m_virtmicProcess.start(QApplication::arguments()[0],
|
||||||
|
{"--virtmic", "None"});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DiscordPage::acceptNavigationRequest(const QUrl &url,
|
bool DiscordPage::acceptNavigationRequest(const QUrl &url,
|
||||||
|
|
|
@ -90,6 +90,7 @@ void start(QString _target) {
|
||||||
{"audio.position", "FL,FR"}},
|
{"audio.position", "FL,FR"}},
|
||||||
pipewire::node::type, pipewire::node::version, false);
|
pipewire::node::type, pipewire::node::version, false);
|
||||||
|
|
||||||
|
if (target != "None") {
|
||||||
auto reg_events = reg.listen<pipewire::registry_listener>();
|
auto reg_events = reg.listen<pipewire::registry_listener>();
|
||||||
reg_events.on<pipewire::registry_event::global>(
|
reg_events.on<pipewire::registry_event::global>(
|
||||||
[&](const pipewire::global &global) {
|
[&](const pipewire::global &global) {
|
||||||
|
@ -142,6 +143,7 @@ void start(QString _target) {
|
||||||
links.erase(id);
|
links.erase(id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
main_loop.run();
|
main_loop.run();
|
||||||
|
|
Loading…
Reference in New Issue