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