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

Side by Side Diff: webrtc/api/peerconnectioninterface.h

Issue 2942503002: Detailed description will be added. (Closed)
Patch Set: Suggested changes to comments Created 3 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/api/mediastreaminterface.h ('k') | webrtc/call/BUILD.gn » ('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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 #include "webrtc/api/rtpsenderinterface.h" 83 #include "webrtc/api/rtpsenderinterface.h"
84 #include "webrtc/api/stats/rtcstatscollectorcallback.h" 84 #include "webrtc/api/stats/rtcstatscollectorcallback.h"
85 #include "webrtc/api/statstypes.h" 85 #include "webrtc/api/statstypes.h"
86 #include "webrtc/api/umametrics.h" 86 #include "webrtc/api/umametrics.h"
87 #include "webrtc/base/fileutils.h" 87 #include "webrtc/base/fileutils.h"
88 #include "webrtc/base/network.h" 88 #include "webrtc/base/network.h"
89 #include "webrtc/base/rtccertificate.h" 89 #include "webrtc/base/rtccertificate.h"
90 #include "webrtc/base/rtccertificategenerator.h" 90 #include "webrtc/base/rtccertificategenerator.h"
91 #include "webrtc/base/socketaddress.h" 91 #include "webrtc/base/socketaddress.h"
92 #include "webrtc/base/sslstreamadapter.h" 92 #include "webrtc/base/sslstreamadapter.h"
93 #include "webrtc/call/callfactoryinterface.h"
94 #include "webrtc/logging/rtc_event_log/rtc_event_log_factory_interface.h"
93 #include "webrtc/media/base/mediachannel.h" 95 #include "webrtc/media/base/mediachannel.h"
94 #include "webrtc/media/base/videocapturer.h" 96 #include "webrtc/media/base/videocapturer.h"
95 #include "webrtc/p2p/base/portallocator.h" 97 #include "webrtc/p2p/base/portallocator.h"
96 98
97 namespace rtc { 99 namespace rtc {
98 class SSLIdentity; 100 class SSLIdentity;
99 class Thread; 101 class Thread;
100 } 102 }
101 103
102 namespace cricket { 104 namespace cricket {
105 class MediaEngineInterface;
103 class WebRtcVideoDecoderFactory; 106 class WebRtcVideoDecoderFactory;
104 class WebRtcVideoEncoderFactory; 107 class WebRtcVideoEncoderFactory;
105 } 108 }
106 109
107 namespace webrtc { 110 namespace webrtc {
108 class AudioDeviceModule; 111 class AudioDeviceModule;
109 class AudioMixer; 112 class AudioMixer;
113 class CallFactoryInterface;
110 class MediaConstraintsInterface; 114 class MediaConstraintsInterface;
111 115
112 // MediaStream container interface. 116 // MediaStream container interface.
113 class StreamCollectionInterface : public rtc::RefCountInterface { 117 class StreamCollectionInterface : public rtc::RefCountInterface {
114 public: 118 public:
115 // TODO(ronghuawu): Update the function names to c++ style, e.g. find -> Find. 119 // TODO(ronghuawu): Update the function names to c++ style, e.g. find -> Find.
116 virtual size_t count() = 0; 120 virtual size_t count() = 0;
117 virtual MediaStreamInterface* at(size_t index) = 0; 121 virtual MediaStreamInterface* at(size_t index) = 0;
118 virtual MediaStreamInterface* find(const std::string& label) = 0; 122 virtual MediaStreamInterface* find(const std::string& label) = 0;
119 virtual MediaStreamTrackInterface* FindAudioTrack( 123 virtual MediaStreamTrackInterface* FindAudioTrack(
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 // 1029 //
1026 // As such, if the current thread is not already running an rtc::Thread message 1030 // As such, if the current thread is not already running an rtc::Thread message
1027 // loop, an application using this method must eventually either call 1031 // loop, an application using this method must eventually either call
1028 // rtc::Thread::Current()->Run(), or call 1032 // rtc::Thread::Current()->Run(), or call
1029 // rtc::Thread::Current()->ProcessMessages() within the application's own 1033 // rtc::Thread::Current()->ProcessMessages() within the application's own
1030 // message loop. 1034 // message loop.
1031 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( 1035 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
1032 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, 1036 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
1033 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory); 1037 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory);
1034 1038
1035 // Deprecated variant of the above.
1036 // TODO(kwiberg): Remove. 1039 // TODO(kwiberg): Remove.
1037 rtc::scoped_refptr<PeerConnectionFactoryInterface> 1040 rtc::scoped_refptr<PeerConnectionFactoryInterface>
1038 CreatePeerConnectionFactory(); 1041 CreatePeerConnectionFactory();
1039 1042
1040 // Create a new instance of PeerConnectionFactoryInterface. 1043 // Create a new instance of PeerConnectionFactoryInterface.
1041 // 1044 //
1042 // |network_thread|, |worker_thread| and |signaling_thread| are 1045 // |network_thread|, |worker_thread| and |signaling_thread| are
1043 // the only mandatory parameters. 1046 // the only mandatory parameters.
1044 // 1047 //
1045 // If non-null, a reference is added to |default_adm|, and ownership of 1048 // If non-null, a reference is added to |default_adm|, and ownership of
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 rtc::Thread* worker_and_network_thread, 1122 rtc::Thread* worker_and_network_thread,
1120 rtc::Thread* signaling_thread, 1123 rtc::Thread* signaling_thread,
1121 AudioDeviceModule* default_adm, 1124 AudioDeviceModule* default_adm,
1122 cricket::WebRtcVideoEncoderFactory* encoder_factory, 1125 cricket::WebRtcVideoEncoderFactory* encoder_factory,
1123 cricket::WebRtcVideoDecoderFactory* decoder_factory) { 1126 cricket::WebRtcVideoDecoderFactory* decoder_factory) {
1124 return CreatePeerConnectionFactory( 1127 return CreatePeerConnectionFactory(
1125 worker_and_network_thread, worker_and_network_thread, signaling_thread, 1128 worker_and_network_thread, worker_and_network_thread, signaling_thread,
1126 default_adm, encoder_factory, decoder_factory); 1129 default_adm, encoder_factory, decoder_factory);
1127 } 1130 }
1128 1131
1132 // This is a lower-level version of the CreatePeerConnectionFactory functions
1133 // above. It's implemented in the "peerconnection" build target, whereas the
1134 // above methods are only implemented in the broader "libjingle_peerconnection"
1135 // build target, which pulls in the implementations of every module webrtc may
1136 // use.
1137 //
1138 // If an application knows it will only require certain modules, it can reduce
1139 // webrtc's impact on its binary size by depending only on the "peerconnection"
1140 // target and the modules the application requires, using
1141 // CreateModularPeerConnectionFactory instead of one of the
1142 // CreatePeerConnectionFactory methods above. For example, if an application
1143 // only uses WebRTC for audio, it can pass in null pointers for the
1144 // video-specific interfaces, and omit the corresponding modules from its
1145 // build.
1146 //
1147 // |worker_thread| is the only mandatory parameter. If the |network_thread| or
1148 // the |signaling_thread| is null, the PeerConnectionFactory would create the
1149 // |network_thread| internally and use the thread which this method is called as
1150 // the |signaling_thread|. In this case, all the threads would be owned by the
1151 // PeerConnectionFactory.
1152 //
1153 // If all the threads passed in are non-null, the PeerConnectionFactory will not
1154 // own them.
1155 //
1156 // If non-null, a reference is added to |default_adm|, and ownership of
1157 // |video_encoder_factory| and |video_decoder_factory| is transferred to the
1158 // returned factory.
1159 //
1160 // TODO(deadbeef): Use rtc::scoped_refptr<> and std::unique_ptr<> to make this
1161 // ownership transfer and ref counting more obvious.
1162 //
1163 // TODO(deadbeef): Encapsulate these modules in a struct, so that when a new
1164 // module is inevitably exposed, we can just add a field to the struct instead
1165 // of adding a whole new CreateModularPeerConnectionFactory overload.
1166 rtc::scoped_refptr<PeerConnectionFactoryInterface>
1167 CreateModularPeerConnectionFactory(
1168 rtc::Thread* network_thread,
1169 rtc::Thread* worker_thread,
1170 rtc::Thread* signaling_thread,
1171 AudioDeviceModule* default_adm,
1172 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
1173 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
1174 cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
1175 cricket::WebRtcVideoDecoderFactory* video_decoder_factory,
1176 rtc::scoped_refptr<AudioMixer> audio_mixer,
1177 std::unique_ptr<cricket::MediaEngineInterface> media_engine,
1178 std::unique_ptr<CallFactoryInterface> call_factory,
1179 std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory);
1180
1129 } // namespace webrtc 1181 } // namespace webrtc
1130 1182
1131 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ 1183 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_
OLDNEW
« no previous file with comments | « webrtc/api/mediastreaminterface.h ('k') | webrtc/call/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698