Backed out 5 changesets (bug 1213453) for bustages on MediaEngineDefault.cpp . CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Fri, 08 Mar 2019 13:34:52 +0200
changeset 521017 f63a07c8426b
parent 521016 118792523194
child 521018 3dc8bca5dd90
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1213453
milestone67.0a1
backs out118792523194
6208d9e15f3d
ec1da6bbf1a7
f78c357f2f5f
6903f0739e83
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 5 changesets (bug 1213453) for bustages on MediaEngineDefault.cpp . CLOSED TREE Backed out changeset 118792523194 (bug 1213453) Backed out changeset 6208d9e15f3d (bug 1213453) Backed out changeset ec1da6bbf1a7 (bug 1213453) Backed out changeset f78c357f2f5f (bug 1213453) Backed out changeset 6903f0739e83 (bug 1213453)
dom/media/AudioDeviceInfo.cpp
dom/media/AudioDeviceInfo.h
dom/media/MediaDeviceInfo.h
dom/media/MediaDevices.cpp
dom/media/MediaManager.cpp
dom/media/MediaManager.h
dom/media/gtest/TestGroupId.cpp
dom/media/gtest/moz.build
dom/media/nsIDOMNavigatorUserMedia.idl
dom/media/tests/mochitest/mochitest.ini
dom/media/tests/mochitest/test_enumerateDevices.html
dom/media/tests/mochitest/test_groupId.html
dom/media/webrtc/MediaEngineDefault.cpp
dom/media/webrtc/MediaEngineDefault.h
dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
dom/media/webrtc/MediaEngineRemoteVideoSource.h
dom/media/webrtc/MediaEngineSource.h
dom/media/webrtc/MediaEngineTabVideoSource.cpp
dom/media/webrtc/MediaEngineTabVideoSource.h
dom/media/webrtc/MediaEngineWebRTC.cpp
dom/media/webrtc/MediaEngineWebRTCAudio.cpp
dom/media/webrtc/MediaEngineWebRTCAudio.h
dom/media/webrtc/MediaTrackConstraints.cpp
--- a/dom/media/AudioDeviceInfo.cpp
+++ b/dom/media/AudioDeviceInfo.cpp
@@ -57,17 +57,16 @@ AudioDeviceInfo::AudioDeviceInfo(
              "Wrong default format");
 }
 
 AudioDeviceID AudioDeviceInfo::DeviceID() const { return mDeviceId; }
 const nsString& AudioDeviceInfo::Name() const { return mName; }
 uint32_t AudioDeviceInfo::MaxChannels() const { return mMaxChannels; }
 uint32_t AudioDeviceInfo::Type() const { return mType; }
 uint32_t AudioDeviceInfo::State() const { return mState; }
-const nsString& AudioDeviceInfo::GroupID() const { return mGroupId; }
 
 bool AudioDeviceInfo::Preferred() const { return mPreferred; }
 
 /* readonly attribute DOMString name; */
 NS_IMETHODIMP
 AudioDeviceInfo::GetName(nsAString& aName) {
   aName = mName;
   return NS_OK;
--- a/dom/media/AudioDeviceInfo.h
+++ b/dom/media/AudioDeviceInfo.h
@@ -27,17 +27,16 @@ class AudioDeviceInfo final : public nsI
                   uint32_t aMinLatency);
   explicit AudioDeviceInfo(cubeb_device_info* aInfo);
 
   AudioDeviceID DeviceID() const;
   const nsString& Name() const;
   uint32_t MaxChannels() const;
   uint32_t Type() const;
   uint32_t State() const;
-  const nsString& GroupID() const;
   bool Preferred() const;
 
  private:
   virtual ~AudioDeviceInfo() = default;
 
   const AudioDeviceID mDeviceId;
   const nsString mName;
   const nsString mGroupId;
--- a/dom/media/MediaDeviceInfo.h
+++ b/dom/media/MediaDeviceInfo.h
@@ -19,17 +19,18 @@ namespace dom {
     0x25091870, 0x84d6, 0x4acf, {                      \
       0xaf, 0x97, 0x6e, 0xd5, 0x5b, 0xe0, 0x47, 0xb2   \
     }                                                  \
   }
 
 class MediaDeviceInfo final : public nsISupports, public nsWrapperCache {
  public:
   explicit MediaDeviceInfo(const nsAString& aDeviceId, MediaDeviceKind aKind,
-                           const nsAString& aLabel, const nsAString& aGroupId);
+                           const nsAString& aLabel,
+                           const nsAString& aGroupId = nsString());
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaDeviceInfo)
   NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOM_MEDIADEVICEINFO_IMPLEMENTATION_IID)
 
   JSObject* WrapObject(JSContext* cx,
                        JS::Handle<JSObject*> aGivenProto) override;
 
--- a/dom/media/MediaDevices.cpp
+++ b/dom/media/MediaDevices.cpp
@@ -110,17 +110,17 @@ already_AddRefed<Promise> MediaDevices::
                  nsString label;
                  if (MediaManager::Get()->IsActivelyCapturingOrHasAPermission(
                          windowId) ||
                      Preferences::GetBool("media.navigator.permission.disabled",
                                           false)) {
                    label = device->mName;
                  }
                  infos.AppendElement(MakeRefPtr<MediaDeviceInfo>(
-                     device->mID, device->mKind, label, device->mGroupID));
+                     device->mID, device->mKind, label));
                }
                p->MaybeResolve(std::move(infos));
              },
              [this, self, p](const RefPtr<MediaMgrError>& error) {
                nsPIDOMWindowInner* window = GetWindowIfCurrent();
                if (!window) {
                  return;  // Leave Promise pending after navigation by design.
                }
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -808,65 +808,61 @@ class GetUserMediaWindowListener {
 
 /**
  * nsIMediaDevice implementation.
  */
 NS_IMPL_ISUPPORTS(MediaDevice, nsIMediaDevice)
 
 MediaDevice::MediaDevice(const RefPtr<MediaEngineSource>& aSource,
                          const nsString& aName, const nsString& aID,
-                         const nsString& aGroupID, const nsString& aRawID)
+                         const nsString& aRawID)
     : mSource(aSource),
       mSinkInfo(nullptr),
       mKind((mSource && MediaEngineSource::IsVideo(mSource->GetMediaSource()))
                 ? dom::MediaDeviceKind::Videoinput
                 : dom::MediaDeviceKind::Audioinput),
       mScary(mSource->GetScary()),
       mType(NS_ConvertUTF8toUTF16(
           dom::MediaDeviceKindValues::strings[uint32_t(mKind)].value)),
       mName(aName),
       mID(aID),
-      mGroupID(aGroupID),
       mRawID(aRawID) {
   MOZ_ASSERT(mSource);
 }
 
 MediaDevice::MediaDevice(const RefPtr<AudioDeviceInfo>& aAudioDeviceInfo,
-                         const nsString& aID, const nsString& aGroupID,
-                         const nsString& aRawID)
+                         const nsString& aID, const nsString& aRawID)
     : mSource(nullptr),
       mSinkInfo(aAudioDeviceInfo),
       mKind(mSinkInfo->Type() == AudioDeviceInfo::TYPE_INPUT
                 ? dom::MediaDeviceKind::Audioinput
                 : dom::MediaDeviceKind::Audiooutput),
       mScary(false),
       mType(NS_ConvertUTF8toUTF16(
           dom::MediaDeviceKindValues::strings[uint32_t(mKind)].value)),
       mName(mSinkInfo->Name()),
       mID(aID),
-      mGroupID(aGroupID),
       mRawID(aRawID) {
   // For now this ctor is used only for Audiooutput.
   // It could be used for Audioinput and Videoinput
   // when we do not instantiate a MediaEngineSource
   // during EnumerateDevices.
   MOZ_ASSERT(mKind == dom::MediaDeviceKind::Audiooutput);
   MOZ_ASSERT(mSinkInfo);
 }
 
 MediaDevice::MediaDevice(const RefPtr<MediaDevice>& aOther, const nsString& aID,
-                         const nsString& aGroupID, const nsString& aRawID)
+                         const nsString& aRawID)
     : mSource(aOther->mSource),
       mSinkInfo(aOther->mSinkInfo),
       mKind(aOther->mKind),
       mScary(aOther->mScary),
       mType(aOther->mType),
       mName(aOther->mName),
       mID(aID),
-      mGroupID(aGroupID),
       mRawID(aRawID) {
   MOZ_ASSERT(aOther);
 }
 
 /**
  * Helper functions that implement the constraints algorithm from
  * http://dev.w3.org/2011/webrtc/editor/getusermedia.html#methods-5
  */
