blob: 6b66bccc4e5f58da245db82aac7ba92e055d262a [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)
Yves Gerey665174f2018-06-19 15:03:05 +020026PROXY_SIGNALING_THREAD_DESTRUCTOR()
27PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, local_streams)
28PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, remote_streams)
29PROXY_METHOD1(bool, AddStream, MediaStreamInterface*)
30PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*)
31PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>,
32 AddTrack,
33 rtc::scoped_refptr<MediaStreamTrackInterface>,
34 const std::vector<std::string>&);
Yves Gerey665174f2018-06-19 15:03:05 +020035PROXY_METHOD1(bool, RemoveTrack, RtpSenderInterface*)
36PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
37 AddTransceiver,
38 rtc::scoped_refptr<MediaStreamTrackInterface>)
39PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
40 AddTransceiver,
41 rtc::scoped_refptr<MediaStreamTrackInterface>,
42 const RtpTransceiverInit&)
43PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
44 AddTransceiver,
45 cricket::MediaType)
46PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
47 AddTransceiver,
48 cricket::MediaType,
49 const RtpTransceiverInit&)
Yves Gerey665174f2018-06-19 15:03:05 +020050PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
51 CreateSender,
52 const std::string&,
53 const std::string&)
54PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpSenderInterface>>,
55 GetSenders)
56PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpReceiverInterface>>,
57 GetReceivers)
58PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>,
59 GetTransceivers)
60PROXY_METHOD3(bool,
61 GetStats,
62 StatsObserver*,
63 MediaStreamTrackInterface*,
64 StatsOutputLevel)
65PROXY_METHOD1(void, GetStats, RTCStatsCollectorCallback*)
66PROXY_METHOD2(void,
67 GetStats,
68 rtc::scoped_refptr<RtpSenderInterface>,
69 rtc::scoped_refptr<RTCStatsCollectorCallback>);
70PROXY_METHOD2(void,
71 GetStats,
72 rtc::scoped_refptr<RtpReceiverInterface>,
73 rtc::scoped_refptr<RTCStatsCollectorCallback>);
74PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>,
75 CreateDataChannel,
76 const std::string&,
77 const DataChannelInit*)
78PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description)
79PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description)
80PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
81 pending_local_description)
82PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
83 pending_remote_description)
84PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
85 current_local_description)
86PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
87 current_remote_description)
88PROXY_METHOD2(void,
89 CreateOffer,
90 CreateSessionDescriptionObserver*,
Yves Gerey665174f2018-06-19 15:03:05 +020091 const RTCOfferAnswerOptions&)
92PROXY_METHOD2(void,
93 CreateAnswer,
94 CreateSessionDescriptionObserver*,
95 const RTCOfferAnswerOptions&)
96PROXY_METHOD2(void,
97 SetLocalDescription,
98 SetSessionDescriptionObserver*,
99 SessionDescriptionInterface*)
100PROXY_METHOD2(void,
101 SetRemoteDescription,
102 SetSessionDescriptionObserver*,
103 SessionDescriptionInterface*)
104PROXY_METHOD2(void,
105 SetRemoteDescription,
106 std::unique_ptr<SessionDescriptionInterface>,
107 rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>);
108PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration);
109PROXY_METHOD2(bool,
110 SetConfiguration,
111 const PeerConnectionInterface::RTCConfiguration&,
112 RTCError*);
113PROXY_METHOD1(bool,
114 SetConfiguration,
115 const PeerConnectionInterface::RTCConfiguration&);
116PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*)
117PROXY_METHOD1(bool,
118 RemoveIceCandidates,
119 const std::vector<cricket::Candidate>&);
120PROXY_METHOD1(void, SetAudioPlayout, bool)
121PROXY_METHOD1(void, SetAudioRecording, bool)
Yves Gerey665174f2018-06-19 15:03:05 +0200122PROXY_METHOD1(RTCError, SetBitrate, const BitrateSettings&);
123PROXY_METHOD1(void,
124 SetBitrateAllocationStrategy,
125 std::unique_ptr<rtc::BitrateAllocationStrategy>);
126PROXY_METHOD0(SignalingState, signaling_state)
127PROXY_METHOD0(IceConnectionState, ice_connection_state)
128PROXY_METHOD0(IceGatheringState, ice_gathering_state)
129PROXY_METHOD2(bool, StartRtcEventLog, rtc::PlatformFile, int64_t)
130PROXY_METHOD2(bool,
131 StartRtcEventLog,
132 std::unique_ptr<RtcEventLogOutput>,
133 int64_t);
134PROXY_METHOD0(void, StopRtcEventLog)
135PROXY_METHOD0(void, Close)
deadbeefd99a2002017-01-18 08:55:23 -0800136END_PROXY_MAP()
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000137
138} // namespace webrtc
139
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200140#endif // API_PEERCONNECTIONPROXY_H_