webrtc/api/statstypes.cc
Max Morin 8ddc2e6258 Revert "Add hugeFramesSent GetStats metric"
This reverts commit f9f71b91ae.

Reason for revert: Looks like it's breaking WebRtcBrowserTest.RunsAudioVideoWebRTCCallInTwoTabsGetStatsPromise, see https://ci.chromium.org/buildbot/chromium.webrtc.fyi/Mac%20Tester/48322 (win and lin testers are also failing on the same test).

[ RUN      ] WebRtcBrowserTest.RunsAudioVideoWebRTCCallInTwoTabsGetStatsPromise
[12743:4099:0305/082149.300326:WARNING:notification_platform_bridge_mac.mm(510)] AlertNotificationService: XPC connection invalidated.
[12743:88323:0305/082150.773242:WARNING:embedded_test_server.cc(228)] Request not handled. Returning 404: /favicon.ico
[12743:775:0305/082150.774044:INFO:CONSOLE(13)] "Requesting doGetUserMedia: constraints: {"audio":true,"video":true}", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082150.969262:INFO:CONSOLE(13)] "Returning request-callback-granted to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082150.983959:INFO:CONSOLE(13)] "Returning ok-got-stream to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.741587:INFO:CONSOLE(13)] "Requesting doGetUserMedia: constraints: {"audio":true,"video":true}", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.749225:INFO:CONSOLE(13)] "Returning request-callback-granted to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.754982:INFO:CONSOLE(13)] "Returning ok-got-stream to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.761516:INFO:CONSOLE(13)] "Returning ok-peerconnection-created to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12752:775:0305/082151.762047:WARNING:RTCPeerConnection.cpp(1151)] mediaConstraints is not a supported argument to addStream.
[12752:775:0305/082151.762096:WARNING:RTCPeerConnection.cpp(1153)] mediaConstraints was
[12743:775:0305/082151.762953:INFO:CONSOLE(13)] "Added local stream.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.763010:INFO:CONSOLE(13)] "Returning ok-added to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.767078:INFO:CONSOLE(13)] "Returning ok-peerconnection-created to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12755:775:0305/082151.767614:WARNING:RTCPeerConnection.cpp(1151)] mediaConstraints is not a supported argument to addStream.
[12755:775:0305/082151.767660:WARNING:RTCPeerConnection.cpp(1153)] mediaConstraints was
[12743:775:0305/082151.768452:INFO:CONSOLE(13)] "Added local stream.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.768523:INFO:CONSOLE(13)] "Returning ok-added to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.776171:INFO:CONSOLE(13)] "Returning ok-created to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.777197:INFO:CONSOLE(13)] "Returning ok-created to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12752:42755:0305/082151.777736:WARNING:mediasession.cc(353)] Duplicate id found. Reassigning from 104 to 127
[12752:42755:0305/082151.777766:WARNING:mediasession.cc(353)] Duplicate id found. Reassigning from 106 to 125
[12752:42755:0305/082151.777829:WARNING:mediasession.cc(353)] Duplicate id found. Reassigning from 103 to 124
[12752:42755:0305/082151.777850:WARNING:mediasession.cc(353)] Duplicate id found. Reassigning from 105 to 123
[12743:775:0305/082151.778835:INFO:CONSOLE(13)] "createOffer(): success.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.779780:INFO:CONSOLE(13)] "Returning ok-{"type":"offer","sdp":"v=0\r\no=- 3491235150284933882 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video data\r\na=msid-semantic: WMS Nb7epCcAUJwMKKzTV36r1RGOlNSIxBooVpgU\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:ySYi\r\na=ice-pwd:5E4b4cjl+QFLqPoIgvleZ4m4\r\na=ice-options:trickle\r\na=fingerprint:sha-256 94:ED:E9:BB:45:FF:BE:85:C2:98:E5:45:3A:AB:A9:4B:3B:F0:04:D7:B1:05:45:E9:6D:14:3C:FE:62:5C:23:03\r\na=setup:actpass\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:110 telephone-event/48000\r\na=rtpmap:112 telephone-event/32000\r\na=rtpmap:113 telephone-event/16000\r\na=rtpmap:126 telephone-event/8000\r\na=ssrc:3632917417 cname:J9N+OjIJeArKjXXh\r\na=ssrc:3632917417 msid:Nb7epCcAUJwMKKzTV36r1RGOlNSIxBooVpgU 6e608085-751b-4945-8982-6f4aedf7bef6\r\na=ssrc:3632917417 mslabel:Nb7epCcAUJwMKKzTV36r1RGOlNSIxBooVpgU\r\na=ssrc:3632917417 label:6e608085-751b-4945-8982-6f4aedf7bef6\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 124 127 123 125 107 108\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:ySYi\r\na=ice-pwd:5E4b4cjl+QFLqPoIgvleZ4m4\r\na=ice-options:trickle\r\na=fingerprint:sha-256 94:ED:E9:BB:45:FF:BE:85:C2:98:E5:45:3A:AB:A9:4B:3B:F0:04:D7:B1:05:45:E9:6D:14:3C:FE:62:5C:23:03\r\na=setup:actpass\r\na=mid:video\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=sendrecv\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:98 VP9/90000\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=rtpmap:99 rtx/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:100 H264/90000\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=420032\r\na=rtpmap:101 rtx/90000\r\na=fmtp:101 apt=100\r\na=rtpmap:102 H264/90000\r\na=rtcp-fb:102 goog-remb\r\na=rtcp-fb:102 transport-cc\r\na=rtcp-fb:102 ccm fir\r\na=rtcp-fb:102 nack\r\na=rtcp-fb:102 nack pli\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0032\r\na=rtpmap:124 rtx/90000\r\na=fmtp:124 apt=102\r\na=rtpmap:127 H264/90000\r\na=rtcp-fb:127 goog-remb\r\na=rtcp-fb:127 transport-cc\r\na=rtcp-fb:127 ccm fir\r\na=rtcp-fb:127 nack\r\na=rtcp-fb:127 nack pli\r\na=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032\r\na=rtpmap:123 rtx/90000\r\na=fmtp:123 apt=127\r\na=rtpmap:125 red/90000\r\na=rtpmap:107 rtx/90000\r\na=fmtp:107 apt=125\r\na=rtpmap:108 ulpfec/90000\r\na=ssrc-group:FID 1955312265 3021315394\r\na=ssrc:1955312265 cname:J9N+OjIJeArKjXXh\r\na=ssrc:1955312265 msid:Nb7epCcAUJwMKKzTV36r1RGOlNSIxBooVpgU 7cd84f82-8fa1-42ca-b0ac-326aa0925f05\r\na=ssrc:1955312265 mslabel:Nb7epCcAUJwMKKzTV36r1RGOlNSIxBooVpgU\r\na=ssrc:1955312265 label:7cd84f82-8fa1-42ca-b0ac-326aa0925f05\r\na=ssrc:3021315394 cname:J9N+OjIJeArKjXXh\r\na=ssrc:3021315394 msid:Nb7epCcAUJwMKKzTV36r1RGOlNSIxBooVpgU 7cd84f82-8fa1-42ca-b0ac-326aa0925f05\r\na=ssrc:3021315394 mslabel:Nb7epCcAUJwMKKzTV36r1RGOlNSIxBooVpgU\r\na=ssrc:3021315394 label:7cd84f82-8fa1-42ca-b0ac-326aa0925f05\r\nm=application 9 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:ySYi\r\na=ice-pwd:5E4b4cjl+QFLqPoIgvleZ4m4\r\na=ice-options:trickle\r\na=fingerprint:sha-256 94:ED:E9:BB:45:FF:BE:85:C2:98:E5:45:3A:AB:A9:4B:3B:F0:04:D7:B1:05:45:E9:6D:14:3C:FE:62:5C:23:03\r\na=setup:actpass\r\na=mid:data\r\na=sctpmap:5000 webrtc-datachannel 1024\r\n"} to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.781514:INFO:CONSOLE(13)] "setLocalDescription(): success.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12755:41731:0305/082151.782411:WARNING:channel.cc(1039)] Trying to cache the Absolute Send Time extension id but the SRTP is not active.
[12752:43011:0305/082151.884258:WARNING:p2ptransportchannel.cc(638)] Jingle:Port[0x7fab620da600:audio:1:0:local:Net[en0:192.168.195.x/24:Ethernet]]: SetOption(5, 0) failed: 0
[12752:43011:0305/082151.884438:WARNING:p2ptransportchannel.cc(638)] Jingle:Port[0x7fab620dd000:video:1:0:local:Net[en0:192.168.195.x/24:Ethernet]]: SetOption(1, 65536) failed: 0
[12752:43011:0305/082151.884481:WARNING:p2ptransportchannel.cc(638)] Jingle:Port[0x7fab620dd000:video:1:0:local:Net[en0:192.168.195.x/24:Ethernet]]: SetOption(2, 65536) failed: 0
[12752:43011:0305/082151.884513:WARNING:p2ptransportchannel.cc(638)] Jingle:Port[0x7fab620dd000:video:1:0:local:Net[en0:192.168.195.x/24:Ethernet]]: SetOption(5, 0) failed: 0
[12755:41731:0305/082151.922410:WARNING:channel.cc(1039)] Trying to cache the Absolute Send Time extension id but the SRTP is not active.
[12743:775:0305/082151.924626:INFO:CONSOLE(13)] "createAnswer(): success.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.925506:INFO:CONSOLE(13)] "Returning ok-{"type":"answer","sdp":"v=0\r\no=- 6096510228474213355 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video data\r\na=msid-semantic: WMS 7RUsJxsD5w2UmR1xiHiKSWHyYY8RVKSGT8hN\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:X54X\r\na=ice-pwd:VsLK5tJ8so82vOn1y+R72WBi\r\na=ice-options:trickle\r\na=fingerprint:sha-256 EC:A9:2D:A2:D9:44:F0:A4:EE:58:FC:32:DF:C4:8C:B0:FC:25:C3:08:BE:7E:D7:59:B8:A0:20:16:DA:5A:A5:7F\r\na=setup:active\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:110 telephone-event/48000\r\na=rtpmap:112 telephone-event/32000\r\na=rtpmap:113 telephone-event/16000\r\na=rtpmap:126 telephone-event/8000\r\na=ssrc:3234277340 cname:PfS0qqt1exijuETX\r\na=ssrc:3234277340 msid:7RUsJxsD5w2UmR1xiHiKSWHyYY8RVKSGT8hN 9ddb9a77-20aa-42ba-8540-9e32f3dbb0af\r\na=ssrc:3234277340 mslabel:7RUsJxsD5w2UmR1xiHiKSWHyYY8RVKSGT8hN\r\na=ssrc:3234277340 label:9ddb9a77-20aa-42ba-8540-9e32f3dbb0af\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 124 127 123 125 107 108\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:X54X\r\na=ice-pwd:VsLK5tJ8so82vOn1y+R72WBi\r\na=ice-options:trickle\r\na=fingerprint:sha-256 EC:A9:2D:A2:D9:44:F0:A4:EE:58:FC:32:DF:C4:8C:B0:FC:25:C3:08:BE:7E:D7:59:B8:A0:20:16:DA:5A:A5:7F\r\na=setup:active\r\na=mid:video\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=sendrecv\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:98 VP9/90000\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=rtpmap:99 rtx/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:100 H264/90000\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=420032\r\na=rtpmap:101 rtx/90000\r\na=fmtp:101 apt=100\r\na=rtpmap:102 H264/90000\r\na=rtcp-fb:102 goog-remb\r\na=rtcp-fb:102 transport-cc\r\na=rtcp-fb:102 ccm fir\r\na=rtcp-fb:102 nack\r\na=rtcp-fb:102 nack pli\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0032\r\na=rtpmap:124 rtx/90000\r\na=fmtp:124 apt=102\r\na=rtpmap:127 H264/90000\r\na=rtcp-fb:127 goog-remb\r\na=rtcp-fb:127 transport-cc\r\na=rtcp-fb:127 ccm fir\r\na=rtcp-fb:127 nack\r\na=rtcp-fb:127 nack pli\r\na=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032\r\na=rtpmap:123 rtx/90000\r\na=fmtp:123 apt=127\r\na=rtpmap:125 red/90000\r\na=rtpmap:107 rtx/90000\r\na=fmtp:107 apt=125\r\na=rtpmap:108 ulpfec/90000\r\na=ssrc-group:FID 3517790794 302440277\r\na=ssrc:3517790794 cname:PfS0qqt1exijuETX\r\na=ssrc:3517790794 msid:7RUsJxsD5w2UmR1xiHiKSWHyYY8RVKSGT8hN 2ffa90e8-b71e-463b-a105-d5a65e0ac205\r\na=ssrc:3517790794 mslabel:7RUsJxsD5w2UmR1xiHiKSWHyYY8RVKSGT8hN\r\na=ssrc:3517790794 label:2ffa90e8-b71e-463b-a105-d5a65e0ac205\r\na=ssrc:302440277 cname:PfS0qqt1exijuETX\r\na=ssrc:302440277 msid:7RUsJxsD5w2UmR1xiHiKSWHyYY8RVKSGT8hN 2ffa90e8-b71e-463b-a105-d5a65e0ac205\r\na=ssrc:302440277 mslabel:7RUsJxsD5w2UmR1xiHiKSWHyYY8RVKSGT8hN\r\na=ssrc:302440277 label:2ffa90e8-b71e-463b-a105-d5a65e0ac205\r\nm=application 9 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\nb=AS:30\r\na=ice-ufrag:X54X\r\na=ice-pwd:VsLK5tJ8so82vOn1y+R72WBi\r\na=ice-options:trickle\r\na=fingerprint:sha-256 EC:A9:2D:A2:D9:44:F0:A4:EE:58:FC:32:DF:C4:8C:B0:FC:25:C3:08:BE:7E:D7:59:B8:A0:20:16:DA:5A:A5:7F\r\na=setup:active\r\na=mid:data\r\na=sctpmap:5000 webrtc-datachannel 1024\r\n"} to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.925954:INFO:CONSOLE(13)] "Receiving remote stream...", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.926204:INFO:CONSOLE(13)] "setRemoteDescription(): success.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.939935:INFO:CONSOLE(13)] "Returning ok-verified to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.940232:INFO:CONSOLE(13)] "setLocalDescription(): success.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12752:43011:0305/082151.942049:WARNING:p2ptransportchannel.cc(1093)] SetOption(1, 65536) failed: 0
[12752:43011:0305/082151.942084:WARNING:p2ptransportchannel.cc(1093)] SetOption(2, 65536) failed: 0
[12743:775:0305/082151.946009:INFO:CONSOLE(13)] "Receiving remote stream...", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.946327:INFO:CONSOLE(13)] "setRemoteDescription(): success.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.946367:INFO:CONSOLE(13)] "Returning ok-accepted-answer to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082151.950048:INFO:CONSOLE(368)] "Still ICE gathering - waiting...", source: http://127.0.0.1:50666/webrtc/peerconnection.js (368)
[12755:41731:0305/082152.030690:WARNING:p2ptransportchannel.cc(638)] Jingle:Port[0x7f8a9c809a00:audio:1:0:local:Net[en0:192.168.195.x/24:Ethernet]]: SetOption(1, 65536) failed: 0
[12755:41731:0305/082152.030759:WARNING:p2ptransportchannel.cc(638)] Jingle:Port[0x7f8a9c809a00:audio:1:0:local:Net[en0:192.168.195.x/24:Ethernet]]: SetOption(2, 65536) failed: 0
[12755:41731:0305/082152.030785:WARNING:p2ptransportchannel.cc(638)] Jingle:Port[0x7f8a9c809a00:audio:1:0:local:Net[en0:192.168.195.x/24:Ethernet]]: SetOption(5, 0) failed: 0
[12743:775:0305/082152.048464:INFO:CONSOLE(13)] "Returning [{"candidate":"candidate:2504140996 1 udp 2122260223 192.168.195.156 65179 typ host generation 0 ufrag X54X network-id 1","sdpMid":"audio","sdpMLineIndex":0},{"candidate":"candidate:3686913076 1 tcp 1518280447 192.168.195.156 9 typ host tcptype active generation 0 ufrag X54X network-id 1","sdpMid":"audio","sdpMLineIndex":0}] to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082152.049868:INFO:CONSOLE(13)] "Returning ok-received-candidates to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082152.050468:INFO:CONSOLE(13)] "Returning [{"candidate":"candidate:2504140996 1 udp 2122260223 192.168.195.156 60484 typ host generation 0 ufrag ySYi network-id 1","sdpMid":"audio","sdpMLineIndex":0},{"candidate":"candidate:2504140996 1 udp 2122260223 192.168.195.156 62030 typ host generation 0 ufrag ySYi network-id 1","sdpMid":"video","sdpMLineIndex":1},{"candidate":"candidate:2504140996 1 udp 2122260223 192.168.195.156 50175 typ host generation 0 ufrag ySYi network-id 1","sdpMid":"data","sdpMLineIndex":2},{"candidate":"candidate:3686913076 1 tcp 1518280447 192.168.195.156 9 typ host tcptype active generation 0 ufrag ySYi network-id 1","sdpMid":"audio","sdpMLineIndex":0},{"candidate":"candidate:3686913076 1 tcp 1518280447 192.168.195.156 9 typ host tcptype active generation 0 ufrag ySYi network-id 1","sdpMid":"video","sdpMLineIndex":1},{"candidate":"candidate:3686913076 1 tcp 1518280447 192.168.195.156 9 typ host tcptype active generation 0 ufrag ySYi network-id 1","sdpMid":"data","sdpMLineIndex":2}] to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082152.052841:INFO:CONSOLE(13)] "Returning ok-received-candidates to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082152.053385:INFO:CONSOLE(13)] "Returning ["codec","inbound-rtp","outbound-rtp","peer-connection","stream","track","data-channel","transport","local-candidate","remote-candidate","candidate-pair","certificate"] to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
[12743:775:0305/082152.061797:INFO:CONSOLE(13)] "Returning Test failed: Error: stats.hugeFramesSent is not a whitelisted member: 0
    at failTest (http://127.0.0.1:50666/webrtc/test_functions.js:46:15)
    at verifyStatsIsWhitelisted_ (http://127.0.0.1:50666/webrtc/peerconnection_getstats.js:386:13)
    at http://127.0.0.1:50666/webrtc/peerconnection_getstats.js:273:9 to test.", source: http://127.0.0.1:50666/webrtc/test_functions.js (13)
../../chrome/browser/media/webrtc/webrtc_browsertest_base.cc:533: Failure
Value of: base::StartsWith(result, "ok-", base::CompareCase::SENSITIVE)
  Actual: false
Expected: true
../../chrome/browser/media/webrtc/webrtc_browsertest_base.cc:138: Failure
Value of: value
  Actual: false
Expected: true
BrowserTestBase received signal: Segmentation fault: 11. Backtrace:
0   browser_tests                       0x0000000105c700cc base::debug::StackTrace::StackTrace(unsigned long) + 28
1   browser_tests                       0x0000000106271902 content::(anonymous namespace)::DumpStackTraceSignalHandler(int) + 226
2   libsystem_platform.dylib            0x00007fffa63ccb3a _sigtramp + 26
3   ???                                 0x0000000000000000 0x0 + 0
4   browser_tests                       0x0000000102ee29e3 WebRtcTestBase::VerifyStatsGeneratedPromise(content::WebContents*) const + 467
5   browser_tests                       0x0000000102edb4d1 WebRtcBrowserTest_RunsAudioVideoWebRTCCallInTwoTabsGetStatsPromise_Test::RunTestOnMainThread() + 817
6   browser_tests                       0x000000010627162d content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() + 557
7   browser_tests                       0x0000000105da0d23 ChromeBrowserMainParts::PreMainMessageLoopRunImpl() + 4227
8   browser_tests                       0x0000000105d9fb9e ChromeBrowserMainParts::PreMainMessageLoopRun() + 62
9   browser_tests                       0x0000000104a3a3d3 content::BrowserMainLoop::PreMainMessageLoopRun() + 67
10  browser_tests                       0x0000000104df0dc7 content::StartupTaskRunner::RunAllTasksNow() + 39
11  browser_tests                       0x0000000104a38d35 content::BrowserMainLoop::CreateStartupTasks() + 661
12  browser_tests                       0x0000000104a3c8f0 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) + 96
13  browser_tests                       0x0000000104a36c94 content::BrowserMain(content::MainFunctionParams const&) + 180
14  browser_tests                       0x0000000105c3ebb9 content::ContentMainRunnerImpl::Run() + 377
15  browser_tests                       0x000000010784a8f4 service_manager::Main(service_manager::MainParams const&) + 2324
16  browser_tests                       0x0000000105c3e094 content::ContentMain(content::ContentMainParams const&) + 68
17  browser_tests                       0x0000000106271216 content::BrowserTestBase::SetUp() + 2550
18  browser_tests                       0x0000000105d2993e InProcessBrowserTest::SetUp() + 398
19  browser_tests                       0x0000000104032b51 testing::Test::Run() + 97
20  browser_tests                       0x0000000104033770 testing::TestInfo::Run() + 288
21  browser_tests                       0x0000000104033cd7 testing::TestCase::Run() + 263
22  browser_tests                       0x000000010403b167 testing::internal::UnitTestImpl::RunAllTests() + 903
23  browser_tests                       0x000000010403adb3 testing::UnitTest::Run() + 163
24  browser_tests                       0x0000000105d41c67 base::TestSuite::Run() + 167
25  browser_tests                       0x0000000105c63755 ChromeTestSuiteRunner::RunTestSuite(int, char**) + 37
26  browser_tests                       0x00000001062b6597 content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) + 391
27  browser_tests                       0x0000000105c63c3c LaunchChromeTests(unsigned long, content::TestLauncherDelegate*, int, char**) + 348
28  browser_tests                       0x0000000105c636ce main + 94
29  libdyld.dylib                       0x00007fffa61bd235 start + 1
30  ???                                 0x000000000000000a 0x0 + 10


