blob: e88190647efbb674e28412fd82860bd5dddaf909 [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
Steve Anton10542f22019-01-11 09:11:00 -080011#ifndef API_PEER_CONNECTION_PROXY_H_
12#define API_PEER_CONNECTION_PROXY_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
Steve Anton10542f22019-01-11 09:11:00 -080018#include "api/peer_connection_interface.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020019#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)
Henrik Boström79b69802019-07-18 11:16:56 +020089PROXY_METHOD0(void, RestartIce)
Yves Gerey665174f2018-06-19 15:03:05 +020090PROXY_METHOD2(void,
91 CreateOffer,
92 CreateSessionDescriptionObserver*,
Yves Gerey665174f2018-06-19 15:03:05 +020093 const RTCOfferAnswerOptions&)
94PROXY_METHOD2(void,
95 CreateAnswer,
96 CreateSessionDescriptionObserver*,
97 const RTCOfferAnswerOptions&)
98PROXY_METHOD2(void,
99 SetLocalDescription,
100 SetSessionDescriptionObserver*,
101 SessionDescriptionInterface*)
102PROXY_METHOD2(void,
103 SetRemoteDescription,
104 SetSessionDescriptionObserver*,
105 SessionDescriptionInterface*)
106PROXY_METHOD2(void,
107 SetRemoteDescription,
108 std::unique_ptr<SessionDescriptionInterface>,
Steve Antone9203512018-12-18 16:29:34 -0800109 rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>)
110PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration)
Niels Möller2579f0c2019-08-19 09:58:17 +0200111PROXY_METHOD1(RTCError,
Yves Gerey665174f2018-06-19 15:03:05 +0200112 SetConfiguration,
Steve Antone9203512018-12-18 16:29:34 -0800113 const PeerConnectionInterface::RTCConfiguration&)
Yves Gerey665174f2018-06-19 15:03:05 +0200114PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*)
Steve Antone9203512018-12-18 16:29:34 -0800115PROXY_METHOD1(bool, RemoveIceCandidates, const std::vector<cricket::Candidate>&)
116PROXY_METHOD1(RTCError, SetBitrate, const BitrateSettings&)
Yves Gerey665174f2018-06-19 15:03:05 +0200117PROXY_METHOD1(void, SetAudioPlayout, bool)
118PROXY_METHOD1(void, SetAudioRecording, bool)
Harald Alvestrand41390472018-12-03 18:45:19 +0100119PROXY_METHOD1(rtc::scoped_refptr<DtlsTransportInterface>,
120 LookupDtlsTransportByMid,
121 const std::string&)
Harald Alvestrandcdea67d2019-02-28 21:33:00 +0100122PROXY_CONSTMETHOD0(rtc::scoped_refptr<SctpTransportInterface>, GetSctpTransport)
Yves Gerey665174f2018-06-19 15:03:05 +0200123PROXY_METHOD0(SignalingState, signaling_state)
124PROXY_METHOD0(IceConnectionState, ice_connection_state)
Steve Antone9203512018-12-18 16:29:34 -0800125PROXY_METHOD0(IceConnectionState, standardized_ice_connection_state)
126PROXY_METHOD0(PeerConnectionState, peer_connection_state)
Yves Gerey665174f2018-06-19 15:03:05 +0200127PROXY_METHOD0(IceGatheringState, ice_gathering_state)
Yves Gerey665174f2018-06-19 15:03:05 +0200128PROXY_METHOD2(bool,
129 StartRtcEventLog,
130 std::unique_ptr<RtcEventLogOutput>,
Steve Antone9203512018-12-18 16:29:34 -0800131 int64_t)
Tim Haloun74e63b82019-06-04 11:23:32 -0700132PROXY_METHOD1(bool, StartRtcEventLog, std::unique_ptr<RtcEventLogOutput>)
Yves Gerey665174f2018-06-19 15:03:05 +0200133PROXY_METHOD0(void, StopRtcEventLog)
134PROXY_METHOD0(void, Close)
deadbeefd99a2002017-01-18 08:55:23 -0800135END_PROXY_MAP()
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000136
137} // namespace webrtc
138
Steve Anton10542f22019-01-11 09:11:00 -0800139#endif // API_PEER_CONNECTION_PROXY_H_