OLD | NEW |
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 30 matching lines...) Expand all Loading... |
41 #include "webrtc/test/null_transport.h" | 41 #include "webrtc/test/null_transport.h" |
42 #include "webrtc/test/rtcp_packet_parser.h" | 42 #include "webrtc/test/rtcp_packet_parser.h" |
43 #include "webrtc/test/rtp_rtcp_observer.h" | 43 #include "webrtc/test/rtp_rtcp_observer.h" |
44 #include "webrtc/test/testsupport/fileutils.h" | 44 #include "webrtc/test/testsupport/fileutils.h" |
45 #include "webrtc/test/testsupport/gtest_disable.h" | 45 #include "webrtc/test/testsupport/gtest_disable.h" |
46 #include "webrtc/test/testsupport/perf_test.h" | 46 #include "webrtc/test/testsupport/perf_test.h" |
47 #include "webrtc/video_encoder.h" | 47 #include "webrtc/video_encoder.h" |
48 | 48 |
49 namespace webrtc { | 49 namespace webrtc { |
50 | 50 |
51 static const unsigned long kSilenceTimeoutMs = 2000; | 51 static const uint32_t kSilenceTimeoutMs = 2000; |
52 | 52 |
53 class EndToEndTest : public test::CallTest { | 53 class EndToEndTest : public test::CallTest { |
54 public: | 54 public: |
55 EndToEndTest() {} | 55 EndToEndTest() {} |
56 | 56 |
57 virtual ~EndToEndTest() { | 57 virtual ~EndToEndTest() { |
58 EXPECT_EQ(nullptr, send_stream_); | 58 EXPECT_EQ(nullptr, send_stream_); |
59 EXPECT_TRUE(receive_streams_.empty()); | 59 EXPECT_TRUE(receive_streams_.empty()); |
60 } | 60 } |
61 | 61 |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 std::set<uint32_t> protected_timestamps_ GUARDED_BY(crit_); | 551 std::set<uint32_t> protected_timestamps_ GUARDED_BY(crit_); |
552 } test; | 552 } test; |
553 | 553 |
554 RunBaseTest(&test, FakeNetworkPipe::Config()); | 554 RunBaseTest(&test, FakeNetworkPipe::Config()); |
555 } | 555 } |
556 | 556 |
557 // Flacky on all platforms. See webrtc:4328. | 557 // Flacky on all platforms. See webrtc:4328. |
558 TEST_F(EndToEndTest, DISABLED_ReceivedFecPacketsNotNacked) { | 558 TEST_F(EndToEndTest, DISABLED_ReceivedFecPacketsNotNacked) { |
559 class FecNackObserver : public test::EndToEndTest { | 559 class FecNackObserver : public test::EndToEndTest { |
560 public: | 560 public: |
561 explicit FecNackObserver() | 561 FecNackObserver() |
562 : EndToEndTest(kDefaultTimeoutMs), | 562 : EndToEndTest(kDefaultTimeoutMs), |
563 state_(kFirstPacket), | 563 state_(kFirstPacket), |
564 fec_sequence_number_(0), | 564 fec_sequence_number_(0), |
565 has_last_sequence_number_(false), | 565 has_last_sequence_number_(false), |
566 last_sequence_number_(0) {} | 566 last_sequence_number_(0) {} |
567 | 567 |
568 private: | 568 private: |
569 Action OnSendRtp(const uint8_t* packet, size_t length) override { | 569 Action OnSendRtp(const uint8_t* packet, size_t length) override { |
570 rtc::CritScope lock_(&crit_); | 570 rtc::CritScope lock_(&crit_); |
571 RTPHeader header; | 571 RTPHeader header; |
(...skipping 2468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3040 int initial_sender_rtcp; | 3040 int initial_sender_rtcp; |
3041 int initial_receiver_rtcp; | 3041 int initial_receiver_rtcp; |
3042 { | 3042 { |
3043 rtc::CritScope lock(&test_crit_); | 3043 rtc::CritScope lock(&test_crit_); |
3044 initial_sender_rtp = sender_rtp_; | 3044 initial_sender_rtp = sender_rtp_; |
3045 initial_sender_rtcp = sender_rtcp_; | 3045 initial_sender_rtcp = sender_rtcp_; |
3046 initial_receiver_rtcp = receiver_rtcp_; | 3046 initial_receiver_rtcp = receiver_rtcp_; |
3047 } | 3047 } |
3048 bool sender_done = false; | 3048 bool sender_done = false; |
3049 bool receiver_done = false; | 3049 bool receiver_done = false; |
3050 while(!sender_done || !receiver_done) { | 3050 while (!sender_done || !receiver_done) { |
3051 packet_event_->Wait(kSilenceTimeoutMs); | 3051 packet_event_->Wait(kSilenceTimeoutMs); |
3052 int64_t time_now_ms = clock_->TimeInMilliseconds(); | 3052 int64_t time_now_ms = clock_->TimeInMilliseconds(); |
3053 rtc::CritScope lock(&test_crit_); | 3053 rtc::CritScope lock(&test_crit_); |
3054 if (sender_down) { | 3054 if (sender_down) { |
3055 ASSERT_LE(sender_rtp_ - initial_sender_rtp, kNumAcceptedDowntimeRtp) | 3055 ASSERT_LE(sender_rtp_ - initial_sender_rtp, kNumAcceptedDowntimeRtp) |
3056 << "RTP sent during sender-side downtime."; | 3056 << "RTP sent during sender-side downtime."; |
3057 ASSERT_LE(sender_rtcp_ - initial_sender_rtcp, | 3057 ASSERT_LE(sender_rtcp_ - initial_sender_rtcp, |
3058 kNumAcceptedDowntimeRtcp) | 3058 kNumAcceptedDowntimeRtcp) |
3059 << "RTCP sent during sender-side downtime."; | 3059 << "RTCP sent during sender-side downtime."; |
3060 if (time_now_ms - initial_time_ms >= | 3060 if (time_now_ms - initial_time_ms >= |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3128 } | 3128 } |
3129 SleepMs(10); | 3129 SleepMs(10); |
3130 } | 3130 } |
3131 | 3131 |
3132 Stop(); | 3132 Stop(); |
3133 DestroyStreams(); | 3133 DestroyStreams(); |
3134 } | 3134 } |
3135 | 3135 |
3136 TEST_F(EndToEndTest, NewSendStreamsRespectNetworkDown) { | 3136 TEST_F(EndToEndTest, NewSendStreamsRespectNetworkDown) { |
3137 class UnusedEncoder : public test::FakeEncoder { | 3137 class UnusedEncoder : public test::FakeEncoder { |
3138 public: | 3138 public: |
3139 UnusedEncoder() : FakeEncoder(Clock::GetRealTimeClock()) {} | 3139 UnusedEncoder() : FakeEncoder(Clock::GetRealTimeClock()) {} |
3140 int32_t Encode(const VideoFrame& input_image, | 3140 int32_t Encode(const VideoFrame& input_image, |
3141 const CodecSpecificInfo* codec_specific_info, | 3141 const CodecSpecificInfo* codec_specific_info, |
3142 const std::vector<FrameType>* frame_types) override { | 3142 const std::vector<FrameType>* frame_types) override { |
3143 ADD_FAILURE() << "Unexpected frame encode."; | 3143 ADD_FAILURE() << "Unexpected frame encode."; |
3144 return test::FakeEncoder::Encode( | 3144 return test::FakeEncoder::Encode( |
3145 input_image, codec_specific_info, frame_types); | 3145 input_image, codec_specific_info, frame_types); |
3146 } | 3146 } |
3147 }; | 3147 }; |
3148 | 3148 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3223 EXPECT_TRUE(default_receive_config.rtp.rtx.empty()) | 3223 EXPECT_TRUE(default_receive_config.rtp.rtx.empty()) |
3224 << "Enabling RTX requires rtpmap: rtx negotiation."; | 3224 << "Enabling RTX requires rtpmap: rtx negotiation."; |
3225 EXPECT_TRUE(default_receive_config.rtp.extensions.empty()) | 3225 EXPECT_TRUE(default_receive_config.rtp.extensions.empty()) |
3226 << "Enabling RTP extensions require negotiation."; | 3226 << "Enabling RTP extensions require negotiation."; |
3227 | 3227 |
3228 VerifyEmptyNackConfig(default_receive_config.rtp.nack); | 3228 VerifyEmptyNackConfig(default_receive_config.rtp.nack); |
3229 VerifyEmptyFecConfig(default_receive_config.rtp.fec); | 3229 VerifyEmptyFecConfig(default_receive_config.rtp.fec); |
3230 } | 3230 } |
3231 | 3231 |
3232 } // namespace webrtc | 3232 } // namespace webrtc |
OLD | NEW |