@@ -951,23 +947,16 @@ MediaDevice::GetId(nsAString& aID) {
 NS_IMETHODIMP
 MediaDevice::GetRawId(nsAString& aID) {
   MOZ_ASSERT(NS_IsMainThread());
   aID.Assign(mRawID);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-MediaDevice::GetGroupId(nsAString& aGroupID) {
-  MOZ_ASSERT(NS_IsMainThread());
-  aGroupID.Assign(mGroupID);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 MediaDevice::GetScary(bool* aScary) {
   *aScary = mScary;
   return NS_OK;
 }
 
 void MediaDevice::GetSettings(dom::MediaTrackSettings& aOutSettings) const {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(mSource);
@@ -1774,80 +1763,16 @@ class GetUserMediaRunnableWrapper : publ
     return NS_OK;
   }
 
  private:
   nsAutoPtr<GetUserMediaTask> mTask;
 };
 #endif
 
-// This function tries to guess the group id for a video device
-// based on the device name. If only one audio device's name contains
-// the name of the video device, then, this video device will take
-// the group id of the audio device. Since this is a guess we try
-// to minimize the probability of false positive. If we fail to find
-// a correlation we leave the video group id untouched. In that case the
-// group id will be the video device name.
-/* static */
-void MediaManager::GuessVideoDeviceGroupIDs(MediaDeviceSet& aDevices) {
-  // Run the logic in a lambda to avoid duplication.
-  auto updateGroupIdIfNeeded = [&](RefPtr<MediaDevice>& aVideo,
-                                   const dom::MediaDeviceKind aKind) -> bool {
-    MOZ_ASSERT(aVideo->mKind == dom::MediaDeviceKind::Videoinput);
-    MOZ_ASSERT(aKind == dom::MediaDeviceKind::Audioinput ||
-               aKind == dom::MediaDeviceKind::Audiooutput);
-    // This will store the new group id if a match is found.
-    nsString newVideoGroupID;
-    // If the group id needs to be updated this will become true. It is
-    // necessary when the new group id is an empty string. Without this extra
-    // variable to signal the update, we would resort to test if
-    // `newVideoGroupId` is empty. However,
-    // that check does not work when the new group id is an empty string.
-    bool updateGroupId = false;
-    for (const RefPtr<MediaDevice>& dev : aDevices) {
-      if (dev->mKind != aKind) {
-        continue;
-      }
-      if (!FindInReadable(aVideo->mName, dev->mName)) {
-        continue;
-      }
-      if (newVideoGroupID.IsEmpty()) {
-        // This is only expected on first match. If that's the only match group
-        // id will be updated to this one at the end of the loop.
-        updateGroupId = true;
-        newVideoGroupID = dev->mGroupID;
-      } else {
-        // More than one device found, it is impossible to know which group id
-        // is the correct one.
-        updateGroupId = false;
-        newVideoGroupID = NS_LITERAL_STRING("");
-        break;
-      }
-    }
-    if (updateGroupId) {
-      aVideo =
-          new MediaDevice(aVideo, aVideo->mID, newVideoGroupID, aVideo->mRawID);
-      return true;
-    }
-    return false;
-  };
-
-  for (RefPtr<MediaDevice>& video : aDevices) {
-    if (video->mKind != dom::MediaDeviceKind::Videoinput) {
-      continue;
-    }
-    if (updateGroupIdIfNeeded(video, dom::MediaDeviceKind::Audioinput)) {
-      // GroupId has been updated, continue to the next video device
-      continue;
-    }
-    // GroupId has not been updated, check among the outputs
-    updateGroupIdIfNeeded(video, dom::MediaDeviceKind::Audiooutput);
-  }
-}
-
 /**
  * EnumerateRawDevices - Enumerate a list of audio & video devices that
  * satisfy passed-in constraints. List contains raw id's.
  */
 
 RefPtr<MediaManager::MgrPromise> MediaManager::EnumerateRawDevices(
     uint64_t aWindowId, MediaSourceEnum aVideoInputType,
     MediaSourceEnum aAudioInputType, MediaSinkEnum aAudioOutputType,
@@ -1950,19 +1875,16 @@ RefPtr<MediaManager::MgrPromise> MediaMa
     }
     if (hasAudioOutput) {
       MediaDeviceSet outputs;
       MOZ_ASSERT(realBackend);
       realBackend->EnumerateDevices(aWindowId, MediaSourceEnum::Other,
                                     MediaSinkEnum::Speaker, &outputs);
       aOutDevices->AppendElements(outputs);
     }
-    if (hasVideo) {
-      GuessVideoDeviceGroupIDs(*aOutDevices);
-    }
 
     holder->Resolve(false, __func__);
   });
 
   if (realDeviceRequested && aForceNoPermRequest &&
       Preferences::GetBool("media.navigator.permission.device", false)) {
     // Need to ask permission to retrieve list of all devices;
     // notify frontend observer and wait for callback notification to post task.
@@ -3077,37 +2999,24 @@ RefPtr<MediaManager::StreamPromise> Medi
   vc.mMediaSource.AssignASCII(EnumToASCII(dom::MediaSourceEnumValues::strings,
                                           MediaSourceEnum::Screen));
 
   return MediaManager::GetUserMedia(aWindow, c, aCallerType);
 }
 
 /* static */
 void MediaManager::AnonymizeDevices(MediaDeviceSet& aDevices,
-                                    const nsACString& aOriginKey,
-                                    const uint64_t aWindowId) {
-
+                                    const nsACString& aOriginKey) {
   if (!aOriginKey.IsEmpty()) {
     for (RefPtr<MediaDevice>& device : aDevices) {
       nsString id;
       device->GetId(id);
       nsString rawId(id);
       AnonymizeId(id, aOriginKey);
-
-      nsString groupId;
-      device->GetGroupId(groupId);
-      // Use window id to salt group id in order to make it session based as
-      // required by the spec. This does not provide unique group ids through
-      // out a browser restart. However, this is not agaist the spec.
-      // Furtermore, since device ids are the same after a browser restart the
-      // fingerprint is not bigger.
-      groupId.AppendInt(aWindowId);
-      AnonymizeId(groupId, aOriginKey);
-
-      device = new MediaDevice(device, id, groupId, rawId);
+      device = new MediaDevice(device, id, rawId);
     }
   }
 }
 
 /* static */
 nsresult MediaManager::AnonymizeId(nsAString& aId,
                                    const nsACString& aOriginKey) {
   MOZ_ASSERT(NS_IsMainThread());
@@ -3276,18 +3185,17 @@ RefPtr<MediaManager::MgrPromise> MediaMa
                    }
                  }
                }
                if (!mgr->IsWindowStillActive(aWindowId)) {
                  return MgrPromise::CreateAndReject(
                      MakeRefPtr<MediaMgrError>(MediaMgrError::Name::AbortError),
                      __func__);
                }
