blob: 171c10b8b5c94ddb1af6c81e3fd557949ed8d0a7 [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
2 * libjingle
3 * Copyright 2012, Google Inc.
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"
75#include "talk/app/webrtc/dtmfsenderinterface.h"
76#include "talk/app/webrtc/jsep.h"
77#include "talk/app/webrtc/mediastreaminterface.h"
78#include "talk/app/webrtc/statstypes.h"
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +000079#include "talk/app/webrtc/umametrics.h"
wu@webrtc.orga8910d22014-01-23 22:12:45 +000080#include "talk/base/fileutils.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000081#include "talk/base/socketaddress.h"
82
83namespace talk_base {
84class Thread;
85}
86
87namespace cricket {
88class PortAllocator;
89class WebRtcVideoDecoderFactory;
90class WebRtcVideoEncoderFactory;
91}
92
93namespace webrtc {
94class AudioDeviceModule;
95class MediaConstraintsInterface;
96
97// MediaStream container interface.
98class StreamCollectionInterface : public talk_base::RefCountInterface {
99 public:
100 // TODO(ronghuawu): Update the function names to c++ style, e.g. find -> Find.
101 virtual size_t count() = 0;
102 virtual MediaStreamInterface* at(size_t index) = 0;
103 virtual MediaStreamInterface* find(const std::string& label) = 0;
104 virtual MediaStreamTrackInterface* FindAudioTrack(
105 const std::string& id) = 0;
106 virtual MediaStreamTrackInterface* FindVideoTrack(
107 const std::string& id) = 0;
108
109 protected:
110 // Dtor protected as objects shouldn't be deleted via this interface.
111 ~StreamCollectionInterface() {}
112};
113
114class StatsObserver : public talk_base::RefCountInterface {
115 public:
tommi@webrtc.org190d2692014-07-25 10:32:30 +0000116 // TODO(tommi): Remove.
117 virtual void OnComplete(const std::vector<StatsReport>& reports) {}
118
119 // TODO(tommi): Make pure virtual and remove implementation.
120 virtual void OnComplete(const StatsReports& reports) {
121 std::vector<StatsReportCopyable> report_copies;
122 for (size_t i = 0; i < reports.size(); ++i)
123 report_copies.push_back(StatsReportCopyable(*reports[i]));
124 std::vector<StatsReport>* r =
125 reinterpret_cast<std::vector<StatsReport>*>(&report_copies);
126 OnComplete(*r);
127 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000128
129 protected:
130 virtual ~StatsObserver() {}
131};
132
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000133class UMAObserver : public talk_base::RefCountInterface {
134 public:
mallinath@webrtc.orgd37bcfa2014-05-12 23:10:18 +0000135 virtual void IncrementCounter(PeerConnectionUMAMetricsCounter type) = 0;
136 virtual void AddHistogramSample(PeerConnectionUMAMetricsName type,
137 int value) = 0;
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000138
139 protected:
140 virtual ~UMAObserver() {}
141};
142
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000143class PeerConnectionInterface : public talk_base::RefCountInterface {
144 public:
145 // See http://dev.w3.org/2011/webrtc/editor/webrtc.html#state-definitions .
146 enum SignalingState {
147 kStable,
148 kHaveLocalOffer,
149 kHaveLocalPrAnswer,
150 kHaveRemoteOffer,
151 kHaveRemotePrAnswer,
152 kClosed,
153 };
154
155 // TODO(bemasc): Remove IceState when callers are changed to
156 // IceConnection/GatheringState.
157 enum IceState {
158 kIceNew,
159 kIceGathering,
160 kIceWaiting,
161 kIceChecking,
162 kIceConnected,
163 kIceCompleted,
164 kIceFailed,
165 kIceClosed,
166 };
167
168 enum IceGatheringState {
169 kIceGatheringNew,
170 kIceGatheringGathering,
171 kIceGatheringComplete
172 };
173
174 enum IceConnectionState {
175 kIceConnectionNew,
176 kIceConnectionChecking,
177 kIceConnectionConnected,
178 kIceConnectionCompleted,
179 kIceConnectionFailed,
180 kIceConnectionDisconnected,
181 kIceConnectionClosed,
182 };
183
184 struct IceServer {
185 std::string uri;
186 std::string username;
187 std::string password;
188 };
189 typedef std::vector<IceServer> IceServers;
190
buildbot@webrtc.org41451d42014-05-03 05:39:45 +0000191 enum IceTransportsType {
192 kNone,
193 kRelay,
194 kNoHost,
195 kAll
196 };
197
198 struct RTCConfiguration {
199 IceTransportsType type;
200 IceServers servers;
201
202 RTCConfiguration() : type(kAll) {}
203 explicit RTCConfiguration(IceTransportsType type) : type(type) {}
204 };
205
wu@webrtc.orgb9a088b2014-02-13 23:18:49 +0000206 // Used by GetStats to decide which stats to include in the stats reports.
207 // |kStatsOutputLevelStandard| includes the standard stats for Javascript API;
208 // |kStatsOutputLevelDebug| includes both the standard stats and additional
209 // stats for debugging purposes.
210 enum StatsOutputLevel {
211 kStatsOutputLevelStandard,
212 kStatsOutputLevelDebug,
213 };
214
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000215 // Accessor methods to active local streams.
216 virtual talk_base::scoped_refptr<StreamCollectionInterface>
217 local_streams() = 0;
218
219 // Accessor methods to remote streams.
220 virtual talk_base::scoped_refptr<StreamCollectionInterface>
221 remote_streams() = 0;
222
223 // Add a new MediaStream to be sent on this PeerConnection.
224 // Note that a SessionDescription negotiation is needed before the
225 // remote peer can receive the stream.
226 virtual bool AddStream(MediaStreamInterface* stream,
227 const MediaConstraintsInterface* constraints) = 0;
228
229 // Remove a MediaStream from this PeerConnection.
230 // Note that a SessionDescription negotiation is need before the
231 // remote peer is notified.
232 virtual void RemoveStream(MediaStreamInterface* stream) = 0;
233
234 // Returns pointer to the created DtmfSender on success.
235 // Otherwise returns NULL.
236 virtual talk_base::scoped_refptr<DtmfSenderInterface> CreateDtmfSender(
237 AudioTrackInterface* track) = 0;
238
wu@webrtc.orgb9a088b2014-02-13 23:18:49 +0000239 virtual bool GetStats(StatsObserver* observer,
240 MediaStreamTrackInterface* track,
241 StatsOutputLevel level) = 0;
242
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000243 virtual talk_base::scoped_refptr<DataChannelInterface> CreateDataChannel(
244 const std::string& label,
245 const DataChannelInit* config) = 0;
246
247 virtual const SessionDescriptionInterface* local_description() const = 0;
248 virtual const SessionDescriptionInterface* remote_description() const = 0;
249
250 // Create a new offer.
251 // The CreateSessionDescriptionObserver callback will be called when done.
252 virtual void CreateOffer(CreateSessionDescriptionObserver* observer,
253 const MediaConstraintsInterface* constraints) = 0;
254 // Create an answer to an offer.
255 // The CreateSessionDescriptionObserver callback will be called when done.
256 virtual void CreateAnswer(CreateSessionDescriptionObserver* observer,
257 const MediaConstraintsInterface* constraints) = 0;
258 // Sets the local session description.
259 // JsepInterface takes the ownership of |desc| even if it fails.
260 // The |observer| callback will be called when done.
261 virtual void SetLocalDescription(SetSessionDescriptionObserver* observer,
262 SessionDescriptionInterface* desc) = 0;
263 // Sets the remote session description.
264 // JsepInterface takes the ownership of |desc| even if it fails.
265 // The |observer| callback will be called when done.
266 virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer,
267 SessionDescriptionInterface* desc) = 0;
268 // Restarts or updates the ICE Agent process of gathering local candidates
269 // and pinging remote candidates.
270 virtual bool UpdateIce(const IceServers& configuration,
271 const MediaConstraintsInterface* constraints) = 0;
272 // Provides a remote candidate to the ICE Agent.
273 // A copy of the |candidate| will be created and added to the remote
274 // description. So the caller of this method still has the ownership of the
275 // |candidate|.
276 // TODO(ronghuawu): Consider to change this so that the AddIceCandidate will
277 // take the ownership of the |candidate|.
278 virtual bool AddIceCandidate(const IceCandidateInterface* candidate) = 0;
279
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000280 virtual void RegisterUMAObserver(UMAObserver* observer) = 0;
281
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000282 // Returns the current SignalingState.
283 virtual SignalingState signaling_state() = 0;
284
285 // TODO(bemasc): Remove ice_state when callers are changed to
286 // IceConnection/GatheringState.
287 // Returns the current IceState.
288 virtual IceState ice_state() = 0;
289 virtual IceConnectionState ice_connection_state() = 0;
290 virtual IceGatheringState ice_gathering_state() = 0;
291
292 // Terminates all media and closes the transport.
293 virtual void Close() = 0;
294
295 protected:
296 // Dtor protected as objects shouldn't be deleted via this interface.
297 ~PeerConnectionInterface() {}
298};
299
300// PeerConnection callback interface. Application should implement these
301// methods.
302class PeerConnectionObserver {
303 public:
304 enum StateType {
305 kSignalingState,
306 kIceState,
307 };
308
309 virtual void OnError() = 0;
310
311 // Triggered when the SignalingState changed.
312 virtual void OnSignalingChange(
313 PeerConnectionInterface::SignalingState new_state) {}
314
315 // Triggered when SignalingState or IceState have changed.
316 // TODO(bemasc): Remove once callers transition to OnSignalingChange.
317 virtual void OnStateChange(StateType state_changed) {}
318
319 // Triggered when media is received on a new stream from remote peer.
320 virtual void OnAddStream(MediaStreamInterface* stream) = 0;
321
322 // Triggered when a remote peer close a stream.
323 virtual void OnRemoveStream(MediaStreamInterface* stream) = 0;
324
325 // Triggered when a remote peer open a data channel.
326 // TODO(perkj): Make pure virtual.
327 virtual void OnDataChannel(DataChannelInterface* data_channel) {}
328
mallinath@webrtc.org0d92ef62014-01-22 02:21:22 +0000329 // Triggered when renegotiation is needed, for example the ICE has restarted.
fischman@webrtc.orgd7568a02014-01-13 22:04:12 +0000330 virtual void OnRenegotiationNeeded() = 0;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000331
332 // Called any time the IceConnectionState changes
333 virtual void OnIceConnectionChange(
334 PeerConnectionInterface::IceConnectionState new_state) {}
335
336 // Called any time the IceGatheringState changes
337 virtual void OnIceGatheringChange(
338 PeerConnectionInterface::IceGatheringState new_state) {}
339
340 // New Ice candidate have been found.
341 virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0;
342
343 // TODO(bemasc): Remove this once callers transition to OnIceGatheringChange.
344 // All Ice candidates have been found.
345 virtual void OnIceComplete() {}
346
347 protected:
348 // Dtor protected as objects shouldn't be deleted via this interface.
349 ~PeerConnectionObserver() {}
350};
351
352// Factory class used for creating cricket::PortAllocator that is used
353// for ICE negotiation.
354class PortAllocatorFactoryInterface : public talk_base::RefCountInterface {
355 public:
356 struct StunConfiguration {
357 StunConfiguration(const std::string& address, int port)
358 : server(address, port) {}
359 // STUN server address and port.
360 talk_base::SocketAddress server;
361 };
362
363 struct TurnConfiguration {
364 TurnConfiguration(const std::string& address,
365 int port,
366 const std::string& username,
367 const std::string& password,
wu@webrtc.org91053e72013-08-10 07:18:04 +0000368 const std::string& transport_type,
369 bool secure)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000370 : server(address, port),
371 username(username),
372 password(password),
wu@webrtc.org91053e72013-08-10 07:18:04 +0000373 transport_type(transport_type),
374 secure(secure) {}
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000375 talk_base::SocketAddress server;
376 std::string username;
377 std::string password;
378 std::string transport_type;
wu@webrtc.org91053e72013-08-10 07:18:04 +0000379 bool secure;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000380 };
381
382 virtual cricket::PortAllocator* CreatePortAllocator(
383 const std::vector<StunConfiguration>& stun_servers,
384 const std::vector<TurnConfiguration>& turn_configurations) = 0;
385
386 protected:
387 PortAllocatorFactoryInterface() {}
388 ~PortAllocatorFactoryInterface() {}
389};
390
391// Used to receive callbacks of DTLS identity requests.
392class DTLSIdentityRequestObserver : public talk_base::RefCountInterface {
393 public:
394 virtual void OnFailure(int error) = 0;
wu@webrtc.org91053e72013-08-10 07:18:04 +0000395 virtual void OnSuccess(const std::string& der_cert,
396 const std::string& der_private_key) = 0;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000397 protected:
398 virtual ~DTLSIdentityRequestObserver() {}
399};
400
401class DTLSIdentityServiceInterface {
402 public:
403 // Asynchronously request a DTLS identity, including a self-signed certificate
404 // and the private key used to sign the certificate, from the identity store
405 // for the given identity name.
406 // DTLSIdentityRequestObserver::OnSuccess will be called with the identity if
407 // the request succeeded; DTLSIdentityRequestObserver::OnFailure will be
408 // called with an error code if the request failed.
409 //
410 // Only one request can be made at a time. If a second request is called
411 // before the first one completes, RequestIdentity will abort and return
412 // false.
413 //
414 // |identity_name| is an internal name selected by the client to identify an
415 // identity within an origin. E.g. an web site may cache the certificates used
416 // to communicate with differnent peers under different identity names.
417 //
418 // |common_name| is the common name used to generate the certificate. If the
419 // certificate already exists in the store, |common_name| is ignored.
420 //
421 // |observer| is the object to receive success or failure callbacks.
422 //
423 // Returns true if either OnFailure or OnSuccess will be called.
424 virtual bool RequestIdentity(
425 const std::string& identity_name,
426 const std::string& common_name,
427 DTLSIdentityRequestObserver* observer) = 0;
wu@webrtc.org91053e72013-08-10 07:18:04 +0000428
429 virtual ~DTLSIdentityServiceInterface() {}
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000430};
431
432// PeerConnectionFactoryInterface is the factory interface use for creating
433// PeerConnection, MediaStream and media tracks.
434// PeerConnectionFactoryInterface will create required libjingle threads,
435// socket and network manager factory classes for networking.
436// If an application decides to provide its own threads and network
437// implementation of these classes it should use the alternate
438// CreatePeerConnectionFactory method which accepts threads as input and use the
439// CreatePeerConnection version that takes a PortAllocatorFactoryInterface as
440// argument.
441class PeerConnectionFactoryInterface : public talk_base::RefCountInterface {
442 public:
wu@webrtc.org97077a32013-10-25 21:18:33 +0000443 class Options {
444 public:
445 Options() :
wu@webrtc.org97077a32013-10-25 21:18:33 +0000446 disable_encryption(false),
447 disable_sctp_data_channels(false) {
448 }
wu@webrtc.org97077a32013-10-25 21:18:33 +0000449 bool disable_encryption;
450 bool disable_sctp_data_channels;
451 };
452
453 virtual void SetOptions(const Options& options) = 0;
buildbot@webrtc.org41451d42014-05-03 05:39:45 +0000454
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000455 virtual talk_base::scoped_refptr<PeerConnectionInterface>
buildbot@webrtc.org41451d42014-05-03 05:39:45 +0000456 CreatePeerConnection(
457 const PeerConnectionInterface::RTCConfiguration& configuration,
458 const MediaConstraintsInterface* constraints,
459 PortAllocatorFactoryInterface* allocator_factory,
460 DTLSIdentityServiceInterface* dtls_identity_service,
461 PeerConnectionObserver* observer) = 0;
462
463 // TODO(mallinath) : Remove below versions after clients are updated
464 // to above method.
465 // In latest W3C WebRTC draft, PC constructor will take RTCConfiguration,
466 // and not IceServers. RTCConfiguration is made up of ice servers and
467 // ice transport type.
468 // http://dev.w3.org/2011/webrtc/editor/webrtc.html
469 inline talk_base::scoped_refptr<PeerConnectionInterface>
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000470 CreatePeerConnection(
471 const PeerConnectionInterface::IceServers& configuration,
472 const MediaConstraintsInterface* constraints,
473 PortAllocatorFactoryInterface* allocator_factory,
474 DTLSIdentityServiceInterface* dtls_identity_service,
buildbot@webrtc.org41451d42014-05-03 05:39:45 +0000475 PeerConnectionObserver* observer) {
476 PeerConnectionInterface::RTCConfiguration rtc_config;
477 rtc_config.servers = configuration;
478 return CreatePeerConnection(rtc_config, constraints, allocator_factory,
479 dtls_identity_service, observer);
480 }
481
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000482 virtual talk_base::scoped_refptr<MediaStreamInterface>
483 CreateLocalMediaStream(const std::string& label) = 0;
484
485 // Creates a AudioSourceInterface.
486 // |constraints| decides audio processing settings but can be NULL.
487 virtual talk_base::scoped_refptr<AudioSourceInterface> CreateAudioSource(
488 const MediaConstraintsInterface* constraints) = 0;
489
490 // Creates a VideoSourceInterface. The new source take ownership of
491 // |capturer|. |constraints| decides video resolution and frame rate but can
492 // be NULL.
493 virtual talk_base::scoped_refptr<VideoSourceInterface> CreateVideoSource(
494 cricket::VideoCapturer* capturer,
495 const MediaConstraintsInterface* constraints) = 0;
496
497 // Creates a new local VideoTrack. The same |source| can be used in several
498 // tracks.
499 virtual talk_base::scoped_refptr<VideoTrackInterface>
500 CreateVideoTrack(const std::string& label,
501 VideoSourceInterface* source) = 0;
502
503 // Creates an new AudioTrack. At the moment |source| can be NULL.
504 virtual talk_base::scoped_refptr<AudioTrackInterface>
505 CreateAudioTrack(const std::string& label,
506 AudioSourceInterface* source) = 0;
507
wu@webrtc.orga9890802013-12-13 00:21:03 +0000508 // Starts AEC dump using existing file. Takes ownership of |file| and passes
509 // it on to VoiceEngine (via other objects) immediately, which will take
wu@webrtc.orga8910d22014-01-23 22:12:45 +0000510 // the ownerhip. If the operation fails, the file will be closed.
wu@webrtc.orga9890802013-12-13 00:21:03 +0000511 // TODO(grunell): Remove when Chromium has started to use AEC in each source.
wu@webrtc.orga8910d22014-01-23 22:12:45 +0000512 // http://crbug.com/264611.
513 virtual bool StartAecDump(talk_base::PlatformFile file) = 0;
wu@webrtc.orga9890802013-12-13 00:21:03 +0000514
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000515 protected:
516 // Dtor and ctor protected as objects shouldn't be created or deleted via
517 // this interface.
518 PeerConnectionFactoryInterface() {}
519 ~PeerConnectionFactoryInterface() {} // NOLINT
520};
521
522// Create a new instance of PeerConnectionFactoryInterface.
523talk_base::scoped_refptr<PeerConnectionFactoryInterface>
524CreatePeerConnectionFactory();
525
526// Create a new instance of PeerConnectionFactoryInterface.
527// Ownership of |factory|, |default_adm|, and optionally |encoder_factory| and
528// |decoder_factory| transferred to the returned factory.
529talk_base::scoped_refptr<PeerConnectionFactoryInterface>
530CreatePeerConnectionFactory(
531 talk_base::Thread* worker_thread,
532 talk_base::Thread* signaling_thread,
533 AudioDeviceModule* default_adm,
534 cricket::WebRtcVideoEncoderFactory* encoder_factory,
535 cricket::WebRtcVideoDecoderFactory* decoder_factory);
536
537} // namespace webrtc
538
539#endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_