blob: 76b45d6ee2f613884acb01852c66aed832996e58 [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
22// Define proxy for PeerConnectionInterface.
nisse72c8d2b2016-04-15 03:49:07 -070023BEGIN_SIGNALING_PROXY_MAP(PeerConnection)
deadbeefd99a2002017-01-18 08:55:23 -080024 PROXY_SIGNALING_THREAD_DESTRUCTOR()
25 PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, local_streams)
26 PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, remote_streams)
perkj@webrtc.orgc2dd5ee2014-11-04 11:31:29 +000027 PROXY_METHOD1(bool, AddStream, MediaStreamInterface*)
henrike@webrtc.org28e20752013-07-10 00:45:36 +000028 PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*)
deadbeefe1f9d832016-01-14 15:35:42 -080029 PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
30 AddTrack,
31 MediaStreamTrackInterface*,
32 std::vector<MediaStreamInterface*>)
33 PROXY_METHOD1(bool, RemoveTrack, RtpSenderInterface*)
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000034 PROXY_METHOD1(rtc::scoped_refptr<DtmfSenderInterface>,
deadbeefd99a2002017-01-18 08:55:23 -080035 CreateDtmfSender,
36 AudioTrackInterface*)
deadbeefbd7d8f72015-12-18 16:58:44 -080037 PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
deadbeeffac06552015-11-25 11:26:01 -080038 CreateSender,
deadbeefbd7d8f72015-12-18 16:58:44 -080039 const std::string&,
deadbeeffac06552015-11-25 11:26:01 -080040 const std::string&)
deadbeef70ab1a12015-09-28 16:53:55 -070041 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpSenderInterface>>,
42 GetSenders)
43 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpReceiverInterface>>,
44 GetReceivers)
deadbeefd99a2002017-01-18 08:55:23 -080045 PROXY_METHOD3(bool,
46 GetStats,
47 StatsObserver*,
wu@webrtc.orgb9a088b2014-02-13 23:18:49 +000048 MediaStreamTrackInterface*,
49 StatsOutputLevel)
hbos74e1a4f2016-09-15 23:33:01 -070050 PROXY_METHOD1(void, GetStats, RTCStatsCollectorCallback*)
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000051 PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>,
deadbeefd99a2002017-01-18 08:55:23 -080052 CreateDataChannel,
53 const std::string&,
54 const DataChannelInit*)
henrike@webrtc.org28e20752013-07-10 00:45:36 +000055 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description)
56 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description)
deadbeeffe4a8a42016-12-20 17:56:17 -080057 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
58 pending_local_description)
59 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
60 pending_remote_description)
61 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
62 current_local_description)
63 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
64 current_remote_description)
deadbeefd99a2002017-01-18 08:55:23 -080065 PROXY_METHOD2(void,
66 CreateOffer,
67 CreateSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000068 const MediaConstraintsInterface*)
deadbeefd99a2002017-01-18 08:55:23 -080069 PROXY_METHOD2(void,
70 CreateAnswer,
71 CreateSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000072 const MediaConstraintsInterface*)
htaa2a49d92016-03-04 02:51:39 -080073 PROXY_METHOD2(void,
74 CreateOffer,
75 CreateSessionDescriptionObserver*,
76 const RTCOfferAnswerOptions&)
77 PROXY_METHOD2(void,
78 CreateAnswer,
79 CreateSessionDescriptionObserver*,
80 const RTCOfferAnswerOptions&)
deadbeefd99a2002017-01-18 08:55:23 -080081 PROXY_METHOD2(void,
82 SetLocalDescription,
83 SetSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000084 SessionDescriptionInterface*)
deadbeefd99a2002017-01-18 08:55:23 -080085 PROXY_METHOD2(void,
86 SetRemoteDescription,
87 SetSessionDescriptionObserver*,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000088 SessionDescriptionInterface*)
deadbeef46c73892016-11-16 19:42:04 -080089 PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration);
deadbeef293e9262017-01-11 12:28:30 -080090 PROXY_METHOD2(bool,
91 SetConfiguration,
92 const PeerConnectionInterface::RTCConfiguration&,
93 RTCError*);
deadbeef1e234612016-12-24 01:43:32 -080094 PROXY_METHOD1(bool,
deadbeefa67696b2015-09-29 11:56:26 -070095 SetConfiguration,
deadbeef1e234612016-12-24 01:43:32 -080096 const PeerConnectionInterface::RTCConfiguration&);
henrike@webrtc.org28e20752013-07-10 00:45:36 +000097 PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*)
Honghai Zhang7fb69db2016-03-14 11:59:18 -070098 PROXY_METHOD1(bool,
99 RemoveIceCandidates,
100 const std::vector<cricket::Candidate>&);
buildbot@webrtc.org1567b8c2014-05-08 19:54:16 +0000101 PROXY_METHOD1(void, RegisterUMAObserver, UMAObserver*)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000102 PROXY_METHOD0(SignalingState, signaling_state)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000103 PROXY_METHOD0(IceConnectionState, ice_connection_state)
104 PROXY_METHOD0(IceGatheringState, ice_gathering_state)
ivoc14d5dbe2016-07-04 07:06:55 -0700105 PROXY_METHOD2(bool, StartRtcEventLog, rtc::PlatformFile, int64_t)
106 PROXY_METHOD0(void, StopRtcEventLog)
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000107 PROXY_METHOD0(void, Close)
deadbeefd99a2002017-01-18 08:55:23 -0800108END_PROXY_MAP()
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000109
110} // namespace webrtc
111
Henrik Kjellander15583c12016-02-10 10:53:12 +0100112#endif // WEBRTC_API_PEERCONNECTIONPROXY_H_