Moving the pacer and the pacer thread to ChannelGroup.

This means all channels within the same group will share the same pacing queue and scheduler. It also means padding will be computed and sent by a single pacer. To accomplish this I also introduce a PacketRouter which finds the RTP module which owns the packet to be paced out.

BUG=4323
R=mflodman@webrtc.org, pbos@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/45549004

Cr-Commit-Position: refs/heads/master@{#8864}
diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_impl.h b/webrtc/modules/bitrate_controller/bitrate_controller_impl.h
index dec4afa..3d38a54 100644
--- a/webrtc/modules/bitrate_controller/bitrate_controller_impl.h
+++ b/webrtc/modules/bitrate_controller/bitrate_controller_impl.h
@@ -29,7 +29,7 @@
 class BitrateControllerImpl : public BitrateController {
  public:
   BitrateControllerImpl(Clock* clock, BitrateObserver* observer);
-  virtual ~BitrateControllerImpl();
+  virtual ~BitrateControllerImpl() {}
 
   bool AvailableBandwidth(uint32_t* bandwidth) const override;
 
@@ -57,6 +57,11 @@
 
   void MaybeTriggerOnNetworkChanged();
 
+  // Returns true if the parameters have changed since the last call.
+  bool GetNetworkParameters(uint32_t* bitrate,
+                            uint8_t* fraction_loss,
+                            int64_t* rtt);
+
   void OnNetworkChanged(uint32_t bitrate,
                         uint8_t fraction_loss,  // 0 - 255.
                         int64_t rtt)
@@ -67,7 +72,7 @@
   BitrateObserver* observer_;
   int64_t last_bitrate_update_ms_;
 
-  CriticalSectionWrapper* critsect_;
+  const rtc::scoped_ptr<CriticalSectionWrapper> critsect_;
   SendSideBandwidthEstimation bandwidth_estimation_ GUARDED_BY(*critsect_);
   uint32_t reserved_bitrate_bps_ GUARDED_BY(*critsect_);