| 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> // max | 10 #include <algorithm> // max |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 | 701 |
| 702 rtcp_sender.SetRTCPStatus(RtcpMode::kReducedSize); | 702 rtcp_sender.SetRTCPStatus(RtcpMode::kReducedSize); |
| 703 rtcp_sender.SetRemoteSSRC(kVideoSendSsrcs[0]); | 703 rtcp_sender.SetRemoteSSRC(kVideoSendSsrcs[0]); |
| 704 | 704 |
| 705 RTCPSender::FeedbackState feedback_state; | 705 RTCPSender::FeedbackState feedback_state; |
| 706 | 706 |
| 707 EXPECT_EQ(0, rtcp_sender.SendRTCP(feedback_state, kRtcpRr)); | 707 EXPECT_EQ(0, rtcp_sender.SendRTCP(feedback_state, kRtcpRr)); |
| 708 } | 708 } |
| 709 } | 709 } |
| 710 | 710 |
| 711 void EncodedFrameCallback(const EncodedFrame& encoded_frame) override { | 711 virtual void EncodedFrameCallback(const EncodedFrame& encoded_frame) { |
| 712 // Increase frame size for next encoded frame, in the context of the | 712 // Increase frame size for next encoded frame, in the context of the |
| 713 // encoder thread. | 713 // encoder thread. |
| 714 if (!use_fec_ && | 714 if (!use_fec_ && |
| 715 current_size_frame_.Value() < static_cast<int32_t>(stop_size_)) { | 715 current_size_frame_.Value() < static_cast<int32_t>(stop_size_)) { |
| 716 ++current_size_frame_; | 716 ++current_size_frame_; |
| 717 } | 717 } |
| 718 encoder_.SetFrameSize(static_cast<size_t>(current_size_frame_.Value())); | 718 encoder_.SetFrameSize(static_cast<size_t>(current_size_frame_.Value())); |
| 719 } | 719 } |
| 720 | 720 |
| 721 Call::Config GetSenderCallConfig() override { | 721 Call::Config GetSenderCallConfig() override { |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 test::PacketTransport* transport = new test::PacketTransport( | 992 test::PacketTransport* transport = new test::PacketTransport( |
| 993 nullptr, this, test::PacketTransport::kReceiver, | 993 nullptr, this, test::PacketTransport::kReceiver, |
| 994 FakeNetworkPipe::Config()); | 994 FakeNetworkPipe::Config()); |
| 995 transport_adapter_.reset(new internal::TransportAdapter(transport)); | 995 transport_adapter_.reset(new internal::TransportAdapter(transport)); |
| 996 transport_adapter_->Enable(); | 996 transport_adapter_->Enable(); |
| 997 return transport; | 997 return transport; |
| 998 } | 998 } |
| 999 | 999 |
| 1000 size_t GetNumVideoStreams() const override { return 3; } | 1000 size_t GetNumVideoStreams() const override { return 3; } |
| 1001 | 1001 |
| 1002 void OnFrameGeneratorCapturerCreated( | 1002 virtual void OnFrameGeneratorCapturerCreated( |
| 1003 test::FrameGeneratorCapturer* frame_generator_capturer) override { | 1003 test::FrameGeneratorCapturer* frame_generator_capturer) { |
| 1004 rtc::CritScope lock(&crit_); | 1004 rtc::CritScope lock(&crit_); |
| 1005 capturer_ = frame_generator_capturer; | 1005 capturer_ = frame_generator_capturer; |
| 1006 } | 1006 } |
| 1007 | 1007 |
| 1008 void PerformTest() override { | 1008 void PerformTest() override { |
| 1009 EXPECT_TRUE(Wait()) | 1009 EXPECT_TRUE(Wait()) |
| 1010 << "Timed out while waiting for RTP packets to stop being sent."; | 1010 << "Timed out while waiting for RTP packets to stop being sent."; |
| 1011 } | 1011 } |
| 1012 | 1012 |
| 1013 Clock* const clock_; | 1013 Clock* const clock_; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1033 static const int kRembBitrateBps = 80000; | 1033 static const int kRembBitrateBps = 80000; |
| 1034 static const int kRembRespectedBitrateBps = 100000; | 1034 static const int kRembRespectedBitrateBps = 100000; |
| 1035 class BitrateObserver : public test::SendTest { | 1035 class BitrateObserver : public test::SendTest { |
| 1036 public: | 1036 public: |
| 1037 BitrateObserver() | 1037 BitrateObserver() |
| 1038 : SendTest(kDefaultTimeoutMs), | 1038 : SendTest(kDefaultTimeoutMs), |
| 1039 bitrate_capped_(false) { | 1039 bitrate_capped_(false) { |
| 1040 } | 1040 } |
| 1041 | 1041 |
| 1042 private: | 1042 private: |
| 1043 Action OnSendRtp(const uint8_t* packet, size_t length) override { | 1043 virtual Action OnSendRtp(const uint8_t* packet, size_t length) { |
| 1044 if (RtpHeaderParser::IsRtcp(packet, length)) | 1044 if (RtpHeaderParser::IsRtcp(packet, length)) |
| 1045 return DROP_PACKET; | 1045 return DROP_PACKET; |
| 1046 | 1046 |
| 1047 RTPHeader header; | 1047 RTPHeader header; |
| 1048 if (!parser_->Parse(packet, length, &header)) | 1048 if (!parser_->Parse(packet, length, &header)) |
| 1049 return DROP_PACKET; | 1049 return DROP_PACKET; |
| 1050 RTC_DCHECK(stream_); | 1050 RTC_DCHECK(stream_); |
| 1051 VideoSendStream::Stats stats = stream_->GetStats(); | 1051 VideoSendStream::Stats stats = stream_->GetStats(); |
| 1052 if (!stats.substreams.empty()) { | 1052 if (!stats.substreams.empty()) { |
| 1053 EXPECT_EQ(1u, stats.substreams.size()); | 1053 EXPECT_EQ(1u, stats.substreams.size()); |
| (...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2292 observation_complete_.Set(); | 2292 observation_complete_.Set(); |
| 2293 } | 2293 } |
| 2294 } | 2294 } |
| 2295 } test; | 2295 } test; |
| 2296 | 2296 |
| 2297 RunBaseTest(&test); | 2297 RunBaseTest(&test); |
| 2298 } | 2298 } |
| 2299 #endif | 2299 #endif |
| 2300 | 2300 |
| 2301 } // namespace webrtc | 2301 } // namespace webrtc |
| OLD | NEW |