blob: 78fe4027db917bef4895269fd24158507bb7f2c5 [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*)
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000036 PROXY_METHOD1(rtc::scoped_refptr<DtmfSenderInterface>,
deadbeefd99a2002017-01-18 08:55:23 -080037 CreateDtmfSender,
38 AudioTrackInterface*)
deadbeefbd7d8f72015-12-18 16:58:44 -080039 PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
deadbeeffac06552015-11-25 11:26:01 -080040 CreateSender,
deadbeefbd7d8f72015-12-18 16:58:44 -080041 const std::string&,
deadbeeffac06552015-11-25 11:26:01 -080042 const std::string&)
deadbeef70ab1a12015-09-28 16:53:55 -070043 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpSenderInterface>>,
44 GetSenders)
45 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpReceiverInterface>>,
46 GetReceivers)
deadbeefd99a2002017-01-18 08:55:23 -080047 PROXY_METHOD3(bool,
48 GetStats,
49 StatsObserver*,
wu@webrtc.orgb9a088b2014-02-13 23:18:49 +000050 MediaStreamTrackInterface*,
51 StatsOutputLevel)
hbos74e1a4f2016-09-15 23:33:01 -070052 PROXY_METHOD1(void, GetStats, RTCStatsCollectorCallback*)
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000053 PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>,
deadbeefd99a2002017-01-18 08:55:23 -080054 CreateDataChannel,
55 const std::string&,
56 const DataChannelInit*)
henrike@webrtc.org28e20752013-07-10 00:45:36 +000057 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description)
58 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description)
deadbeeffe4a8a42016-12-20 17:56:17 -080059 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
60 pending_local_description)
61 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
62 pending_remote_description)
63 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
64 current_local_description)
65 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
66 current_remote_description)
deadbeefd99a2002017-01-18 08:55:23 -080067 PROXY_METHOD2(void,
68 CreateOffer,
69 CreateSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000070 const MediaConstraintsInterface*)
deadbeefd99a2002017-01-18 08:55:23 -080071 PROXY_METHOD2(void,
72 CreateAnswer,
73 CreateSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000074 const MediaConstraintsInterface*)
htaa2a49d92016-03-04 02:51:39 -080075 PROXY_METHOD2(void,
76 CreateOffer,
77 CreateSessionDescriptionObserver*,
78 const RTCOfferAnswerOptions&)
79 PROXY_METHOD2(void,
80 CreateAnswer,
81 CreateSessionDescriptionObserver*,
82 const RTCOfferAnswerOptions&)
deadbeefd99a2002017-01-18 08:55:23 -080083 PROXY_METHOD2(void,
84 SetLocalDescription,
85 SetSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000086 SessionDescriptionInterface*)
deadbeefd99a2002017-01-18 08:55:23 -080087 PROXY_METHOD2(void,
88 SetRemoteDescription,
89 SetSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000090 SessionDescriptionInterface*)
deadbeef46c73892016-11-16 19:42:04 -080091 PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration);
deadbeef293e9262017-01-11 12:28:30 -080092 PROXY_METHOD2(bool,
93 SetConfiguration,
94 const PeerConnectionInterface::RTCConfiguration&,
95 RTCError*);
deadbeef1e234612016-12-24 01:43:32 -080096 PROXY_METHOD1(bool,
deadbeefa67696b2015-09-29 11:56:26 -070097 SetConfiguration,
deadbeef1e234612016-12-24 01:43:32 -080098 const PeerConnectionInterface::RTCConfiguration&);
henrike@webrtc.org28e20752013-07-10 00:45:36 +000099 PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*)
Honghai Zhang7fb69db2016-03-14 11:59:18 -0700100 PROXY_METHOD1(bool,
101 RemoveIceCandidates,
102 const std::vector<cricket::Candidate>&);
henrika5f6bf242017-11-01 11:06:56 +0100103 PROXY_METHOD1(void, SetAudioPlayout, bool)
104 PROXY_METHOD1(void, SetAudioRecording, bool)
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000105 PROXY_METHOD1(void, RegisterUMAObserver, UMAObserver*)
zstein4b979802017-06-02 14:37:37 -0700106 PROXY_METHOD1(RTCError, SetBitrate, const BitrateParameters&);
Alex Narest78609d52017-10-20 10:37:47 +0200107 PROXY_METHOD1(void,
108 SetBitrateAllocationStrategy,
109 std::unique_ptr<rtc::BitrateAllocationStrategy>);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000110 PROXY_METHOD0(SignalingState, signaling_state)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000111 PROXY_METHOD0(IceConnectionState, ice_connection_state)
112 PROXY_METHOD0(IceGatheringState, ice_gathering_state)
ivoc14d5dbe2016-07-04 07:06:55 -0700113 PROXY_METHOD2(bool, StartRtcEventLog, rtc::PlatformFile, int64_t)
Elad Alon99c3fe52017-10-13 16:29:40 +0200114 PROXY_METHOD1(bool, StartRtcEventLog, std::unique_ptr<RtcEventLogOutput>)
ivoc14d5dbe2016-07-04 07:06:55 -0700115 PROXY_METHOD0(void, StopRtcEventLog)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000116 PROXY_METHOD0(void, Close)
deadbeefd99a2002017-01-18 08:55:23 -0800117END_PROXY_MAP()
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000118
119} // namespace webrtc
120
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200121#endif // API_PEERCONNECTIONPROXY_H_