Remove the groupid field

This field is unused within WebRTC, and doesn't seem to
be essential for any existing customers.
If this works well, it will be deprecated and removed.

Bug: none
Change-Id: I96d7485e4d094abfa6a8c3d1e6855834c13dedd7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189680
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35263}
diff --git a/media/base/stream_params.cc b/media/base/stream_params.cc
index db781ac..0fe1be6 100644
--- a/media/base/stream_params.cc
+++ b/media/base/stream_params.cc
@@ -111,7 +111,7 @@
 StreamParams& StreamParams::operator=(StreamParams&&) = default;
 
 bool StreamParams::operator==(const StreamParams& other) const {
-  return (groupid == other.groupid && id == other.id && ssrcs == other.ssrcs &&
+  return (id == other.id && ssrcs == other.ssrcs &&
           ssrc_groups == other.ssrc_groups && cname == other.cname &&
           stream_ids_ == other.stream_ids_ &&
           // RIDs are not required to be in the same order for equality.
@@ -122,9 +122,6 @@
   char buf[2 * 1024];
   rtc::SimpleStringBuilder sb(buf);
   sb << "{";
-  if (!groupid.empty()) {
-    sb << "groupid:" << groupid << ";";
-  }
   if (!id.empty()) {
     sb << "id:" << id << ";";
   }
diff --git a/media/base/stream_params.h b/media/base/stream_params.h
index b8c3770..1f46469 100644
--- a/media/base/stream_params.h
+++ b/media/base/stream_params.h
@@ -183,11 +183,6 @@
 
   std::string ToString() const;
 
-  // Resource of the MUC jid of the participant of with this stream.
-  // For 1:1 calls, should be left empty (which means remote streams
-  // and local streams should not be mixed together). This is not used
-  // internally and should be deprecated.
-  std::string groupid;
   // A unique identifier of the StreamParams object. When the SDP is created,
   // this comes from the track ID of the sender that the StreamParams object
   // is associated with.
@@ -224,26 +219,22 @@
   std::vector<RidDescription> rids_;
 };
 
-// A Stream can be selected by either groupid+id or ssrc.
+// A Stream can be selected by either id or ssrc.
 struct StreamSelector {
   explicit StreamSelector(uint32_t ssrc) : ssrc(ssrc) {}
 
-  StreamSelector(const std::string& groupid, const std::string& streamid)
-      : ssrc(0), groupid(groupid), streamid(streamid) {}
-
   explicit StreamSelector(const std::string& streamid)
       : ssrc(0), streamid(streamid) {}
 
   bool Matches(const StreamParams& stream) const {
     if (ssrc == 0) {
-      return stream.groupid == groupid && stream.id == streamid;
+      return stream.id == streamid;
     } else {
       return stream.has_ssrc(ssrc);
     }
   }
 
   uint32_t ssrc;
-  std::string groupid;
   std::string streamid;
 };
 
@@ -274,19 +265,15 @@
 }
 
 inline const StreamParams* GetStreamByIds(const StreamParamsVec& streams,
-                                          const std::string& groupid,
                                           const std::string& id) {
-  return GetStream(streams, [&groupid, &id](const StreamParams& sp) {
-    return sp.groupid == groupid && sp.id == id;
-  });
+  return GetStream(streams,
+                   [&id](const StreamParams& sp) { return sp.id == id; });
 }
 
 inline StreamParams* GetStreamByIds(StreamParamsVec& streams,
-                                    const std::string& groupid,
                                     const std::string& id) {
-  return GetStream(streams, [&groupid, &id](const StreamParams& sp) {
-    return sp.groupid == groupid && sp.id == id;
-  });
+  return GetStream(streams,
+                   [&id](const StreamParams& sp) { return sp.id == id; });
 }
 
 inline const StreamParams* GetStream(const StreamParamsVec& streams,
@@ -318,11 +305,9 @@
       streams, [&ssrc](const StreamParams& sp) { return sp.has_ssrc(ssrc); });
 }
 inline bool RemoveStreamByIds(StreamParamsVec* streams,
-                              const std::string& groupid,
                               const std::string& id) {
-  return RemoveStream(streams, [&groupid, &id](const StreamParams& sp) {
-    return sp.groupid == groupid && sp.id == id;
-  });
+  return RemoveStream(streams,
+                      [&id](const StreamParams& sp) { return sp.id == id; });
 }
 
 }  // namespace cricket
diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc
index b38ab94..ca5946b 100644
--- a/pc/channel_unittest.cc
+++ b/pc/channel_unittest.cc
@@ -626,13 +626,11 @@
   // SdpType::kOffer / SdpType::kAnswer.
   void TestChangeStreamParamsInContent() {
     cricket::StreamParams stream1;
-    stream1.groupid = "group1";
     stream1.id = "stream1";
     stream1.ssrcs.push_back(kSsrc1);
     stream1.cname = "stream1_cname";
 
     cricket::StreamParams stream2;
-    stream2.groupid = "group1";
     stream2.id = "stream2";
     stream2.ssrcs.push_back(kSsrc2);
     stream2.cname = "stream2_cname";
diff --git a/pc/media_session.cc b/pc/media_session.cc
index 6b8f254..21da2da 100644
--- a/pc/media_session.cc
+++ b/pc/media_session.cc
@@ -443,10 +443,7 @@
       ContainsFlexfecCodec(content_description->codecs());
 
   for (const SenderOptions& sender : sender_options) {
-    // groupid is empty for StreamParams generated using
-    // MediaSessionDescriptionFactory.
-    StreamParams* param =
-        GetStreamByIds(*current_streams, "" /*group_id*/, sender.track_id);
+    StreamParams* param = GetStreamByIds(*current_streams, sender.track_id);
     if (!param) {
       // This is a new sender.
       StreamParams stream_param =