blob: 9325adcec387fd8c04302f0ce2774ee3b4921a37 [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:361/*
kjellanderb24317b2016-02-10 15:54:432 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:363 *
kjellanderb24317b2016-02-10 15:54:434 * 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:369 */
10
Mirko Bonadei92ea95e2017-09-15 04:47:3111#ifndef API_PEERCONNECTIONPROXY_H_
12#define API_PEERCONNECTIONPROXY_H_
henrike@webrtc.org28e20752013-07-10 00:45:3613
Elad Alon99c3fe52017-10-13 14:29:4014#include <memory>
oprypin803dc292017-02-01 09:55:5915#include <string>
16#include <vector>
17
Mirko Bonadei92ea95e2017-09-15 04:47:3118#include "api/peerconnectioninterface.h"
19#include "api/proxy.h"
henrike@webrtc.org28e20752013-07-10 00:45:3620
21namespace webrtc {
22
deadbeefb10f32f2017-02-08 09:38:2123// 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 10:49:0725BEGIN_SIGNALING_PROXY_MAP(PeerConnection)
deadbeefd99a2002017-01-18 16:55:2326 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:2929 PROXY_METHOD1(bool, AddStream, MediaStreamInterface*)
henrike@webrtc.org28e20752013-07-10 00:45:3630 PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*)
Steve Antonf9381f02017-12-14 18:23:5731 PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>,
Steve Anton2d6c76a2018-01-06 01:10:5232 AddTrack,
Steve Antonf9381f02017-12-14 18:23:5733 rtc::scoped_refptr<MediaStreamTrackInterface>,
34 const std::vector<std::string>&);
deadbeefe1f9d832016-01-14 23:35:4235 PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
36 AddTrack,
37 MediaStreamTrackInterface*,
38 std::vector<MediaStreamInterface*>)
39 PROXY_METHOD1(bool, RemoveTrack, RtpSenderInterface*)
Steve Anton9158ef62017-11-27 21:01:5240 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:5254 PROXY_METHOD1(rtc::scoped_refptr<DtmfSenderInterface>,
deadbeefd99a2002017-01-18 16:55:2355 CreateDtmfSender,
56 AudioTrackInterface*)
deadbeefbd7d8f72015-12-19 00:58:4457 PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
deadbeeffac06552015-11-25 19:26:0158 CreateSender,
deadbeefbd7d8f72015-12-19 00:58:4459 const std::string&,
deadbeeffac06552015-11-25 19:26:0160 const std::string&)
deadbeef70ab1a12015-09-28 23:53:5561 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 21:01:5265 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>,
66 GetTransceivers)
deadbeefd99a2002017-01-18 16:55:2367 PROXY_METHOD3(bool,
68 GetStats,
69 StatsObserver*,
wu@webrtc.orgb9a088b2014-02-13 23:18:4970 MediaStreamTrackInterface*,
71 StatsOutputLevel)
hbos74e1a4f2016-09-16 06:33:0172 PROXY_METHOD1(void, GetStats, RTCStatsCollectorCallback*)
Henrik Boström1df1bf82018-03-20 12:24:2073 PROXY_METHOD2(void,
74 GetStats,
75 rtc::scoped_refptr<RtpSenderInterface>,
76 rtc::scoped_refptr<RTCStatsCollectorCallback>);
77 PROXY_METHOD2(void,
78 GetStats,
79 rtc::scoped_refptr<RtpReceiverInterface>,
80 rtc::scoped_refptr<RTCStatsCollectorCallback>);
buildbot@webrtc.orgd4e598d2014-07-29 17:36:5281 PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>,
deadbeefd99a2002017-01-18 16:55:2382 CreateDataChannel,
83 const std::string&,
84 const DataChannelInit*)
henrike@webrtc.org28e20752013-07-10 00:45:3685 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description)
86 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description)
deadbeeffe4a8a42016-12-21 01:56:1787 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
88 pending_local_description)
89 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
90 pending_remote_description)
91 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
92 current_local_description)
93 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
94 current_remote_description)
deadbeefd99a2002017-01-18 16:55:2395 PROXY_METHOD2(void,
96 CreateOffer,
97 CreateSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:3698 const MediaConstraintsInterface*)
deadbeefd99a2002017-01-18 16:55:2399 PROXY_METHOD2(void,
100 CreateAnswer,
101 CreateSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36102 const MediaConstraintsInterface*)
htaa2a49d92016-03-04 10:51:39103 PROXY_METHOD2(void,
104 CreateOffer,
105 CreateSessionDescriptionObserver*,
106 const RTCOfferAnswerOptions&)
107 PROXY_METHOD2(void,
108 CreateAnswer,
109 CreateSessionDescriptionObserver*,
110 const RTCOfferAnswerOptions&)
deadbeefd99a2002017-01-18 16:55:23111 PROXY_METHOD2(void,
112 SetLocalDescription,
113 SetSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36114 SessionDescriptionInterface*)
deadbeefd99a2002017-01-18 16:55:23115 PROXY_METHOD2(void,
116 SetRemoteDescription,
117 SetSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36118 SessionDescriptionInterface*)
Henrik Boström31638672017-11-23 16:48:32119 PROXY_METHOD2(void,
120 SetRemoteDescription,
121 std::unique_ptr<SessionDescriptionInterface>,
122 rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>);
deadbeef46c73892016-11-17 03:42:04123 PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration);
deadbeef293e9262017-01-11 20:28:30124 PROXY_METHOD2(bool,
125 SetConfiguration,
126 const PeerConnectionInterface::RTCConfiguration&,
127 RTCError*);
deadbeef1e234612016-12-24 09:43:32128 PROXY_METHOD1(bool,
deadbeefa67696b2015-09-29 18:56:26129 SetConfiguration,
deadbeef1e234612016-12-24 09:43:32130 const PeerConnectionInterface::RTCConfiguration&);
henrike@webrtc.org28e20752013-07-10 00:45:36131 PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*)
Honghai Zhang7fb69db2016-03-14 18:59:18132 PROXY_METHOD1(bool,
133 RemoveIceCandidates,
134 const std::vector<cricket::Candidate>&);
henrika5f6bf242017-11-01 10:06:56135 PROXY_METHOD1(void, SetAudioPlayout, bool)
136 PROXY_METHOD1(void, SetAudioRecording, bool)
buildbot@webrtc.org1567b8c2014-05-08 19:54:16137 PROXY_METHOD1(void, RegisterUMAObserver, UMAObserver*)
zstein4b979802017-06-02 21:37:37138 PROXY_METHOD1(RTCError, SetBitrate, const BitrateParameters&);
Alex Narest78609d52017-10-20 08:37:47139 PROXY_METHOD1(void,
140 SetBitrateAllocationStrategy,
141 std::unique_ptr<rtc::BitrateAllocationStrategy>);
henrike@webrtc.org28e20752013-07-10 00:45:36142 PROXY_METHOD0(SignalingState, signaling_state)
henrike@webrtc.org28e20752013-07-10 00:45:36143 PROXY_METHOD0(IceConnectionState, ice_connection_state)
144 PROXY_METHOD0(IceGatheringState, ice_gathering_state)
ivoc14d5dbe2016-07-04 14:06:55145 PROXY_METHOD2(bool, StartRtcEventLog, rtc::PlatformFile, int64_t)
Bjorn Tereliusde939432017-11-20 16:38:14146 PROXY_METHOD2(bool,
147 StartRtcEventLog,
148 std::unique_ptr<RtcEventLogOutput>,
149 int64_t);
ivoc14d5dbe2016-07-04 14:06:55150 PROXY_METHOD0(void, StopRtcEventLog)
henrike@webrtc.org28e20752013-07-10 00:45:36151 PROXY_METHOD0(void, Close)
deadbeefd99a2002017-01-18 16:55:23152END_PROXY_MAP()
henrike@webrtc.org28e20752013-07-10 00:45:36153
154} // namespace webrtc
155
Mirko Bonadei92ea95e2017-09-15 04:47:31156#endif // API_PEERCONNECTIONPROXY_H_