blob: 551af4823ea6369f5f2e0bbe424e575a63f5318b [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>)
Niels Möller7b04a912019-09-13 15:41:21 +020075PROXY_METHOD0(void, ClearStatsCache)
Yves Gerey665174f2018-06-19 15:03:05 +020076PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>,
77 CreateDataChannel,
78 const std::string&,
79 const DataChannelInit*)
80PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description)
81PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description)
82PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
Yves Gerey665174f2018-06-19 15:03:05 +020083 current_local_description)
84PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
85 current_remote_description)
Steve Antone9203512018-12-18 16:29:34 -080086PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
87 pending_local_description)
88PROXY_CONSTMETHOD0(const SessionDescriptionInterface*,
89 pending_remote_description)
Henrik Boström79b69802019-07-18 11:16:56 +020090PROXY_METHOD0(void, RestartIce)
Yves Gerey665174f2018-06-19 15:03:05 +020091PROXY_METHOD2(void,
92 CreateOffer,
93 CreateSessionDescriptionObserver*,
Yves Gerey665174f2018-06-19 15:03:05 +020094 const RTCOfferAnswerOptions&)
95PROXY_METHOD2(void,
96 CreateAnswer,
97 CreateSessionDescriptionObserver*,
98 const RTCOfferAnswerOptions&)
99PROXY_METHOD2(void,
100 SetLocalDescription,
101 SetSessionDescriptionObserver*,
102 SessionDescriptionInterface*)
103PROXY_METHOD2(void,
104 SetRemoteDescription,
105 SetSessionDescriptionObserver*,
106 SessionDescriptionInterface*)
107PROXY_METHOD2(void,
108 SetRemoteDescription,
109 std::unique_ptr<SessionDescriptionInterface>,
Steve Antone9203512018-12-18 16:29:34 -0800110 rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>)
111PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration)
Niels Möller2579f0c2019-08-19 09:58:17 +0200112PROXY_METHOD1(RTCError,
Yves Gerey665174f2018-06-19 15:03:05 +0200113 SetConfiguration,
Steve Antone9203512018-12-18 16:29:34 -0800114 const PeerConnectionInterface::RTCConfiguration&)
Yves Gerey665174f2018-06-19 15:03:05 +0200115PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*)
Steve Antone9203512018-12-18 16:29:34 -0800116PROXY_METHOD1(bool, RemoveIceCandidates, const std::vector<cricket::Candidate>&)
117PROXY_METHOD1(RTCError, SetBitrate, const BitrateSettings&)
Yves Gerey665174f2018-06-19 15:03:05 +0200118PROXY_METHOD1(void, SetAudioPlayout, bool)
119PROXY_METHOD1(void, SetAudioRecording, bool)
Harald Alvestrand41390472018-12-03 18:45:19 +0100120PROXY_METHOD1(rtc::scoped_refptr<DtlsTransportInterface>,
121 LookupDtlsTransportByMid,
122 const std::string&)
Harald Alvestrandcdea67d2019-02-28 21:33:00 +0100123PROXY_CONSTMETHOD0(rtc::scoped_refptr<SctpTransportInterface>, GetSctpTransport)
Yves Gerey665174f2018-06-19 15:03:05 +0200124PROXY_METHOD0(SignalingState, signaling_state)
125PROXY_METHOD0(IceConnectionState, ice_connection_state)
Steve Antone9203512018-12-18 16:29:34 -0800126PROXY_METHOD0(IceConnectionState, standardized_ice_connection_state)
127PROXY_METHOD0(PeerConnectionState, peer_connection_state)
Yves Gerey665174f2018-06-19 15:03:05 +0200128PROXY_METHOD0(IceGatheringState, ice_gathering_state)
Yves Gerey665174f2018-06-19 15:03:05 +0200129PROXY_METHOD2(bool,
130 StartRtcEventLog,
131 std::unique_ptr<RtcEventLogOutput>,
Steve Antone9203512018-12-18 16:29:34 -0800132 int64_t)
Tim Haloun74e63b82019-06-04 11:23:32 -0700133PROXY_METHOD1(bool, StartRtcEventLog, std::unique_ptr<RtcEventLogOutput>)
Yves Gerey665174f2018-06-19 15:03:05 +0200134PROXY_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
Steve Anton10542f22019-01-11 09:11:00 -0800140#endif // API_PEER_CONNECTION_PROXY_H_