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

Side by Side Diff: webrtc/ortc/ortcfactory.cc

Issue 2799033006: Injectable audio encoders: Moved audio encoder, factory and builtin factory to api/. (Closed)
Patch Set: More backwards-compatibility! 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
« no previous file with comments | « webrtc/ortc/ortcfactory.h ('k') | webrtc/pc/peerconnectionfactory.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 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2017 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 "webrtc/ortc/ortcfactory.h" 11 #include "webrtc/ortc/ortcfactory.h"
12 12
13 #include <sstream> 13 #include <sstream>
14 #include <utility> // For std::move. 14 #include <utility> // For std::move.
15 #include <vector> 15 #include <vector>
16 16
17 #include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h"
18 #include "webrtc/api/audio_codecs/builtin_audio_encoder_factory.h"
17 #include "webrtc/api/mediastreamtrackproxy.h" 19 #include "webrtc/api/mediastreamtrackproxy.h"
18 #include "webrtc/api/proxy.h" 20 #include "webrtc/api/proxy.h"
19 #include "webrtc/api/rtcerror.h" 21 #include "webrtc/api/rtcerror.h"
20 #include "webrtc/api/videosourceproxy.h" 22 #include "webrtc/api/videosourceproxy.h"
21 #include "webrtc/base/asyncpacketsocket.h" 23 #include "webrtc/base/asyncpacketsocket.h"
22 #include "webrtc/base/bind.h" 24 #include "webrtc/base/bind.h"
23 #include "webrtc/base/checks.h" 25 #include "webrtc/base/checks.h"
24 #include "webrtc/base/helpers.h" 26 #include "webrtc/base/helpers.h"
25 #include "webrtc/base/logging.h" 27 #include "webrtc/base/logging.h"
26 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" 28 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
27 #include "webrtc/media/base/mediaconstants.h" 29 #include "webrtc/media/base/mediaconstants.h"
28 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h"
29 #include "webrtc/ortc/ortcrtpreceiveradapter.h" 30 #include "webrtc/ortc/ortcrtpreceiveradapter.h"
30 #include "webrtc/ortc/ortcrtpsenderadapter.h" 31 #include "webrtc/ortc/ortcrtpsenderadapter.h"
31 #include "webrtc/ortc/rtpparametersconversion.h" 32 #include "webrtc/ortc/rtpparametersconversion.h"
32 #include "webrtc/ortc/rtptransportadapter.h" 33 #include "webrtc/ortc/rtptransportadapter.h"
33 #include "webrtc/ortc/rtptransportcontrolleradapter.h" 34 #include "webrtc/ortc/rtptransportcontrolleradapter.h"
34 #include "webrtc/p2p/base/basicpacketsocketfactory.h" 35 #include "webrtc/p2p/base/basicpacketsocketfactory.h"
35 #include "webrtc/p2p/base/udptransport.h" 36 #include "webrtc/p2p/base/udptransport.h"
36 #include "webrtc/pc/audiotrack.h" 37 #include "webrtc/pc/audiotrack.h"
37 #include "webrtc/pc/channelmanager.h" 38 #include "webrtc/pc/channelmanager.h"
38 #include "webrtc/pc/localaudiosource.h" 39 #include "webrtc/pc/localaudiosource.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 rtc::Thread* signaling_thread, 162 rtc::Thread* signaling_thread,
162 rtc::NetworkManager* network_manager, 163 rtc::NetworkManager* network_manager,
163 rtc::PacketSocketFactory* socket_factory, 164 rtc::PacketSocketFactory* socket_factory,
164 AudioDeviceModule* adm) 165 AudioDeviceModule* adm)
165 : network_thread_(network_thread), 166 : network_thread_(network_thread),
166 signaling_thread_(signaling_thread), 167 signaling_thread_(signaling_thread),
167 network_manager_(network_manager), 168 network_manager_(network_manager),
168 socket_factory_(socket_factory), 169 socket_factory_(socket_factory),
169 adm_(adm), 170 adm_(adm),
170 null_event_log_(RtcEventLog::CreateNull()), 171 null_event_log_(RtcEventLog::CreateNull()),
172 audio_encoder_factory_(CreateBuiltinAudioEncoderFactory()),
171 audio_decoder_factory_(CreateBuiltinAudioDecoderFactory()) { 173 audio_decoder_factory_(CreateBuiltinAudioDecoderFactory()) {
172 if (!rtc::CreateRandomString(kDefaultRtcpCnameLength, &default_cname_)) { 174 if (!rtc::CreateRandomString(kDefaultRtcpCnameLength, &default_cname_)) {
173 LOG(LS_ERROR) << "Failed to generate CNAME?"; 175 LOG(LS_ERROR) << "Failed to generate CNAME?";
174 RTC_NOTREACHED(); 176 RTC_NOTREACHED();
175 } 177 }
176 if (!network_thread_) { 178 if (!network_thread_) {
177 owned_network_thread_ = rtc::Thread::CreateWithSocketServer(); 179 owned_network_thread_ = rtc::Thread::CreateWithSocketServer();
178 owned_network_thread_->Start(); 180 owned_network_thread_->Start();
179 network_thread_ = owned_network_thread_.get(); 181 network_thread_ = owned_network_thread_.get();
180 } 182 }
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 537
536 std::unique_ptr<cricket::MediaEngineInterface> 538 std::unique_ptr<cricket::MediaEngineInterface>
537 OrtcFactory::CreateMediaEngine_w() { 539 OrtcFactory::CreateMediaEngine_w() {
538 RTC_DCHECK_RUN_ON(worker_thread_.get()); 540 RTC_DCHECK_RUN_ON(worker_thread_.get());
539 // The null arguments are optional factories that could be passed into the 541 // The null arguments are optional factories that could be passed into the
540 // OrtcFactory, but aren't yet. 542 // OrtcFactory, but aren't yet.
541 // 543 //
542 // Note that |adm_| may be null, in which case the platform-specific default 544 // Note that |adm_| may be null, in which case the platform-specific default
543 // AudioDeviceModule will be used. 545 // AudioDeviceModule will be used.
544 return std::unique_ptr<cricket::MediaEngineInterface>( 546 return std::unique_ptr<cricket::MediaEngineInterface>(
545 cricket::WebRtcMediaEngineFactory::Create(adm_, audio_decoder_factory_, 547 cricket::WebRtcMediaEngineFactory::Create(adm_, audio_encoder_factory_,
546 nullptr, nullptr, nullptr)); 548 audio_decoder_factory_, nullptr,
549 nullptr, nullptr));
547 } 550 }
548 551
549 } // namespace webrtc 552 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/ortc/ortcfactory.h ('k') | webrtc/pc/peerconnectionfactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698