-               MediaManager::AnonymizeDevices(*aOutDevices, *originKey,
-                                              aWindowId);
+               MediaManager::AnonymizeDevices(*aOutDevices, *originKey);
                return MgrPromise::CreateAndResolve(false, __func__);
              },
              [](RefPtr<MediaMgrError>&& aError) {
                return MgrPromise::CreateAndReject(std::move(aError), __func__);
              });
 }
 
 RefPtr<MediaManager::DevicesPromise> MediaManager::EnumerateDevices(
--- a/dom/media/MediaManager.h
+++ b/dom/media/MediaManager.h
@@ -62,26 +62,26 @@ class GetUserMediaWindowListener;
 class MediaManager;
 class SourceListener;
 
 class MediaDevice : public nsIMediaDevice {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIMEDIADEVICE
 
-  MediaDevice(const RefPtr<MediaEngineSource>& aSource, const nsString& aName,
-              const nsString& aID, const nsString& aGroupID,
-              const nsString& aRawID);
+  explicit MediaDevice(const RefPtr<MediaEngineSource>& aSource,
+                       const nsString& aName, const nsString& aID,
+                       const nsString& aRawID);
 
-  MediaDevice(const RefPtr<AudioDeviceInfo>& aAudioDeviceInfo,
-              const nsString& aID, const nsString& aGroupID,
-              const nsString& aRawID = NS_LITERAL_STRING(""));
+  explicit MediaDevice(const RefPtr<AudioDeviceInfo>& aAudioDeviceInfo,
+                       const nsString& aID,
+                       const nsString& aRawID = NS_LITERAL_STRING(""));
 
-  MediaDevice(const RefPtr<MediaDevice>& aOther, const nsString& aID,
-              const nsString& aGroupID, const nsString& aRawID);
+  explicit MediaDevice(const RefPtr<MediaDevice>& aOther, const nsString& aID,
+                       const nsString& aRawID);
 
   uint32_t GetBestFitnessDistance(
       const nsTArray<const NormalizedConstraintSet*>& aConstraintSets,
       bool aIsChrome);
 
   nsresult Allocate(const dom::MediaTrackConstraints& aConstraints,
                     const MediaEnginePrefs& aPrefs,
                     const mozilla::ipc::PrincipalInfo& aPrincipalInfo,
@@ -125,17 +125,16 @@ class MediaDevice : public nsIMediaDevic
  public:
   const RefPtr<MediaEngineSource> mSource;
   const RefPtr<AudioDeviceInfo> mSinkInfo;
   const dom::MediaDeviceKind mKind;
   const bool mScary;
   const nsString mType;
   const nsString mName;
   const nsString mID;
-  const nsString mGroupID;
   const nsString mRawID;
 };
 
 typedef nsRefPtrHashtable<nsUint64HashKey, GetUserMediaWindowListener>
     WindowTable;
 typedef MozPromise<RefPtr<AudioDeviceInfo>, nsresult, true> SinkInfoPromise;
 
 class MediaManager final : public nsIMediaManagerService,
@@ -271,21 +270,19 @@ class MediaManager final : public nsIMed
   virtual void OnDeviceChange() override;
 
  private:
   static nsresult GenerateUUID(nsAString& aResult);
   static nsresult AnonymizeId(nsAString& aId, const nsACString& aOriginKey);
 
  public:  // TODO: make private once we upgrade to GCC 4.8+ on linux.
   static void AnonymizeDevices(MediaDeviceSet& aDevices,
-                               const nsACString& aOriginKey,
-                               const uint64_t aWindowId);
+                               const nsACString& aOriginKey);
   static already_AddRefed<nsIWritableVariant> ToJSArray(
       MediaDeviceSet& aDevices);
-  static void GuessVideoDeviceGroupIDs(MediaManager::MediaDeviceSet& aDevices);
 
  private:
   enum class DeviceEnumerationType : uint8_t {
     Normal,  // Enumeration should not return loopback or fake devices
     Fake,    // Enumeration should return fake device(s)
     Loopback /* Enumeration should return loopback device(s) (possibly in
              addition to normal devices) */
   };
deleted file mode 100644
--- a/dom/media/gtest/TestGroupId.cpp
+++ /dev/null
@@ -1,336 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "AudioDeviceInfo.h"
-#include "MediaManager.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest-printers.h"
-#include "gtest/gtest.h"
-#include "mozilla/Attributes.h"
-#include "mozilla/UniquePtr.h"
-#include "nsTArray.h"
-#include "webrtc/MediaEngineSource.h"
-
-using ::testing::Return;
-
-void PrintTo(const nsString& aValue, ::std::ostream* aStream) {
-  NS_ConvertUTF16toUTF8 str(aValue);
-  (*aStream) << str.get();
-}
-void PrintTo(const nsCString& aValue, ::std::ostream* aStream) {
-  (*aStream) << aValue.get();
-}
-
-class MockMediaEngineSource : public MediaEngineSource {
- public:
-  MOCK_CONST_METHOD0(GetMediaSource, dom::MediaSourceEnum());
-
-  /* Unused overrides */
-  MOCK_CONST_METHOD0(GetName, nsString());
-  MOCK_CONST_METHOD0(GetUUID, nsCString());
-  MOCK_CONST_METHOD0(GetGroupId, nsString());
-  MOCK_METHOD6(Allocate, nsresult(const dom::MediaTrackConstraints&,
-                                  const MediaEnginePrefs&, const nsString&,
-                                  const ipc::PrincipalInfo&, AllocationHandle**,
-                                  const char**));
-  MOCK_METHOD4(SetTrack, void(const RefPtr<const AllocationHandle>&,
-                              const RefPtr<SourceMediaStream>&, TrackID,
-                              const PrincipalHandle&));
-  MOCK_METHOD1(Start, nsresult(const RefPtr<const AllocationHandle>&));
-  MOCK_METHOD5(Reconfigure, nsresult(const RefPtr<AllocationHandle>&,
-                                     const dom::MediaTrackConstraints&,
-                                     const MediaEnginePrefs&, const nsString&,
-                                     const char**));
-  MOCK_METHOD1(Stop, nsresult(const RefPtr<const AllocationHandle>&));
-  MOCK_METHOD1(Deallocate, nsresult(const RefPtr<const AllocationHandle>&));
-  MOCK_CONST_METHOD2(GetBestFitnessDistance,
-                     uint32_t(const nsTArray<const NormalizedConstraintSet*>&,
-                              const nsString&));
-  MOCK_METHOD6(Pull,
-               void(const RefPtr<const AllocationHandle>& aHandle,
-                    const RefPtr<SourceMediaStream>& aStream, TrackID aTrackID,
-                    StreamTime aEndOfAppendedData, StreamTime aDesiredTime,
-                    const PrincipalHandle& aPrincipalHandle));
-};
-
-RefPtr<AudioDeviceInfo> MakeAudioDeviceInfo(const nsString aName) {
-  return MakeRefPtr<AudioDeviceInfo>(
-      nullptr, aName, NS_LITERAL_STRING("GroupId"), NS_LITERAL_STRING("Vendor"),
-      AudioDeviceInfo::TYPE_OUTPUT, AudioDeviceInfo::STATE_ENABLED,
-      AudioDeviceInfo::PREF_NONE, AudioDeviceInfo::FMT_F32LE,
-      AudioDeviceInfo::FMT_F32LE, 2u, 44100u, 44100u, 44100u, 0, 0);
-}
-
-RefPtr<MediaDevice> MakeCameraDevice(const nsString& aName,
-                                     const nsString& aGroupId) {
-  auto v = MakeRefPtr<MockMediaEngineSource>();
-  EXPECT_CALL(*v, GetMediaSource())
-      .WillRepeatedly(Return(dom::MediaSourceEnum::Camera));
-
-  return MakeRefPtr<MediaDevice>(v, aName, NS_LITERAL_STRING(""), aGroupId,
-                                 NS_LITERAL_STRING(""));
-}
-
-RefPtr<MediaDevice> MakeMicDevice(const nsString& aName,
-                                  const nsString& aGroupId) {
-  auto a = MakeRefPtr<MockMediaEngineSource>();
-  EXPECT_CALL(*a, GetMediaSource())
-      .WillRepeatedly(Return(dom::MediaSourceEnum::Microphone));
-
-  return MakeRefPtr<MediaDevice>(a, aName, NS_LITERAL_STRING(""), aGroupId,
-                                 NS_LITERAL_STRING(""));
-}
-
-RefPtr<MediaDevice> MakeSpeakerDevice(const nsString& aName,
-                                      const nsString& aGroupId) {
-  return MakeRefPtr<MediaDevice>(MakeAudioDeviceInfo(aName),
-                                 NS_LITERAL_STRING("ID"), aGroupId,
-                                 NS_LITERAL_STRING("RawID"));
-}
-
-/* Verify that when an audio input device name contains the video input device
- * name the video device group id is updated to become equal to the audio
- * device group id. */
-TEST(TestGroupId, MatchInput_PartOfName) {
-  MediaManager::MediaDeviceSet devices;
-
-  devices.AppendElement(
-      MakeCameraDevice(NS_LITERAL_STRING("Vendor Model"),
-                       NS_LITERAL_STRING("Cam-Model-GroupId")));
-
-  devices.AppendElement(
-      MakeMicDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                    NS_LITERAL_STRING("Mic-Model-GroupId")));
-
-  MediaManager::GuessVideoDeviceGroupIDs(devices);
-
-  EXPECT_EQ(devices[0]->mGroupID, devices[1]->mGroupID)
-      << "Video group id is the same as audio input group id.";
-}
-
-/* Verify that when an audio input device name is the same as the video input
- * device name the video device group id is updated to become equal to the audio
- * device group id. */
-TEST(TestGroupId, MatchInput_FullName) {
-  MediaManager::MediaDeviceSet devices;
-
-  devices.AppendElement(
-      MakeCameraDevice(NS_LITERAL_STRING("Vendor Model"),
-                       NS_LITERAL_STRING("Cam-Model-GroupId")));
-
-  devices.AppendElement(MakeMicDevice(NS_LITERAL_STRING("Vendor Model"),
-                                      NS_LITERAL_STRING("Mic-Model-GroupId")));
-
-  MediaManager::GuessVideoDeviceGroupIDs(devices);
-
-  EXPECT_EQ(devices[0]->mGroupID, devices[1]->mGroupID)
-      << "Video group id is the same as audio input group id.";
-}
-
-/* Verify that when an audio input device name does not contain the video input
- * device name the video device group id does not change. */
-TEST(TestGroupId, NoMatchInput) {
-  MediaManager::MediaDeviceSet devices;
-
-  nsString Cam_Model_GroupId = NS_LITERAL_STRING("Cam-Model-GroupId");
-  devices.AppendElement(
-      MakeCameraDevice(NS_LITERAL_STRING("Vendor Model"), Cam_Model_GroupId));
-
-  devices.AppendElement(MakeMicDevice(NS_LITERAL_STRING("Model Analog Stereo"),
-                                      NS_LITERAL_STRING("Mic-Model-GroupId")));
-
-  MediaManager::GuessVideoDeviceGroupIDs(devices);
-
-  EXPECT_EQ(devices[0]->mGroupID, Cam_Model_GroupId)
-      << "Video group id has not been updated.";
-  EXPECT_NE(devices[0]->mGroupID, devices[1]->mGroupID)
-      << "Video group id is different than audio input group id.";
-}
-
-/* Verify that when more that one audio input and more than one audio output
- * device name contain the video input device name the video device group id
- * does not change. */
-TEST(TestGroupId, NoMatch_TwoIdenticalDevices) {
-  MediaManager::MediaDeviceSet devices;
-
-  nsString Cam_Model_GroupId = NS_LITERAL_STRING("Cam-Model-GroupId");
-  devices.AppendElement(
-      MakeCameraDevice(NS_LITERAL_STRING("Vendor Model"), Cam_Model_GroupId));
-
-  devices.AppendElement(
-      MakeMicDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                    NS_LITERAL_STRING("Mic-Model-GroupId")));
-  devices.AppendElement(
-      MakeMicDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                    NS_LITERAL_STRING("Mic-Model-GroupId")));
-
-  devices.AppendElement(
-      MakeSpeakerDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                        NS_LITERAL_STRING("Speaker-Model-GroupId")));
-  devices.AppendElement(
-      MakeSpeakerDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                        NS_LITERAL_STRING("Speaker-Model-GroupId")));
-
-  MediaManager::GuessVideoDeviceGroupIDs(devices);
-
-  EXPECT_EQ(devices[0]->mGroupID, Cam_Model_GroupId)
-      << "Video group id has not been updated.";
-  EXPECT_NE(devices[0]->mGroupID, devices[1]->mGroupID)
-      << "Video group id is different than audio input group id.";
-  EXPECT_NE(devices[0]->mGroupID, devices[3]->mGroupID)
-      << "Video group id is different than audio output group id.";
-}
-
-/* Verify that when more that one audio input device name contain the video
- * input device name the video device group id is not updated by audio input
- * device group id but it continues looking at audio output devices where it
- * finds a match so video input group id is updated by audio output group id. */
-TEST(TestGroupId, Match_TwoIdenticalInputsMatchOutput) {
-  MediaManager::MediaDeviceSet devices;
-
-  nsString Cam_Model_GroupId = NS_LITERAL_STRING("Cam-Model-GroupId");
-  devices.AppendElement(
-      MakeCameraDevice(NS_LITERAL_STRING("Vendor Model"), Cam_Model_GroupId));
-
-  devices.AppendElement(
-      MakeMicDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                    NS_LITERAL_STRING("Mic-Model-GroupId")));
-  devices.AppendElement(
-      MakeMicDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                    NS_LITERAL_STRING("Mic-Model-GroupId")));
-
-  devices.AppendElement(
-      MakeSpeakerDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                        NS_LITERAL_STRING("Speaker-Model-GroupId")));
-
-  MediaManager::GuessVideoDeviceGroupIDs(devices);
-
-  EXPECT_EQ(devices[0]->mGroupID, devices[3]->mGroupID)
-      << "Video group id is the same as audio output group id.";
-}
-
-/* Verify that when more that one audio input and more than one audio output
- * device names contain the video input device name the video device group id
- * does not change. */
-TEST(TestGroupId, NoMatch_ThreeIdenticalDevices) {
-  MediaManager::MediaDeviceSet devices;
-
-  nsString Cam_Model_GroupId = NS_LITERAL_STRING("Cam-Model-GroupId");
-  devices.AppendElement(
-      MakeCameraDevice(NS_LITERAL_STRING("Vendor Model"), Cam_Model_GroupId));
-
-  devices.AppendElement(
-      MakeMicDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                    NS_LITERAL_STRING("Mic-Model-GroupId")));
-  devices.AppendElement(
-      MakeMicDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                    NS_LITERAL_STRING("Mic-Model-GroupId")));
-  devices.AppendElement(
-      MakeMicDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                    NS_LITERAL_STRING("Mic-Model-GroupId")));
-
-  devices.AppendElement(
-      MakeSpeakerDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                        NS_LITERAL_STRING("Speaker-Model-GroupId")));
-  devices.AppendElement(
-      MakeSpeakerDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                        NS_LITERAL_STRING("Speaker-Model-GroupId")));
-  devices.AppendElement(
-      MakeSpeakerDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                        NS_LITERAL_STRING("Speaker-Model-GroupId")));
-
-  MediaManager::GuessVideoDeviceGroupIDs(devices);
-
-  EXPECT_EQ(devices[0]->mGroupID, Cam_Model_GroupId)
-      << "Video group id has not been updated.";
-  EXPECT_NE(devices[0]->mGroupID, devices[1]->mGroupID)
-      << "Video group id is different than audio input group id.";
-  EXPECT_NE(devices[0]->mGroupID, devices[4]->mGroupID)
-      << "Video group id is different than audio output group id.";
-}
-
-/* Verify that when an audio output device name contains the video input device
- * name the video device group id is updated to become equal to the audio
- * device group id. */
-TEST(TestGroupId, MatchOutput) {
-  MediaManager::MediaDeviceSet devices;
-
-  devices.AppendElement(
-      MakeCameraDevice(NS_LITERAL_STRING("Vendor Model"),
-                       NS_LITERAL_STRING("Cam-Model-GroupId")));
-
-  devices.AppendElement(MakeMicDevice(NS_LITERAL_STRING("Mic Analog Stereo"),
-                                      NS_LITERAL_STRING("Mic-Model-GroupId")));
-
-  devices.AppendElement(
-      MakeSpeakerDevice(NS_LITERAL_STRING("Vendor Model Analog Stereo"),
-                        NS_LITERAL_STRING("Speaker-Model-GroupId")));
-
-  MediaManager::GuessVideoDeviceGroupIDs(devices);
-
-  EXPECT_EQ(devices[0]->mGroupID, devices[2]->mGroupID)
-      << "Video group id is the same as audio output group id.";
-}
-
-/* Verify that when an audio input device name is the same as audio output
- * device and video input device name the video device group id is updated to
- * become equal to the audio input device group id. */
-TEST(TestGroupId, InputOutputSameName) {
-  MediaManager::MediaDeviceSet devices;
-
-  devices.AppendElement(
-      MakeCameraDevice(NS_LITERAL_STRING("Vendor Model"),
-                       NS_LITERAL_STRING("Cam-Model-GroupId")));
-
-  devices.AppendElement(MakeMicDevice(NS_LITERAL_STRING("Vendor Model"),
-                                      NS_LITERAL_STRING("Mic-Model-GroupId")));
-
-  devices.AppendElement(
-      MakeSpeakerDevice(NS_LITERAL_STRING("Vendor Model"),
-                        NS_LITERAL_STRING("Speaker-Model-GroupId")));
-
-  MediaManager::GuessVideoDeviceGroupIDs(devices);
-
-  EXPECT_EQ(devices[0]->mGroupID, devices[1]->mGroupID)
-      << "Video input group id is the same as audio input group id.";
-}
-
-/* Verify that when an audio input device name contains the video input device
- * and the audio input group id is an empty string, the video device group id
- * is updated to become equal to the audio device group id. */
-TEST(TestGroupId, InputEmptyGroupId) {
-  MediaManager::MediaDeviceSet devices;
-
-  devices.AppendElement(
-      MakeCameraDevice(NS_LITERAL_STRING("Vendor Model"),
-                       NS_LITERAL_STRING("Cam-Model-GroupId")));
-
-  devices.AppendElement(
-      MakeMicDevice(NS_LITERAL_STRING("Vendor Model"), NS_LITERAL_STRING("")));
-
-  MediaManager::GuessVideoDeviceGroupIDs(devices);
-
-  EXPECT_EQ(devices[0]->mGroupID, devices[1]->mGroupID)
-      << "Video input group id is the same as audio input group id.";
-}
-
-/* Verify that when an audio output device name contains the video input device
- * and the audio output group id is an empty string, the video device group id
- * is updated to become equal to the audio output device group id. */
-TEST(TestGroupId, OutputEmptyGroupId) {
-  MediaManager::MediaDeviceSet devices;
-
-  devices.AppendElement(
-      MakeCameraDevice(NS_LITERAL_STRING("Vendor Model"),
-                       NS_LITERAL_STRING("Cam-Model-GroupId")));
-
-  devices.AppendElement(MakeSpeakerDevice(NS_LITERAL_STRING("Vendor Model"),
-                                          NS_LITERAL_STRING("")));
-
-  MediaManager::GuessVideoDeviceGroupIDs(devices);
-
-  EXPECT_EQ(devices[0]->mGroupID, devices[1]->mGroupID)
-      << "Video input group id is the same as audio output group id.";
-}
--- a/dom/media/gtest/moz.build
+++ b/dom/media/gtest/moz.build
@@ -23,17 +23,16 @@ UNIFIED_SOURCES += [
     'TestAudioTrackEncoder.cpp',
     'TestBitWriter.cpp',
     'TestBlankVideoDataCreator.cpp',
     'TestCDMStorage.cpp',
     'TestDataMutex.cpp',
     'TestGMPCrossOrigin.cpp',
     'TestGMPRemoveAndDelete.cpp',
     'TestGMPUtils.cpp',
-    'TestGroupId.cpp',
     'TestIntervalSet.cpp',
     'TestMediaDataDecoder.cpp',
     'TestMediaDataEncoder.cpp',
     'TestMediaEventSource.cpp',
     'TestMediaMIMETypes.cpp',
     'TestMP3Demuxer.cpp',
     'TestMP4Demuxer.cpp',
     'TestOpusParser.cpp',
--- a/dom/media/nsIDOMNavigatorUserMedia.idl
+++ b/dom/media/nsIDOMNavigatorUserMedia.idl
@@ -8,17 +8,16 @@
 [scriptable, builtinclass, uuid(ba3b2e08-1c07-4cd3-8822-f4d7e35ff2ae)]
 interface nsIMediaDevice : nsISupports
 {
   readonly attribute AString type;
   readonly attribute AString name;
   readonly attribute AString id;
   readonly attribute AString mediaSource;
   readonly attribute AString rawId;
-  readonly attribute AString groupId;
   readonly attribute boolean scary;
 };
 
 [scriptable, function, uuid(24544878-d35e-4962-8c5f-fb84e97bdfee)]
 interface nsIGetUserMediaDevicesSuccessCallback : nsISupports
 {
   void onSuccess(in nsIVariant devices);
 };
--- a/dom/media/tests/mochitest/mochitest.ini
+++ b/dom/media/tests/mochitest/mochitest.ini
@@ -42,17 +42,16 @@ skip-if = toolkit == 'android'  # Bug 11
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_dataChannel_bug1013809.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_dataChannel_dataOnlyBufferedAmountLow.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_dataChannel_noOffer.html]
 [test_enumerateDevices.html]
 [test_enumerateDevices_navigation.html]
