blob: 1d8cf5faaa3f2c6039e69d41fc5fbf3a0a282667 [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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef API_PEERCONNECTIONPROXY_H_
12#define API_PEERCONNECTIONPROXY_H_
henrike@webrtc.org28e20752013-07-10 00:45:36 +000013
Elad Alon99c3fe52017-10-13 16:29:40 +020014#include <memory>
oprypin803dc292017-02-01 01:55:59 -080015#include <string>
16#include <vector>
17
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020018#include "api/peerconnectioninterface.h"
19#include "api/proxy.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000020
21namespace webrtc {
22
deadbeefb10f32f2017-02-08 01:38:21 -080023// TODO(deadbeef): Move this to .cc file and out of api/. What threads methods
24// are called on is an implementation detail.
nisse72c8d2b2016-04-15 03:49:07 -070025BEGIN_SIGNALING_PROXY_MAP(PeerConnection)
deadbeefd99a2002017-01-18 08:55:23 -080026 PROXY_SIGNALING_THREAD_DESTRUCTOR()
27 PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, local_streams)
28 PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, remote_streams)
perkj@webrtc.orgc2dd5ee2014-11-04 11:31:29 +000029 PROXY_METHOD1(bool, AddStream, MediaStreamInterface*)
henrike@webrtc.org28e20752013-07-10 00:45:36 +000030 PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*)
deadbeefe1f9d832016-01-14 15:35:42 -080031 PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
32 AddTrack,
33 MediaStreamTrackInterface*,
34 std::vector<MediaStreamInterface*>)
35 PROXY_METHOD1(bool, RemoveTrack, RtpSenderInterface*)
Steve Anton9158ef62017-11-27 13:01:52 -080036 PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
37 AddTransceiver,
38 rtc::scoped_refptr<MediaStreamTrackInterface>)
39 PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
40 AddTransceiver,
41 rtc::scoped_refptr<MediaStreamTrackInterface>,
42 const RtpTransceiverInit&)
43 PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
44 AddTransceiver,
45 cricket::MediaType)
46 PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
47 AddTransceiver,
48 cricket::MediaType,
49 const RtpTransceiverInit&)
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000050 PROXY_METHOD1(rtc::scoped_refptr<DtmfSenderInterface>,
deadbeefd99a2002017-01-18 08:55:23 -080051 CreateDtmfSender,
52 AudioTrackInterface*)
deadbeefbd7d8f72015-12-18 16:58:44 -080053 PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
deadbeeffac06552015-11-25 11:26:01 -080054 CreateSender,
deadbeefbd7d8f72015-12-18 16:58:44 -080055 const std::string&,
deadbeeffac06552015-11-25 11:26:01 -080056 const std::string&)
deadbeef70ab1a12015-09-28 16:53:55 -070057 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpSenderInterface>>,
58 GetSenders)
59 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpReceiverInterface>>,
60 GetReceivers)
Steve Anton9158ef62017-11-27 13:01:52 -080061 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>,
62 GetTransceivers)
deadbeefd99a2002017-01-18 08:55:23 -080063 PROXY_METHOD3(bool,
64 GetStats,
65 StatsObserver*,
wu@webrtc.orgb9a088b2014-02-13 23:18:49 +000066 MediaStreamTrackInterface*,
67 StatsOutputLevel)
hbos74e1a4f2016-09-15 23:33:01 -070068 PROXY_METHOD1(void, GetStats, RTCStatsCollectorCallback*)
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000069 PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>,
deadbeefd99a2002017-01-18 08:55:23 -080070 CreateDataChannel,
71 const std::string&,
72 const DataChannelInit*)
henrike@webrtc.org28e20752013-07-10 00:45:36 +000073 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description)
74 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description)
deadbeeffe4a8a42016-12-20 17:56:17 -080075 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
76 pending_local_description)
77 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
78 pending_remote_description)
79 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
80 current_local_description)
81 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
82 current_remote_description)
deadbeefd99a2002017-01-18 08:55:23 -080083 PROXY_METHOD2(void,
84 CreateOffer,
85 CreateSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000086 const MediaConstraintsInterface*)
deadbeefd99a2002017-01-18 08:55:23 -080087 PROXY_METHOD2(void,
88 CreateAnswer,
89 CreateSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000090 const MediaConstraintsInterface*)
htaa2a49d92016-03-04 02:51:39 -080091 PROXY_METHOD2(void,
92 CreateOffer,
93 CreateSessionDescriptionObserver*,
94 const RTCOfferAnswerOptions&)
95 PROXY_METHOD2(void,
96 CreateAnswer,
97 CreateSessionDescriptionObserver*,
98 const RTCOfferAnswerOptions&)
deadbeefd99a2002017-01-18 08:55:23 -080099 PROXY_METHOD2(void,
100 SetLocalDescription,
101 SetSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000102 SessionDescriptionInterface*)
deadbeefd99a2002017-01-18 08:55:23 -0800103 PROXY_METHOD2(void,
104 SetRemoteDescription,
105 SetSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000106 SessionDescriptionInterface*)
Henrik Boström31638672017-11-23 17:48:32 +0100107 PROXY_METHOD2(void,
108 SetRemoteDescription,
109 std::unique_ptr<SessionDescriptionInterface>,
110 rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>);
deadbeef46c73892016-11-16 19:42:04 -0800111 PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration);
deadbeef293e9262017-01-11 12:28:30 -0800112 PROXY_METHOD2(bool,
113 SetConfiguration,
114 const PeerConnectionInterface::RTCConfiguration&,
115 RTCError*);
deadbeef1e234612016-12-24 01:43:32 -0800116 PROXY_METHOD1(bool,
deadbeefa67696b2015-09-29 11:56:26 -0700117 SetConfiguration,
deadbeef1e234612016-12-24 01:43:32 -0800118 const PeerConnectionInterface::RTCConfiguration&);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000119 PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*)
Honghai Zhang7fb69db2016-03-14 11:59:18 -0700120 PROXY_METHOD1(bool,
121 RemoveIceCandidates,
122 const std::vector<cricket::Candidate>&);
henrika5f6bf242017-11-01 11:06:56 +0100123 PROXY_METHOD1(void, SetAudioPlayout, bool)
124 PROXY_METHOD1(void, SetAudioRecording, bool)
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000125 PROXY_METHOD1(void, RegisterUMAObserver, UMAObserver*)
zstein4b979802017-06-02 14:37:37 -0700126 PROXY_METHOD1(RTCError, SetBitrate, const BitrateParameters&);
Alex Narest78609d52017-10-20 10:37:47 +0200127 PROXY_METHOD1(void,
128 SetBitrateAllocationStrategy,
129 std::unique_ptr<rtc::BitrateAllocationStrategy>);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000130 PROXY_METHOD0(SignalingState, signaling_state)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000131 PROXY_METHOD0(IceConnectionState, ice_connection_state)
132 PROXY_METHOD0(IceGatheringState, ice_gathering_state)
ivoc14d5dbe2016-07-04 07:06:55 -0700133 PROXY_METHOD2(bool, StartRtcEventLog, rtc::PlatformFile, int64_t)
Bjorn Tereliusde939432017-11-20 17:38:14 +0100134 PROXY_METHOD2(bool,
135 StartRtcEventLog,
136 std::unique_ptr<RtcEventLogOutput>,
137 int64_t);
ivoc14d5dbe2016-07-04 07:06:55 -0700138 PROXY_METHOD0(void, StopRtcEventLog)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000139 PROXY_METHOD0(void, Close)
deadbeefd99a2002017-01-18 08:55:23 -0800140END_PROXY_MAP()
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000141
142} // namespace webrtc
143
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200144#endif // API_PEERCONNECTIONPROXY_H_