blob: 2375dd4dcecd4b20f7abf66e78ec446b3f35bab4 [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
kjellanderb24317b2016-02-10 07:54:43 -08002 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00003 *
kjellanderb24317b2016-02-10 07:54:43 -08004 * 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.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00009 */
10
Henrik Kjellander15583c12016-02-10 10:53:12 +010011#ifndef WEBRTC_API_PEERCONNECTIONPROXY_H_
12#define WEBRTC_API_PEERCONNECTIONPROXY_H_
henrike@webrtc.org28e20752013-07-10 00:45:36 +000013
oprypin803dc292017-02-01 01:55:59 -080014#include <string>
15#include <vector>
16
Henrik Kjellander15583c12016-02-10 10:53:12 +010017#include "webrtc/api/peerconnectioninterface.h"
18#include "webrtc/api/proxy.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000019
20namespace webrtc {
21
deadbeefb10f32f2017-02-08 01:38:21 -080022// TODO(deadbeef): Move this to .cc file and out of api/. What threads methods
23// are called on is an implementation detail.
nisse72c8d2b2016-04-15 03:49:07 -070024BEGIN_SIGNALING_PROXY_MAP(PeerConnection)
deadbeefd99a2002017-01-18 08:55:23 -080025 PROXY_SIGNALING_THREAD_DESTRUCTOR()
26 PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, local_streams)
27 PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, remote_streams)
perkj@webrtc.orgc2dd5ee2014-11-04 11:31:29 +000028 PROXY_METHOD1(bool, AddStream, MediaStreamInterface*)
henrike@webrtc.org28e20752013-07-10 00:45:36 +000029 PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*)
deadbeefe1f9d832016-01-14 15:35:42 -080030 PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
31 AddTrack,
32 MediaStreamTrackInterface*,
33 std::vector<MediaStreamInterface*>)
34 PROXY_METHOD1(bool, RemoveTrack, RtpSenderInterface*)
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000035 PROXY_METHOD1(rtc::scoped_refptr<DtmfSenderInterface>,
deadbeefd99a2002017-01-18 08:55:23 -080036 CreateDtmfSender,
37 AudioTrackInterface*)
deadbeefbd7d8f72015-12-18 16:58:44 -080038 PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
deadbeeffac06552015-11-25 11:26:01 -080039 CreateSender,
deadbeefbd7d8f72015-12-18 16:58:44 -080040 const std::string&,
deadbeeffac06552015-11-25 11:26:01 -080041 const std::string&)
deadbeef70ab1a12015-09-28 16:53:55 -070042 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpSenderInterface>>,
43 GetSenders)
44 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpReceiverInterface>>,
45 GetReceivers)
deadbeefd99a2002017-01-18 08:55:23 -080046 PROXY_METHOD3(bool,
47 GetStats,
48 StatsObserver*,
wu@webrtc.orgb9a088b2014-02-13 23:18:49 +000049 MediaStreamTrackInterface*,
50 StatsOutputLevel)
hbos74e1a4f2016-09-15 23:33:01 -070051 PROXY_METHOD1(void, GetStats, RTCStatsCollectorCallback*)
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000052 PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>,
deadbeefd99a2002017-01-18 08:55:23 -080053 CreateDataChannel,
54 const std::string&,
55 const DataChannelInit*)
henrike@webrtc.org28e20752013-07-10 00:45:36 +000056 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description)
57 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description)
deadbeeffe4a8a42016-12-20 17:56:17 -080058 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
59 pending_local_description)
60 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
61 pending_remote_description)
62 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
63 current_local_description)
64 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
65 current_remote_description)
deadbeefd99a2002017-01-18 08:55:23 -080066 PROXY_METHOD2(void,
67 CreateOffer,
68 CreateSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000069 const MediaConstraintsInterface*)
deadbeefd99a2002017-01-18 08:55:23 -080070 PROXY_METHOD2(void,
71 CreateAnswer,
72 CreateSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000073 const MediaConstraintsInterface*)
htaa2a49d92016-03-04 02:51:39 -080074 PROXY_METHOD2(void,
75 CreateOffer,
76 CreateSessionDescriptionObserver*,
77 const RTCOfferAnswerOptions&)
78 PROXY_METHOD2(void,
79 CreateAnswer,
80 CreateSessionDescriptionObserver*,
81 const RTCOfferAnswerOptions&)
deadbeefd99a2002017-01-18 08:55:23 -080082 PROXY_METHOD2(void,
83 SetLocalDescription,
84 SetSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000085 SessionDescriptionInterface*)
deadbeefd99a2002017-01-18 08:55:23 -080086 PROXY_METHOD2(void,
87 SetRemoteDescription,
88 SetSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000089 SessionDescriptionInterface*)
deadbeef46c73892016-11-16 19:42:04 -080090 PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration);
deadbeef293e9262017-01-11 12:28:30 -080091 PROXY_METHOD2(bool,
92 SetConfiguration,
93 const PeerConnectionInterface::RTCConfiguration&,
94 RTCError*);
deadbeef1e234612016-12-24 01:43:32 -080095 PROXY_METHOD1(bool,
deadbeefa67696b2015-09-29 11:56:26 -070096 SetConfiguration,
deadbeef1e234612016-12-24 01:43:32 -080097 const PeerConnectionInterface::RTCConfiguration&);
henrike@webrtc.org28e20752013-07-10 00:45:36 +000098 PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*)
Honghai Zhang7fb69db2016-03-14 11:59:18 -070099 PROXY_METHOD1(bool,
100 RemoveIceCandidates,
101 const std::vector<cricket::Candidate>&);
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000102 PROXY_METHOD1(void, RegisterUMAObserver, UMAObserver*)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000103 PROXY_METHOD0(SignalingState, signaling_state)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000104 PROXY_METHOD0(IceConnectionState, ice_connection_state)
105 PROXY_METHOD0(IceGatheringState, ice_gathering_state)
ivoc14d5dbe2016-07-04 07:06:55 -0700106 PROXY_METHOD2(bool, StartRtcEventLog, rtc::PlatformFile, int64_t)
107 PROXY_METHOD0(void, StopRtcEventLog)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000108 PROXY_METHOD0(void, Close)
deadbeefd99a2002017-01-18 08:55:23 -0800109END_PROXY_MAP()
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000110
111} // namespace webrtc
112
Henrik Kjellander15583c12016-02-10 10:53:12 +0100113#endif // WEBRTC_API_PEERCONNECTIONPROXY_H_