Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Unified Diff: webrtc/video/end_to_end_tests.cc

Issue 2946413002: Report timing frames info in GetStats. (Closed)
Patch Set: rebase Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/test/fuzzers/rtp_packet_fuzzer.cc ('k') | webrtc/video/payload_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/end_to_end_tests.cc
diff --git a/webrtc/video/end_to_end_tests.cc b/webrtc/video/end_to_end_tests.cc
index f876621fd3551bc2409edf7ee9be9754f07b73ab..b76a57db267de4121bd5d65ee65032f6b00d4dcf 100644
--- a/webrtc/video/end_to_end_tests.cc
+++ b/webrtc/video/end_to_end_tests.cc
@@ -3442,6 +3442,59 @@ TEST_F(EndToEndTest, GetStats) {
RunBaseTest(&test);
}
+TEST_F(EndToEndTest, GetTimingFrameInfoReportsTimingFrames) {
+ static const int kExtensionId = 5;
+
+ class StatsObserver : public test::EndToEndTest {
+ public:
+ StatsObserver() : EndToEndTest(kLongTimeoutMs) {}
+
+ private:
+ std::string CompoundKey(const char* name, uint32_t ssrc) {
+ std::ostringstream oss;
+ oss << name << "_" << ssrc;
+ return oss.str();
+ }
+
+ void ModifyVideoConfigs(
+ VideoSendStream::Config* send_config,
+ std::vector<VideoReceiveStream::Config>* receive_configs,
+ VideoEncoderConfig* encoder_config) override {
+ send_config->rtp.extensions.clear();
+ send_config->rtp.extensions.push_back(
+ RtpExtension(RtpExtension::kVideoTimingUri, kExtensionId));
+ for (size_t i = 0; i < receive_configs->size(); ++i) {
+ (*receive_configs)[i].rtp.extensions.clear();
+ (*receive_configs)[i].rtp.extensions.push_back(
+ RtpExtension(RtpExtension::kVideoTimingUri, kExtensionId));
+ }
+ }
+
+ void OnVideoStreamsCreated(
+ VideoSendStream* send_stream,
+ const std::vector<VideoReceiveStream*>& receive_streams) override {
+ receive_streams_ = receive_streams;
+ }
+
+ void PerformTest() override {
+ // No frames reported initially.
+ for (size_t i = 0; i < receive_streams_.size(); ++i) {
+ EXPECT_FALSE(receive_streams_[i]->GetAndResetTimingFrameInfo());
+ }
+ // Wait for at least one timing frame to be sent with 100ms grace period.
+ SleepMs(kDefaultTimingFramesDelayMs + 100);
+ // Check that timing frames are reported for each stream.
+ for (size_t i = 0; i < receive_streams_.size(); ++i) {
+ EXPECT_TRUE(receive_streams_[i]->GetAndResetTimingFrameInfo());
+ }
+ }
+
+ std::vector<VideoReceiveStream*> receive_streams_;
+ } test;
+
+ RunBaseTest(&test);
+}
+
class RtcpXrObserver : public test::EndToEndTest {
public:
RtcpXrObserver(bool enable_rrtr, bool enable_target_bitrate)
« no previous file with comments | « webrtc/test/fuzzers/rtp_packet_fuzzer.cc ('k') | webrtc/video/payload_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698