Signal track ID correctly when Unified Plan semantics selected

This change corrects PeerConnection behavior under Unified
Plan semantics to:
- Set the RtpSender id to be the track ID if created with AddTrack.
- Put the RtpSender id in the SDP as part of the MSID.
- Set the RtpReceiver id to be the track part of the MSID
    when created via SetRemoteDescription.

Also, the RtpSender constructors have been simplified to defer
mutable state (in this case, setting BaseChannels) to method calls.

Bug: webrtc:8721
Change-Id: Idc80965e2df7a803b8bbeec1d96de9ad95391cce
Reviewed-on: https://webrtc-review.googlesource.com/38480
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21563}
diff --git a/pc/peerconnection_rtp_unittest.cc b/pc/peerconnection_rtp_unittest.cc
index 78e18c3..f418f7e 100644
--- a/pc/peerconnection_rtp_unittest.cc
+++ b/pc/peerconnection_rtp_unittest.cc
@@ -736,6 +736,17 @@
   EXPECT_EQ(RtpTransceiverDirection::kSendRecv, transceiver->direction());
 }
 
+TEST_F(PeerConnectionRtpUnifiedPlanTest, AddTrackCreatesSenderWithTrackId) {
+  const std::string kTrackId = "audio_track";
+
+  auto caller = CreatePeerConnectionWithUnifiedPlan();
+
+  auto audio_track = caller->CreateAudioTrack(kTrackId);
+  auto sender = caller->AddTrack(audio_track);
+
+  EXPECT_EQ(kTrackId, sender->id());
+}
+
 // Unified Plan AddTrack error handling.
 
 TEST_F(PeerConnectionRtpUnifiedPlanTest, AddTrackErrorIfClosed) {