Bug 1537986 - Add deviceId and groupId to all camera and microphone settings. r=jib,smaug

Differential Revision: https://phabricator.services.mozilla.com/D32964

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2019-06-04 12:07:31 +00:00
Родитель 612199b2c5
Коммит d80077c20a
2 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -4260,7 +4260,15 @@ void SourceListener::StopTrack(const RefPtr<SourceListener>& self,
void SourceListener::GetSettingsFor(
TrackID aTrackID, dom::MediaTrackSettings& aOutSettings) const {
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread");
GetDeviceStateFor(aTrackID).mDevice->GetSettings(aOutSettings);
DeviceState& state = GetDeviceStateFor(aTrackID);
state.mDevice->GetSettings(aOutSettings);
MediaSourceEnum mediaSource = state.mDevice->GetMediaSource();
if (mediaSource == MediaSourceEnum::Camera ||
mediaSource == MediaSourceEnum::Microphone) {
aOutSettings.mDeviceId.Construct(state.mDevice->mID);
aOutSettings.mGroupId.Construct(state.mDevice->mGroupID);
}
}
void SourceListener::SetEnabledFor(TrackID aTrackID, bool aEnable) {

Просмотреть файл

@ -12,11 +12,12 @@ dictionary MediaTrackSettings {
long height;
double frameRate;
DOMString facingMode;
DOMString deviceId;
boolean echoCancellation;
boolean noiseSuppression;
boolean autoGainControl;
boolean echoCancellation;
boolean autoGainControl;
boolean noiseSuppression;
long channelCount;
DOMString deviceId;
DOMString groupId;
// Mozilla-specific extensions: