Refactoring PayloadRouter.

- Move PayloadRouter to RtpTransportControllerInterface.
- Move RetransmissionLimiter inside RtpTransportControllerSend from
  VideoSendStreamImpl.
- Move video RTP specifics into PayloadRouter, in particular ownership
  of the RTP modules.
- PayloadRouter now contains all video specific RTP code, and will be
  renamed in a follow-up to VideoRtpSender.
- Introduce VideoRtpSenderInterface.

Bug: webrtc:9517
Change-Id: I1c7b293fa6f9c320286c80533b3c584498034a38
Reviewed-on: https://webrtc-review.googlesource.com/88240
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24009}
diff --git a/call/rtp_config.h b/call/rtp_config.h
index 86d32ac..96fe15f 100644
--- a/call/rtp_config.h
+++ b/call/rtp_config.h
@@ -12,8 +12,17 @@
 #define CALL_RTP_CONFIG_H_
 
 #include <string>
+#include <vector>
+
+#include "api/rtp_headers.h"
+#include "api/rtpparameters.h"
 
 namespace webrtc {
+// Currently only VP8/VP9 specific.
+struct RtpPayloadState {
+  int16_t picture_id = -1;
+  uint8_t tl0_pic_idx = 0;
+};
 // Settings for NACK, see RFC 4585 for details.
 struct NackConfig {
   NackConfig() : rtp_history_ms(0) {}
@@ -44,5 +53,92 @@
   // RTX payload type for RED payload.
   int red_rtx_payload_type;
 };
+
+static const size_t kDefaultMaxPacketSize = 1500 - 40;  // TCP over IPv4.
+struct RtpConfig {
+  RtpConfig();
+  RtpConfig(const RtpConfig&);
+  ~RtpConfig();
+  std::string ToString() const;
+
+  std::vector<uint32_t> ssrcs;
+
+  // The value to send in the MID RTP header extension if the extension is
+  // included in the list of extensions.
+  std::string mid;
+
+  // See RtcpMode for description.
+  RtcpMode rtcp_mode = RtcpMode::kCompound;
+
+  // Max RTP packet size delivered to send transport from VideoEngine.
+  size_t max_packet_size = kDefaultMaxPacketSize;
+
+  // RTP header extensions to use for this send stream.
+  std::vector<RtpExtension> extensions;
+
+  // TODO(nisse): For now, these are fixed, but we'd like to support
+  // changing codec without recreating the VideoSendStream. Then these
+  // fields must be removed, and association between payload type and codec
+  // must move above the per-stream level. Ownership could be with
+  // RtpTransportControllerSend, with a reference from PayloadRouter, where
+  // the latter would be responsible for mapping the codec type of encoded
+  // images to the right payload type.
+  std::string payload_name;
+  int payload_type = -1;
+
+  // See NackConfig for description.
+  NackConfig nack;
+
+  // See UlpfecConfig for description.
+  UlpfecConfig ulpfec;
+
+  struct Flexfec {
+    Flexfec();
+    Flexfec(const Flexfec&);
+    ~Flexfec();
+    // Payload type of FlexFEC. Set to -1 to disable sending FlexFEC.
+    int payload_type = -1;
+
+    // SSRC of FlexFEC stream.
+    uint32_t ssrc = 0;
+
+    // Vector containing a single element, corresponding to the SSRC of the
+    // media stream being protected by this FlexFEC stream.
+    // The vector MUST have size 1.
+    //
+    // TODO(brandtr): Update comment above when we support
+    // multistream protection.
+    std::vector<uint32_t> protected_media_ssrcs;
+  } flexfec;
+
+  // Settings for RTP retransmission payload format, see RFC 4588 for
+  // details.
+  struct Rtx {
+    Rtx();
+    Rtx(const Rtx&);
+    ~Rtx();
+    std::string ToString() const;
+    // SSRCs to use for the RTX streams.
+    std::vector<uint32_t> ssrcs;
+
+    // Payload type to use for the RTX stream.
+    int payload_type = -1;
+  } rtx;
+
+  // RTCP CNAME, see RFC 3550.
+  std::string c_name;
+};
+
+struct RtcpConfig {
+  RtcpConfig();
+  RtcpConfig(const RtcpConfig&);
+  ~RtcpConfig();
+  std::string ToString() const;
+
+  // Time interval between RTCP report for video
+  int64_t video_report_interval_ms = 1000;
+  // Time interval between RTCP report for audio
+  int64_t audio_report_interval_ms = 5000;
+};
 }  // namespace webrtc
 #endif  // CALL_RTP_CONFIG_H_