Change RtpSender to have multiple stream_ids

This is part of the work towards implementing Unified Plan.

In Unified Plan, an RtpSender/MediaStreamTrack can be a part of
multiple streams. This changes RtpSender to internally store
stream ids as a vector so that later CL's can update downstream
consumers to support multiple streams. For now, the vector can
only have exactly one element in it, but once the supporting code
has been updated the singular getter/setter will be removed and
any number of streams can be associated with an RtpSender.

Bug: webrtc:8183
Change-Id: I499a77ce79198861d35c91328b40ced2eb913cc0
Reviewed-on: https://chromium-review.googlesource.com/646712
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19733}
diff --git a/webrtc/pc/mediasession.cc b/webrtc/pc/mediasession.cc
index 2d9fd94..e1c3dd4 100644
--- a/webrtc/pc/mediasession.cc
+++ b/webrtc/pc/mediasession.cc
@@ -498,7 +498,9 @@
         }
       }
       stream_param.cname = rtcp_cname;
-      stream_param.sync_label = sender.stream_id;
+      // TODO(steveanton): Support any number of stream ids.
+      RTC_CHECK(sender.stream_ids.size() == 1U);
+      stream_param.sync_label = sender.stream_ids[0];
       content_description->AddStream(stream_param);
 
       // Store the new StreamParams in current_streams.
@@ -508,7 +510,9 @@
       // Use existing generated SSRCs/groups, but update the sync_label if
       // necessary. This may be needed if a MediaStreamTrack was moved from one
       // MediaStream to another.
-      param->sync_label = sender.stream_id;
+      // TODO(steveanton): Support any number of stream ids.
+      RTC_CHECK(sender.stream_ids.size() == 1U);
+      param->sync_label = sender.stream_ids[0];
       content_description->AddStream(*param);
     }
   }
@@ -1250,29 +1254,36 @@
   return dir_str;
 }
 
-void MediaDescriptionOptions::AddAudioSender(const std::string& track_id,
-                                             const std::string& stream_id) {
+void MediaDescriptionOptions::AddAudioSender(
+    const std::string& track_id,
+    const std::vector<std::string>& stream_ids) {
   RTC_DCHECK(type == MEDIA_TYPE_AUDIO);
-  AddSenderInternal(track_id, stream_id, 1);
+  AddSenderInternal(track_id, stream_ids, 1);
 }
 
-void MediaDescriptionOptions::AddVideoSender(const std::string& track_id,
-                                             const std::string& stream_id,
-                                             int num_sim_layers) {
+void MediaDescriptionOptions::AddVideoSender(
+    const std::string& track_id,
+    const std::vector<std::string>& stream_ids,
+    int num_sim_layers) {
   RTC_DCHECK(type == MEDIA_TYPE_VIDEO);
-  AddSenderInternal(track_id, stream_id, num_sim_layers);
+  AddSenderInternal(track_id, stream_ids, num_sim_layers);
 }
 
 void MediaDescriptionOptions::AddRtpDataChannel(const std::string& track_id,
                                                 const std::string& stream_id) {
   RTC_DCHECK(type == MEDIA_TYPE_DATA);
-  AddSenderInternal(track_id, stream_id, 1);
+  // TODO(steveanton): Is it the case that RtpDataChannel will never have more
+  // than one stream?
+  AddSenderInternal(track_id, {stream_id}, 1);
 }
 
-void MediaDescriptionOptions::AddSenderInternal(const std::string& track_id,
-                                                const std::string& stream_id,
-                                                int num_sim_layers) {
-  sender_options.push_back(SenderOptions{track_id, stream_id, num_sim_layers});
+void MediaDescriptionOptions::AddSenderInternal(
+    const std::string& track_id,
+    const std::vector<std::string>& stream_ids,
+    int num_sim_layers) {
+  // TODO(steveanton): Support any number of stream ids.
+  RTC_CHECK(stream_ids.size() == 1U);
+  sender_options.push_back(SenderOptions{track_id, stream_ids, num_sim_layers});
 }
 
 bool MediaSessionOptions::HasMediaDescription(MediaType type) const {