-[test_groupId.html]
 [test_ondevicechange.html]
 skip-if = os == 'android' || verify
 [test_getUserMedia_active_autoplay.html]
 [test_getUserMedia_audioCapture.html]
 skip-if = toolkit == 'android' # android(Bug 1189784, timeouts on 4.3 emulator), android(Bug 1264333)
 [test_getUserMedia_addTrackRemoveTrack.html]
 skip-if = android_version == '18' || os == 'linux' # android(Bug 1189784, timeouts on 4.3 emulator), linux bug 1377450
 [test_getUserMedia_addtrack_removetrack_events.html]
--- a/dom/media/tests/mochitest/test_enumerateDevices.html
+++ b/dom/media/tests/mochitest/test_enumerateDevices.html
@@ -33,17 +33,19 @@ async function mustFailWith(msg, reason,
 }
 
 var gUM = c => navigator.mediaDevices.getUserMedia(c);
 
 var validateDevice = ({kind, label, deviceId, groupId}) => {
   ok(kind == "videoinput" || kind == "audioinput", "Known device kind");
   is(deviceId.length, 44, "deviceId length id as expected for Firefox");
   ok(label.length !== undefined, "Device label: " + label);
-  isnot(groupId, "", "groupId must be present.");
+
+  // TODO: s/todo_// once Bug 1213453 is fixed.
+  todo_isnot(groupId, "", "groupId must be present.");
 }
 
 runTest(async () => {
   await pushPrefs(["media.navigator.streams.fake", true]);
 
   // Validate enumerated devices.
 
   let devices = await navigator.mediaDevices.enumerateDevices();
deleted file mode 100644
--- a/dom/media/tests/mochitest/test_groupId.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <script src="mediaStreamPlayback.js"></script>
-</head>
-<body>
-<pre id="test">
-<script type="application/javascript">
-createHTML({ title: "Test group id of MediaDeviceInfo", bug: "1213453" });
-
-let getDefaultDevices = async () => {
-  let devices = await navigator.mediaDevices.enumerateDevices();
-  is(devices.length, 2, "Two fake devices found.");
-
-  devices.forEach(d => isnot(d.groupId, "", "GroupId is included in every device"));
-
-  let videos = devices.filter(d => d.kind == "videoinput");
-  is(videos.length, 1, "One video device found.");
-  let audios = devices.filter(d => d.kind == "audioinput");
-  is(audios.length, 1, "One microphone device found.");
-
-  return {audio: audios[0], video: videos[0]};
-}
-
-runTest(async () => {
-  // Force fake devices in order to be able to change camera name by pref.
-  await pushPrefs(["media.navigator.streams.fake", true],
-                  ["media.audio_loopback_dev", ""],
-                  ["media.video_loopback_dev", ""]);
-
-  let {audio, video} = await getDefaultDevices();
-
-  /* The low level method to correlate groupIds is by device names.
-   * Use a similar comparison here to verify that it works.
-   * Multiple devices of the same device name are not expected in
-   * automation. */
-  isnot(audio.groupId, video.groupId,"Not the same groupIds");
-  // Change video name to match.
-  await pushPrefs(["media.getusermedia.fake-camera-name", audio.label]);
-  ({audio, video} = await getDefaultDevices());
-  is(audio.groupId, video.groupId, "GroupIds should be the same");
-});
-</script>
-</pre>
-</body>
-</html>
--- a/dom/media/webrtc/MediaEngineDefault.cpp
+++ b/dom/media/webrtc/MediaEngineDefault.cpp
@@ -27,59 +27,33 @@
 #  include "YuvStamper.h"
 #endif
 
 #define DEFAULT_AUDIO_TIMER_MS 10
 namespace mozilla {
 
 using namespace mozilla::gfx;
 
-static nsString DefaultVideoName() {
-  // For the purpose of testing we allow to change the name of the fake device
-  // by pref.
-  nsAutoString cameraNameFromPref;
-  nsresult rv;
-  NS_DispatchToMainThread(
-      NS_NewRunnableFunction(__func__,
-                             [&]() {
-                               rv = Preferences::GetString(
-                                   "media.getusermedia.fake-camera-name",
-                                   cameraNameFromPref);
-                             }),
-      NS_DISPATCH_SYNC);
-
-  if (NS_SUCCEEDED(rv)) {
-    return cameraNameFromPref;
-  }
-  return NS_LITERAL_STRING(u"Default Video Device");
-}
-
 /**
  * Default video source.
  */
 
 MediaEngineDefaultVideoSource::MediaEngineDefaultVideoSource()
-    : mTimer(nullptr),
-      mMutex("MediaEngineDefaultVideoSource::mMutex"),
-      mName(DefaultVideoName()) {}
+    : mTimer(nullptr), mMutex("MediaEngineDefaultVideoSource::mMutex") {}
 
 MediaEngineDefaultVideoSource::~MediaEngineDefaultVideoSource() {}
 
 nsString MediaEngineDefaultVideoSource::GetName() const {
-  return mName;
+  return NS_LITERAL_STRING(u"Default Video Device");
 }
 
 nsCString MediaEngineDefaultVideoSource::GetUUID() const {
   return NS_LITERAL_CSTRING("1041FCBD-3F12-4F7B-9E9B-1EC556DD5676");
 }
 
-nsString MediaEngineDefaultVideoSource::GetGroupId() const {
-  return NS_LITERAL_STRING(u"Default Video Group");
-}
-
 uint32_t MediaEngineDefaultVideoSource::GetBestFitnessDistance(
     const nsTArray<const NormalizedConstraintSet*>& aConstraintSets,
     const nsString& aDeviceId) const {
   AssertIsOnOwningThread();
 
   uint32_t distance = 0;
 #ifdef MOZ_WEBRTC
   for (const auto* cs : aConstraintSets) {
@@ -383,20 +357,16 @@ MediaEngineDefaultAudioSource::~MediaEng
 nsString MediaEngineDefaultAudioSource::GetName() const {
   return NS_LITERAL_STRING(u"Default Audio Device");
 }
 
 nsCString MediaEngineDefaultAudioSource::GetUUID() const {
   return NS_LITERAL_CSTRING("B7CBD7C1-53EF-42F9-8353-73F61C70C092");
 }
 
-nsString MediaEngineDefaultAudioSource::GetGroupId() const {
-  return NS_LITERAL_STRING(u"Default Audio Group");
-}
-
 uint32_t MediaEngineDefaultAudioSource::GetBestFitnessDistance(
     const nsTArray<const NormalizedConstraintSet*>& aConstraintSets,
     const nsString& aDeviceId) const {
   uint32_t distance = 0;
 #ifdef MOZ_WEBRTC
   for (const auto* cs : aConstraintSets) {
     distance =
         MediaConstraintsHelper::GetMinimumFitnessDistance(*cs, aDeviceId);
@@ -577,41 +547,39 @@ void MediaEngineDefault::EnumerateDevice
       // in Allocate().
 
       nsTArray<RefPtr<MediaEngineSource>>* devicesForThisWindow =
           mVSources.LookupOrAdd(aWindowId);
       auto newSource = MakeRefPtr<MediaEngineDefaultVideoSource>();
       devicesForThisWindow->AppendElement(newSource);
       aDevices->AppendElement(MakeRefPtr<MediaDevice>(
           newSource, newSource->GetName(),
-          NS_ConvertUTF8toUTF16(newSource->GetUUID()),
-          newSource->GetGroupId(), NS_LITERAL_STRING("")));
+          NS_ConvertUTF8toUTF16(newSource->GetUUID()), NS_LITERAL_STRING("")));
       return;
     }
     case dom::MediaSourceEnum::Microphone: {
       nsTArray<RefPtr<MediaEngineDefaultAudioSource>>* devicesForThisWindow =
           mASources.LookupOrAdd(aWindowId);
       for (const RefPtr<MediaEngineDefaultAudioSource>& source :
            *devicesForThisWindow) {
         if (source->IsAvailable()) {
           aDevices->AppendElement(MakeRefPtr<MediaDevice>(
               source, source->GetName(),
-              NS_ConvertUTF8toUTF16(source->GetUUID()),
-              source->GetGroupId(), NS_LITERAL_STRING("")));
+              NS_ConvertUTF8toUTF16(source->GetUUID()), NS_LITERAL_STRING("")));
         }
       }
 
       if (aDevices->IsEmpty()) {
         // All streams are currently busy, just make a new one.
         auto newSource = MakeRefPtr<MediaEngineDefaultAudioSource>();
         devicesForThisWindow->AppendElement(newSource);
-        aDevices->AppendElement(MakeRefPtr<MediaDevice>(
-            newSource, newSource->GetName(),
-            NS_ConvertUTF8toUTF16(newSource->GetUUID()),
-            newSource->GetGroupId(), NS_LITERAL_STRING("")));
+        aDevices->AppendElement(
+            MakeRefPtr<MediaDevice>(newSource, newSource->GetName(),
+                                    NS_ConvertUTF8toUTF16(newSource->GetUUID()),
+                                    NS_LITERAL_STRING("")));
       }
       return;
     }
     default:
       MOZ_ASSERT_UNREACHABLE("Unsupported source type");
       return;
   }
 
--- a/dom/media/webrtc/MediaEngineDefault.h
+++ b/dom/media/webrtc/MediaEngineDefault.h
@@ -36,17 +36,16 @@ class MediaEngineDefault;
  * The default implementation of the MediaEngine interface.
  */
 class MediaEngineDefaultVideoSource : public MediaEngineSource {
  public:
   MediaEngineDefaultVideoSource();
 
   nsString GetName() const override;
   nsCString GetUUID() const override;
-  nsString GetGroupId() const override;
 
   nsresult Allocate(const dom::MediaTrackConstraints& aConstraints,
                     const MediaEnginePrefs& aPrefs, const nsString& aDeviceId,
                     const ipc::PrincipalInfo& aPrincipalInfo,
                     AllocationHandle** aOutHandle,
                     const char** aOutBadConstraint) override;
   void SetTrack(const RefPtr<const AllocationHandle>& aHandle,
                 const RefPtr<SourceMediaStream>& aStream, TrackID aTrackID,
@@ -94,30 +93,26 @@ class MediaEngineDefaultVideoSource : pu
   MediaEngineSourceState mState = kReleased;
   RefPtr<layers::Image> mImage;
   RefPtr<SourceMediaStream> mStream;
   TrackID mTrackID = TRACK_NONE;
 
   MediaEnginePrefs mOpts;
   int mCb = 16;
   int mCr = 16;
-
-private:
-  const nsString mName;
 };
 
 class SineWaveGenerator;
 
 class MediaEngineDefaultAudioSource : public MediaEngineSource {
  public:
   MediaEngineDefaultAudioSource();
 
   nsString GetName() const override;
   nsCString GetUUID() const override;
-  nsString GetGroupId() const override;
 
   nsresult Allocate(const dom::MediaTrackConstraints& aConstraints,
                     const MediaEnginePrefs& aPrefs, const nsString& aDeviceId,
                     const ipc::PrincipalInfo& aPrincipalInfo,
                     AllocationHandle** aOutHandle,
                     const char** aOutBadConstraint) override;
   void SetTrack(const RefPtr<const AllocationHandle>& aHandle,
                 const RefPtr<SourceMediaStream>& aStream, TrackID aTrackID,
--- a/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
@@ -81,17 +81,16 @@ void MediaEngineRemoteVideoSource::Init(
                               kMaxDeviceNameLength, uniqueId,
                               kMaxUniqueIdLength, nullptr)) {
     LOG("Error initializing RemoteVideoSource (GetCaptureDevice)");
     return;
   }
 
   SetName(NS_ConvertUTF8toUTF16(deviceName));
   SetUUID(uniqueId);
-  SetGroupId(NS_ConvertUTF8toUTF16(deviceName));
 
   mInitDone = true;
 }
 
 void MediaEngineRemoteVideoSource::Shutdown() {
   LOG(__PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
@@ -176,28 +175,16 @@ void MediaEngineRemoteVideoSource::SetUU
 }
 
 nsCString MediaEngineRemoteVideoSource::GetUUID() const {
   AssertIsOnOwningThread();
 
   return mUniqueId;
 }
 
-void MediaEngineRemoteVideoSource::SetGroupId(nsString aGroupId) {
-  AssertIsOnOwningThread();
-
-  mGroupId = std::move(aGroupId);
-}
-
-nsString MediaEngineRemoteVideoSource::GetGroupId() const {
-  AssertIsOnOwningThread();
-
-  return mGroupId;
-}
-
 nsresult MediaEngineRemoteVideoSource::Allocate(
     const MediaTrackConstraints& aConstraints, const MediaEnginePrefs& aPrefs,
     const nsString& aDeviceId,
     const mozilla::ipc::PrincipalInfo& aPrincipalInfo,
     AllocationHandle** aOutHandle, const char** aOutBadConstraint) {
   LOG(__PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
@@ -1000,12 +987,11 @@ void MediaEngineRemoteVideoSource::Refre
                               mCapEngine, aIndex, deviceName,
                               sizeof(deviceName), uniqueId, sizeof(uniqueId),
                               nullptr)) {
     return;
   }
 
   SetName(NS_ConvertUTF8toUTF16(deviceName));
   MOZ_ASSERT(mUniqueId.Equals(uniqueId));
-  SetGroupId(NS_ConvertUTF8toUTF16(deviceName));
 }
 
 }  // namespace mozilla
--- a/dom/media/webrtc/MediaEngineRemoteVideoSource.h
+++ b/dom/media/webrtc/MediaEngineRemoteVideoSource.h
@@ -148,19 +148,16 @@ class MediaEngineRemoteVideoSource : pub
   void Shutdown() override;
 
   nsString GetName() const override;
   void SetName(nsString aName);
 
   nsCString GetUUID() const override;
   void SetUUID(const char* aUUID);
 
-  nsString GetGroupId() const override;
-  void SetGroupId(nsString aGroupId);
-
   bool GetScary() const override { return mScary; }
 
   RefPtr<GenericNonExclusivePromise> GetFirstFramePromise() const override {
     return mFirstFramePromise;
   }
 
  private:
   // Initialize the needed Video engine interfaces.
@@ -248,17 +245,16 @@ class MediaEngineRemoteVideoSource : pub
    *
    * This is mutable so that the const method NumCapabilities() can reset it.
    * Owning thread only.
    */
   mutable nsTArray<webrtc::CaptureCapability> mHardcodedCapabilities;
 
   nsString mDeviceName;
   nsCString mUniqueId;
-  nsString mGroupId;
   nsString mFacingMode;
 
   // Whether init has successfully completed.
   // Set in Init(), reset in Shutdown().
   // Owning thread only.
   bool mInitDone = false;
 };
 
