OLD | NEW |
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 it->second == config.rtp.fec.red_rtx_payload_type); | 90 it->second == config.rtp.fec.red_rtx_payload_type); |
91 } | 91 } |
92 } | 92 } |
93 } // namespace | 93 } // namespace |
94 | 94 |
95 namespace cricket { | 95 namespace cricket { |
96 class WebRtcVideoEngine2Test : public ::testing::Test { | 96 class WebRtcVideoEngine2Test : public ::testing::Test { |
97 public: | 97 public: |
98 WebRtcVideoEngine2Test() : WebRtcVideoEngine2Test("") {} | 98 WebRtcVideoEngine2Test() : WebRtcVideoEngine2Test("") {} |
99 explicit WebRtcVideoEngine2Test(const char* field_trials) | 99 explicit WebRtcVideoEngine2Test(const char* field_trials) |
100 : WebRtcVideoEngine2Test(nullptr, field_trials) {} | |
101 WebRtcVideoEngine2Test(WebRtcVoiceEngine* voice_engine, | |
102 const char* field_trials) | |
103 : override_field_trials_(field_trials), | 100 : override_field_trials_(field_trials), |
104 call_(webrtc::Call::Create(webrtc::Call::Config())), | 101 call_(webrtc::Call::Create(webrtc::Call::Config())), |
105 voice_engine_(nullptr), | |
106 engine_() { | 102 engine_() { |
107 std::vector<VideoCodec> engine_codecs = engine_.codecs(); | 103 std::vector<VideoCodec> engine_codecs = engine_.codecs(); |
108 RTC_DCHECK(!engine_codecs.empty()); | 104 RTC_DCHECK(!engine_codecs.empty()); |
109 bool codec_set = false; | 105 bool codec_set = false; |
110 for (size_t i = 0; i < engine_codecs.size(); ++i) { | 106 for (size_t i = 0; i < engine_codecs.size(); ++i) { |
111 if (engine_codecs[i].name == "red") { | 107 if (engine_codecs[i].name == "red") { |
112 default_red_codec_ = engine_codecs[i]; | 108 default_red_codec_ = engine_codecs[i]; |
113 } else if (engine_codecs[i].name == "ulpfec") { | 109 } else if (engine_codecs[i].name == "ulpfec") { |
114 default_ulpfec_codec_ = engine_codecs[i]; | 110 default_ulpfec_codec_ = engine_codecs[i]; |
115 } else if (engine_codecs[i].name == "rtx") { | 111 } else if (engine_codecs[i].name == "rtx") { |
(...skipping 19 matching lines...) Expand all Loading... |
135 VideoMediaChannel* SetUpForExternalDecoderFactory( | 131 VideoMediaChannel* SetUpForExternalDecoderFactory( |
136 cricket::WebRtcVideoDecoderFactory* decoder_factory, | 132 cricket::WebRtcVideoDecoderFactory* decoder_factory, |
137 const std::vector<VideoCodec>& codecs); | 133 const std::vector<VideoCodec>& codecs); |
138 | 134 |
139 void TestExtendedEncoderOveruse(bool use_external_encoder); | 135 void TestExtendedEncoderOveruse(bool use_external_encoder); |
140 | 136 |
141 webrtc::test::ScopedFieldTrials override_field_trials_; | 137 webrtc::test::ScopedFieldTrials override_field_trials_; |
142 // Used in WebRtcVideoEngine2VoiceTest, but defined here so it's properly | 138 // Used in WebRtcVideoEngine2VoiceTest, but defined here so it's properly |
143 // initialized when the constructor is called. | 139 // initialized when the constructor is called. |
144 std::unique_ptr<webrtc::Call> call_; | 140 std::unique_ptr<webrtc::Call> call_; |
145 WebRtcVoiceEngine voice_engine_; | |
146 WebRtcVideoEngine2 engine_; | 141 WebRtcVideoEngine2 engine_; |
147 VideoCodec default_codec_; | 142 VideoCodec default_codec_; |
148 VideoCodec default_red_codec_; | 143 VideoCodec default_red_codec_; |
149 VideoCodec default_ulpfec_codec_; | 144 VideoCodec default_ulpfec_codec_; |
150 std::map<int, int> default_apt_rtx_types_; | 145 std::map<int, int> default_apt_rtx_types_; |
151 }; | 146 }; |
152 | 147 |
153 TEST_F(WebRtcVideoEngine2Test, DefaultRtxCodecHasAssociatedPayloadTypeSet) { | 148 TEST_F(WebRtcVideoEngine2Test, DefaultRtxCodecHasAssociatedPayloadTypeSet) { |
154 std::vector<VideoCodec> engine_codecs = engine_.codecs(); | 149 std::vector<VideoCodec> engine_codecs = engine_.codecs(); |
155 for (size_t i = 0; i < engine_codecs.size(); ++i) { | 150 for (size_t i = 0; i < engine_codecs.size(); ++i) { |
(...skipping 3531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3687 } | 3682 } |
3688 | 3683 |
3689 // Test that we normalize send codec format size in simulcast. | 3684 // Test that we normalize send codec format size in simulcast. |
3690 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3685 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
3691 cricket::VideoCodec codec(kVp8Codec270p); | 3686 cricket::VideoCodec codec(kVp8Codec270p); |
3692 codec.width += 1; | 3687 codec.width += 1; |
3693 codec.height += 1; | 3688 codec.height += 1; |
3694 VerifySimulcastSettings(codec, 2, 2); | 3689 VerifySimulcastSettings(codec, 2, 2); |
3695 } | 3690 } |
3696 } // namespace cricket | 3691 } // namespace cricket |
OLD | NEW |