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) |