--- a/dom/media/webrtc/MediaEngineSource.h
+++ b/dom/media/webrtc/MediaEngineSource.h
@@ -100,21 +100,16 @@ class MediaEngineSourceInterface {
   virtual nsString GetName() const = 0;
 
   /**
    * Gets the UUID of this device.
    */
   virtual nsCString GetUUID() const = 0;
 
   /**
-   * Gets the Group id of this device.
-   */
-  virtual nsString GetGroupId() const = 0;
-
-  /**
    * Get the enum describing the underlying type of MediaSource.
    */
   virtual dom::MediaSourceEnum GetMediaSource() const = 0;
 
   /**
    * Override w/true if source does end-run around cross origin restrictions.
    */
   virtual bool GetScary() const = 0;
--- a/dom/media/webrtc/MediaEngineTabVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineTabVideoSource.cpp
@@ -110,20 +110,16 @@ nsresult MediaEngineTabVideoSource::Dest
 nsString MediaEngineTabVideoSource::GetName() const {
   return NS_LITERAL_STRING(u"&getUserMedia.videoSource.tabShare;");
 }
 
 nsCString MediaEngineTabVideoSource::GetUUID() const {
   return NS_LITERAL_CSTRING("tab");
 }
 
-nsString MediaEngineTabVideoSource::GetGroupId() const {
-  return NS_LITERAL_STRING(u"&getUserMedia.videoSource.tabShareGroup;");
-}
-
 #define DEFAULT_TABSHARE_VIDEO_MAX_WIDTH 4096
 #define DEFAULT_TABSHARE_VIDEO_MAX_HEIGHT 4096
 #define DEFAULT_TABSHARE_VIDEO_FRAMERATE 30
 
 nsresult MediaEngineTabVideoSource::Allocate(
     const dom::MediaTrackConstraints& aConstraints,
     const MediaEnginePrefs& aPrefs, const nsString& aDeviceId,
     const mozilla::ipc::PrincipalInfo& aPrincipalInfo,
--- a/dom/media/webrtc/MediaEngineTabVideoSource.h
+++ b/dom/media/webrtc/MediaEngineTabVideoSource.h
@@ -16,17 +16,16 @@ class ImageContainer;
 }
 
 class MediaEngineTabVideoSource : public MediaEngineSource {
  public:
   MediaEngineTabVideoSource();
 
   nsString GetName() const override;
   nsCString GetUUID() const override;
-  nsString GetGroupId() const override;
 
   bool GetScary() const override { return true; }
 
   dom::MediaSourceEnum GetMediaSource() const override {
     return dom::MediaSourceEnum::Browser;
   }
 
   nsresult Allocate(const dom::MediaTrackConstraints& aConstraints,
--- a/dom/media/webrtc/MediaEngineWebRTC.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTC.cpp
@@ -139,25 +139,25 @@ void MediaEngineWebRTC::EnumerateVideoDe
       static_cast<MediaEngineRemoteVideoSource*>(vSource.get())->Refresh(i);
     } else {
       vSource = new MediaEngineRemoteVideoSource(i, aCapEngine,
                                                  scaryKind || scarySource);
       devicesForThisWindow->Put(uuid, vSource);
     }
     aDevices->AppendElement(MakeRefPtr<MediaDevice>(
         vSource, vSource->GetName(), NS_ConvertUTF8toUTF16(vSource->GetUUID()),
-        vSource->GetGroupId(), NS_LITERAL_STRING("")));
+        NS_LITERAL_STRING("")));
   }
 
   if (mHasTabVideoSource || aCapEngine == camera::BrowserEngine) {
     RefPtr<MediaEngineSource> tabVideoSource = new MediaEngineTabVideoSource();
     aDevices->AppendElement(MakeRefPtr<MediaDevice>(
         tabVideoSource, tabVideoSource->GetName(),
         NS_ConvertUTF8toUTF16(tabVideoSource->GetUUID()),
-        tabVideoSource->GetGroupId(), NS_LITERAL_STRING("")));
+        NS_LITERAL_STRING("")));
   }
 }
 
 void MediaEngineWebRTC::EnumerateMicrophoneDevices(
     uint64_t aWindowId, nsTArray<RefPtr<MediaDevice>>* aDevices) {
   mMutex.AssertCurrentThreadOwns();
 
   mEnumerator = CubebDeviceEnumerator::GetInstance();
@@ -176,21 +176,21 @@ void MediaEngineWebRTC::EnumerateMicroph
          NS_ConvertUTF16toUTF8(devices[i]->Name()).get(),
          devices[i]->DeviceID()));
 
     if (devices[i]->State() == CUBEB_DEVICE_STATE_ENABLED) {
       MOZ_ASSERT(devices[i]->Type() == CUBEB_DEVICE_TYPE_INPUT);
       RefPtr<MediaEngineSource> source = new MediaEngineWebRTCMicrophoneSource(
           devices[i], devices[i]->Name(),
           // Lie and provide the name as UUID
-          NS_ConvertUTF16toUTF8(devices[i]->Name()), devices[i]->GroupID(),
-          devices[i]->MaxChannels(), mDelayAgnostic, mExtendedFilter);
+          NS_ConvertUTF16toUTF8(devices[i]->Name()), devices[i]->MaxChannels(),
+          mDelayAgnostic, mExtendedFilter);
       RefPtr<MediaDevice> device = MakeRefPtr<MediaDevice>(
           source, source->GetName(), NS_ConvertUTF8toUTF16(source->GetUUID()),
-          source->GetGroupId(), NS_LITERAL_STRING(""));
+          NS_LITERAL_STRING(""));
       if (devices[i]->Preferred()) {
 #ifdef DEBUG
         if (!foundPreferredDevice) {
           foundPreferredDevice = true;
         } else {
           MOZ_ASSERT(!foundPreferredDevice,
                      "Found more than one preferred audio input device"
                      "while enumerating");
@@ -215,18 +215,17 @@ void MediaEngineWebRTC::EnumerateSpeaker
   for (auto& device : devices) {
     if (device->State() == CUBEB_DEVICE_STATE_ENABLED) {
       MOZ_ASSERT(device->Type() == CUBEB_DEVICE_TYPE_OUTPUT);
       nsString uuid(device->Name());
       // If, for example, input and output are in the same device, uuid
       // would be the same for both which ends up to create the same
       // deviceIDs (in JS).
       uuid.Append(NS_LITERAL_STRING("_Speaker"));
-      nsString groupId(device->GroupID());
-      aDevices->AppendElement(MakeRefPtr<MediaDevice>(device, uuid, groupId));
+      aDevices->AppendElement(MakeRefPtr<MediaDevice>(device, uuid));
     }
   }
 }
 
 void MediaEngineWebRTC::EnumerateDevices(
     uint64_t aWindowId, dom::MediaSourceEnum aMediaSource,
     MediaSinkEnum aMediaSink, nsTArray<RefPtr<MediaDevice>>* aDevices) {
   MOZ_ASSERT(aMediaSource != dom::MediaSourceEnum::Other ||
@@ -259,17 +258,17 @@ void MediaEngineWebRTC::EnumerateDevices
         break;
     }
   } else if (aMediaSource == dom::MediaSourceEnum::AudioCapture) {
     RefPtr<MediaEngineWebRTCAudioCaptureSource> audioCaptureSource =
         new MediaEngineWebRTCAudioCaptureSource(nullptr);
     aDevices->AppendElement(MakeRefPtr<MediaDevice>(
         audioCaptureSource, audioCaptureSource->GetName(),
         NS_ConvertUTF8toUTF16(audioCaptureSource->GetUUID()),
-        audioCaptureSource->GetGroupId(), NS_LITERAL_STRING("")));
+        NS_LITERAL_STRING("")));
   } else if (aMediaSource == dom::MediaSourceEnum::Microphone) {
     MOZ_ASSERT(aMediaSource == dom::MediaSourceEnum::Microphone);
     EnumerateMicrophoneDevices(aWindowId, aDevices);
   }
 
   if (aMediaSink == MediaSinkEnum::Speaker) {
     EnumerateSpeakerDevices(aWindowId, aDevices);
   }
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -41,26 +41,25 @@ extern LazyLogModule gMediaManagerLog;
 #define LOG_ERROR(...) MOZ_LOG(gMediaManagerLog, LogLevel::Error, (__VA_ARGS__))
 
 /**
  * WebRTC Microphone MediaEngineSource.
  */
 
 MediaEngineWebRTCMicrophoneSource::MediaEngineWebRTCMicrophoneSource(
     RefPtr<AudioDeviceInfo> aInfo, const nsString& aDeviceName,
-    const nsCString& aDeviceUUID, const nsString& aDeviceGroup,
-    uint32_t aMaxChannelCount, bool aDelayAgnostic, bool aExtendedFilter)
+    const nsCString& aDeviceUUID, uint32_t aMaxChannelCount,
+    bool aDelayAgnostic, bool aExtendedFilter)
     : mTrackID(TRACK_NONE),
       mPrincipal(PRINCIPAL_HANDLE_NONE),
       mDeviceInfo(std::move(aInfo)),
       mDelayAgnostic(aDelayAgnostic),
       mExtendedFilter(aExtendedFilter),
       mDeviceName(aDeviceName),
       mDeviceUUID(aDeviceUUID),
