Commit 6d82ab4e authored by Henrik Boström's avatar Henrik Boström Committed by Commit Bot

Expose RTCMediaSourceStats in standard getStats().

This exposes RTCAudioSourceStats and RTCVideoSourceStats, which are the
RTCMediaSourceStats dictionaries, to JavaScript.

Implementation in WebRTC here:
https://webrtc-review.googlesource.com/c/src/+/137804/

This CL also re-enabled
WebRtcBrowserTest.RunsAudioVideoWebRTCCallInTwoTabsGetStatsPromise and
external/wpt/webrtc/RTCPeerConnection-track-stats.https.html
which were temporarily disabled due to blocking the WebRTC CL from
rolling.

Bug: webrtc:10453
Change-Id: I1c97a9798301c48437982fb656a1bdf5fbcabb36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1621912
Commit-Queue: Henrik Boström <hbos@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663022}
parent 0e244ee9
...@@ -232,11 +232,8 @@ IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, ...@@ -232,11 +232,8 @@ IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
DetectVideoAndHangUp(); DetectVideoAndHangUp();
} }
// TODO(https://crbug.com/webrtc/10453): Temporarily disabled to unblock a IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
// webrtc roll. RunsAudioVideoWebRTCCallInTwoTabsGetStatsPromise) {
IN_PROC_BROWSER_TEST_F(
MAYBE_WebRtcBrowserTest,
DISABLED_RunsAudioVideoWebRTCCallInTwoTabsGetStatsPromise) {
StartServerAndOpenTabs(); StartServerAndOpenTabs();
SetupPeerconnectionWithLocalStream(left_tab_); SetupPeerconnectionWithLocalStream(left_tab_);
SetupPeerconnectionWithLocalStream(right_tab_); SetupPeerconnectionWithLocalStream(right_tab_);
......
...@@ -169,6 +169,7 @@ let kRTCSentRtpStreamStats = new RTCStats(kRTCRtpStreamStats, { ...@@ -169,6 +169,7 @@ let kRTCSentRtpStreamStats = new RTCStats(kRTCRtpStreamStats, {
*/ */
let kRTCOutboundRtpStreamStats = new RTCStats(kRTCSentRtpStreamStats, { let kRTCOutboundRtpStreamStats = new RTCStats(kRTCSentRtpStreamStats, {
trackId: 'string', trackId: 'string',
mediaSourceId: 'string',
senderId: 'string', senderId: 'string',
remoteId: 'string', remoteId: 'string',
lastPacketSentTimestamp: 'number', lastPacketSentTimestamp: 'number',
...@@ -205,6 +206,40 @@ let kRTCRemoteOutboundRtpStreamStats = new RTCStats(kRTCSentRtpStreamStats, { ...@@ -205,6 +206,40 @@ let kRTCRemoteOutboundRtpStreamStats = new RTCStats(kRTCSentRtpStreamStats, {
addRTCStatsToWhitelist( addRTCStatsToWhitelist(
Presence.OPTIONAL, 'remote-outbound-rtp', kRTCRemoteOutboundRtpStreamStats); Presence.OPTIONAL, 'remote-outbound-rtp', kRTCRemoteOutboundRtpStreamStats);
/**
* RTCMediaSourceStats
* https://w3c.github.io/webrtc-stats/#dom-rtcmediasourcestats
* @private
*/
const kRTCMediaSourceStats = new RTCStats(null, {
trackIdentifier: 'string',
kind: 'string',
});
/**
* RTCAudioSourceStats
* https://w3c.github.io/webrtc-stats/#dom-rtcaudiosourcestats
* @private
*/
const kRTCAudioSourceStats = new RTCStats(kRTCMediaSourceStats, {
});
addRTCStatsToWhitelist(
Presence.MANDATORY, 'media-source', kRTCAudioSourceStats);
/**
* RTCVideoSourceStats
* https://w3c.github.io/webrtc-stats/#dom-rtcvideosourcestats
* @private
*/
const kRTCVideoSourceStats = new RTCStats(kRTCMediaSourceStats, {
width: 'number',
height: 'number',
frames: 'number',
framesPerSecond: 'number',
});
addRTCStatsToWhitelist(
Presence.MANDATORY, 'media-source', kRTCVideoSourceStats);
/* /*
* RTCRtpContributingSourceStats * RTCRtpContributingSourceStats
* https://w3c.github.io/webrtc-stats/#dom-rtcrtpcontributingsourcestats * https://w3c.github.io/webrtc-stats/#dom-rtcrtpcontributingsourcestats
...@@ -294,6 +329,7 @@ let kRTCVideoHandlerStats = new RTCStats(kRTCMediaHandlerStats, { ...@@ -294,6 +329,7 @@ let kRTCVideoHandlerStats = new RTCStats(kRTCMediaHandlerStats, {
* @private * @private
*/ */
let kRTCVideoSenderStats = new RTCStats(kRTCVideoHandlerStats, { let kRTCVideoSenderStats = new RTCStats(kRTCVideoHandlerStats, {
mediaSourceId: 'string',
framesCaptured: 'number', framesCaptured: 'number',
framesSent: 'number', framesSent: 'number',
hugeFramesSent: 'number', hugeFramesSent: 'number',
...@@ -361,6 +397,7 @@ let kRTCAudioHandlerStats = new RTCStats(kRTCMediaHandlerStats, { ...@@ -361,6 +397,7 @@ let kRTCAudioHandlerStats = new RTCStats(kRTCMediaHandlerStats, {
* @private * @private
*/ */
let kRTCAudioSenderStats = new RTCStats(kRTCAudioHandlerStats, { let kRTCAudioSenderStats = new RTCStats(kRTCAudioHandlerStats, {
mediaSourceId: 'string',
echoReturnLoss: 'number', echoReturnLoss: 'number',
echoReturnLossEnhancement: 'number', echoReturnLossEnhancement: 'number',
totalSamplesSent: 'number', totalSamplesSent: 'number',
......
...@@ -35,6 +35,9 @@ class RTCStatsWhitelist { ...@@ -35,6 +35,9 @@ class RTCStatsWhitelist {
whitelisted_stats_types_.insert(webrtc::RTCRTPStreamStats::kType); whitelisted_stats_types_.insert(webrtc::RTCRTPStreamStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCInboundRTPStreamStats::kType); whitelisted_stats_types_.insert(webrtc::RTCInboundRTPStreamStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCOutboundRTPStreamStats::kType); whitelisted_stats_types_.insert(webrtc::RTCOutboundRTPStreamStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCMediaSourceStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCAudioSourceStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCVideoSourceStats::kType);
whitelisted_stats_types_.insert(webrtc::RTCTransportStats::kType); whitelisted_stats_types_.insert(webrtc::RTCTransportStats::kType);
} }
......
...@@ -5715,7 +5715,3 @@ crbug.com/965389 [ Mac ] media/track/track-cue-rendering-position-auto.html [ Pa ...@@ -5715,7 +5715,3 @@ crbug.com/965389 [ Mac ] media/track/track-cue-rendering-position-auto.html [ Pa
# Sheriff 2019-05-21 # Sheriff 2019-05-21
crbug.com/965134 [ Linux ] virtual/mouseevent_fractional/fast/events/pointerevents/multi-touch-events.html [ Failure ] crbug.com/965134 [ Linux ] virtual/mouseevent_fractional/fast/events/pointerevents/multi-touch-events.html [ Failure ]
# Temporarily allow failing to unblock third_party/webrtc from rolling.
crbug.com/webrtc/10453 external/wpt/webrtc/RTCPeerConnection-track-stats.https.html [ Pass Failure ]
crbug.com/webrtc/10453 virtual/webrtc-wpt-plan-b/external/wpt/webrtc/RTCPeerConnection-track-stats.https.html [ Pass Failure ]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment