Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
|
magjed_webrtc
2017/06/13 15:14:31
This is a file I haven't seen before and it's not
Zhi Huang
2017/06/14 06:57:01
Agree. It would be much better to put them to null
| |
| 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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 | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #include "webrtc/api/peerconnectioninterface.h" | |
| 12 #include "webrtc/base/bind.h" | |
| 13 #include "webrtc/base/scoped_ref_ptr.h" | |
| 14 #include "webrtc/base/thread.h" | |
| 15 #include "webrtc/call/callfactoryinterface.h" | |
| 16 #include "webrtc/media/engine/webrtcmediaengine.h" // nogncheck | |
| 17 | |
| 18 namespace webrtc { | |
| 19 | |
| 20 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( | |
|
the sun
2017/06/13 14:34:39
Do you really need all of these functions? Isn't t
Zhi Huang
2017/06/14 06:57:00
You are right. I'll try to remove the unused ones.
| |
| 21 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, | |
| 22 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory) { | |
| 23 // Create and start the worker thread to create the MediaEngine. | |
| 24 std::unique_ptr<rtc::Thread> worker_thread = rtc::Thread::Create(); | |
| 25 worker_thread->Start(); | |
| 26 | |
| 27 return CreateModularPeerConnectionFactory( | |
| 28 nullptr, /*network_thread*/ | |
| 29 worker_thread.release(), nullptr /*signaling_thread*/, | |
| 30 nullptr /*default_adm*/, audio_encoder_factory, audio_decoder_factory, | |
| 31 nullptr /*video_encoder_factory*/, nullptr /*video_decoder_factory*/, | |
| 32 nullptr /*audio_mixer*/, std::unique_ptr<cricket::MediaEngineInterface>(), | |
| 33 std::unique_ptr<CallFactoryInterface>(), | |
| 34 std::unique_ptr<RtcEventLogFactoryInterface>()); | |
| 35 } | |
| 36 | |
| 37 rtc::scoped_refptr<PeerConnectionFactoryInterface> | |
| 38 CreatePeerConnectionFactory() { | |
| 39 return CreatePeerConnectionFactory(nullptr /*AudioEncoderFactory*/, | |
| 40 nullptr /*AudioDecoderFactory*/); | |
| 41 } | |
| 42 | |
| 43 rtc::scoped_refptr<PeerConnectionFactoryInterface> | |
| 44 CreatePeerConnectionFactoryWithAudioMixer( | |
| 45 rtc::Thread* network_thread, | |
| 46 rtc::Thread* worker_thread, | |
| 47 rtc::Thread* signaling_thread, | |
| 48 AudioDeviceModule* default_adm, | |
| 49 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, | |
| 50 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, | |
| 51 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, | |
| 52 cricket::WebRtcVideoDecoderFactory* video_decoder_factory, | |
| 53 rtc::scoped_refptr<AudioMixer> audio_mixer) { | |
| 54 return CreateModularPeerConnectionFactory( | |
| 55 network_thread, worker_thread, signaling_thread, default_adm, | |
| 56 audio_encoder_factory, audio_decoder_factory, video_encoder_factory, | |
| 57 video_decoder_factory, audio_mixer, | |
| 58 std::unique_ptr<cricket::MediaEngineInterface>(), | |
| 59 std::unique_ptr<CallFactoryInterface>(), | |
| 60 std::unique_ptr<RtcEventLogFactoryInterface>()); | |
| 61 } | |
| 62 | |
| 63 rtc::scoped_refptr<PeerConnectionFactoryInterface> | |
| 64 CreatePeerConnectionFactoryWithAudioMixer( | |
| 65 rtc::Thread* network_thread, | |
| 66 rtc::Thread* worker_thread, | |
| 67 rtc::Thread* signaling_thread, | |
| 68 AudioDeviceModule* default_adm, | |
| 69 cricket::WebRtcVideoEncoderFactory* encoder_factory, | |
| 70 cricket::WebRtcVideoDecoderFactory* decoder_factory, | |
| 71 rtc::scoped_refptr<AudioMixer> audio_mixer) { | |
| 72 return CreatePeerConnectionFactoryWithAudioMixer( | |
| 73 network_thread, worker_thread, signaling_thread, default_adm, | |
| 74 nullptr, /*AudioEncoderFactory*/ | |
| 75 nullptr /*AudioDecoderFactory*/, encoder_factory, decoder_factory, | |
| 76 audio_mixer); | |
| 77 } | |
| 78 | |
| 79 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( | |
| 80 rtc::Thread* network_thread, | |
| 81 rtc::Thread* worker_thread, | |
| 82 rtc::Thread* signaling_thread, | |
| 83 AudioDeviceModule* default_adm, | |
| 84 cricket::WebRtcVideoEncoderFactory* encoder_factory, | |
| 85 cricket::WebRtcVideoDecoderFactory* decoder_factory) { | |
| 86 return CreatePeerConnectionFactoryWithAudioMixer( | |
| 87 network_thread, worker_thread, signaling_thread, default_adm, | |
| 88 encoder_factory, decoder_factory, nullptr); | |
| 89 } | |
| 90 | |
| 91 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( | |
| 92 rtc::Thread* network_thread, | |
| 93 rtc::Thread* worker_thread, | |
| 94 rtc::Thread* signaling_thread, | |
| 95 AudioDeviceModule* default_adm, | |
| 96 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, | |
| 97 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, | |
| 98 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, | |
| 99 cricket::WebRtcVideoDecoderFactory* video_decoder_factory) { | |
| 100 return CreatePeerConnectionFactoryWithAudioMixer( | |
| 101 network_thread, worker_thread, signaling_thread, default_adm, | |
| 102 audio_encoder_factory, audio_decoder_factory, video_encoder_factory, | |
| 103 video_decoder_factory, nullptr); | |
| 104 } | |
| 105 | |
| 106 } // namespace webrtc | |
| OLD | NEW |