-      mDeviceGroup(aDeviceGroup),
       mDeviceMaxChannelCount(aMaxChannelCount),
       mSettings(new nsMainThreadPtrHolder<
                 media::Refcountable<dom::MediaTrackSettings>>(
           "MediaEngineWebRTCMicrophoneSource::mSettings",
           new media::Refcountable<dom::MediaTrackSettings>(),
           // Non-strict means it won't assert main thread for us.
           // It would be great if it did but we're already on the media thread.
           /* aStrict = */ false)) {
@@ -80,20 +79,16 @@ MediaEngineWebRTCMicrophoneSource::Media
 nsString MediaEngineWebRTCMicrophoneSource::GetName() const {
   return mDeviceName;
 }
 
 nsCString MediaEngineWebRTCMicrophoneSource::GetUUID() const {
   return mDeviceUUID;
 }
 
-nsString MediaEngineWebRTCMicrophoneSource::GetGroupId() const {
-  return mDeviceGroup;
-}
-
 // GetBestFitnessDistance returns the best distance the capture device can offer
 // as a whole, given an accumulated number of ConstraintSets.
 // Ideal values are considered in the first ConstraintSet only.
 // Plain values are treated as Ideal in the first ConstraintSet.
 // Plain values are treated as Exact in subsequent ConstraintSets.
 // Infinity = UINT32_MAX e.g. device cannot satisfy accumulated ConstraintSets.
 // A finite result may be used to calculate this device's ranking as a choice.
 
@@ -1163,20 +1158,16 @@ nsCString MediaEngineWebRTCAudioCaptureS
 
   uuid.ToProvidedString(uuidBuffer);
   asciiString.AssignASCII(uuidBuffer);
 
   // Remove {} and the null terminator
   return nsCString(Substring(asciiString, 1, NSID_LENGTH - 3));
 }
 
