[Stats] Add googTimingFrameInfo to the modern API.

This is exposing something that is already exposed in the legacy
getStats() API and is only available if the "video-timing" header
extension is used. Adding this metric here should unblock legacy
getStats() API deprecation. The follow-up to unship or standardize this
metric is tracked by https://crbug.com/webrtc/14586.

Bug: webrtc:14587
Change-Id: Ic3d45b0558d7caf4be2856a4cd95b88db312f85e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38444}
This commit is contained in:
Henrik Boström
2022-10-19 17:50:09 +02:00
committed by WebRTC LUCI CQ
parent 8e7a105c51
commit c5f8f800a2
5 changed files with 54 additions and 1 deletions

View File

@ -38,6 +38,7 @@
#include "api/video/video_frame.h"
#include "api/video/video_sink_interface.h"
#include "api/video/video_source_interface.h"
#include "api/video/video_timing.h"
#include "common_video/include/quality_limitation_reason.h"
#include "media/base/media_channel.h"
#include "modules/audio_processing/include/audio_processing_statistics.h"
@ -2714,6 +2715,42 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) {
EXPECT_TRUE(report->Get(*expected_video.codec_id));
}
TEST_F(RTCStatsCollectorTest, CollectGoogTimingFrameInfo) {
cricket::VideoMediaInfo video_media_info;
video_media_info.receivers.push_back(cricket::VideoReceiverInfo());
video_media_info.receivers[0].local_stats.push_back(
cricket::SsrcReceiverInfo());
video_media_info.receivers[0].local_stats[0].ssrc = 1;
TimingFrameInfo timing_frame_info;
timing_frame_info.rtp_timestamp = 1;
timing_frame_info.capture_time_ms = 2;
timing_frame_info.encode_start_ms = 3;
timing_frame_info.encode_finish_ms = 4;
timing_frame_info.packetization_finish_ms = 5;
timing_frame_info.pacer_exit_ms = 6;
timing_frame_info.network_timestamp_ms = 7;
timing_frame_info.network2_timestamp_ms = 8;
timing_frame_info.receive_start_ms = 9;
timing_frame_info.receive_finish_ms = 10;
timing_frame_info.decode_start_ms = 11;
timing_frame_info.decode_finish_ms = 12;
timing_frame_info.render_time_ms = 13;
timing_frame_info.flags = 14;
video_media_info.receivers[0].timing_frame_info = timing_frame_info;
pc_->AddVideoChannel("Mid0", "Transport0", video_media_info);
stats_->SetupRemoteTrackAndReceiver(
cricket::MEDIA_TYPE_VIDEO, "RemoteVideoTrackID", "RemoteStreamId", 1);
rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
auto inbound_rtps = report->GetStatsOfType<RTCInboundRTPStreamStats>();
ASSERT_EQ(inbound_rtps.size(), 1u);
ASSERT_TRUE(inbound_rtps[0]->goog_timing_frame_info.is_defined());
EXPECT_EQ(*inbound_rtps[0]->goog_timing_frame_info,
"1,2,3,4,5,6,7,8,9,10,11,12,13,1,0");
}
TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Audio) {
cricket::VoiceMediaInfo voice_media_info;