henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 1 | /* |
| 2 | * libjingle |
jlmiller@webrtc.org | 5f93d0a | 2015-01-20 21:36:13 | [diff] [blame] | 3 | * Copyright 2012 Google Inc. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions are met: |
| 7 | * |
| 8 | * 1. Redistributions of source code must retain the above copyright notice, |
| 9 | * this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| 11 | * this list of conditions and the following disclaimer in the documentation |
| 12 | * and/or other materials provided with the distribution. |
| 13 | * 3. The name of the author may not be used to endorse or promote products |
| 14 | * derived from this software without specific prior written permission. |
| 15 | * |
| 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
| 19 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 21 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 22 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 23 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 24 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 25 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | */ |
| 27 | |
| 28 | // This file contains the PeerConnection interface as defined in |
| 29 | // http://dev.w3.org/2011/webrtc/editor/webrtc.html#peer-to-peer-connections. |
| 30 | // Applications must use this interface to implement peerconnection. |
| 31 | // PeerConnectionFactory class provides factory methods to create |
| 32 | // peerconnection, mediastream and media tracks objects. |
| 33 | // |
| 34 | // The Following steps are needed to setup a typical call using Jsep. |
| 35 | // 1. Create a PeerConnectionFactoryInterface. Check constructors for more |
| 36 | // information about input parameters. |
| 37 | // 2. Create a PeerConnection object. Provide a configuration string which |
| 38 | // points either to stun or turn server to generate ICE candidates and provide |
| 39 | // an object that implements the PeerConnectionObserver interface. |
| 40 | // 3. Create local MediaStream and MediaTracks using the PeerConnectionFactory |
| 41 | // and add it to PeerConnection by calling AddStream. |
| 42 | // 4. Create an offer and serialize it and send it to the remote peer. |
| 43 | // 5. Once an ice candidate have been found PeerConnection will call the |
| 44 | // observer function OnIceCandidate. The candidates must also be serialized and |
| 45 | // sent to the remote peer. |
| 46 | // 6. Once an answer is received from the remote peer, call |
| 47 | // SetLocalSessionDescription with the offer and SetRemoteSessionDescription |
| 48 | // with the remote answer. |
| 49 | // 7. Once a remote candidate is received from the remote peer, provide it to |
| 50 | // the peerconnection by calling AddIceCandidate. |
| 51 | |
| 52 | |
| 53 | // The Receiver of a call can decide to accept or reject the call. |
| 54 | // This decision will be taken by the application not peerconnection. |
| 55 | // If application decides to accept the call |
| 56 | // 1. Create PeerConnectionFactoryInterface if it doesn't exist. |
| 57 | // 2. Create a new PeerConnection. |
| 58 | // 3. Provide the remote offer to the new PeerConnection object by calling |
| 59 | // SetRemoteSessionDescription. |
| 60 | // 4. Generate an answer to the remote offer by calling CreateAnswer and send it |
| 61 | // back to the remote peer. |
| 62 | // 5. Provide the local answer to the new PeerConnection by calling |
| 63 | // SetLocalSessionDescription with the answer. |
| 64 | // 6. Provide the remote ice candidates by calling AddIceCandidate. |
| 65 | // 7. Once a candidate have been found PeerConnection will call the observer |
| 66 | // function OnIceCandidate. Send these candidates to the remote peer. |
| 67 | |
| 68 | #ifndef TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ |
| 69 | #define TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ |
| 70 | |
| 71 | #include <string> |
| 72 | #include <vector> |
| 73 | |
| 74 | #include "talk/app/webrtc/datachannelinterface.h" |
Henrik Boström | 5b4ce33 | 2015-08-05 14:55:22 | [diff] [blame] | 75 | #include "talk/app/webrtc/dtlsidentitystore.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 76 | #include "talk/app/webrtc/dtmfsenderinterface.h" |
Henrik Boström | 5e56c59 | 2015-08-11 08:33:13 | [diff] [blame] | 77 | #include "talk/app/webrtc/dtlsidentitystore.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 78 | #include "talk/app/webrtc/jsep.h" |
| 79 | #include "talk/app/webrtc/mediastreaminterface.h" |
deadbeef | 70ab1a1 | 2015-09-28 23:53:55 | [diff] [blame] | 80 | #include "talk/app/webrtc/rtpreceiverinterface.h" |
| 81 | #include "talk/app/webrtc/rtpsenderinterface.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 82 | #include "talk/app/webrtc/statstypes.h" |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 83 | #include "talk/app/webrtc/umametrics.h" |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 84 | #include "webrtc/base/fileutils.h" |
phoglund@webrtc.org | 006521d | 2015-02-12 09:23:59 | [diff] [blame] | 85 | #include "webrtc/base/network.h" |
Henrik Boström | 87713d0 | 2015-08-25 07:53:21 | [diff] [blame] | 86 | #include "webrtc/base/rtccertificate.h" |
Joachim Bauch | 04e5b49 | 2015-05-29 07:40:39 | [diff] [blame] | 87 | #include "webrtc/base/sslstreamadapter.h" |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 88 | #include "webrtc/base/socketaddress.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 89 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 90 | namespace rtc { |
jiayl@webrtc.org | 61e00b0 | 2015-03-04 22:17:38 | [diff] [blame] | 91 | class SSLIdentity; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 92 | class Thread; |
| 93 | } |
| 94 | |
| 95 | namespace cricket { |
| 96 | class PortAllocator; |
| 97 | class WebRtcVideoDecoderFactory; |
| 98 | class WebRtcVideoEncoderFactory; |
| 99 | } |
| 100 | |
| 101 | namespace webrtc { |
| 102 | class AudioDeviceModule; |
| 103 | class MediaConstraintsInterface; |
| 104 | |
| 105 | // MediaStream container interface. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 106 | class StreamCollectionInterface : public rtc::RefCountInterface { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 107 | public: |
| 108 | // TODO(ronghuawu): Update the function names to c++ style, e.g. find -> Find. |
| 109 | virtual size_t count() = 0; |
| 110 | virtual MediaStreamInterface* at(size_t index) = 0; |
| 111 | virtual MediaStreamInterface* find(const std::string& label) = 0; |
| 112 | virtual MediaStreamTrackInterface* FindAudioTrack( |
| 113 | const std::string& id) = 0; |
| 114 | virtual MediaStreamTrackInterface* FindVideoTrack( |
| 115 | const std::string& id) = 0; |
| 116 | |
| 117 | protected: |
| 118 | // Dtor protected as objects shouldn't be deleted via this interface. |
| 119 | ~StreamCollectionInterface() {} |
| 120 | }; |
| 121 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 122 | class StatsObserver : public rtc::RefCountInterface { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 123 | public: |
tommi@webrtc.org | e2e199b | 2014-12-15 13:22:54 | [diff] [blame] | 124 | virtual void OnComplete(const StatsReports& reports) = 0; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 125 | |
| 126 | protected: |
| 127 | virtual ~StatsObserver() {} |
| 128 | }; |
| 129 | |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 | [diff] [blame] | 130 | class MetricsObserverInterface : public rtc::RefCountInterface { |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 131 | public: |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 132 | |
| 133 | // |type| is the type of the enum counter to be incremented. |counter| |
| 134 | // is the particular counter in that type. |counter_max| is the next sequence |
| 135 | // number after the highest counter. |
| 136 | virtual void IncrementEnumCounter(PeerConnectionEnumCounterType type, |
| 137 | int counter, |
| 138 | int counter_max) {} |
| 139 | |
Guo-wei Shieh | 456696a | 2015-10-01 04:48:54 | [diff] [blame] | 140 | // This is used to handle sparse counters like SSL cipher suites. |
| 141 | // TODO(guoweis): Remove the implementation once the dependency's interface |
| 142 | // definition is updated. |
| 143 | virtual void IncrementSparseEnumCounter(PeerConnectionEnumCounterType type, |
| 144 | int counter) { |
| 145 | IncrementEnumCounter(type, counter, 0 /* Ignored */); |
| 146 | } |
| 147 | |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 | [diff] [blame] | 148 | virtual void AddHistogramSample(PeerConnectionMetricsName type, |
mallinath@webrtc.org | d37bcfa | 2014-05-12 23:10:18 | [diff] [blame] | 149 | int value) = 0; |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 150 | |
| 151 | protected: |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 | [diff] [blame] | 152 | virtual ~MetricsObserverInterface() {} |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 153 | }; |
| 154 | |
guoweis@webrtc.org | 7169afd | 2014-12-04 17:59:29 | [diff] [blame] | 155 | typedef MetricsObserverInterface UMAObserver; |
| 156 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 157 | class PeerConnectionInterface : public rtc::RefCountInterface { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 158 | public: |
| 159 | // See http://dev.w3.org/2011/webrtc/editor/webrtc.html#state-definitions . |
| 160 | enum SignalingState { |
| 161 | kStable, |
| 162 | kHaveLocalOffer, |
| 163 | kHaveLocalPrAnswer, |
| 164 | kHaveRemoteOffer, |
| 165 | kHaveRemotePrAnswer, |
| 166 | kClosed, |
| 167 | }; |
| 168 | |
| 169 | // TODO(bemasc): Remove IceState when callers are changed to |
| 170 | // IceConnection/GatheringState. |
| 171 | enum IceState { |
| 172 | kIceNew, |
| 173 | kIceGathering, |
| 174 | kIceWaiting, |
| 175 | kIceChecking, |
| 176 | kIceConnected, |
| 177 | kIceCompleted, |
| 178 | kIceFailed, |
| 179 | kIceClosed, |
| 180 | }; |
| 181 | |
| 182 | enum IceGatheringState { |
| 183 | kIceGatheringNew, |
| 184 | kIceGatheringGathering, |
| 185 | kIceGatheringComplete |
| 186 | }; |
| 187 | |
| 188 | enum IceConnectionState { |
| 189 | kIceConnectionNew, |
| 190 | kIceConnectionChecking, |
| 191 | kIceConnectionConnected, |
| 192 | kIceConnectionCompleted, |
| 193 | kIceConnectionFailed, |
| 194 | kIceConnectionDisconnected, |
| 195 | kIceConnectionClosed, |
Guo-wei Shieh | 3d564c1 | 2015-08-19 23:51:15 | [diff] [blame] | 196 | kIceConnectionMax, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 197 | }; |
| 198 | |
| 199 | struct IceServer { |
Joachim Bauch | 7c4e745 | 2015-05-28 21:06:30 | [diff] [blame] | 200 | // TODO(jbauch): Remove uri when all code using it has switched to urls. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 201 | std::string uri; |
Joachim Bauch | 7c4e745 | 2015-05-28 21:06:30 | [diff] [blame] | 202 | std::vector<std::string> urls; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 203 | std::string username; |
| 204 | std::string password; |
| 205 | }; |
| 206 | typedef std::vector<IceServer> IceServers; |
| 207 | |
buildbot@webrtc.org | 41451d4 | 2014-05-03 05:39:45 | [diff] [blame] | 208 | enum IceTransportsType { |
pthatcher@webrtc.org | fd630a5 | 2015-01-14 23:19:06 | [diff] [blame] | 209 | // TODO(pthatcher): Rename these kTransporTypeXXX, but update |
| 210 | // Chromium at the same time. |
buildbot@webrtc.org | 41451d4 | 2014-05-03 05:39:45 | [diff] [blame] | 211 | kNone, |
| 212 | kRelay, |
| 213 | kNoHost, |
| 214 | kAll |
| 215 | }; |
| 216 | |
pthatcher@webrtc.org | fd630a5 | 2015-01-14 23:19:06 | [diff] [blame] | 217 | // https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-08#section-4.1.1 |
| 218 | enum BundlePolicy { |
| 219 | kBundlePolicyBalanced, |
| 220 | kBundlePolicyMaxBundle, |
| 221 | kBundlePolicyMaxCompat |
| 222 | }; |
buildbot@webrtc.org | 41451d4 | 2014-05-03 05:39:45 | [diff] [blame] | 223 | |
Peter Thatcher | af55ccc | 2015-05-21 14:48:41 | [diff] [blame] | 224 | // https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-09#section-4.1.1 |
| 225 | enum RtcpMuxPolicy { |
| 226 | kRtcpMuxPolicyNegotiate, |
| 227 | kRtcpMuxPolicyRequire, |
| 228 | }; |
| 229 | |
Jiayang Liu | cac1b38 | 2015-04-30 19:35:24 | [diff] [blame] | 230 | enum TcpCandidatePolicy { |
| 231 | kTcpCandidatePolicyEnabled, |
| 232 | kTcpCandidatePolicyDisabled |
| 233 | }; |
| 234 | |
honghaiz | 1f429e3 | 2015-09-28 14:57:34 | [diff] [blame] | 235 | enum ContinualGatheringPolicy { |
| 236 | GATHER_ONCE, |
| 237 | GATHER_CONTINUALLY |
| 238 | }; |
| 239 | |
Henrik Boström | 87713d0 | 2015-08-25 07:53:21 | [diff] [blame] | 240 | // TODO(hbos): Change into class with private data and public getters. |
pthatcher@webrtc.org | fd630a5 | 2015-01-14 23:19:06 | [diff] [blame] | 241 | struct RTCConfiguration { |
honghaiz | 4edc39c | 2015-09-01 16:53:56 | [diff] [blame] | 242 | static const int kUndefined = -1; |
| 243 | // Default maximum number of packets in the audio jitter buffer. |
| 244 | static const int kAudioJitterBufferMaxPackets = 50; |
pthatcher@webrtc.org | fd630a5 | 2015-01-14 23:19:06 | [diff] [blame] | 245 | // TODO(pthatcher): Rename this ice_transport_type, but update |
| 246 | // Chromium at the same time. |
| 247 | IceTransportsType type; |
| 248 | // TODO(pthatcher): Rename this ice_servers, but update Chromium |
| 249 | // at the same time. |
| 250 | IceServers servers; |
Guo-wei Shieh | fe3bc9d | 2015-08-20 15:48:20 | [diff] [blame] | 251 | // A localhost candidate is signaled whenever a candidate with the any |
| 252 | // address is allocated. |
| 253 | bool enable_localhost_ice_candidate; |
pthatcher@webrtc.org | fd630a5 | 2015-01-14 23:19:06 | [diff] [blame] | 254 | BundlePolicy bundle_policy; |
Peter Thatcher | af55ccc | 2015-05-21 14:48:41 | [diff] [blame] | 255 | RtcpMuxPolicy rtcp_mux_policy; |
Jiayang Liu | cac1b38 | 2015-04-30 19:35:24 | [diff] [blame] | 256 | TcpCandidatePolicy tcp_candidate_policy; |
Henrik Lundin | 64dad83 | 2015-05-11 10:44:23 | [diff] [blame] | 257 | int audio_jitter_buffer_max_packets; |
Henrik Lundin | 5263b3c | 2015-06-01 08:29:41 | [diff] [blame] | 258 | bool audio_jitter_buffer_fast_accelerate; |
honghaiz | 4edc39c | 2015-09-01 16:53:56 | [diff] [blame] | 259 | int ice_connection_receiving_timeout; |
honghaiz | 1f429e3 | 2015-09-28 14:57:34 | [diff] [blame] | 260 | ContinualGatheringPolicy continual_gathering_policy; |
Henrik Boström | 87713d0 | 2015-08-25 07:53:21 | [diff] [blame] | 261 | std::vector<rtc::scoped_refptr<rtc::RTCCertificate>> certificates; |
pthatcher@webrtc.org | fd630a5 | 2015-01-14 23:19:06 | [diff] [blame] | 262 | |
Jiayang Liu | cac1b38 | 2015-04-30 19:35:24 | [diff] [blame] | 263 | RTCConfiguration() |
| 264 | : type(kAll), |
Guo-wei Shieh | fe3bc9d | 2015-08-20 15:48:20 | [diff] [blame] | 265 | enable_localhost_ice_candidate(false), |
Jiayang Liu | cac1b38 | 2015-04-30 19:35:24 | [diff] [blame] | 266 | bundle_policy(kBundlePolicyBalanced), |
Peter Thatcher | af55ccc | 2015-05-21 14:48:41 | [diff] [blame] | 267 | rtcp_mux_policy(kRtcpMuxPolicyNegotiate), |
Henrik Lundin | 64dad83 | 2015-05-11 10:44:23 | [diff] [blame] | 268 | tcp_candidate_policy(kTcpCandidatePolicyEnabled), |
honghaiz | 4edc39c | 2015-09-01 16:53:56 | [diff] [blame] | 269 | audio_jitter_buffer_max_packets(kAudioJitterBufferMaxPackets), |
| 270 | audio_jitter_buffer_fast_accelerate(false), |
honghaiz | 1f429e3 | 2015-09-28 14:57:34 | [diff] [blame] | 271 | ice_connection_receiving_timeout(kUndefined), |
| 272 | continual_gathering_policy(GATHER_ONCE) {} |
buildbot@webrtc.org | 41451d4 | 2014-05-03 05:39:45 | [diff] [blame] | 273 | }; |
| 274 | |
jiayl@webrtc.org | b18bf5e | 2014-08-04 18:34:16 | [diff] [blame] | 275 | struct RTCOfferAnswerOptions { |
| 276 | static const int kUndefined = -1; |
| 277 | static const int kMaxOfferToReceiveMedia = 1; |
| 278 | |
| 279 | // The default value for constraint offerToReceiveX:true. |
| 280 | static const int kOfferToReceiveMediaTrue = 1; |
| 281 | |
| 282 | int offer_to_receive_video; |
| 283 | int offer_to_receive_audio; |
| 284 | bool voice_activity_detection; |
| 285 | bool ice_restart; |
| 286 | bool use_rtp_mux; |
| 287 | |
| 288 | RTCOfferAnswerOptions() |
| 289 | : offer_to_receive_video(kUndefined), |
| 290 | offer_to_receive_audio(kUndefined), |
| 291 | voice_activity_detection(true), |
| 292 | ice_restart(false), |
| 293 | use_rtp_mux(true) {} |
| 294 | |
| 295 | RTCOfferAnswerOptions(int offer_to_receive_video, |
| 296 | int offer_to_receive_audio, |
| 297 | bool voice_activity_detection, |
| 298 | bool ice_restart, |
| 299 | bool use_rtp_mux) |
| 300 | : offer_to_receive_video(offer_to_receive_video), |
| 301 | offer_to_receive_audio(offer_to_receive_audio), |
| 302 | voice_activity_detection(voice_activity_detection), |
| 303 | ice_restart(ice_restart), |
| 304 | use_rtp_mux(use_rtp_mux) {} |
| 305 | }; |
| 306 | |
wu@webrtc.org | b9a088b | 2014-02-13 23:18:49 | [diff] [blame] | 307 | // Used by GetStats to decide which stats to include in the stats reports. |
| 308 | // |kStatsOutputLevelStandard| includes the standard stats for Javascript API; |
| 309 | // |kStatsOutputLevelDebug| includes both the standard stats and additional |
| 310 | // stats for debugging purposes. |
| 311 | enum StatsOutputLevel { |
| 312 | kStatsOutputLevelStandard, |
| 313 | kStatsOutputLevelDebug, |
| 314 | }; |
| 315 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 316 | // Accessor methods to active local streams. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 317 | virtual rtc::scoped_refptr<StreamCollectionInterface> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 318 | local_streams() = 0; |
| 319 | |
| 320 | // Accessor methods to remote streams. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 321 | virtual rtc::scoped_refptr<StreamCollectionInterface> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 322 | remote_streams() = 0; |
| 323 | |
| 324 | // Add a new MediaStream to be sent on this PeerConnection. |
| 325 | // Note that a SessionDescription negotiation is needed before the |
| 326 | // remote peer can receive the stream. |
perkj@webrtc.org | fd0efb6 | 2014-11-06 12:16:36 | [diff] [blame] | 327 | virtual bool AddStream(MediaStreamInterface* stream) = 0; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 328 | |
| 329 | // Remove a MediaStream from this PeerConnection. |
| 330 | // Note that a SessionDescription negotiation is need before the |
| 331 | // remote peer is notified. |
| 332 | virtual void RemoveStream(MediaStreamInterface* stream) = 0; |
| 333 | |
| 334 | // Returns pointer to the created DtmfSender on success. |
| 335 | // Otherwise returns NULL. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 336 | virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 337 | AudioTrackInterface* track) = 0; |
| 338 | |
deadbeef | 70ab1a1 | 2015-09-28 23:53:55 | [diff] [blame] | 339 | // TODO(deadbeef): Make these pure virtual once all subclasses implement them. |
| 340 | virtual std::vector<rtc::scoped_refptr<RtpSenderInterface>> GetSenders() |
| 341 | const { |
| 342 | return std::vector<rtc::scoped_refptr<RtpSenderInterface>>(); |
| 343 | } |
| 344 | |
| 345 | virtual std::vector<rtc::scoped_refptr<RtpReceiverInterface>> GetReceivers() |
| 346 | const { |
| 347 | return std::vector<rtc::scoped_refptr<RtpReceiverInterface>>(); |
| 348 | } |
| 349 | |
wu@webrtc.org | b9a088b | 2014-02-13 23:18:49 | [diff] [blame] | 350 | virtual bool GetStats(StatsObserver* observer, |
| 351 | MediaStreamTrackInterface* track, |
| 352 | StatsOutputLevel level) = 0; |
| 353 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 354 | virtual rtc::scoped_refptr<DataChannelInterface> CreateDataChannel( |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 355 | const std::string& label, |
| 356 | const DataChannelInit* config) = 0; |
| 357 | |
| 358 | virtual const SessionDescriptionInterface* local_description() const = 0; |
| 359 | virtual const SessionDescriptionInterface* remote_description() const = 0; |
| 360 | |
| 361 | // Create a new offer. |
| 362 | // The CreateSessionDescriptionObserver callback will be called when done. |
| 363 | virtual void CreateOffer(CreateSessionDescriptionObserver* observer, |
jiayl@webrtc.org | b18bf5e | 2014-08-04 18:34:16 | [diff] [blame] | 364 | const MediaConstraintsInterface* constraints) {} |
| 365 | |
| 366 | // TODO(jiayl): remove the default impl and the old interface when chromium |
| 367 | // code is updated. |
| 368 | virtual void CreateOffer(CreateSessionDescriptionObserver* observer, |
| 369 | const RTCOfferAnswerOptions& options) {} |
| 370 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 371 | // Create an answer to an offer. |
| 372 | // The CreateSessionDescriptionObserver callback will be called when done. |
| 373 | virtual void CreateAnswer(CreateSessionDescriptionObserver* observer, |
| 374 | const MediaConstraintsInterface* constraints) = 0; |
| 375 | // Sets the local session description. |
| 376 | // JsepInterface takes the ownership of |desc| even if it fails. |
| 377 | // The |observer| callback will be called when done. |
| 378 | virtual void SetLocalDescription(SetSessionDescriptionObserver* observer, |
| 379 | SessionDescriptionInterface* desc) = 0; |
| 380 | // Sets the remote session description. |
| 381 | // JsepInterface takes the ownership of |desc| even if it fails. |
| 382 | // The |observer| callback will be called when done. |
| 383 | virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer, |
| 384 | SessionDescriptionInterface* desc) = 0; |
| 385 | // Restarts or updates the ICE Agent process of gathering local candidates |
| 386 | // and pinging remote candidates. |
deadbeef | a67696b | 2015-09-29 18:56:26 | [diff] [blame] | 387 | // TODO(deadbeef): Remove once Chrome is moved over to SetConfiguration. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 388 | virtual bool UpdateIce(const IceServers& configuration, |
deadbeef | a67696b | 2015-09-29 18:56:26 | [diff] [blame] | 389 | const MediaConstraintsInterface* constraints) { |
| 390 | return false; |
| 391 | } |
| 392 | // Sets the PeerConnection's global configuration to |config|. |
| 393 | // Any changes to STUN/TURN servers or ICE candidate policy will affect the |
| 394 | // next gathering phase, and cause the next call to createOffer to generate |
| 395 | // new ICE credentials. Note that the BUNDLE and RTCP-multiplexing policies |
| 396 | // cannot be changed with this method. |
| 397 | // TODO(deadbeef): Make this pure virtual once all Chrome subclasses of |
| 398 | // PeerConnectionInterface implement it. |
| 399 | virtual bool SetConfiguration( |
| 400 | const PeerConnectionInterface::RTCConfiguration& config) { |
| 401 | return false; |
| 402 | } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 403 | // Provides a remote candidate to the ICE Agent. |
| 404 | // A copy of the |candidate| will be created and added to the remote |
| 405 | // description. So the caller of this method still has the ownership of the |
| 406 | // |candidate|. |
| 407 | // TODO(ronghuawu): Consider to change this so that the AddIceCandidate will |
| 408 | // take the ownership of the |candidate|. |
| 409 | virtual bool AddIceCandidate(const IceCandidateInterface* candidate) = 0; |
| 410 | |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 | [diff] [blame] | 411 | virtual void RegisterUMAObserver(UMAObserver* observer) = 0; |
| 412 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 413 | // Returns the current SignalingState. |
| 414 | virtual SignalingState signaling_state() = 0; |
| 415 | |
| 416 | // TODO(bemasc): Remove ice_state when callers are changed to |
| 417 | // IceConnection/GatheringState. |
| 418 | // Returns the current IceState. |
| 419 | virtual IceState ice_state() = 0; |
| 420 | virtual IceConnectionState ice_connection_state() = 0; |
| 421 | virtual IceGatheringState ice_gathering_state() = 0; |
| 422 | |
| 423 | // Terminates all media and closes the transport. |
| 424 | virtual void Close() = 0; |
| 425 | |
| 426 | protected: |
| 427 | // Dtor protected as objects shouldn't be deleted via this interface. |
| 428 | ~PeerConnectionInterface() {} |
| 429 | }; |
| 430 | |
| 431 | // PeerConnection callback interface. Application should implement these |
| 432 | // methods. |
| 433 | class PeerConnectionObserver { |
| 434 | public: |
| 435 | enum StateType { |
| 436 | kSignalingState, |
| 437 | kIceState, |
| 438 | }; |
| 439 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 440 | // Triggered when the SignalingState changed. |
| 441 | virtual void OnSignalingChange( |
| 442 | PeerConnectionInterface::SignalingState new_state) {} |
| 443 | |
| 444 | // Triggered when SignalingState or IceState have changed. |
| 445 | // TODO(bemasc): Remove once callers transition to OnSignalingChange. |
| 446 | virtual void OnStateChange(StateType state_changed) {} |
| 447 | |
| 448 | // Triggered when media is received on a new stream from remote peer. |
| 449 | virtual void OnAddStream(MediaStreamInterface* stream) = 0; |
| 450 | |
| 451 | // Triggered when a remote peer close a stream. |
| 452 | virtual void OnRemoveStream(MediaStreamInterface* stream) = 0; |
| 453 | |
| 454 | // Triggered when a remote peer open a data channel. |
perkj@webrtc.org | c2dd5ee | 2014-11-04 11:31:29 | [diff] [blame] | 455 | virtual void OnDataChannel(DataChannelInterface* data_channel) = 0; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 456 | |
mallinath@webrtc.org | 0d92ef6 | 2014-01-22 02:21:22 | [diff] [blame] | 457 | // Triggered when renegotiation is needed, for example the ICE has restarted. |
fischman@webrtc.org | d7568a0 | 2014-01-13 22:04:12 | [diff] [blame] | 458 | virtual void OnRenegotiationNeeded() = 0; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 459 | |
| 460 | // Called any time the IceConnectionState changes |
| 461 | virtual void OnIceConnectionChange( |
| 462 | PeerConnectionInterface::IceConnectionState new_state) {} |
| 463 | |
| 464 | // Called any time the IceGatheringState changes |
| 465 | virtual void OnIceGatheringChange( |
| 466 | PeerConnectionInterface::IceGatheringState new_state) {} |
| 467 | |
| 468 | // New Ice candidate have been found. |
| 469 | virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0; |
| 470 | |
| 471 | // TODO(bemasc): Remove this once callers transition to OnIceGatheringChange. |
| 472 | // All Ice candidates have been found. |
| 473 | virtual void OnIceComplete() {} |
| 474 | |
Peter Thatcher | 5436051 | 2015-07-08 18:08:35 | [diff] [blame] | 475 | // Called when the ICE connection receiving status changes. |
| 476 | virtual void OnIceConnectionReceivingChange(bool receiving) {} |
| 477 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 478 | protected: |
| 479 | // Dtor protected as objects shouldn't be deleted via this interface. |
| 480 | ~PeerConnectionObserver() {} |
| 481 | }; |
| 482 | |
| 483 | // Factory class used for creating cricket::PortAllocator that is used |
| 484 | // for ICE negotiation. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 485 | class PortAllocatorFactoryInterface : public rtc::RefCountInterface { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 486 | public: |
| 487 | struct StunConfiguration { |
| 488 | StunConfiguration(const std::string& address, int port) |
| 489 | : server(address, port) {} |
| 490 | // STUN server address and port. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 491 | rtc::SocketAddress server; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 492 | }; |
| 493 | |
| 494 | struct TurnConfiguration { |
| 495 | TurnConfiguration(const std::string& address, |
| 496 | int port, |
| 497 | const std::string& username, |
| 498 | const std::string& password, |
wu@webrtc.org | 91053e7 | 2013-08-10 07:18:04 | [diff] [blame] | 499 | const std::string& transport_type, |
| 500 | bool secure) |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 501 | : server(address, port), |
| 502 | username(username), |
| 503 | password(password), |
wu@webrtc.org | 91053e7 | 2013-08-10 07:18:04 | [diff] [blame] | 504 | transport_type(transport_type), |
| 505 | secure(secure) {} |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 506 | rtc::SocketAddress server; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 507 | std::string username; |
| 508 | std::string password; |
| 509 | std::string transport_type; |
wu@webrtc.org | 91053e7 | 2013-08-10 07:18:04 | [diff] [blame] | 510 | bool secure; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 511 | }; |
| 512 | |
| 513 | virtual cricket::PortAllocator* CreatePortAllocator( |
| 514 | const std::vector<StunConfiguration>& stun_servers, |
| 515 | const std::vector<TurnConfiguration>& turn_configurations) = 0; |
| 516 | |
phoglund@webrtc.org | 006521d | 2015-02-12 09:23:59 | [diff] [blame] | 517 | // TODO(phoglund): Make pure virtual when Chrome's factory implements this. |
| 518 | // After this method is called, the port allocator should consider loopback |
| 519 | // network interfaces as well. |
| 520 | virtual void SetNetworkIgnoreMask(int network_ignore_mask) { |
| 521 | } |
| 522 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 523 | protected: |
| 524 | PortAllocatorFactoryInterface() {} |
| 525 | ~PortAllocatorFactoryInterface() {} |
| 526 | }; |
| 527 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 528 | // PeerConnectionFactoryInterface is the factory interface use for creating |
| 529 | // PeerConnection, MediaStream and media tracks. |
| 530 | // PeerConnectionFactoryInterface will create required libjingle threads, |
| 531 | // socket and network manager factory classes for networking. |
| 532 | // If an application decides to provide its own threads and network |
| 533 | // implementation of these classes it should use the alternate |
| 534 | // CreatePeerConnectionFactory method which accepts threads as input and use the |
| 535 | // CreatePeerConnection version that takes a PortAllocatorFactoryInterface as |
| 536 | // argument. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 537 | class PeerConnectionFactoryInterface : public rtc::RefCountInterface { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 538 | public: |
wu@webrtc.org | 97077a3 | 2013-10-25 21:18:33 | [diff] [blame] | 539 | class Options { |
| 540 | public: |
| 541 | Options() : |
wu@webrtc.org | 97077a3 | 2013-10-25 21:18:33 | [diff] [blame] | 542 | disable_encryption(false), |
phoglund@webrtc.org | 006521d | 2015-02-12 09:23:59 | [diff] [blame] | 543 | disable_sctp_data_channels(false), |
Joachim Bauch | 04e5b49 | 2015-05-29 07:40:39 | [diff] [blame] | 544 | network_ignore_mask(rtc::kDefaultNetworkIgnoreMask), |
| 545 | ssl_max_version(rtc::SSL_PROTOCOL_DTLS_10) { |
wu@webrtc.org | 97077a3 | 2013-10-25 21:18:33 | [diff] [blame] | 546 | } |
wu@webrtc.org | 97077a3 | 2013-10-25 21:18:33 | [diff] [blame] | 547 | bool disable_encryption; |
| 548 | bool disable_sctp_data_channels; |
phoglund@webrtc.org | 006521d | 2015-02-12 09:23:59 | [diff] [blame] | 549 | |
| 550 | // Sets the network types to ignore. For instance, calling this with |
| 551 | // ADAPTER_TYPE_ETHERNET | ADAPTER_TYPE_LOOPBACK will ignore Ethernet and |
| 552 | // loopback interfaces. |
| 553 | int network_ignore_mask; |
Joachim Bauch | 04e5b49 | 2015-05-29 07:40:39 | [diff] [blame] | 554 | |
| 555 | // Sets the maximum supported protocol version. The highest version |
| 556 | // supported by both ends will be used for the connection, i.e. if one |
| 557 | // party supports DTLS 1.0 and the other DTLS 1.2, DTLS 1.0 will be used. |
| 558 | rtc::SSLProtocolVersion ssl_max_version; |
wu@webrtc.org | 97077a3 | 2013-10-25 21:18:33 | [diff] [blame] | 559 | }; |
| 560 | |
| 561 | virtual void SetOptions(const Options& options) = 0; |
buildbot@webrtc.org | 41451d4 | 2014-05-03 05:39:45 | [diff] [blame] | 562 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 563 | virtual rtc::scoped_refptr<PeerConnectionInterface> |
buildbot@webrtc.org | 41451d4 | 2014-05-03 05:39:45 | [diff] [blame] | 564 | CreatePeerConnection( |
| 565 | const PeerConnectionInterface::RTCConfiguration& configuration, |
| 566 | const MediaConstraintsInterface* constraints, |
| 567 | PortAllocatorFactoryInterface* allocator_factory, |
Henrik Boström | 5e56c59 | 2015-08-11 08:33:13 | [diff] [blame] | 568 | rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
buildbot@webrtc.org | 41451d4 | 2014-05-03 05:39:45 | [diff] [blame] | 569 | PeerConnectionObserver* observer) = 0; |
| 570 | |
Henrik Boström | 5e56c59 | 2015-08-11 08:33:13 | [diff] [blame] | 571 | // TODO(hbos): Remove below version after clients are updated to above method. |
buildbot@webrtc.org | 41451d4 | 2014-05-03 05:39:45 | [diff] [blame] | 572 | // In latest W3C WebRTC draft, PC constructor will take RTCConfiguration, |
| 573 | // and not IceServers. RTCConfiguration is made up of ice servers and |
| 574 | // ice transport type. |
| 575 | // http://dev.w3.org/2011/webrtc/editor/webrtc.html |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 576 | inline rtc::scoped_refptr<PeerConnectionInterface> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 577 | CreatePeerConnection( |
pthatcher@webrtc.org | 877ac76 | 2015-02-04 22:03:09 | [diff] [blame] | 578 | const PeerConnectionInterface::IceServers& servers, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 579 | const MediaConstraintsInterface* constraints, |
| 580 | PortAllocatorFactoryInterface* allocator_factory, |
Henrik Boström | 5e56c59 | 2015-08-11 08:33:13 | [diff] [blame] | 581 | rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
buildbot@webrtc.org | 41451d4 | 2014-05-03 05:39:45 | [diff] [blame] | 582 | PeerConnectionObserver* observer) { |
| 583 | PeerConnectionInterface::RTCConfiguration rtc_config; |
pthatcher@webrtc.org | 877ac76 | 2015-02-04 22:03:09 | [diff] [blame] | 584 | rtc_config.servers = servers; |
buildbot@webrtc.org | 41451d4 | 2014-05-03 05:39:45 | [diff] [blame] | 585 | return CreatePeerConnection(rtc_config, constraints, allocator_factory, |
Henrik Boström | 5e56c59 | 2015-08-11 08:33:13 | [diff] [blame] | 586 | dtls_identity_store.Pass(), observer); |
buildbot@webrtc.org | 41451d4 | 2014-05-03 05:39:45 | [diff] [blame] | 587 | } |
| 588 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 589 | virtual rtc::scoped_refptr<MediaStreamInterface> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 590 | CreateLocalMediaStream(const std::string& label) = 0; |
| 591 | |
| 592 | // Creates a AudioSourceInterface. |
| 593 | // |constraints| decides audio processing settings but can be NULL. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 594 | virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 595 | const MediaConstraintsInterface* constraints) = 0; |
| 596 | |
| 597 | // Creates a VideoSourceInterface. The new source take ownership of |
| 598 | // |capturer|. |constraints| decides video resolution and frame rate but can |
| 599 | // be NULL. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 600 | virtual rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource( |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 601 | cricket::VideoCapturer* capturer, |
| 602 | const MediaConstraintsInterface* constraints) = 0; |
| 603 | |
| 604 | // Creates a new local VideoTrack. The same |source| can be used in several |
| 605 | // tracks. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 606 | virtual rtc::scoped_refptr<VideoTrackInterface> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 607 | CreateVideoTrack(const std::string& label, |
| 608 | VideoSourceInterface* source) = 0; |
| 609 | |
| 610 | // Creates an new AudioTrack. At the moment |source| can be NULL. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 611 | virtual rtc::scoped_refptr<AudioTrackInterface> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 612 | CreateAudioTrack(const std::string& label, |
| 613 | AudioSourceInterface* source) = 0; |
| 614 | |
wu@webrtc.org | a989080 | 2013-12-13 00:21:03 | [diff] [blame] | 615 | // Starts AEC dump using existing file. Takes ownership of |file| and passes |
| 616 | // it on to VoiceEngine (via other objects) immediately, which will take |
wu@webrtc.org | a8910d2 | 2014-01-23 22:12:45 | [diff] [blame] | 617 | // the ownerhip. If the operation fails, the file will be closed. |
wu@webrtc.org | a989080 | 2013-12-13 00:21:03 | [diff] [blame] | 618 | // TODO(grunell): Remove when Chromium has started to use AEC in each source. |
wu@webrtc.org | a8910d2 | 2014-01-23 22:12:45 | [diff] [blame] | 619 | // http://crbug.com/264611. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 620 | virtual bool StartAecDump(rtc::PlatformFile file) = 0; |
wu@webrtc.org | a989080 | 2013-12-13 00:21:03 | [diff] [blame] | 621 | |
ivoc | 112a3d8 | 2015-10-16 09:22:18 | [diff] [blame] | 622 | // Starts RtcEventLog using existing file. Takes ownership of |file| and |
| 623 | // passes it on to VoiceEngine, which will take the ownership. If the |
| 624 | // operation fails the file will be closed. The logging will stop |
| 625 | // automatically after 10 minutes have passed, or when the StopRtcEventLog |
| 626 | // function is called. |
| 627 | // This function as well as the StopRtcEventLog don't really belong on this |
| 628 | // interface, this is a temporary solution until we move the logging object |
| 629 | // from inside voice engine to webrtc::Call, which will happen when the VoE |
| 630 | // restructuring effort is further along. |
| 631 | // TODO(ivoc): Move this into being: |
| 632 | // PeerConnection => MediaController => webrtc::Call. |
| 633 | virtual bool StartRtcEventLog(rtc::PlatformFile file) = 0; |
| 634 | |
| 635 | // Stops logging the RtcEventLog. |
| 636 | virtual void StopRtcEventLog() = 0; |
| 637 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 638 | protected: |
| 639 | // Dtor and ctor protected as objects shouldn't be created or deleted via |
| 640 | // this interface. |
| 641 | PeerConnectionFactoryInterface() {} |
| 642 | ~PeerConnectionFactoryInterface() {} // NOLINT |
| 643 | }; |
| 644 | |
| 645 | // Create a new instance of PeerConnectionFactoryInterface. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 646 | rtc::scoped_refptr<PeerConnectionFactoryInterface> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 647 | CreatePeerConnectionFactory(); |
| 648 | |
| 649 | // Create a new instance of PeerConnectionFactoryInterface. |
| 650 | // Ownership of |factory|, |default_adm|, and optionally |encoder_factory| and |
| 651 | // |decoder_factory| transferred to the returned factory. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 652 | rtc::scoped_refptr<PeerConnectionFactoryInterface> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 653 | CreatePeerConnectionFactory( |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 654 | rtc::Thread* worker_thread, |
| 655 | rtc::Thread* signaling_thread, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 656 | AudioDeviceModule* default_adm, |
| 657 | cricket::WebRtcVideoEncoderFactory* encoder_factory, |
| 658 | cricket::WebRtcVideoDecoderFactory* decoder_factory); |
| 659 | |
| 660 | } // namespace webrtc |
| 661 | |
| 662 | #endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ |