blob: c39c9333aae11c2cc5752cb82e395f4968fccb54 [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*)
Steve Antonf9381f02017-12-14 10:23:57 -080031 PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>,
32 AddTrackWithStreamLabels,
33 rtc::scoped_refptr<MediaStreamTrackInterface>,
34 const std::vector<std::string>&);
deadbeefe1f9d832016-01-14 15:35:42 -080035 PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
36 AddTrack,
37 MediaStreamTrackInterface*,
38 std::vector<MediaStreamInterface*>)
39 PROXY_METHOD1(bool, RemoveTrack, RtpSenderInterface*)
Steve Anton9158ef62017-11-27 13:01:52 -080040 PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
41 AddTransceiver,
42 rtc::scoped_refptr<MediaStreamTrackInterface>)
43 PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
44 AddTransceiver,
45 rtc::scoped_refptr<MediaStreamTrackInterface>,
46 const RtpTransceiverInit&)
47 PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
48 AddTransceiver,
49 cricket::MediaType)
50 PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
51 AddTransceiver,
52 cricket::MediaType,
53 const RtpTransceiverInit&)
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000054 PROXY_METHOD1(rtc::scoped_refptr<DtmfSenderInterface>,
deadbeefd99a2002017-01-18 08:55:23 -080055 CreateDtmfSender,
56 AudioTrackInterface*)
deadbeefbd7d8f72015-12-18 16:58:44 -080057 PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
deadbeeffac06552015-11-25 11:26:01 -080058 CreateSender,
deadbeefbd7d8f72015-12-18 16:58:44 -080059 const std::string&,
deadbeeffac06552015-11-25 11:26:01 -080060 const std::string&)
deadbeef70ab1a12015-09-28 16:53:55 -070061 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpSenderInterface>>,
62 GetSenders)
63 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpReceiverInterface>>,
64 GetReceivers)
Steve Anton9158ef62017-11-27 13:01:52 -080065 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>,
66 GetTransceivers)
deadbeefd99a2002017-01-18 08:55:23 -080067 PROXY_METHOD3(bool,
68 GetStats,
69 StatsObserver*,
wu@webrtc.orgb9a088b2014-02-13 23:18:49 +000070 MediaStreamTrackInterface*,
71 StatsOutputLevel)
hbos74e1a4f2016-09-15 23:33:01 -070072 PROXY_METHOD1(void, GetStats, RTCStatsCollectorCallback*)
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000073 PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>,
deadbeefd99a2002017-01-18 08:55:23 -080074 CreateDataChannel,
75 const std::string&,
76 const DataChannelInit*)
henrike@webrtc.org28e20752013-07-10 00:45:36 +000077 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description)
78 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description)
deadbeeffe4a8a42016-12-20 17:56:17 -080079 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
80 pending_local_description)
81 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
82 pending_remote_description)
83 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
84 current_local_description)
85 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
86 current_remote_description)
deadbeefd99a2002017-01-18 08:55:23 -080087 PROXY_METHOD2(void,
88 CreateOffer,
89 CreateSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000090 const MediaConstraintsInterface*)
deadbeefd99a2002017-01-18 08:55:23 -080091 PROXY_METHOD2(void,
92 CreateAnswer,
93 CreateSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000094 const MediaConstraintsInterface*)
htaa2a49d92016-03-04 02:51:39 -080095 PROXY_METHOD2(void,
96 CreateOffer,
97 CreateSessionDescriptionObserver*,
98 const RTCOfferAnswerOptions&)
99 PROXY_METHOD2(void,
100 CreateAnswer,
101 CreateSessionDescriptionObserver*,
102 const RTCOfferAnswerOptions&)
deadbeefd99a2002017-01-18 08:55:23 -0800103 PROXY_METHOD2(void,
104 SetLocalDescription,
105 SetSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000106 SessionDescriptionInterface*)
deadbeefd99a2002017-01-18 08:55:23 -0800107 PROXY_METHOD2(void,
108 SetRemoteDescription,
109 SetSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000110 SessionDescriptionInterface*)
Henrik Boström31638672017-11-23 17:48:32 +0100111 PROXY_METHOD2(void,
112 SetRemoteDescription,
113 std::unique_ptr<SessionDescriptionInterface>,
114 rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>);
deadbeef46c73892016-11-16 19:42:04 -0800115 PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration);
deadbeef293e9262017-01-11 12:28:30 -0800116 PROXY_METHOD2(bool,
117 SetConfiguration,
118 const PeerConnectionInterface::RTCConfiguration&,
119 RTCError*);
deadbeef1e234612016-12-24 01:43:32 -0800120 PROXY_METHOD1(bool,
deadbeefa67696b2015-09-29 11:56:26 -0700121 SetConfiguration,
deadbeef1e234612016-12-24 01:43:32 -0800122 const PeerConnectionInterface::RTCConfiguration&);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000123 PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*)
Honghai Zhang7fb69db2016-03-14 11:59:18 -0700124 PROXY_METHOD1(bool,
125 RemoveIceCandidates,
126 const std::vector<cricket::Candidate>&);
henrika5f6bf242017-11-01 11:06:56 +0100127 PROXY_METHOD1(void, SetAudioPlayout, bool)
128 PROXY_METHOD1(void, SetAudioRecording, bool)
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000129 PROXY_METHOD1(void, RegisterUMAObserver, UMAObserver*)
zstein4b979802017-06-02 14:37:37 -0700130 PROXY_METHOD1(RTCError, SetBitrate, const BitrateParameters&);
Alex Narest78609d52017-10-20 10:37:47 +0200131 PROXY_METHOD1(void,
132 SetBitrateAllocationStrategy,
133 std::unique_ptr<rtc::BitrateAllocationStrategy>);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000134 PROXY_METHOD0(SignalingState, signaling_state)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000135 PROXY_METHOD0(IceConnectionState, ice_connection_state)
136 PROXY_METHOD0(IceGatheringState, ice_gathering_state)
ivoc14d5dbe2016-07-04 07:06:55 -0700137 PROXY_METHOD2(bool, StartRtcEventLog, rtc::PlatformFile, int64_t)
Bjorn Tereliusde939432017-11-20 17:38:14 +0100138 PROXY_METHOD2(bool,
139 StartRtcEventLog,
140 std::unique_ptr<RtcEventLogOutput>,
141 int64_t);
ivoc14d5dbe2016-07-04 07:06:55 -0700142 PROXY_METHOD0(void, StopRtcEventLog)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000143 PROXY_METHOD0(void, Close)
deadbeefd99a2002017-01-18 08:55:23 -0800144END_PROXY_MAP()
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000145
146} // namespace webrtc
147
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200148#endif // API_PEERCONNECTIONPROXY_H_