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

Side by Side Diff: webrtc/call/call_perf_tests.cc

Issue 2705093002: Injectable audio encoders: WebRtcVoiceEngine and company (Closed)
Patch Set: Channel::GetSendCodec asks both its acm and its codec manager. Created 3 years, 7 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) 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 10
11 #include <algorithm> 11 #include <algorithm>
12 #include <limits> 12 #include <limits>
13 #include <memory> 13 #include <memory>
14 #include <string> 14 #include <string>
15 15
16 #include "webrtc/base/checks.h" 16 #include "webrtc/base/checks.h"
17 #include "webrtc/base/constructormagic.h" 17 #include "webrtc/base/constructormagic.h"
18 #include "webrtc/base/thread_annotations.h" 18 #include "webrtc/base/thread_annotations.h"
19 #include "webrtc/call/call.h" 19 #include "webrtc/call/call.h"
20 #include "webrtc/config.h" 20 #include "webrtc/config.h"
21 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" 21 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
22 #include "webrtc/modules/audio_coding/codecs/builtin_audio_encoder_factory.h"
22 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" 23 #include "webrtc/modules/audio_coding/include/audio_coding_module.h"
23 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h" 24 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h"
24 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" 25 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
25 #include "webrtc/system_wrappers/include/metrics_default.h" 26 #include "webrtc/system_wrappers/include/metrics_default.h"
26 #include "webrtc/test/call_test.h" 27 #include "webrtc/test/call_test.h"
27 #include "webrtc/test/direct_transport.h" 28 #include "webrtc/test/direct_transport.h"
28 #include "webrtc/test/drifting_clock.h" 29 #include "webrtc/test/drifting_clock.h"
29 #include "webrtc/test/encoder_settings.h" 30 #include "webrtc/test/encoder_settings.h"
30 #include "webrtc/test/fake_audio_device.h" 31 #include "webrtc/test/fake_audio_device.h"
31 #include "webrtc/test/fake_decoder.h" 32 #include "webrtc/test/fake_decoder.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 receive_transport.SetReceiver(sender_call_->Receiver()); 226 receive_transport.SetReceiver(sender_call_->Receiver());
226 227
227 test::FakeDecoder fake_decoder; 228 test::FakeDecoder fake_decoder;
228 229
229 CreateSendConfig(1, 0, 0, &video_send_transport); 230 CreateSendConfig(1, 0, 0, &video_send_transport);
230 CreateMatchingReceiveConfigs(&receive_transport); 231 CreateMatchingReceiveConfigs(&receive_transport);
231 232
232 AudioSendStream::Config audio_send_config(&audio_send_transport); 233 AudioSendStream::Config audio_send_config(&audio_send_transport);
233 audio_send_config.voe_channel_id = send_channel_id; 234 audio_send_config.voe_channel_id = send_channel_id;
234 audio_send_config.rtp.ssrc = kAudioSendSsrc; 235 audio_send_config.rtp.ssrc = kAudioSendSsrc;
235 audio_send_config.send_codec_spec.codec_inst = 236 audio_send_config.send_codec_spec =
236 CodecInst{kAudioSendPayloadType, "ISAC", 16000, 480, 1, 32000}; 237 rtc::Optional<AudioSendStream::Config::SendCodecSpec>(
238 {kAudioSendPayloadType, {"ISAC", 16000, 1}});
239 audio_send_config.encoder_factory = CreateBuiltinAudioEncoderFactory();
237 AudioSendStream* audio_send_stream = 240 AudioSendStream* audio_send_stream =
238 sender_call_->CreateAudioSendStream(audio_send_config); 241 sender_call_->CreateAudioSendStream(audio_send_config);
239 242
240 video_send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs; 243 video_send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
241 if (fec == FecMode::kOn) { 244 if (fec == FecMode::kOn) {
242 video_send_config_.rtp.ulpfec.red_payload_type = kRedPayloadType; 245 video_send_config_.rtp.ulpfec.red_payload_type = kRedPayloadType;
243 video_send_config_.rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType; 246 video_send_config_.rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
244 video_receive_configs_[0].rtp.ulpfec.red_payload_type = kRedPayloadType; 247 video_receive_configs_[0].rtp.ulpfec.red_payload_type = kRedPayloadType;
245 video_receive_configs_[0].rtp.ulpfec.ulpfec_payload_type = 248 video_receive_configs_[0].rtp.ulpfec.ulpfec_payload_type =
246 kUlpfecPayloadType; 249 kUlpfecPayloadType;
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 uint32_t last_set_bitrate_kbps_; 777 uint32_t last_set_bitrate_kbps_;
775 VideoSendStream* send_stream_; 778 VideoSendStream* send_stream_;
776 test::FrameGeneratorCapturer* frame_generator_; 779 test::FrameGeneratorCapturer* frame_generator_;
777 VideoEncoderConfig encoder_config_; 780 VideoEncoderConfig encoder_config_;
778 } test; 781 } test;
779 782
780 RunBaseTest(&test); 783 RunBaseTest(&test);
781 } 784 }
782 785
783 } // namespace webrtc 786 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698