Original change's description:
> Add hugeFramesSent GetStats metric
> 
> Bug: webrtc:8901
> Change-Id: I36021c1160c3426d3bfa0f37ff0adaa35710b93e
> Reviewed-on: https://webrtc-review.googlesource.com/54420
> Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22290}

TBR=solenberg@webrtc.org,ilnik@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,hta@webrtc.org

Change-Id: I6a7501c46f928281d357da37f9232bb92c5a4f19
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8901
Reviewed-on: https://webrtc-review.googlesource.com/60120
Reviewed-by: Max Morin <maxmorin@webrtc.org>
Commit-Queue: Max Morin <maxmorin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22303}
2018-03-06 08:28:52 +00:00

837 lines
26 KiB
C++

/*
* Copyright 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "api/statstypes.h"
#include <string.h>
#include "rtc_base/checks.h"
#include "rtc_base/refcountedobject.h"
// TODO(tommi): Could we have a static map of value name -> expected type
// and use this to RTC_DCHECK on correct usage (somewhat strongly typed values)?
// Alternatively, we could define the names+type in a separate document and
// generate strongly typed inline C++ code that forces the correct type to be
// used for a given name at compile time.
using rtc::RefCountedObject;
namespace webrtc {
namespace {
// The id of StatsReport of type kStatsReportTypeBwe.
const char kStatsReportVideoBweId[] = "bweforvideo";
// NOTE: These names need to be consistent with an external
// specification (W3C Stats Identifiers).
const char* InternalTypeToString(StatsReport::StatsType type) {
switch (type) {
case StatsReport::kStatsReportTypeSession:
return "googLibjingleSession";
case StatsReport::kStatsReportTypeBwe:
return "VideoBwe";
case StatsReport::kStatsReportTypeRemoteSsrc:
return "remoteSsrc";
case StatsReport::kStatsReportTypeSsrc:
return "ssrc";
case StatsReport::kStatsReportTypeTrack:
return "googTrack";
case StatsReport::kStatsReportTypeIceLocalCandidate:
return "localcandidate";
case StatsReport::kStatsReportTypeIceRemoteCandidate:
return "remotecandidate";
case StatsReport::kStatsReportTypeTransport:
return "transport";
case StatsReport::kStatsReportTypeComponent:
return "googComponent";
case StatsReport::kStatsReportTypeCandidatePair:
return "googCandidatePair";
case StatsReport::kStatsReportTypeCertificate:
return "googCertificate";
case StatsReport::kStatsReportTypeDataChannel:
return "datachannel";
}
RTC_NOTREACHED();
return nullptr;
}
class BandwidthEstimationId : public StatsReport::IdBase {
public:
BandwidthEstimationId()
: StatsReport::IdBase(StatsReport::kStatsReportTypeBwe) {}
std::string ToString() const override { return kStatsReportVideoBweId; }
};
class TypedId : public StatsReport::IdBase {
public:
TypedId(StatsReport::StatsType type, const std::string& id)
: StatsReport::IdBase(type), id_(id) {}
bool Equals(const IdBase& other) const override {
return IdBase::Equals(other) &&
static_cast<const TypedId&>(other).id_ == id_;
}
std::string ToString() const override {
return std::string(InternalTypeToString(type_)) + kSeparator + id_;
}
protected:
const std::string id_;
};
class TypedIntId : public StatsReport::IdBase {
public:
TypedIntId(StatsReport::StatsType type, int id)
: StatsReport::IdBase(type), id_(id) {}
bool Equals(const IdBase& other) const override {
return IdBase::Equals(other) &&
static_cast<const TypedIntId&>(other).id_ == id_;
}
std::string ToString() const override {
return std::string(InternalTypeToString(type_)) +
kSeparator +
rtc::ToString<int>(id_);
}
protected:
const int id_;
};
class IdWithDirection : public TypedId {
public:
IdWithDirection(StatsReport::StatsType type, const std::string& id,
StatsReport::Direction direction)
: TypedId(type, id), direction_(direction) {}
bool Equals(const IdBase& other) const override {
return TypedId::Equals(other) &&
static_cast<const IdWithDirection&>(other).direction_ == direction_;
}
std::string ToString() const override {
std::string ret(TypedId::ToString());
ret += kSeparator;
ret += direction_ == StatsReport::kSend ? "send" : "recv";
return ret;
}
private:
const StatsReport::Direction direction_;
};
class CandidateId : public TypedId {
public:
CandidateId(bool local, const std::string& id)
: TypedId(local ?
StatsReport::kStatsReportTypeIceLocalCandidate :
StatsReport::kStatsReportTypeIceRemoteCandidate,
id) {
}
std::string ToString() const override {
return "Cand-" + id_;
}
};
class ComponentId : public StatsReport::IdBase {
public:
ComponentId(const std::string& content_name, int component)
: ComponentId(StatsReport::kStatsReportTypeComponent, content_name,
component) {}
bool Equals(const IdBase& other) const override {
return IdBase::Equals(other) &&
static_cast<const ComponentId&>(other).component_ == component_ &&
static_cast<const ComponentId&>(other).content_name_ == content_name_;
}
std::string ToString() const override {
return ToString("Channel-");
}
protected:
ComponentId(StatsReport::StatsType type, const std::string& content_name,
int component)
: IdBase(type),
content_name_(content_name),
component_(component) {}
std::string ToString(const char* prefix) const {
std::string ret(prefix);
ret += content_name_;
ret += '-';
ret += rtc::ToString<>(component_);
return ret;
}
private:
const std::string content_name_;
const int component_;
};
class CandidatePairId : public ComponentId {
public:
CandidatePairId(const std::string& content_name, int component, int index)
: ComponentId(StatsReport::kStatsReportTypeCandidatePair, content_name,
component),
index_(index) {}
bool Equals(const IdBase& other) const override {
return ComponentId::Equals(other) &&
static_cast<const CandidatePairId&>(other).index_ == index_;
}
std::string ToString() const override {
std::string ret(ComponentId::ToString("Conn-"));
ret += '-';
ret += rtc::ToString<>(index_);
return ret;
}
private:
const int index_;
};
} // namespace
StatsReport::IdBase::IdBase(StatsType type) : type_(type) {}
StatsReport::IdBase::~IdBase() {}
StatsReport::StatsType StatsReport::IdBase::type() const { return type_; }
bool StatsReport::IdBase::Equals(const IdBase& other) const {
return other.type_ == type_;
}
StatsReport::Value::Value(StatsValueName name, int64_t value, Type int_type)
: name(name), type_(int_type) {
RTC_DCHECK(type_ == kInt || type_ == kInt64);
type_ == kInt ? value_.int_ = static_cast<int>(value) : value_.int64_ = value;
}
StatsReport::Value::Value(StatsValueName name, float f)
: name(name), type_(kFloat) {
value_.float_ = f;
}
StatsReport::Value::Value(StatsValueName name, const std::string& value)
: name(name), type_(kString) {
value_.string_ = new std::string(value);
}
StatsReport::Value::Value(StatsValueName name, const char* value)
: name(name), type_(kStaticString) {
value_.static_string_ = value;
}
StatsReport::Value::Value(StatsValueName name, bool b)
: name(name), type_(kBool) {
value_.bool_ = b;
}
StatsReport::Value::Value(StatsValueName name, const Id& value)
: name(name), type_(kId) {
value_.id_ = new Id(value);
}
StatsReport::Value::~Value() {
switch (type_) {
case kInt:
case kInt64:
case kFloat:
case kBool:
case kStaticString:
break;
case kString:
delete value_.string_;
break;
case kId:
delete value_.id_;
break;
}
}
bool StatsReport::Value::Equals(const Value& other) const {
if (name != other.name)
return false;
// There's a 1:1 relation between a name and a type, so we don't have to
// check that.
RTC_DCHECK_EQ(type_, other.type_);
switch (type_) {
case kInt:
return value_.int_ == other.value_.int_;
case kInt64:
return value_.int64_ == other.value_.int64_;
case kFloat:
return value_.float_ == other.value_.float_;
case kStaticString: {
#if RTC_DCHECK_IS_ON
if (value_.static_string_ != other.value_.static_string_) {
RTC_DCHECK(strcmp(value_.static_string_, other.value_.static_string_) !=
0)
<< "Duplicate global?";
}
#endif
return value_.static_string_ == other.value_.static_string_;
}
case kString:
return *value_.string_ == *other.value_.string_;
case kBool:
return value_.bool_ == other.value_.bool_;
case kId:
return (*value_.id_)->Equals(*other.value_.id_);
}
RTC_NOTREACHED();
return false;
}
bool StatsReport::Value::operator==(const std::string& value) const {
return (type_ == kString && value_.string_->compare(value) == 0) ||
(type_ == kStaticString && value.compare(value_.static_string_) == 0);
}
bool StatsReport::Value::operator==(const char* value) const {
if (type_ == kString)
return value_.string_->compare(value) == 0;
if (type_ != kStaticString)
return false;
#if RTC_DCHECK_IS_ON
if (value_.static_string_ != value)
RTC_DCHECK(strcmp(value_.static_string_, value) != 0)
<< "Duplicate global?";
#endif
return value == value_.static_string_;
}
bool StatsReport::Value::operator==(int64_t value) const {
return type_ == kInt ? value_.int_ == static_cast<int>(value) :
(type_ == kInt64 ? value_.int64_ == value : false);
}
bool StatsReport::Value::operator==(bool value) const {
return type_ == kBool && value_.bool_ == value;
}
bool StatsReport::Value::operator==(float value) const {
return type_ == kFloat && value_.float_ == value;
}
bool StatsReport::Value::operator==(const Id& value) const {
return type_ == kId && (*value_.id_)->Equals(value);
}
int StatsReport::Value::int_val() const {
RTC_DCHECK(type_ == kInt);
return value_.int_;
}
int64_t StatsReport::Value::int64_val() const {
RTC_DCHECK(type_ == kInt64);
return value_.int64_;
}
float StatsReport::Value::float_val() const {
RTC_DCHECK(type_ == kFloat);
return value_.float_;
}
const char* StatsReport::Value::static_string_val() const {
RTC_DCHECK(type_ == kStaticString);
return value_.static_string_;
}
const std::string& StatsReport::Value::string_val() const {
RTC_DCHECK(type_ == kString);
return *value_.string_;
}
bool StatsReport::Value::bool_val() const {
RTC_DCHECK(type_ == kBool);
return value_.bool_;
}
const char* StatsReport::Value::display_name() const {
switch (name) {
case kStatsValueNameAecDivergentFilterFraction:
return "aecDivergentFilterFraction";
case kStatsValueNameAudioOutputLevel:
return "audioOutputLevel";
case kStatsValueNameAudioInputLevel:
return "audioInputLevel";
case kStatsValueNameBytesSent:
return "bytesSent";
case kStatsValueNameConcealedSamples:
return "concealedSamples";
case kStatsValueNameConcealmentEvents:
return "concealmentEvents";
case kStatsValueNamePacketsSent:
return "packetsSent";
case kStatsValueNameBytesReceived:
return "bytesReceived";
case kStatsValueNameLabel:
return "label";
case kStatsValueNamePacketsReceived:
return "packetsReceived";
case kStatsValueNamePacketsLost:
return "packetsLost";
case kStatsValueNameProtocol:
return "protocol";
case kStatsValueNameTotalSamplesReceived:
return "totalSamplesReceived";
case kStatsValueNameTransportId:
return "transportId";
case kStatsValueNameSelectedCandidatePairId:
return "selectedCandidatePairId";
case kStatsValueNameSsrc:
return "ssrc";
case kStatsValueNameState:
return "state";
case kStatsValueNameDataChannelId:
return "datachannelid";
case kStatsValueNameFramesDecoded:
return "framesDecoded";
case kStatsValueNameFramesEncoded:
return "framesEncoded";
case kStatsValueNameJitterBufferDelay:
return "jitterBufferDelay";
case kStatsValueNameCodecImplementationName:
return "codecImplementationName";
case kStatsValueNameMediaType:
return "mediaType";
case kStatsValueNameQpSum:
return "qpSum";
// 'goog' prefixed constants.
case kStatsValueNameAccelerateRate:
return "googAccelerateRate";
case kStatsValueNameActiveConnection:
return "googActiveConnection";
case kStatsValueNameActualEncBitrate:
return "googActualEncBitrate";
case kStatsValueNameAvailableReceiveBandwidth:
return "googAvailableReceiveBandwidth";
case kStatsValueNameAvailableSendBandwidth:
return "googAvailableSendBandwidth";
case kStatsValueNameAvgEncodeMs:
return "googAvgEncodeMs";
case kStatsValueNameBucketDelay:
return "googBucketDelay";
case kStatsValueNameBandwidthLimitedResolution:
return "googBandwidthLimitedResolution";
// STUN ping related attributes.
//
// TODO(zhihuang) Rename these stats to follow the standards.
// Connectivity checks.
case kStatsValueNameSentPingRequestsTotal:
return "requestsSent";
case kStatsValueNameSentPingRequestsBeforeFirstResponse:
return "consentRequestsSent";
case kStatsValueNameSentPingResponses:
return "responsesSent";
case kStatsValueNameRecvPingRequests:
return "requestsReceived";
case kStatsValueNameRecvPingResponses:
return "responsesReceived";
// STUN Keepalive pings.
case kStatsValueNameSentStunKeepaliveRequests:
return "stunKeepaliveRequestsSent";
case kStatsValueNameRecvStunKeepaliveResponses:
return "stunKeepaliveResponsesReceived";
case kStatsValueNameStunKeepaliveRttTotal:
return "stunKeepaliveRttTotal";
case kStatsValueNameStunKeepaliveRttSquaredTotal:
return "stunKeepaliveRttSquaredTotal";
// Candidate related attributes. Values are taken from
// http://w3c.github.io/webrtc-stats/#rtcstatstype-enum*.
case kStatsValueNameCandidateIPAddress:
return "ipAddress";
case kStatsValueNameCandidateNetworkType:
return "networkType";
case kStatsValueNameCandidatePortNumber:
return "portNumber";
case kStatsValueNameCandidatePriority:
return "priority";
case kStatsValueNameCandidateTransportType:
return "transport";
case kStatsValueNameCandidateType:
return "candidateType";
case kStatsValueNameChannelId:
return "googChannelId";
case kStatsValueNameCodecName:
return "googCodecName";
case kStatsValueNameComponent:
return "googComponent";
case kStatsValueNameContentName:
return "googContentName";
case kStatsValueNameContentType:
return "googContentType";
case kStatsValueNameCpuLimitedResolution:
return "googCpuLimitedResolution";
case kStatsValueNameDecodingCTSG:
return "googDecodingCTSG";
case kStatsValueNameDecodingCTN:
return "googDecodingCTN";
case kStatsValueNameDecodingMutedOutput:
return "googDecodingMuted";
case kStatsValueNameDecodingNormal:
return "googDecodingNormal";
case kStatsValueNameDecodingPLC:
return "googDecodingPLC";
case kStatsValueNameDecodingCNG:
return "googDecodingCNG";
case kStatsValueNameDecodingPLCCNG:
return "googDecodingPLCCNG";
case kStatsValueNameDer:
return "googDerBase64";
case kStatsValueNameDtlsCipher:
return "dtlsCipher";
case kStatsValueNameEchoDelayMedian:
return "googEchoCancellationEchoDelayMedian";
case kStatsValueNameEchoDelayStdDev:
return "googEchoCancellationEchoDelayStdDev";
case kStatsValueNameEchoReturnLoss:
return "googEchoCancellationReturnLoss";
case kStatsValueNameEchoReturnLossEnhancement:
return "googEchoCancellationReturnLossEnhancement";
case kStatsValueNameEncodeUsagePercent:
return "googEncodeUsagePercent";
case kStatsValueNameExpandRate:
return "googExpandRate";
case kStatsValueNameFingerprint:
return "googFingerprint";
case kStatsValueNameFingerprintAlgorithm:
return "googFingerprintAlgorithm";
case kStatsValueNameFirsReceived:
return "googFirsReceived";
case kStatsValueNameFirsSent:
return "googFirsSent";
case kStatsValueNameFrameHeightInput:
return "googFrameHeightInput";
case kStatsValueNameFrameHeightReceived:
return "googFrameHeightReceived";
case kStatsValueNameFrameHeightSent:
return "googFrameHeightSent";
case kStatsValueNameFrameRateReceived:
return "googFrameRateReceived";
case kStatsValueNameFrameRateDecoded:
return "googFrameRateDecoded";
case kStatsValueNameFrameRateOutput:
return "googFrameRateOutput";
case kStatsValueNameDecodeMs:
return "googDecodeMs";
case kStatsValueNameMaxDecodeMs:
return "googMaxDecodeMs";
case kStatsValueNameCurrentDelayMs:
return "googCurrentDelayMs";
case kStatsValueNameTargetDelayMs:
return "googTargetDelayMs";
case kStatsValueNameJitterBufferMs:
return "googJitterBufferMs";
case kStatsValueNameMinPlayoutDelayMs:
return "googMinPlayoutDelayMs";
case kStatsValueNameRenderDelayMs:
return "googRenderDelayMs";
case kStatsValueNameCaptureStartNtpTimeMs:
return "googCaptureStartNtpTimeMs";
case kStatsValueNameFrameRateInput:
return "googFrameRateInput";
case kStatsValueNameFrameRateSent:
return "googFrameRateSent";
case kStatsValueNameFrameWidthInput:
return "googFrameWidthInput";
case kStatsValueNameFrameWidthReceived:
return "googFrameWidthReceived";
case kStatsValueNameFrameWidthSent:
return "googFrameWidthSent";
case kStatsValueNameHasEnteredLowResolution:
return "googHasEnteredLowResolution";
case kStatsValueNameInitiator:
return "googInitiator";
case kStatsValueNameInterframeDelayMaxMs:
return "googInterframeDelayMax";
case kStatsValueNameIssuerId:
return "googIssuerId";
case kStatsValueNameJitterReceived:
return "googJitterReceived";
case kStatsValueNameLocalAddress:
return "googLocalAddress";
case kStatsValueNameLocalCandidateId:
return "localCandidateId";
case kStatsValueNameLocalCandidateType:
return "googLocalCandidateType";
case kStatsValueNameLocalCertificateId:
return "localCertificateId";
case kStatsValueNameAdaptationChanges:
return "googAdaptationChanges";
case kStatsValueNameNacksReceived:
return "googNacksReceived";
case kStatsValueNameNacksSent:
return "googNacksSent";
case kStatsValueNamePreemptiveExpandRate:
return "googPreemptiveExpandRate";
case kStatsValueNamePlisReceived:
return "googPlisReceived";
case kStatsValueNamePlisSent:
return "googPlisSent";
case kStatsValueNamePreferredJitterBufferMs:
return "googPreferredJitterBufferMs";
case kStatsValueNameReceiving:
return "googReadable";
case kStatsValueNameRemoteAddress:
return "googRemoteAddress";
case kStatsValueNameRemoteCandidateId:
return "remoteCandidateId";
case kStatsValueNameRemoteCandidateType:
return "googRemoteCandidateType";
case kStatsValueNameRemoteCertificateId:
return "remoteCertificateId";
case kStatsValueNameResidualEchoLikelihood:
return "googResidualEchoLikelihood";
case kStatsValueNameResidualEchoLikelihoodRecentMax:
return "googResidualEchoLikelihoodRecentMax";
case kStatsValueNameAnaBitrateActionCounter:
return "googAnaBitrateActionCounter";
case kStatsValueNameAnaChannelActionCounter:
return "googAnaChannelActionCounter";
case kStatsValueNameAnaDtxActionCounter:
return "googAnaDtxActionCounter";
case kStatsValueNameAnaFecActionCounter:
return "googAnaFecActionCounter";
case kStatsValueNameAnaFrameLengthIncreaseCounter:
return "googAnaFrameLengthIncreaseCounter";
case kStatsValueNameAnaFrameLengthDecreaseCounter:
return "googAnaFrameLengthDecreaseCounter";
case kStatsValueNameAnaUplinkPacketLossFraction:
return "googAnaUplinkPacketLossFraction";
case kStatsValueNameRetransmitBitrate:
return "googRetransmitBitrate";
case kStatsValueNameRtt:
return "googRtt";
case kStatsValueNameSecondaryDecodedRate:
return "googSecondaryDecodedRate";
case kStatsValueNameSecondaryDiscardedRate:
return "googSecondaryDiscardedRate";
case kStatsValueNameSendPacketsDiscarded:
return "packetsDiscardedOnSend";
case kStatsValueNameSpeechExpandRate:
return "googSpeechExpandRate";
case kStatsValueNameSrtpCipher:
return "srtpCipher";
case kStatsValueNameTargetEncBitrate:
return "googTargetEncBitrate";
case kStatsValueNameTotalAudioEnergy:
return "totalAudioEnergy";
case kStatsValueNameTotalSamplesDuration:
return "totalSamplesDuration";
case kStatsValueNameTransmitBitrate:
return "googTransmitBitrate";
case kStatsValueNameTransportType:
return "googTransportType";
case kStatsValueNameTrackId:
return "googTrackId";
case kStatsValueNameTimingFrameInfo:
return "googTimingFrameInfo";
case kStatsValueNameTypingNoiseState:
return "googTypingNoiseState";
case kStatsValueNameWritable:
return "googWritable";
}
return nullptr;
}
std::string StatsReport::Value::ToString() const {
switch (type_) {
case kInt:
return rtc::ToString(value_.int_);
case kInt64:
return rtc::ToString(value_.int64_);
case kFloat:
return rtc::ToString(value_.float_);
case kStaticString:
return std::string(value_.static_string_);
case kString:
return *value_.string_;
case kBool:
return value_.bool_ ? "true" : "false";
case kId:
return (*value_.id_)->ToString();
}
RTC_NOTREACHED();
return std::string();
}
StatsReport::StatsReport(const Id& id) : id_(id), timestamp_(0.0) {
RTC_DCHECK(id_.get());
}
StatsReport::~StatsReport() = default;
// static
StatsReport::Id StatsReport::NewBandwidthEstimationId() {
return Id(new RefCountedObject<BandwidthEstimationId>());
}
// static
StatsReport::Id StatsReport::NewTypedId(StatsType type, const std::string& id) {
return Id(new RefCountedObject<TypedId>(type, id));
}
// static
StatsReport::Id StatsReport::NewTypedIntId(StatsType type, int id) {
return Id(new RefCountedObject<TypedIntId>(type, id));
}
// static
StatsReport::Id StatsReport::NewIdWithDirection(
StatsType type, const std::string& id, StatsReport::Direction direction) {
return Id(new RefCountedObject<IdWithDirection>(type, id, direction));
}
// static
StatsReport::Id StatsReport::NewCandidateId(bool local, const std::string& id) {
return Id(new RefCountedObject<CandidateId>(local, id));
}
// static
StatsReport::Id StatsReport::NewComponentId(
const std::string& content_name, int component) {
return Id(new RefCountedObject<ComponentId>(content_name, component));
}
// static
StatsReport::Id StatsReport::NewCandidatePairId(
const std::string& content_name, int component, int index) {
return Id(new RefCountedObject<CandidatePairId>(
content_name, component, index));
}
const char* StatsReport::TypeToString() const {
return InternalTypeToString(id_->type());
}
void StatsReport::AddString(StatsReport::StatsValueName name,
const std::string& value) {
const Value* found = FindValue(name);
if (!found || !(*found == value))
values_[name] = ValuePtr(new Value(name, value));
}
void StatsReport::AddString(StatsReport::StatsValueName name,
const char* value) {
const Value* found = FindValue(name);
if (!found || !(*found == value))
values_[name] = ValuePtr(new Value(name, value));
}
void StatsReport::AddInt64(StatsReport::StatsValueName name, int64_t value) {
const Value* found = FindValue(name);
if (!found || !(*found == value))
values_[name] = ValuePtr(new Value(name, value, Value::kInt64));
}
void StatsReport::AddInt(StatsReport::StatsValueName name, int value) {
const Value* found = FindValue(name);
if (!found || !(*found == static_cast<int64_t>(value)))
values_[name] = ValuePtr(new Value(name, value, Value::kInt));
}
void StatsReport::AddFloat(StatsReport::StatsValueName name, float value) {
const Value* found = FindValue(name);
if (!found || !(*found == value))
values_[name] = ValuePtr(new Value(name, value));
}
void StatsReport::AddBoolean(StatsReport::StatsValueName name, bool value) {
const Value* found = FindValue(name);
if (!found || !(*found == value))
values_[name] = ValuePtr(new Value(name, value));
}
void StatsReport::AddId(StatsReport::StatsValueName name,
const Id& value) {
const Value* found = FindValue(name);
if (!found || !(*found == value))
values_[name] = ValuePtr(new Value(name, value));
}
const StatsReport::Value* StatsReport::FindValue(StatsValueName name) const {
Values::const_iterator it = values_.find(name);
return it == values_.end() ? nullptr : it->second.get();
}
StatsCollection::StatsCollection() {
}
StatsCollection::~StatsCollection() {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
for (auto* r : list_)
delete r;
}
StatsCollection::const_iterator StatsCollection::begin() const {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
return list_.begin();
}
StatsCollection::const_iterator StatsCollection::end() const {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
return list_.end();
}
size_t StatsCollection::size() const {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
return list_.size();
}
StatsReport* StatsCollection::InsertNew(const StatsReport::Id& id) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
RTC_DCHECK(Find(id) == nullptr);
StatsReport* report = new StatsReport(id);
list_.push_back(report);
return report;
}
StatsReport* StatsCollection::FindOrAddNew(const StatsReport::Id& id) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
StatsReport* ret = Find(id);
return ret ? ret : InsertNew(id);
}
StatsReport* StatsCollection::ReplaceOrAddNew(const StatsReport::Id& id) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
RTC_DCHECK(id.get());
Container::iterator it = std::find_if(list_.begin(), list_.end(),
[&id](const StatsReport* r)->bool { return r->id()->Equals(id); });
if (it != end()) {
StatsReport* report = new StatsReport((*it)->id());
delete *it;
*it = report;
return report;
}
return InsertNew(id);
}
// Looks for a report with the given |id|. If one is not found, null
// will be returned.
StatsReport* StatsCollection::Find(const StatsReport::Id& id) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
Container::iterator it = std::find_if(list_.begin(), list_.end(),
[&id](const StatsReport* r)->bool { return r->id()->Equals(id); });
return it == list_.end() ? nullptr : *it;
}
} // namespace webrtc