blob: e69efc04eda80713c70c484dcecebcbc0e7f70a0 [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>,
Steve Antone9203512018-12-18 16:29:34 -080034 const std::vector<std::string>&)
Yves Gerey665174f2018-06-19 15:03:05 +020035PROXY_METHOD1(bool, RemoveTrack, RtpSenderInterface*)
Steve Antone9203512018-12-18 16:29:34 -080036PROXY_METHOD1(RTCError, RemoveTrackNew, rtc::scoped_refptr<RtpSenderInterface>)
Yves Gerey665174f2018-06-19 15:03:05 +020037PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
38 AddTransceiver,
39 rtc::scoped_refptr<MediaStreamTrackInterface>)
40PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
41 AddTransceiver,
42 rtc::scoped_refptr<MediaStreamTrackInterface>,
43 const RtpTransceiverInit&)
44PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
45 AddTransceiver,
46 cricket::MediaType)
47PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
48 AddTransceiver,
49 cricket::MediaType,
50 const RtpTransceiverInit&)
Yves Gerey665174f2018-06-19 15:03:05 +020051PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
52 CreateSender,
53 const std::string&,
54 const std::string&)
55PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpSenderInterface>>,
56 GetSenders)
57PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpReceiverInterface>>,
58 GetReceivers)
59PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>,
60 GetTransceivers)
61PROXY_METHOD3(bool,
62 GetStats,
63 StatsObserver*,
64 MediaStreamTrackInterface*,
65 StatsOutputLevel)
66PROXY_METHOD1(void, GetStats, RTCStatsCollectorCallback*)
67PROXY_METHOD2(void,
68 GetStats,
69 rtc::scoped_refptr<RtpSenderInterface>,
Steve Antone9203512018-12-18 16:29:34 -080070 rtc::scoped_refptr<RTCStatsCollectorCallback>)
Yves Gerey665174f2018-06-19 15:03:05 +020071PROXY_METHOD2(void,
72 GetStats,
73 rtc::scoped_refptr<RtpReceiverInterface>,
Steve Antone9203512018-12-18 16:29:34 -080074 rtc::scoped_refptr<RTCStatsCollectorCallback>)
Yves Gerey665174f2018-06-19 15:03:05 +020075PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>,
76 CreateDataChannel,
77 const std::string&,
78 const DataChannelInit*)
79PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description)
80PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description)
81PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
Yves Gerey665174f2018-06-19 15:03:05 +020082 current_local_description)
83PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
84 current_remote_description)
Steve Antone9203512018-12-18 16:29:34 -080085PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
86 pending_local_description)
87PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
88 pending_remote_description)
Yves Gerey665174f2018-06-19 15:03:05 +020089PROXY_METHOD2(void,
90 CreateOffer,
91 CreateSessionDescriptionObserver*,
Yves Gerey665174f2018-06-19 15:03:05 +020092 const RTCOfferAnswerOptions&)
93PROXY_METHOD2(void,
94 CreateAnswer,
95 CreateSessionDescriptionObserver*,
96 const RTCOfferAnswerOptions&)
97PROXY_METHOD2(void,
98 SetLocalDescription,
99 SetSessionDescriptionObserver*,
100 SessionDescriptionInterface*)
101PROXY_METHOD2(void,
102 SetRemoteDescription,
103 SetSessionDescriptionObserver*,
104 SessionDescriptionInterface*)
105PROXY_METHOD2(void,
106 SetRemoteDescription,
107 std::unique_ptr<SessionDescriptionInterface>,
Steve Antone9203512018-12-18 16:29:34 -0800108 rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>)
109PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration)
Yves Gerey665174f2018-06-19 15:03:05 +0200110PROXY_METHOD2(bool,
111 SetConfiguration,
112 const PeerConnectionInterface::RTCConfiguration&,
Steve Antone9203512018-12-18 16:29:34 -0800113 RTCError*)
Yves Gerey665174f2018-06-19 15:03:05 +0200114PROXY_METHOD1(bool,
115 SetConfiguration,
Steve Antone9203512018-12-18 16:29:34 -0800116 const PeerConnectionInterface::RTCConfiguration&)
Yves Gerey665174f2018-06-19 15:03:05 +0200117PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*)
Steve Antone9203512018-12-18 16:29:34 -0800118PROXY_METHOD1(bool, RemoveIceCandidates, const std::vector<cricket::Candidate>&)
119PROXY_METHOD1(RTCError, SetBitrate, const BitrateSettings&)
120PROXY_METHOD1(void,
121 SetBitrateAllocationStrategy,
122 std::unique_ptr<rtc::BitrateAllocationStrategy>)
Yves Gerey665174f2018-06-19 15:03:05 +0200123PROXY_METHOD1(void, SetAudioPlayout, bool)
124PROXY_METHOD1(void, SetAudioRecording, bool)
Harald Alvestrand41390472018-12-03 18:45:19 +0100125PROXY_METHOD1(rtc::scoped_refptr<DtlsTransportInterface>,
126 LookupDtlsTransportByMid,
127 const std::string&)
Yves Gerey665174f2018-06-19 15:03:05 +0200128PROXY_METHOD0(SignalingState, signaling_state)
129PROXY_METHOD0(IceConnectionState, ice_connection_state)
Steve Antone9203512018-12-18 16:29:34 -0800130PROXY_METHOD0(IceConnectionState, standardized_ice_connection_state)
131PROXY_METHOD0(PeerConnectionState, peer_connection_state)
Yves Gerey665174f2018-06-19 15:03:05 +0200132PROXY_METHOD0(IceGatheringState, ice_gathering_state)
133PROXY_METHOD2(bool, StartRtcEventLog, rtc::PlatformFile, int64_t)
134PROXY_METHOD2(bool,
135 StartRtcEventLog,
136 std::unique_ptr<RtcEventLogOutput>,
Steve Antone9203512018-12-18 16:29:34 -0800137 int64_t)
Yves Gerey665174f2018-06-19 15:03:05 +0200138PROXY_METHOD0(void, StopRtcEventLog)
139PROXY_METHOD0(void, Close)
deadbeefd99a2002017-01-18 08:55:23 -0800140END_PROXY_MAP()
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000141
142} // namespace webrtc
143
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200144#endif // API_PEERCONNECTIONPROXY_H_