Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / video_receive_stream.h
index ac1afc6..febb221 100644 (file)
@@ -26,10 +26,7 @@ namespace webrtc {
 namespace newapi {
 // RTCP mode to use. Compound mode is described by RFC 4585 and reduced-size
 // RTCP mode is described by RFC 5506.
-enum RtcpMode {
-  kRtcpCompound,
-  kRtcpReducedSize
-};
+enum RtcpMode { kRtcpCompound, kRtcpReducedSize };
 }  // namespace newapi
 
 class VideoDecoder;
@@ -58,39 +55,22 @@ struct ExternalVideoDecoder {
 
 class VideoReceiveStream {
  public:
-  struct Stats {
+  struct Stats : public StreamStats {
     Stats()
         : network_frame_rate(0),
           decode_frame_rate(0),
           render_frame_rate(0),
-          key_frames(0),
-          delta_frames(0),
-          video_packets(0),
-          retransmitted_packets(0),
-          fec_packets(0),
-          padding_packets(0),
+          avg_delay_ms(0),
           discarded_packets(0),
-          received_bitrate_bps(0),
-          receive_side_delay_ms(0) {}
-    RtpStatistics rtp_stats;
+          ssrc(0) {}
+
     int network_frame_rate;
     int decode_frame_rate;
     int render_frame_rate;
-    uint32_t key_frames;
-    uint32_t delta_frames;
-    uint32_t video_packets;
-    uint32_t retransmitted_packets;
-    uint32_t fec_packets;
-    uint32_t padding_packets;
+    int avg_delay_ms;
     uint32_t discarded_packets;
-    int32_t received_bitrate_bps;
-    int receive_side_delay_ms;
-  };
-
-  class StatsCallback {
-   public:
-    virtual ~StatsCallback() {}
-    virtual void ReceiveStats(const Stats& stats) = 0;
+    uint32_t ssrc;
+    std::string c_name;
   };
 
   struct Config {
@@ -138,9 +118,21 @@ class VideoReceiveStream {
       // See FecConfig for description.
       FecConfig fec;
 
-      // RTX settings for video payloads that may be received. RTX is disabled
-      // if there's no config present.
-      std::map<int, RtxConfig> rtx;
+      // RTX settings for incoming video payloads that may be received. RTX is
+      // disabled if there's no config present.
+      struct Rtx {
+        Rtx() : ssrc(0), payload_type(0) {}
+
+        // SSRCs to use for the RTX streams.
+        uint32_t ssrc;
+
+        // Payload type to use for the RTX stream.
+        int payload_type;
+      };
+
+      // Map from video RTP payload type -> RTX config.
+      typedef std::map<int, Rtx> RtxMap;
+      RtxMap rtx;
 
       // RTP header extensions used for the received stream.
       std::vector<RtpExtension> extensions;
@@ -177,13 +169,11 @@ class VideoReceiveStream {
     // Target delay in milliseconds. A positive value indicates this stream is
     // used for streaming instead of a real-time call.
     int target_delay_ms;
-
-    // Callback for periodically receiving receiver stats.
-    StatsCallback* stats_callback;
   };
 
   virtual void StartReceiving() = 0;
   virtual void StopReceiving() = 0;
+  virtual Stats GetStats() const = 0;
 
   // TODO(mflodman) Replace this with callback.
   virtual void GetCurrentReceiveCodec(VideoCodec* receive_codec) = 0;