henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 1 | /* |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 2 | * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 3 | * |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 4 | * 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.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef API_PEERCONNECTIONPROXY_H_ |
| 12 | #define API_PEERCONNECTIONPROXY_H_ |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 13 | |
Elad Alon | 99c3fe5 | 2017-10-13 16:29:40 +0200 | [diff] [blame] | 14 | #include <memory> |
oprypin | 803dc29 | 2017-02-01 01:55:59 -0800 | [diff] [blame] | 15 | #include <string> |
| 16 | #include <vector> |
| 17 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 18 | #include "api/peerconnectioninterface.h" |
| 19 | #include "api/proxy.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 20 | |
| 21 | namespace webrtc { |
| 22 | |
deadbeef | b10f32f | 2017-02-08 01:38:21 -0800 | [diff] [blame] | 23 | // TODO(deadbeef): Move this to .cc file and out of api/. What threads methods |
| 24 | // are called on is an implementation detail. |
nisse | 72c8d2b | 2016-04-15 03:49:07 -0700 | [diff] [blame] | 25 | BEGIN_SIGNALING_PROXY_MAP(PeerConnection) |
deadbeef | d99a200 | 2017-01-18 08:55:23 -0800 | [diff] [blame] | 26 | PROXY_SIGNALING_THREAD_DESTRUCTOR() |
| 27 | PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, local_streams) |
| 28 | PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, remote_streams) |
perkj@webrtc.org | c2dd5ee | 2014-11-04 11:31:29 +0000 | [diff] [blame] | 29 | PROXY_METHOD1(bool, AddStream, MediaStreamInterface*) |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 30 | PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*) |
deadbeef | e1f9d83 | 2016-01-14 15:35:42 -0800 | [diff] [blame] | 31 | PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>, |
| 32 | AddTrack, |
| 33 | MediaStreamTrackInterface*, |
| 34 | std::vector<MediaStreamInterface*>) |
| 35 | PROXY_METHOD1(bool, RemoveTrack, RtpSenderInterface*) |
Steve Anton | 9158ef6 | 2017-11-27 13:01:52 -0800 | [diff] [blame] | 36 | PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>, |
| 37 | AddTransceiver, |
| 38 | rtc::scoped_refptr<MediaStreamTrackInterface>) |
| 39 | PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>, |
| 40 | AddTransceiver, |
| 41 | rtc::scoped_refptr<MediaStreamTrackInterface>, |
| 42 | const RtpTransceiverInit&) |
| 43 | PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>, |
| 44 | AddTransceiver, |
| 45 | cricket::MediaType) |
| 46 | PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>, |
| 47 | AddTransceiver, |
| 48 | cricket::MediaType, |
| 49 | const RtpTransceiverInit&) |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 50 | PROXY_METHOD1(rtc::scoped_refptr<DtmfSenderInterface>, |
deadbeef | d99a200 | 2017-01-18 08:55:23 -0800 | [diff] [blame] | 51 | CreateDtmfSender, |
| 52 | AudioTrackInterface*) |
deadbeef | bd7d8f7 | 2015-12-18 16:58:44 -0800 | [diff] [blame] | 53 | PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>, |
deadbeef | fac0655 | 2015-11-25 11:26:01 -0800 | [diff] [blame] | 54 | CreateSender, |
deadbeef | bd7d8f7 | 2015-12-18 16:58:44 -0800 | [diff] [blame] | 55 | const std::string&, |
deadbeef | fac0655 | 2015-11-25 11:26:01 -0800 | [diff] [blame] | 56 | const std::string&) |
deadbeef | 70ab1a1 | 2015-09-28 16:53:55 -0700 | [diff] [blame] | 57 | PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpSenderInterface>>, |
| 58 | GetSenders) |
| 59 | PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpReceiverInterface>>, |
| 60 | GetReceivers) |
Steve Anton | 9158ef6 | 2017-11-27 13:01:52 -0800 | [diff] [blame] | 61 | PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>, |
| 62 | GetTransceivers) |
deadbeef | d99a200 | 2017-01-18 08:55:23 -0800 | [diff] [blame] | 63 | PROXY_METHOD3(bool, |
| 64 | GetStats, |
| 65 | StatsObserver*, |
wu@webrtc.org | b9a088b | 2014-02-13 23:18:49 +0000 | [diff] [blame] | 66 | MediaStreamTrackInterface*, |
| 67 | StatsOutputLevel) |
hbos | 74e1a4f | 2016-09-15 23:33:01 -0700 | [diff] [blame] | 68 | PROXY_METHOD1(void, GetStats, RTCStatsCollectorCallback*) |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 69 | PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>, |
deadbeef | d99a200 | 2017-01-18 08:55:23 -0800 | [diff] [blame] | 70 | CreateDataChannel, |
| 71 | const std::string&, |
| 72 | const DataChannelInit*) |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 73 | PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description) |
| 74 | PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description) |
deadbeef | fe4a8a4 | 2016-12-20 17:56:17 -0800 | [diff] [blame] | 75 | PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, |
| 76 | pending_local_description) |
| 77 | PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, |
| 78 | pending_remote_description) |
| 79 | PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, |
| 80 | current_local_description) |
| 81 | PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, |
| 82 | current_remote_description) |
deadbeef | d99a200 | 2017-01-18 08:55:23 -0800 | [diff] [blame] | 83 | PROXY_METHOD2(void, |
| 84 | CreateOffer, |
| 85 | CreateSessionDescriptionObserver*, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 86 | const MediaConstraintsInterface*) |
deadbeef | d99a200 | 2017-01-18 08:55:23 -0800 | [diff] [blame] | 87 | PROXY_METHOD2(void, |
| 88 | CreateAnswer, |
| 89 | CreateSessionDescriptionObserver*, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 90 | const MediaConstraintsInterface*) |
hta | a2a49d9 | 2016-03-04 02:51:39 -0800 | [diff] [blame] | 91 | PROXY_METHOD2(void, |
| 92 | CreateOffer, |
| 93 | CreateSessionDescriptionObserver*, |
| 94 | const RTCOfferAnswerOptions&) |
| 95 | PROXY_METHOD2(void, |
| 96 | CreateAnswer, |
| 97 | CreateSessionDescriptionObserver*, |
| 98 | const RTCOfferAnswerOptions&) |
deadbeef | d99a200 | 2017-01-18 08:55:23 -0800 | [diff] [blame] | 99 | PROXY_METHOD2(void, |
| 100 | SetLocalDescription, |
| 101 | SetSessionDescriptionObserver*, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 102 | SessionDescriptionInterface*) |
deadbeef | d99a200 | 2017-01-18 08:55:23 -0800 | [diff] [blame] | 103 | PROXY_METHOD2(void, |
| 104 | SetRemoteDescription, |
| 105 | SetSessionDescriptionObserver*, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 106 | SessionDescriptionInterface*) |
Henrik Boström | 3163867 | 2017-11-23 17:48:32 +0100 | [diff] [blame] | 107 | PROXY_METHOD2(void, |
| 108 | SetRemoteDescription, |
| 109 | std::unique_ptr<SessionDescriptionInterface>, |
| 110 | rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>); |
deadbeef | 46c7389 | 2016-11-16 19:42:04 -0800 | [diff] [blame] | 111 | PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration); |
deadbeef | 293e926 | 2017-01-11 12:28:30 -0800 | [diff] [blame] | 112 | PROXY_METHOD2(bool, |
| 113 | SetConfiguration, |
| 114 | const PeerConnectionInterface::RTCConfiguration&, |
| 115 | RTCError*); |
deadbeef | 1e23461 | 2016-12-24 01:43:32 -0800 | [diff] [blame] | 116 | PROXY_METHOD1(bool, |
deadbeef | a67696b | 2015-09-29 11:56:26 -0700 | [diff] [blame] | 117 | SetConfiguration, |
deadbeef | 1e23461 | 2016-12-24 01:43:32 -0800 | [diff] [blame] | 118 | const PeerConnectionInterface::RTCConfiguration&); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 119 | PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*) |
Honghai Zhang | 7fb69db | 2016-03-14 11:59:18 -0700 | [diff] [blame] | 120 | PROXY_METHOD1(bool, |
| 121 | RemoveIceCandidates, |
| 122 | const std::vector<cricket::Candidate>&); |
henrika | 5f6bf24 | 2017-11-01 11:06:56 +0100 | [diff] [blame] | 123 | PROXY_METHOD1(void, SetAudioPlayout, bool) |
| 124 | PROXY_METHOD1(void, SetAudioRecording, bool) |
buildbot@webrtc.org | 1567b8c | 2014-05-08 19:54:16 +0000 | [diff] [blame] | 125 | PROXY_METHOD1(void, RegisterUMAObserver, UMAObserver*) |
zstein | 4b97980 | 2017-06-02 14:37:37 -0700 | [diff] [blame] | 126 | PROXY_METHOD1(RTCError, SetBitrate, const BitrateParameters&); |
Alex Narest | 78609d5 | 2017-10-20 10:37:47 +0200 | [diff] [blame] | 127 | PROXY_METHOD1(void, |
| 128 | SetBitrateAllocationStrategy, |
| 129 | std::unique_ptr<rtc::BitrateAllocationStrategy>); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 130 | PROXY_METHOD0(SignalingState, signaling_state) |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 131 | PROXY_METHOD0(IceConnectionState, ice_connection_state) |
| 132 | PROXY_METHOD0(IceGatheringState, ice_gathering_state) |
ivoc | 14d5dbe | 2016-07-04 07:06:55 -0700 | [diff] [blame] | 133 | PROXY_METHOD2(bool, StartRtcEventLog, rtc::PlatformFile, int64_t) |
Bjorn Terelius | de93943 | 2017-11-20 17:38:14 +0100 | [diff] [blame] | 134 | PROXY_METHOD2(bool, |
| 135 | StartRtcEventLog, |
| 136 | std::unique_ptr<RtcEventLogOutput>, |
| 137 | int64_t); |
ivoc | 14d5dbe | 2016-07-04 07:06:55 -0700 | [diff] [blame] | 138 | PROXY_METHOD0(void, StopRtcEventLog) |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 139 | PROXY_METHOD0(void, Close) |
deadbeef | d99a200 | 2017-01-18 08:55:23 -0800 | [diff] [blame] | 140 | END_PROXY_MAP() |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 141 | |
| 142 | } // namespace webrtc |
| 143 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 144 | #endif // API_PEERCONNECTIONPROXY_H_ |