mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
save default video device
Now setting the default video device will update the order of the video preferences and then save the config. This ensures that the default video device setting persists between dring sessions as the order of the video preferences in dring.yml is used to determine the default device when launching dring. Reviewed-by: Alexandre Viau <alexandre.viau@savoirfairelinux.com> Change-Id: I7af715c80db58b83eaf4b7584b34ca2279023a2c Tuleap: #1035
This commit is contained in:

committed by
Alexandre Viau

parent
10f592d549
commit
918c67d9d0
@ -79,6 +79,7 @@ setDefaultDevice(const std::string& name)
|
||||
{
|
||||
RING_DBG("Setting default device to %s", name.c_str());
|
||||
ring::Manager::instance().getVideoManager().videoDeviceMonitor.setDefaultDevice(name);
|
||||
ring::Manager::instance().saveConfig();
|
||||
}
|
||||
|
||||
std::map<std::string, std::string>
|
||||
|
@ -109,9 +109,20 @@ VideoDeviceMonitor::getMRLForDefaultDevice() const
|
||||
void
|
||||
VideoDeviceMonitor::setDefaultDevice(const std::string& name)
|
||||
{
|
||||
const auto it = findDeviceByName(name);
|
||||
if (it != devices_.end())
|
||||
defaultDevice_ = it->name;
|
||||
const auto itDev = findDeviceByName(name);
|
||||
if (itDev != devices_.end()) {
|
||||
defaultDevice_ = itDev->name;
|
||||
|
||||
// place it at the begining of the prefs
|
||||
auto itPref = findPreferencesByName(name);
|
||||
if (itPref != preferences_.end()) {
|
||||
auto settings = *itPref;
|
||||
preferences_.erase(itPref);
|
||||
preferences_.insert(preferences_.begin(), settings);
|
||||
} else {
|
||||
preferences_.insert(preferences_.begin(), itDev->getSettings());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DeviceParams
|
||||
|
Reference in New Issue
Block a user