Add video send bitrates to histogram stats:
- total bitrate ("WebRTC.Video.BitrateSentInKbps")
- media bitrate ("WebRTC.Video.MediaBitrateSentInKbps")
- rtx bitrate ("WebRTC.Video.RtxBitrateSentInKbps")
- padding bitrate ("WebRTC.Video.PaddingBitrateSentInKbps")
- retransmitted bitrate ("WebRTC.Video.RetransmittedBitrateInKbps")

Add retransmitted bytes to StreamDataCounters.

Change in UpdateRtpStats to also update counters for retransmitted packet.

BUG=crbug/419657
R=mflodman@webrtc.org, stefan@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7838 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/common_types.h b/webrtc/common_types.h
index 9cb56af..43d1bd7 100644
--- a/webrtc/common_types.h
+++ b/webrtc/common_types.h
@@ -229,13 +229,16 @@
   uint32_t unique_nack_requests;  // Number of unique NACKed RTP packets.
 };
 
-// Data usage statistics for a (rtp) stream
+// Data usage statistics for a (rtp) stream.
 struct StreamDataCounters {
   StreamDataCounters()
    : bytes(0),
      header_bytes(0),
      padding_bytes(0),
      packets(0),
+     retransmitted_bytes(0),
+     retransmitted_header_bytes(0),
+     retransmitted_padding_bytes(0),
      retransmitted_packets(0),
      fec_packets(0) {}
 
@@ -244,15 +247,34 @@
     header_bytes += other.header_bytes;
     padding_bytes += other.padding_bytes;
     packets += other.packets;
+    retransmitted_bytes += other.retransmitted_bytes;
+    retransmitted_header_bytes += other.retransmitted_header_bytes;
+    retransmitted_padding_bytes += other.retransmitted_padding_bytes;
     retransmitted_packets += other.retransmitted_packets;
     fec_packets += other.fec_packets;
   }
 
+  size_t TotalBytes() const {
+    return bytes + header_bytes + padding_bytes;
+  }
+
+  size_t RetransmittedBytes() const {
+    return retransmitted_bytes + retransmitted_header_bytes +
+           retransmitted_padding_bytes;
+  }
+
+  size_t MediaPayloadBytes() const {
+    return bytes - retransmitted_bytes;
+  }
+
   // TODO(pbos): Rename bytes -> media_bytes.
   size_t bytes;  // Payload bytes, excluding RTP headers and padding.
   size_t header_bytes;  // Number of bytes used by RTP headers.
   size_t padding_bytes;  // Number of padding bytes.
   uint32_t packets;  // Number of packets.
+  size_t retransmitted_bytes;  // Number of retransmitted payload bytes.
+  size_t retransmitted_header_bytes;  // Retransmitted bytes used by RTP header.
+  size_t retransmitted_padding_bytes;  // Retransmitted padding bytes.
   uint32_t retransmitted_packets;  // Number of retransmitted packets.
   uint32_t fec_packets;  // Number of redundancy packets.
 };