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

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

Issue 1991233004: Moved creation of AudioDecoderFactory to inside PeerConnectionFactory. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@audio-decoder-factory-injections-3
Patch Set: Parental Advisory: Explicit Content Created 4 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
« no previous file with comments | « webrtc/media/engine/webrtcmediaengine.cc ('k') | webrtc/media/engine/webrtcvoiceengine.h » ('j') | 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) 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
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 it->second == config.rtp.fec.red_rtx_payload_type); 92 it->second == config.rtp.fec.red_rtx_payload_type);
93 } 93 }
94 } 94 }
95 } // namespace 95 } // namespace
96 96
97 namespace cricket { 97 namespace cricket {
98 class WebRtcVideoEngine2Test : public ::testing::Test { 98 class WebRtcVideoEngine2Test : public ::testing::Test {
99 public: 99 public:
100 WebRtcVideoEngine2Test() : WebRtcVideoEngine2Test("") {} 100 WebRtcVideoEngine2Test() : WebRtcVideoEngine2Test("") {}
101 explicit WebRtcVideoEngine2Test(const char* field_trials) 101 explicit WebRtcVideoEngine2Test(const char* field_trials)
102 : WebRtcVideoEngine2Test(nullptr, field_trials) {}
103 WebRtcVideoEngine2Test(WebRtcVoiceEngine* voice_engine,
104 const char* field_trials)
105 : override_field_trials_(field_trials), 102 : override_field_trials_(field_trials),
106 call_(webrtc::Call::Create(webrtc::Call::Config())), 103 call_(webrtc::Call::Create(webrtc::Call::Config())),
107 voice_engine_(nullptr),
108 engine_() { 104 engine_() {
109 std::vector<VideoCodec> engine_codecs = engine_.codecs(); 105 std::vector<VideoCodec> engine_codecs = engine_.codecs();
110 RTC_DCHECK(!engine_codecs.empty()); 106 RTC_DCHECK(!engine_codecs.empty());
111 bool codec_set = false; 107 bool codec_set = false;
112 for (size_t i = 0; i < engine_codecs.size(); ++i) { 108 for (size_t i = 0; i < engine_codecs.size(); ++i) {
113 if (engine_codecs[i].name == "red") { 109 if (engine_codecs[i].name == "red") {
114 default_red_codec_ = engine_codecs[i]; 110 default_red_codec_ = engine_codecs[i];
115 } else if (engine_codecs[i].name == "ulpfec") { 111 } else if (engine_codecs[i].name == "ulpfec") {
116 default_ulpfec_codec_ = engine_codecs[i]; 112 default_ulpfec_codec_ = engine_codecs[i];
117 } else if (engine_codecs[i].name == "rtx") { 113 } else if (engine_codecs[i].name == "rtx") {
(...skipping 19 matching lines...) Expand all
137 VideoMediaChannel* SetUpForExternalDecoderFactory( 133 VideoMediaChannel* SetUpForExternalDecoderFactory(
138 cricket::WebRtcVideoDecoderFactory* decoder_factory, 134 cricket::WebRtcVideoDecoderFactory* decoder_factory,
139 const std::vector<VideoCodec>& codecs); 135 const std::vector<VideoCodec>& codecs);
140 136
141 void TestExtendedEncoderOveruse(bool use_external_encoder); 137 void TestExtendedEncoderOveruse(bool use_external_encoder);
142 138
143 webrtc::test::ScopedFieldTrials override_field_trials_; 139 webrtc::test::ScopedFieldTrials override_field_trials_;
144 // Used in WebRtcVideoEngine2VoiceTest, but defined here so it's properly 140 // Used in WebRtcVideoEngine2VoiceTest, but defined here so it's properly
145 // initialized when the constructor is called. 141 // initialized when the constructor is called.
146 std::unique_ptr<webrtc::Call> call_; 142 std::unique_ptr<webrtc::Call> call_;
147 WebRtcVoiceEngine voice_engine_;
148 WebRtcVideoEngine2 engine_; 143 WebRtcVideoEngine2 engine_;
149 VideoCodec default_codec_; 144 VideoCodec default_codec_;
150 VideoCodec default_red_codec_; 145 VideoCodec default_red_codec_;
151 VideoCodec default_ulpfec_codec_; 146 VideoCodec default_ulpfec_codec_;
152 std::map<int, int> default_apt_rtx_types_; 147 std::map<int, int> default_apt_rtx_types_;
153 }; 148 };
154 149
155 TEST_F(WebRtcVideoEngine2Test, AnnouncesVp9AccordingToBuildFlags) { 150 TEST_F(WebRtcVideoEngine2Test, AnnouncesVp9AccordingToBuildFlags) {
156 bool claims_vp9_support = false; 151 bool claims_vp9_support = false;
157 for (const cricket::VideoCodec& codec : engine_.codecs()) { 152 for (const cricket::VideoCodec& codec : engine_.codecs()) {
(...skipping 3608 matching lines...) Expand 10 before | Expand all | Expand 10 after
3766 } 3761 }
3767 3762
3768 // Test that we normalize send codec format size in simulcast. 3763 // Test that we normalize send codec format size in simulcast.
3769 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3764 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3770 cricket::VideoCodec codec(kVp8Codec270p); 3765 cricket::VideoCodec codec(kVp8Codec270p);
3771 codec.width += 1; 3766 codec.width += 1;
3772 codec.height += 1; 3767 codec.height += 1;
3773 VerifySimulcastSettings(codec, 2, 2); 3768 VerifySimulcastSettings(codec, 2, 2);
3774 } 3769 }
3775 } // namespace cricket 3770 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcmediaengine.cc ('k') | webrtc/media/engine/webrtcvoiceengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698