Implement RTCRemoteInboundRtpStreamStats for both audio and video.

This implements the essentials of RTCRemoteInboundRtpStreamStats. This
includes:
- ssrc
- transportId
- codecId
- packetsLost
- jitter
- localId
- roundTripTime
https://w3c.github.io/webrtc-stats/#remoteinboundrtpstats-dict*

The following members are not implemented because they require more
work...
- From RTCReceivedRtpStreamStats: packetsReceived, packetsDiscarded,
  packetsRepaired, burstPacketsLost, burstPacketsDiscarded,
  burstLossCount, burstDiscardCount, burstLossRate, burstDiscardRate,
  gapLossRate and gapDiscardRate.
- From RTCRemoteInboundRtpStreamStats: fractionLost.

Bug: webrtc:10455, webrtc:10456
Change-Id: If2ab0da7105d8c93bba58e14aa93bd22ffe57f1d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138067
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28073}
diff --git a/pc/rtc_stats_integrationtest.cc b/pc/rtc_stats_integrationtest.cc
index 10b17e5..df1d58d 100644
--- a/pc/rtc_stats_integrationtest.cc
+++ b/pc/rtc_stats_integrationtest.cc
@@ -394,6 +394,9 @@
       } else if (stats.type() == RTCOutboundRTPStreamStats::kType) {
         verify_successful &= VerifyRTCOutboundRTPStreamStats(
             stats.cast_to<RTCOutboundRTPStreamStats>());
+      } else if (stats.type() == RTCRemoteInboundRtpStreamStats::kType) {
+        verify_successful &= VerifyRTCRemoteInboundRtpStreamStats(
+            stats.cast_to<RTCRemoteInboundRtpStreamStats>());
       } else if (stats.type() == RTCAudioSourceStats::kType) {
         // RTCAudioSourceStats::kType and RTCVideoSourceStats::kType both have
         // the value "media-source", but they are distinguishable with pointer
@@ -846,6 +849,26 @@
     return verifier.ExpectAllMembersSuccessfullyTested();
   }
 
+  bool VerifyRTCRemoteInboundRtpStreamStats(
+      const RTCRemoteInboundRtpStreamStats& remote_inbound_stream) {
+    RTCStatsVerifier verifier(report_, &remote_inbound_stream);
+    verifier.TestMemberIsDefined(remote_inbound_stream.ssrc);
+    verifier.TestMemberIsDefined(remote_inbound_stream.kind);
+    verifier.TestMemberIsIDReference(remote_inbound_stream.transport_id,
+                                     RTCTransportStats::kType);
+    verifier.TestMemberIsIDReference(remote_inbound_stream.codec_id,
+                                     RTCCodecStats::kType);
+    verifier.TestMemberIsDefined(remote_inbound_stream.packets_lost);
+    // Note that the existance of RTCCodecStats is needed for |codec_id| and
+    // |jitter| to be present.
+    verifier.TestMemberIsNonNegative<double>(remote_inbound_stream.jitter);
+    verifier.TestMemberIsIDReference(remote_inbound_stream.local_id,
+                                     RTCOutboundRTPStreamStats::kType);
+    verifier.TestMemberIsNonNegative<double>(
+        remote_inbound_stream.round_trip_time);
+    return verifier.ExpectAllMembersSuccessfullyTested();
+  }
+
   void VerifyRTCMediaSourceStats(const RTCMediaSourceStats& media_source,
                                  RTCStatsVerifier* verifier) {
     verifier->TestMemberIsDefined(media_source.track_identifier);