Exposing RtpSenders and RtpReceivers from PeerConnection.

This CL essentially converts [Local|Remote]TrackHandler to
Rtp[Sender|Receiver], and adds a "SetTrack" method for RtpSender.

It also gets rid of MediaStreamHandler and MediaStreamHandlerContainer,
since these classes weren't really anything more than containers.
PeerConnection now manages the RtpSenders and RtpReceivers directly.

Review URL: https://codereview.webrtc.org/1351803002

Cr-Commit-Position: refs/heads/master@{#10100}
diff --git a/talk/app/webrtc/rtpreceiver.h b/talk/app/webrtc/rtpreceiver.h
index aee77e1..f5bcb2e 100644
--- a/talk/app/webrtc/rtpreceiver.h
+++ b/talk/app/webrtc/rtpreceiver.h
@@ -25,4 +25,80 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// This file is currently stubbed so that Chromium's build files can be updated.
+// This file contains classes that implement RtpReceiverInterface.
+// An RtpReceiver associates a MediaStreamTrackInterface with an underlying
+// transport (provided by AudioProviderInterface/VideoProviderInterface)
+
+#ifndef TALK_APP_WEBRTC_RTPRECEIVER_H_
+#define TALK_APP_WEBRTC_RTPRECEIVER_H_
+
+#include <string>
+
+#include "talk/app/webrtc/mediastreamprovider.h"
+#include "talk/app/webrtc/rtpreceiverinterface.h"
+#include "webrtc/base/basictypes.h"
+
+namespace webrtc {
+
+class AudioRtpReceiver : public ObserverInterface,
+                         public AudioSourceInterface::AudioObserver,
+                         public rtc::RefCountedObject<RtpReceiverInterface> {
+ public:
+  AudioRtpReceiver(AudioTrackInterface* track,
+                   uint32 ssrc,
+                   AudioProviderInterface* provider);
+
+  virtual ~AudioRtpReceiver();
+
+  // ObserverInterface implementation
+  void OnChanged() override;
+
+  // AudioSourceInterface::AudioObserver implementation
+  void OnSetVolume(double volume) override;
+
+  // RtpReceiverInterface implementation
+  rtc::scoped_refptr<MediaStreamTrackInterface> track() const override {
+    return track_.get();
+  }
+
+  std::string id() const override { return id_; }
+
+  void Stop() override;
+
+ private:
+  void Reconfigure();
+
+  std::string id_;
+  rtc::scoped_refptr<AudioTrackInterface> track_;
+  uint32 ssrc_;
+  AudioProviderInterface* provider_;
+  bool cached_track_enabled_;
+};
+
+class VideoRtpReceiver : public rtc::RefCountedObject<RtpReceiverInterface> {
+ public:
+  VideoRtpReceiver(VideoTrackInterface* track,
+                   uint32 ssrc,
+                   VideoProviderInterface* provider);
+
+  virtual ~VideoRtpReceiver();
+
+  // RtpReceiverInterface implementation
+  rtc::scoped_refptr<MediaStreamTrackInterface> track() const override {
+    return track_.get();
+  }
+
+  std::string id() const override { return id_; }
+
+  void Stop() override;
+
+ private:
+  std::string id_;
+  rtc::scoped_refptr<VideoTrackInterface> track_;
+  uint32 ssrc_;
+  VideoProviderInterface* provider_;
+};
+
+}  // namespace webrtc
+
+#endif  // TALK_APP_WEBRTC_RTPRECEIVER_H_