1 /* 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 3 * 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. 9 */ 10 11 #ifndef API_PEER_CONNECTION_PROXY_H_ 12 #define API_PEER_CONNECTION_PROXY_H_ 13 14 #include <memory> 15 #include <string> 16 #include <vector> 17 18 #include "api/peer_connection_interface.h" 19 #include "api/proxy.h" 20 21 namespace webrtc { 22 23 // TODO(deadbeef): Move this to .cc file and out of api/. What threads methods 24 // are called on is an implementation detail. 25 BEGIN_SIGNALING_PROXY_MAP(PeerConnection) 26 PROXY_SIGNALING_THREAD_DESTRUCTOR() 27 PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, local_streams) 28 PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, remote_streams) 29 PROXY_METHOD1(bool, AddStream, MediaStreamInterface*) 30 PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*) 31 PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>, 32 AddTrack, 33 rtc::scoped_refptr<MediaStreamTrackInterface>, 34 const std::vector<std::string>&) 35 PROXY_METHOD1(bool, RemoveTrack, RtpSenderInterface*) 36 PROXY_METHOD1(RTCError, RemoveTrackNew, rtc::scoped_refptr<RtpSenderInterface>) 37 PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>, 38 AddTransceiver, 39 rtc::scoped_refptr<MediaStreamTrackInterface>) 40 PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>, 41 AddTransceiver, 42 rtc::scoped_refptr<MediaStreamTrackInterface>, 43 const RtpTransceiverInit&) 44 PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>, 45 AddTransceiver, 46 cricket::MediaType) 47 PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>, 48 AddTransceiver, 49 cricket::MediaType, 50 const RtpTransceiverInit&) 51 PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>, 52 CreateSender, 53 const std::string&, 54 const std::string&) 55 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpSenderInterface>>, 56 GetSenders) 57 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpReceiverInterface>>, 58 GetReceivers) 59 PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>, 60 GetTransceivers) 61 PROXY_METHOD3(bool, 62 GetStats, 63 StatsObserver*, 64 MediaStreamTrackInterface*, 65 StatsOutputLevel) 66 PROXY_METHOD1(void, GetStats, RTCStatsCollectorCallback*) 67 PROXY_METHOD2(void, 68 GetStats, 69 rtc::scoped_refptr<RtpSenderInterface>, 70 rtc::scoped_refptr<RTCStatsCollectorCallback>) 71 PROXY_METHOD2(void, 72 GetStats, 73 rtc::scoped_refptr<RtpReceiverInterface>, 74 rtc::scoped_refptr<RTCStatsCollectorCallback>) 75 PROXY_METHOD0(void, ClearStatsCache) 76 PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>, 77 CreateDataChannel, 78 const std::string&, 79 const DataChannelInit*) 80 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description) 81 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description) 82 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, 83 current_local_description) 84 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, 85 current_remote_description) 86 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, 87 pending_local_description) 88 PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, 89 pending_remote_description) 90 PROXY_METHOD0(void, RestartIce) 91 PROXY_METHOD2(void, 92 CreateOffer, 93 CreateSessionDescriptionObserver*, 94 const RTCOfferAnswerOptions&) 95 PROXY_METHOD2(void, 96 CreateAnswer, 97 CreateSessionDescriptionObserver*, 98 const RTCOfferAnswerOptions&) 99 PROXY_METHOD2(void, 100 SetLocalDescription, 101 SetSessionDescriptionObserver*, 102 SessionDescriptionInterface*) 103 PROXY_METHOD1(void, SetLocalDescription, SetSessionDescriptionObserver*) 104 PROXY_METHOD2(void, 105 SetRemoteDescription, 106 SetSessionDescriptionObserver*, 107 SessionDescriptionInterface*) 108 PROXY_METHOD2(void, 109 SetRemoteDescription, 110 std::unique_ptr<SessionDescriptionInterface>, 111 rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>) 112 PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration) 113 PROXY_METHOD1(RTCError, 114 SetConfiguration, 115 const PeerConnectionInterface::RTCConfiguration&) 116 PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*) 117 PROXY_METHOD2(void, 118 AddIceCandidate, 119 std::unique_ptr<IceCandidateInterface>, 120 std::function<void(RTCError)>) 121 PROXY_METHOD1(bool, RemoveIceCandidates, const std::vector<cricket::Candidate>&) 122 PROXY_METHOD1(RTCError, SetBitrate, const BitrateSettings&) 123 PROXY_METHOD1(void, SetAudioPlayout, bool) 124 PROXY_METHOD1(void, SetAudioRecording, bool) 125 PROXY_METHOD1(rtc::scoped_refptr<DtlsTransportInterface>, 126 LookupDtlsTransportByMid, 127 const std::string&) 128 PROXY_CONSTMETHOD0(rtc::scoped_refptr<SctpTransportInterface>, GetSctpTransport) 129 PROXY_METHOD0(SignalingState, signaling_state) 130 PROXY_METHOD0(IceConnectionState, ice_connection_state) 131 PROXY_METHOD0(IceConnectionState, standardized_ice_connection_state) 132 PROXY_METHOD0(PeerConnectionState, peer_connection_state) 133 PROXY_METHOD0(IceGatheringState, ice_gathering_state) 134 PROXY_METHOD0(absl::optional<bool>, can_trickle_ice_candidates) 135 PROXY_METHOD1(void, AddAdaptationResource, rtc::scoped_refptr<Resource>) 136 PROXY_METHOD2(bool, 137 StartRtcEventLog, 138 std::unique_ptr<RtcEventLogOutput>, 139 int64_t) 140 PROXY_METHOD1(bool, StartRtcEventLog, std::unique_ptr<RtcEventLogOutput>) 141 PROXY_METHOD0(void, StopRtcEventLog) 142 PROXY_METHOD0(void, Close) 143 END_PROXY_MAP() 144 145 } // namespace webrtc 146 147 #endif // API_PEER_CONNECTION_PROXY_H_ 148