Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
5458eb86
Commit
5458eb86
authored
Jun 28, 2019
by
Andreas Traczyk
Browse files
videodevices: don't change preference order when changing settings
Change-Id: I743181cb854c5bdc961ade5dceb7f6ccc1b1ba13
parent
ec67b99e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/media/video/video_device_monitor.cpp
View file @
5458eb86
...
...
@@ -80,7 +80,7 @@ VideoDeviceMonitor::getSettings(const string& name)
}
void
VideoDeviceMonitor
::
applySettings
(
const
string
&
name
,
VideoSettings
settings
)
VideoDeviceMonitor
::
applySettings
(
const
string
&
name
,
const
VideoSettings
&
settings
)
{
std
::
lock_guard
<
std
::
mutex
>
l
(
lock_
);
const
auto
iter
=
findDeviceByName
(
name
);
...
...
@@ -89,7 +89,9 @@ VideoDeviceMonitor::applySettings(const string& name, VideoSettings settings)
return
;
iter
->
applySettings
(
settings
);
overwritePreferences
(
iter
->
getSettings
());
auto
it
=
findPreferencesByName
(
settings
.
name
);
if
(
it
!=
preferences_
.
end
())
(
*
it
)
=
settings
;
}
string
...
...
@@ -303,12 +305,12 @@ VideoDeviceMonitor::findPreferencesByName(const string& name)
}
void
VideoDeviceMonitor
::
overwritePreferences
(
VideoSettings
settings
)
VideoDeviceMonitor
::
overwritePreferences
(
const
VideoSettings
&
settings
)
{
auto
it
=
findPreferencesByName
(
settings
.
name
);
if
(
it
!=
preferences_
.
end
())
preferences_
.
erase
(
it
);
preferences_
.
push
_back
(
settings
);
preferences_
.
emplace
_back
(
settings
);
}
void
...
...
src/media/video/video_device_monitor.h
View file @
5458eb86
...
...
@@ -51,7 +51,7 @@ class VideoDeviceMonitor : public Serializable
DRing
::
VideoCapabilities
getCapabilities
(
const
std
::
string
&
name
)
const
;
VideoSettings
getSettings
(
const
std
::
string
&
name
);
void
applySettings
(
const
std
::
string
&
name
,
VideoSettings
settings
);
void
applySettings
(
const
std
::
string
&
name
,
const
VideoSettings
&
settings
);
std
::
string
getDefaultDevice
()
const
;
std
::
string
getMRLForDefaultDevice
()
const
;
...
...
@@ -82,7 +82,7 @@ class VideoDeviceMonitor : public Serializable
*/
std
::
vector
<
VideoSettings
>
preferences_
;
void
overwritePreferences
(
VideoSettings
settings
);
void
overwritePreferences
(
const
VideoSettings
&
settings
);
std
::
vector
<
VideoSettings
>::
iterator
findPreferencesByName
(
const
std
::
string
&
name
);
/*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment