| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 | 10 |
| 11 #include <memory> |
| 12 |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 14 |
| 13 #include "webrtc/common_types.h" | 15 #include "webrtc/common_types.h" |
| 14 #include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" | 16 #include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" |
| 15 #include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitra
te_observer.h" | 17 #include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitra
te_observer.h" |
| 16 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl
e_stream.h" | 18 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl
e_stream.h" |
| 17 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h" | 19 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h" |
| 18 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" | 20 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" |
| 19 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" | 21 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" |
| 20 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 22 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 remote_bitrate_observer_(), | 69 remote_bitrate_observer_(), |
| 68 remote_bitrate_estimator_( | 70 remote_bitrate_estimator_( |
| 69 new RemoteBitrateEstimatorSingleStream(&remote_bitrate_observer_, | 71 new RemoteBitrateEstimatorSingleStream(&remote_bitrate_observer_, |
| 70 system_clock_)) {} | 72 system_clock_)) {} |
| 71 void SetUp() override; | 73 void SetUp() override; |
| 72 void TearDown() override; | 74 void TearDown() override; |
| 73 | 75 |
| 74 OverUseDetectorOptions over_use_detector_options_; | 76 OverUseDetectorOptions over_use_detector_options_; |
| 75 Clock* system_clock_; | 77 Clock* system_clock_; |
| 76 ModuleRtpRtcpImpl* dummy_rtp_rtcp_impl_; | 78 ModuleRtpRtcpImpl* dummy_rtp_rtcp_impl_; |
| 77 rtc::scoped_ptr<ReceiveStatistics> receive_statistics_; | 79 std::unique_ptr<ReceiveStatistics> receive_statistics_; |
| 78 RTCPSender* rtcp_sender_; | 80 RTCPSender* rtcp_sender_; |
| 79 RTCPReceiver* rtcp_receiver_; | 81 RTCPReceiver* rtcp_receiver_; |
| 80 TestTransport* test_transport_; | 82 TestTransport* test_transport_; |
| 81 test::NullTransport null_transport_; | 83 test::NullTransport null_transport_; |
| 82 MockRemoteBitrateObserver remote_bitrate_observer_; | 84 MockRemoteBitrateObserver remote_bitrate_observer_; |
| 83 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; | 85 std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; |
| 84 }; | 86 }; |
| 85 | 87 |
| 86 void RtcpFormatRembTest::SetUp() { | 88 void RtcpFormatRembTest::SetUp() { |
| 87 RtpRtcp::Configuration configuration; | 89 RtpRtcp::Configuration configuration; |
| 88 configuration.audio = false; | 90 configuration.audio = false; |
| 89 configuration.clock = system_clock_; | 91 configuration.clock = system_clock_; |
| 90 configuration.remote_bitrate_estimator = remote_bitrate_estimator_.get(); | 92 configuration.remote_bitrate_estimator = remote_bitrate_estimator_.get(); |
| 91 configuration.outgoing_transport = &null_transport_; | 93 configuration.outgoing_transport = &null_transport_; |
| 92 dummy_rtp_rtcp_impl_ = new ModuleRtpRtcpImpl(configuration); | 94 dummy_rtp_rtcp_impl_ = new ModuleRtpRtcpImpl(configuration); |
| 93 rtcp_receiver_ = new RTCPReceiver(system_clock_, false, nullptr, nullptr, | 95 rtcp_receiver_ = new RTCPReceiver(system_clock_, false, nullptr, nullptr, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 124 TEST_F(RtcpFormatRembTest, TestCompund) { | 126 TEST_F(RtcpFormatRembTest, TestCompund) { |
| 125 uint32_t SSRCs[2] = {456789, 98765}; | 127 uint32_t SSRCs[2] = {456789, 98765}; |
| 126 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound); | 128 rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound); |
| 127 rtcp_sender_->SetREMBData(1234, std::vector<uint32_t>(SSRCs, SSRCs + 2)); | 129 rtcp_sender_->SetREMBData(1234, std::vector<uint32_t>(SSRCs, SSRCs + 2)); |
| 128 RTCPSender::FeedbackState feedback_state = | 130 RTCPSender::FeedbackState feedback_state = |
| 129 dummy_rtp_rtcp_impl_->GetFeedbackState(); | 131 dummy_rtp_rtcp_impl_->GetFeedbackState(); |
| 130 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state, kRtcpRemb)); | 132 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state, kRtcpRemb)); |
| 131 } | 133 } |
| 132 } // namespace | 134 } // namespace |
| 133 } // namespace webrtc | 135 } // namespace webrtc |
| OLD | NEW |