Refactoring RtpSenderInternal to share implementation for Audio & Video.

Most of the implementation in rtp_sender.cc is a copy paste for both
Audio & Video RTP senders. This change moves all the common behavior
into the base RtpSenderInternal class.
Template method pattern is used to accomodate for the very slight differences
between audio and video senders.

Bug: None
Change-Id: I6d4e93cd32fbb0fb361fd0e1883791019bde9a92
Reviewed-on: https://webrtc-review.googlesource.com/c/123411
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26758}
diff --git a/media/base/media_channel.h b/media/base/media_channel.h
index 5f5f32d..2a08c68 100644
--- a/media/base/media_channel.h
+++ b/media/base/media_channel.h
@@ -273,6 +273,11 @@
   }
   bool ExtmapAllowMixed() const { return extmap_allow_mixed_; }
 
+  virtual webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const = 0;
+  virtual webrtc::RTCError SetRtpSendParameters(
+      uint32_t ssrc,
+      const webrtc::RtpParameters& parameters) = 0;
+
  protected:
   virtual rtc::DiffServCodePoint PreferredDscp() const;
 
@@ -712,10 +717,6 @@
   cricket::MediaType media_type() const override;
   virtual bool SetSendParameters(const AudioSendParameters& params) = 0;
   virtual bool SetRecvParameters(const AudioRecvParameters& params) = 0;
-  virtual webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const = 0;
-  virtual webrtc::RTCError SetRtpSendParameters(
-      uint32_t ssrc,
-      const webrtc::RtpParameters& parameters) = 0;
   // Get the receive parameters for the incoming stream identified by |ssrc|.
   // If |ssrc| is 0, retrieve the receive parameters for the default receive
   // stream, which is used when SSRCs are not signaled. Note that calling with
@@ -792,10 +793,6 @@
   cricket::MediaType media_type() const override;
   virtual bool SetSendParameters(const VideoSendParameters& params) = 0;
   virtual bool SetRecvParameters(const VideoRecvParameters& params) = 0;
-  virtual webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const = 0;
-  virtual webrtc::RTCError SetRtpSendParameters(
-      uint32_t ssrc,
-      const webrtc::RtpParameters& parameters) = 0;
   // Get the receive parameters for the incoming stream identified by |ssrc|.
   // If |ssrc| is 0, retrieve the receive parameters for the default receive
   // stream, which is used when SSRCs are not signaled. Note that calling with
@@ -905,6 +902,12 @@
   virtual bool SetSendParameters(const DataSendParameters& params) = 0;
   virtual bool SetRecvParameters(const DataRecvParameters& params) = 0;
 
+  // RtpParameter methods are not supported for Data channel.
+  webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const override;
+  webrtc::RTCError SetRtpSendParameters(
+      uint32_t ssrc,
+      const webrtc::RtpParameters& parameters) override;
+
   // TODO(pthatcher): Implement this.
   virtual bool GetStats(DataMediaInfo* info);