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

Side by Side Diff: webrtc/video/end_to_end_tests.cc

Issue 3002023002: Let Call::OnRecoveredPacket parse RTP header extensions. (Closed)
Patch Set: Fix. Created 3 years, 4 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 unified diff | Download patch
« webrtc/call/call.cc ('K') | « webrtc/call/call.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #include <algorithm> 10 #include <algorithm>
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 // At low RTT (< kLowRttNackMs) -> NACK only, no FEC. 802 // At low RTT (< kLowRttNackMs) -> NACK only, no FEC.
803 const int kNetworkDelayMs = 100; 803 const int kNetworkDelayMs = 100;
804 FakeNetworkPipe::Config config; 804 FakeNetworkPipe::Config config;
805 config.queue_delay_ms = kNetworkDelayMs; 805 config.queue_delay_ms = kNetworkDelayMs;
806 return new test::PacketTransport(sender_call, this, 806 return new test::PacketTransport(sender_call, this,
807 test::PacketTransport::kSender, 807 test::PacketTransport::kSender,
808 test::CallTest::payload_type_map_, config); 808 test::CallTest::payload_type_map_, config);
809 } 809 }
810 810
811 void OnFrame(const VideoFrame& video_frame) override { 811 void OnFrame(const VideoFrame& video_frame) override {
812 EXPECT_EQ(kVideoRotation_90, video_frame.rotation());
813
812 rtc::CritScope lock(&crit_); 814 rtc::CritScope lock(&crit_);
813 // Rendering frame with timestamp of packet that was dropped -> FEC 815 // Rendering frame with timestamp of packet that was dropped -> FEC
814 // protection worked. 816 // protection worked.
815 auto it = dropped_timestamps_.find(video_frame.timestamp()); 817 auto it = dropped_timestamps_.find(video_frame.timestamp());
816 if (it != dropped_timestamps_.end()) { 818 if (it != dropped_timestamps_.end()) {
817 if (!expect_flexfec_rtcp_ || received_flexfec_rtcp_) { 819 if (!expect_flexfec_rtcp_ || received_flexfec_rtcp_) {
818 observation_complete_.Set(); 820 observation_complete_.Set();
819 } 821 }
820 } 822 }
821 } 823 }
(...skipping 17 matching lines...) Expand all
839 (*receive_configs)[0].rtp.ulpfec.red_rtx_payload_type = 841 (*receive_configs)[0].rtp.ulpfec.red_rtx_payload_type =
840 test::CallTest::kRtxRedPayloadType; 842 test::CallTest::kRtxRedPayloadType;
841 843
842 (*receive_configs)[0].rtp.rtx_ssrc = test::CallTest::kSendRtxSsrcs[0]; 844 (*receive_configs)[0].rtp.rtx_ssrc = test::CallTest::kSendRtxSsrcs[0];
843 (*receive_configs)[0] 845 (*receive_configs)[0]
844 .rtp.rtx_payload_types[test::CallTest::kVideoSendPayloadType] = 846 .rtp.rtx_payload_types[test::CallTest::kVideoSendPayloadType] =
845 test::CallTest::kSendRtxPayloadType; 847 test::CallTest::kSendRtxPayloadType;
846 } 848 }
847 } 849 }
848 850
851 void OnFrameGeneratorCapturerCreated(
852 test::FrameGeneratorCapturer* frame_generator_capturer) override {
853 frame_generator_capturer->SetFakeRotation(kVideoRotation_90);
854 }
855
849 void ModifyFlexfecConfigs( 856 void ModifyFlexfecConfigs(
850 std::vector<FlexfecReceiveStream::Config>* receive_configs) override { 857 std::vector<FlexfecReceiveStream::Config>* receive_configs) override {
851 (*receive_configs)[0].local_ssrc = kFlexfecLocalSsrc; 858 (*receive_configs)[0].local_ssrc = kFlexfecLocalSsrc;
852 } 859 }
853 860
854 void PerformTest() override { 861 void PerformTest() override {
855 EXPECT_TRUE(Wait()) 862 EXPECT_TRUE(Wait())
856 << "Timed out waiting for dropped frames to be rendered."; 863 << "Timed out waiting for dropped frames to be rendered.";
857 } 864 }
858 865
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 // details. 1109 // details.
1103 observation_complete_.Set(); 1110 observation_complete_.Set();
1104 } 1111 }
1105 return DROP_PACKET; 1112 return DROP_PACKET;
1106 } 1113 }
1107 1114
1108 return SEND_PACKET; 1115 return SEND_PACKET;
1109 } 1116 }
1110 1117
1111 void OnFrame(const VideoFrame& frame) override { 1118 void OnFrame(const VideoFrame& frame) override {
1119 EXPECT_EQ(kVideoRotation_90, frame.rotation());
1112 { 1120 {
1113 rtc::CritScope lock(&crit_); 1121 rtc::CritScope lock(&crit_);
1114 if (frame.timestamp() == retransmitted_timestamp_) 1122 if (frame.timestamp() == retransmitted_timestamp_)
1115 observation_complete_.Set(); 1123 observation_complete_.Set();
1116 rendered_timestamps_.push_back(frame.timestamp()); 1124 rendered_timestamps_.push_back(frame.timestamp());
1117 } 1125 }
1118 orig_renderer_->OnFrame(frame); 1126 orig_renderer_->OnFrame(frame);
1119 } 1127 }
1120 1128
1121 void ModifyVideoConfigs( 1129 void ModifyVideoConfigs(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 kSendRtxPayloadType; 1162 kSendRtxPayloadType;
1155 } 1163 }
1156 // Configure encoding and decoding with VP8, since generic packetization 1164 // Configure encoding and decoding with VP8, since generic packetization
1157 // doesn't support FEC with NACK. 1165 // doesn't support FEC with NACK.
1158 RTC_DCHECK_EQ(1, (*receive_configs)[0].decoders.size()); 1166 RTC_DCHECK_EQ(1, (*receive_configs)[0].decoders.size());
1159 send_config->encoder_settings.encoder = encoder_.get(); 1167 send_config->encoder_settings.encoder = encoder_.get();
1160 send_config->encoder_settings.payload_name = "VP8"; 1168 send_config->encoder_settings.payload_name = "VP8";
1161 (*receive_configs)[0].decoders[0].payload_name = "VP8"; 1169 (*receive_configs)[0].decoders[0].payload_name = "VP8";
1162 } 1170 }
1163 1171
1172 void OnFrameGeneratorCapturerCreated(
1173 test::FrameGeneratorCapturer* frame_generator_capturer) override {
1174 frame_generator_capturer->SetFakeRotation(kVideoRotation_90);
brandtr 2017/08/21 11:05:32 Added this to catch similar regressions affecting
nisse-webrtc 2017/08/21 11:54:24 Nice!
1175 }
1176
1164 void PerformTest() override { 1177 void PerformTest() override {
1165 EXPECT_TRUE(Wait()) 1178 EXPECT_TRUE(Wait())
1166 << "Timed out while waiting for retransmission to render."; 1179 << "Timed out while waiting for retransmission to render.";
1167 } 1180 }
1168 1181
1169 int GetPayloadType(bool use_rtx, bool use_red) { 1182 int GetPayloadType(bool use_rtx, bool use_red) {
1170 if (use_red) { 1183 if (use_red) {
1171 if (use_rtx) 1184 if (use_rtx)
1172 return kRtxRedPayloadType; 1185 return kRtxRedPayloadType;
1173 return kRedPayloadType; 1186 return kRedPayloadType;
(...skipping 3666 matching lines...) Expand 10 before | Expand all | Expand 10 after
4840 std::unique_ptr<VideoEncoder> encoder_; 4853 std::unique_ptr<VideoEncoder> encoder_;
4841 std::unique_ptr<VideoDecoder> decoder_; 4854 std::unique_ptr<VideoDecoder> decoder_;
4842 rtc::CriticalSection crit_; 4855 rtc::CriticalSection crit_;
4843 int recorded_frames_ GUARDED_BY(crit_); 4856 int recorded_frames_ GUARDED_BY(crit_);
4844 } test(this); 4857 } test(this);
4845 4858
4846 RunBaseTest(&test); 4859 RunBaseTest(&test);
4847 } 4860 }
4848 4861
4849 } // namespace webrtc 4862 } // namespace webrtc
OLDNEW
« webrtc/call/call.cc ('K') | « webrtc/call/call.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698