OLD | NEW |
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 Loading... |
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 Loading... |
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. | 1039 // Deprecated. Use the CreateModularPeerConnectionFactory instead. |
1036 // TODO(kwiberg): Remove. | 1040 // TODO(kwiberg): Remove. |
1037 rtc::scoped_refptr<PeerConnectionFactoryInterface> | 1041 rtc::scoped_refptr<PeerConnectionFactoryInterface> |
1038 CreatePeerConnectionFactory(); | 1042 CreatePeerConnectionFactory(); |
1039 | 1043 |
| 1044 // Deprecated. Use the CreateModularPeerConnectionFactory instead. |
| 1045 // |
1040 // Create a new instance of PeerConnectionFactoryInterface. | 1046 // Create a new instance of PeerConnectionFactoryInterface. |
1041 // | 1047 // |
1042 // |network_thread|, |worker_thread| and |signaling_thread| are | 1048 // |network_thread|, |worker_thread| and |signaling_thread| are |
1043 // the only mandatory parameters. | 1049 // the only mandatory parameters. |
1044 // | 1050 // |
1045 // If non-null, a reference is added to |default_adm|, and ownership of | 1051 // If non-null, a reference is added to |default_adm|, and ownership of |
1046 // |video_encoder_factory| and |video_decoder_factory| is transferred to the | 1052 // |video_encoder_factory| and |video_decoder_factory| is transferred to the |
1047 // returned factory. | 1053 // returned factory. |
1048 // TODO(deadbeef): Use rtc::scoped_refptr<> and std::unique_ptr<> to make this | 1054 // TODO(deadbeef): Use rtc::scoped_refptr<> and std::unique_ptr<> to make this |
1049 // ownership transfer and ref counting more obvious. | 1055 // ownership transfer and ref counting more obvious. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 rtc::Thread* worker_and_network_thread, | 1125 rtc::Thread* worker_and_network_thread, |
1120 rtc::Thread* signaling_thread, | 1126 rtc::Thread* signaling_thread, |
1121 AudioDeviceModule* default_adm, | 1127 AudioDeviceModule* default_adm, |
1122 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 1128 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
1123 cricket::WebRtcVideoDecoderFactory* decoder_factory) { | 1129 cricket::WebRtcVideoDecoderFactory* decoder_factory) { |
1124 return CreatePeerConnectionFactory( | 1130 return CreatePeerConnectionFactory( |
1125 worker_and_network_thread, worker_and_network_thread, signaling_thread, | 1131 worker_and_network_thread, worker_and_network_thread, signaling_thread, |
1126 default_adm, encoder_factory, decoder_factory); | 1132 default_adm, encoder_factory, decoder_factory); |
1127 } | 1133 } |
1128 | 1134 |
| 1135 // This is a lower-level version of the CreatePeerConnectionFactory functions |
| 1136 // above. It's implemented in the "peerconnection" build target, whereas the |
| 1137 // above methods are only implemented in the broader "libjingle_peerconnection" |
| 1138 // build target, which pulls in the implementations of every module webrtc may |
| 1139 // use. |
| 1140 // |
| 1141 // If an application knows it will only require certain modules, it can reduce |
| 1142 // webrtc's impact on its binary size by depending only on the "peerconnection" |
| 1143 // target and the modules the application requires, using |
| 1144 // CreateModularPeerConnectionFactory instead of one of the |
| 1145 // CreatePeerConnectionFactory methods above. For example, if an application |
| 1146 // only uses WebRTC for audio, it can pass in null pointers for the |
| 1147 // video-specific interfaces, and omit the corresponding modules from its |
| 1148 // build. |
| 1149 // |
| 1150 // If |network_thread| or |worker_thread| are null, the PeerConnectionFactory |
| 1151 // will create the necessary thread internally. If |signaling_thread| is null, |
| 1152 // the PeerConnectionFactory will use the thread on which this method is called |
| 1153 // as the signaling thread, wrapping it in an rtc::Thread object if needed. |
| 1154 // |
| 1155 // If non-null, a reference is added to |default_adm|, and ownership of |
| 1156 // |video_encoder_factory| and |video_decoder_factory| is transferred to the |
| 1157 // returned factory. |
| 1158 // |
| 1159 // TODO(deadbeef): Use rtc::scoped_refptr<> and std::unique_ptr<> to make this |
| 1160 // ownership transfer and ref counting more obvious. |
| 1161 // |
| 1162 // TODO(deadbeef): Encapsulate these modules in a struct, so that when a new |
| 1163 // module is inevitably exposed, we can just add a field to the struct instead |
| 1164 // of adding a whole new CreateModularPeerConnectionFactory overload. |
| 1165 rtc::scoped_refptr<PeerConnectionFactoryInterface> |
| 1166 CreateModularPeerConnectionFactory( |
| 1167 rtc::Thread* network_thread, |
| 1168 rtc::Thread* worker_thread, |
| 1169 rtc::Thread* signaling_thread, |
| 1170 AudioDeviceModule* default_adm, |
| 1171 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, |
| 1172 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, |
| 1173 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, |
| 1174 cricket::WebRtcVideoDecoderFactory* video_decoder_factory, |
| 1175 rtc::scoped_refptr<AudioMixer> audio_mixer, |
| 1176 std::unique_ptr<cricket::MediaEngineInterface> media_engine, |
| 1177 std::unique_ptr<CallFactoryInterface> call_factory, |
| 1178 std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory); |
| 1179 |
1129 } // namespace webrtc | 1180 } // namespace webrtc |
1130 | 1181 |
1131 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ | 1182 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ |
OLD | NEW |