-nsString MediaEngineWebRTCAudioCaptureSource::GetGroupId() const {
-  return NS_LITERAL_STRING(u"AudioCaptureGroup");
-}
-
 void MediaEngineWebRTCAudioCaptureSource::SetTrack(
     const RefPtr<const AllocationHandle>&,
     const RefPtr<SourceMediaStream>& aStream, TrackID aTrackID,
     const PrincipalHandle& aPrincipalHandle) {
   AssertIsOnOwningThread();
   // Nothing to do here. aStream is a placeholder dummy and not exposed.
 }
 
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.h
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.h
@@ -23,25 +23,24 @@ class AudioInputProcessing;
 //   the main thread and then the MSG thread so that it can be used as part of
 //   the graph processing. On destruction, similarly, a message is sent to the
 //   graph so that it stops using it, and then it is deleted.
 // - mSettings is created on the MediaManager thread is always ever accessed on
 //   the Main Thread. It is const.
 class MediaEngineWebRTCMicrophoneSource : public MediaEngineSource {
  public:
   MediaEngineWebRTCMicrophoneSource(RefPtr<AudioDeviceInfo> aInfo,
-                                    const nsString& aName, const nsCString& aUuid,
-                                    const nsString& aGroupId, uint32_t aMaxChannelCount,
+                                    const nsString& name, const nsCString& uuid,
+                                    uint32_t maxChannelCount,
                                     bool aDelayAgnostic, bool aExtendedFilter);
 
   bool RequiresSharing() const override { return false; }
 
   nsString GetName() const override;
   nsCString GetUUID() const override;
-  nsString GetGroupId() const override;
 
   nsresult Allocate(const dom::MediaTrackConstraints& aConstraints,
                     const MediaEnginePrefs& aPrefs, const nsString& aDeviceId,
                     const ipc::PrincipalInfo& aPrincipalInfo,
                     AllocationHandle** aOutHandle,
                     const char** aOutBadConstraint) override;
   nsresult Deallocate(const RefPtr<const AllocationHandle>& aHandle) override;
   void SetTrack(const RefPtr<const AllocationHandle>& aHandle,
@@ -113,17 +112,16 @@ class MediaEngineWebRTCMicrophoneSource 
   TrackID mTrackID = TRACK_NONE;
   PrincipalHandle mPrincipal = PRINCIPAL_HANDLE_NONE;
 
   const RefPtr<AudioDeviceInfo> mDeviceInfo;
   const bool mDelayAgnostic;
   const bool mExtendedFilter;
   const nsString mDeviceName;
   const nsCString mDeviceUUID;
-  const nsString mDeviceGroup;
 
   // The maximum number of channels that this device supports.
   const uint32_t mDeviceMaxChannelCount;
   // The current settings for the underlying device.
   // Constructed on the MediaManager thread, and then only ever accessed on the
   // main thread.
   const nsMainThreadPtrHandle<media::Refcountable<dom::MediaTrackSettings>>
       mSettings;
@@ -252,17 +250,16 @@ class AudioInputProcessing : public Audi
   bool mEnded;
 };
 
 class MediaEngineWebRTCAudioCaptureSource : public MediaEngineSource {
  public:
   explicit MediaEngineWebRTCAudioCaptureSource(const char* aUuid) {}
   nsString GetName() const override;
   nsCString GetUUID() const override;
-  nsString GetGroupId() const override;
   nsresult Allocate(const dom::MediaTrackConstraints& aConstraints,
                     const MediaEnginePrefs& aPrefs, const nsString& aDeviceId,
                     const ipc::PrincipalInfo& aPrincipalInfo,
                     AllocationHandle** aOutHandle,
                     const char** aOutBadConstraint) override {
     // Nothing to do here, everything is managed in MediaManager.cpp
     *aOutHandle = nullptr;
     return NS_OK;
--- a/dom/media/webrtc/MediaTrackConstraints.cpp
+++ b/dom/media/webrtc/MediaTrackConstraints.cpp
@@ -512,19 +512,19 @@ uint32_t MediaConstraintsHelper::Fitness
   return "";
 }
 
 /* static */ const char* MediaConstraintsHelper::FindBadConstraint(
     const NormalizedConstraints& aConstraints,
     const RefPtr<MediaEngineSource>& aMediaEngineSource,
     const nsString& aDeviceId) {
   AutoTArray<RefPtr<MediaDevice>, 1> devices;
-  devices.AppendElement(MakeRefPtr<MediaDevice>(
-      aMediaEngineSource, aMediaEngineSource->GetName(), aDeviceId,
-      aMediaEngineSource->GetGroupId(), NS_LITERAL_STRING("")));
+  devices.AppendElement(
+      MakeRefPtr<MediaDevice>(aMediaEngineSource, aMediaEngineSource->GetName(),
+                              aDeviceId, NS_LITERAL_STRING("")));
   return FindBadConstraint(aConstraints, devices);
 }
 
 static void LogConstraintStringRange(
     const NormalizedConstraintSet::StringRange& aRange) {
   if (aRange.mExact.size() <= 1 && aRange.mIdeal.size() <= 1) {
     LOG("  %s: { exact: [%s], ideal: [%s] }", aRange.mName,
         (aRange.mExact.size()