Skip to content
Snippets Groups Projects
Commit 748e161b authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

video: don't start the camera for no reason when it's plugged in

When the video device count goes to 1 from 0, previewing is
activated even if we're not in the av settings view. This patch
emits a signal that can be responded to by the settings view.

Gitlab: #489
Change-Id: Id0ed2809015359423ec0f829d8494f598a89c8ea
parent 2ea0a000
No related branches found
No related tags found
No related merge requests found
......@@ -293,10 +293,11 @@ AvAdapter::onVideoDeviceEvent()
if (deviceEvent == DeviceEvent::Added && currentDeviceListSize == 1) {
avModel.setDefaultDevice(defaultDevice);
avModel.setCurrentVideoCaptureDevice(defaultDevice);
if (callId.isEmpty())
lrcInstance_->renderer()->startPreviewing();
else
if (callId.isEmpty()) {
Q_EMIT videoDeviceAvailable();
} else {
avModel.switchInputTo(defaultDevice, callId);
}
} else {
cb();
}
......
......@@ -39,8 +39,8 @@ Q_SIGNALS:
void audioDeviceListChanged(int inputs, int outputs);
void videoDeviceListChanged(int inputs);
void screenCaptured(int screenNumber, QString source);
void videoDeviceAvailable();
protected:
void safeInit() override {};
......
......@@ -42,6 +42,15 @@ Rectangle {
color: JamiTheme.secondaryBackgroundColor
Connections {
target: AvAdapter
function onVideoDeviceAvailable() {
if (root.visible)
videoSettings.startPreviewing()
}
}
ColumnLayout {
id: avSettingsColumnLayout
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment