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

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 2880323002: Move ownership of RtpTransportControllerSendInterface from Call to PeerConnection.
Patch Set: Delete shadowing member variables in BitrateEstimatorTest. Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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 <algorithm> 11 #include <algorithm>
12 #include <map> 12 #include <map>
13 #include <memory> 13 #include <memory>
14 #include <vector> 14 #include <vector>
15 15
16 #include "webrtc/api/video_codecs/video_encoder.h" 16 #include "webrtc/api/video_codecs/video_encoder.h"
17 #include "webrtc/base/arraysize.h" 17 #include "webrtc/base/arraysize.h"
18 #include "webrtc/base/gunit.h" 18 #include "webrtc/base/gunit.h"
19 #include "webrtc/base/ptr_util.h"
19 #include "webrtc/base/stringutils.h" 20 #include "webrtc/base/stringutils.h"
20 #include "webrtc/call/flexfec_receive_stream.h" 21 #include "webrtc/call/flexfec_receive_stream.h"
22 #include "webrtc/call/rtp_transport_controller_send.h"
21 #include "webrtc/common_video/h264/profile_level_id.h" 23 #include "webrtc/common_video/h264/profile_level_id.h"
22 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" 24 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
23 #include "webrtc/media/base/mediaconstants.h" 25 #include "webrtc/media/base/mediaconstants.h"
24 #include "webrtc/media/base/rtputils.h" 26 #include "webrtc/media/base/rtputils.h"
25 #include "webrtc/media/base/testutils.h" 27 #include "webrtc/media/base/testutils.h"
26 #include "webrtc/media/base/videoengine_unittest.h" 28 #include "webrtc/media/base/videoengine_unittest.h"
27 #include "webrtc/media/engine/constants.h" 29 #include "webrtc/media/engine/constants.h"
28 #include "webrtc/media/engine/fakewebrtccall.h" 30 #include "webrtc/media/engine/fakewebrtccall.h"
29 #include "webrtc/media/engine/fakewebrtcvideoengine.h" 31 #include "webrtc/media/engine/fakewebrtcvideoengine.h"
30 #include "webrtc/media/engine/simulcast.h" 32 #include "webrtc/media/engine/simulcast.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 return media_config; 114 return media_config;
113 } 115 }
114 } // namespace 116 } // namespace
115 117
116 namespace cricket { 118 namespace cricket {
117 class WebRtcVideoEngine2Test : public ::testing::Test { 119 class WebRtcVideoEngine2Test : public ::testing::Test {
118 public: 120 public:
119 WebRtcVideoEngine2Test() : WebRtcVideoEngine2Test("") {} 121 WebRtcVideoEngine2Test() : WebRtcVideoEngine2Test("") {}
120 explicit WebRtcVideoEngine2Test(const char* field_trials) 122 explicit WebRtcVideoEngine2Test(const char* field_trials)
121 : override_field_trials_(field_trials), 123 : override_field_trials_(field_trials),
122 call_(webrtc::Call::Create(webrtc::Call::Config(&event_log_))), 124 rtp_transport_controller_send_(
125 rtc::MakeUnique<webrtc::RtpTransportControllerSend>(
126 webrtc::Clock::GetRealTimeClock(), &event_log_)),
123 engine_() { 127 engine_() {
128 webrtc::Call::Config call_config(&event_log_);
129 call_config.audio_rtp_transport_send = rtp_transport_controller_send_.get();
130 call_config.video_rtp_transport_send = rtp_transport_controller_send_.get();
131 call_config.send_side_cc = rtp_transport_controller_send_->send_side_cc();
132 call_ = rtc::WrapUnique(webrtc::Call::Create(call_config));
133
124 std::vector<VideoCodec> engine_codecs = engine_.codecs(); 134 std::vector<VideoCodec> engine_codecs = engine_.codecs();
125 RTC_DCHECK(!engine_codecs.empty()); 135 RTC_DCHECK(!engine_codecs.empty());
126 bool codec_set = false; 136 bool codec_set = false;
127 for (const cricket::VideoCodec& codec : engine_codecs) { 137 for (const cricket::VideoCodec& codec : engine_codecs) {
128 if (codec.name == "rtx") { 138 if (codec.name == "rtx") {
129 int associated_payload_type; 139 int associated_payload_type;
130 if (codec.GetParam(kCodecParamAssociatedPayloadType, 140 if (codec.GetParam(kCodecParamAssociatedPayloadType,
131 &associated_payload_type)) { 141 &associated_payload_type)) {
132 default_apt_rtx_types_[associated_payload_type] = codec.id; 142 default_apt_rtx_types_[associated_payload_type] = codec.id;
133 } 143 }
(...skipping 15 matching lines...) Expand all
149 cricket::WebRtcVideoEncoderFactory* encoder_factory); 159 cricket::WebRtcVideoEncoderFactory* encoder_factory);
150 160
151 VideoMediaChannel* SetUpForExternalDecoderFactory( 161 VideoMediaChannel* SetUpForExternalDecoderFactory(
152 cricket::WebRtcVideoDecoderFactory* decoder_factory, 162 cricket::WebRtcVideoDecoderFactory* decoder_factory,
153 const std::vector<VideoCodec>& codecs); 163 const std::vector<VideoCodec>& codecs);
154 164
155 void TestExtendedEncoderOveruse(bool use_external_encoder); 165 void TestExtendedEncoderOveruse(bool use_external_encoder);
156 166
157 webrtc::test::ScopedFieldTrials override_field_trials_; 167 webrtc::test::ScopedFieldTrials override_field_trials_;
158 webrtc::RtcEventLogNullImpl event_log_; 168 webrtc::RtcEventLogNullImpl event_log_;
169 const std::unique_ptr<webrtc::RtpTransportControllerSendInterface>
170 rtp_transport_controller_send_;
159 // Used in WebRtcVideoEngine2VoiceTest, but defined here so it's properly 171 // Used in WebRtcVideoEngine2VoiceTest, but defined here so it's properly
160 // initialized when the constructor is called. 172 // initialized when the constructor is called.
161 std::unique_ptr<webrtc::Call> call_; 173 std::unique_ptr<webrtc::Call> call_;
162 WebRtcVideoEngine2 engine_; 174 WebRtcVideoEngine2 engine_;
163 VideoCodec default_codec_; 175 VideoCodec default_codec_;
164 std::map<int, int> default_apt_rtx_types_; 176 std::map<int, int> default_apt_rtx_types_;
165 }; 177 };
166 178
167 TEST_F(WebRtcVideoEngine2Test, AnnouncesVp9AccordingToBuildFlags) { 179 TEST_F(WebRtcVideoEngine2Test, AnnouncesVp9AccordingToBuildFlags) {
168 bool claims_vp9_support = false; 180 bool claims_vp9_support = false;
(...skipping 4408 matching lines...) Expand 10 before | Expand all | Expand 10 after
4577 4589
4578 TEST_F(WebRtcVideoChannel2SimulcastTest, 4590 TEST_F(WebRtcVideoChannel2SimulcastTest,
4579 NoSimulcastScreenshareWithoutConference) { 4591 NoSimulcastScreenshareWithoutConference) {
4580 webrtc::test::ScopedFieldTrials override_field_trials_( 4592 webrtc::test::ScopedFieldTrials override_field_trials_(
4581 "WebRTC-SimulcastScreenshare/Enabled/"); 4593 "WebRTC-SimulcastScreenshare/Enabled/");
4582 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true, 4594 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true,
4583 false); 4595 false);
4584 } 4596 }
4585 4597
4586 } // namespace cricket 4598 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/base/videoengine_unittest.h ('k') | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698