| 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 | std::unique_ptr<SessionDescriptionInterface>, |
| 102 | rtc::scoped_refptr<SetLocalDescriptionObserverInterface>) |
| 103 | PROXY_METHOD1(void, |
| 104 | SetLocalDescription, |
| 105 | rtc::scoped_refptr<SetLocalDescriptionObserverInterface>) |
| 106 | PROXY_METHOD2(void, |
| 107 | SetLocalDescription, |
| 108 | SetSessionDescriptionObserver*, |
| 109 | SessionDescriptionInterface*) |
| 110 | PROXY_METHOD1(void, SetLocalDescription, SetSessionDescriptionObserver*) |
| 111 | PROXY_METHOD2(void, |
| 112 | SetRemoteDescription, |
| 113 | std::unique_ptr<SessionDescriptionInterface>, |
| 114 | rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>) |
| 115 | PROXY_METHOD2(void, |
| 116 | SetRemoteDescription, |
| 117 | SetSessionDescriptionObserver*, |
| 118 | SessionDescriptionInterface*) |
| 119 | PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration) |
| 120 | PROXY_METHOD1(RTCError, |
| 121 | SetConfiguration, |
| 122 | const PeerConnectionInterface::RTCConfiguration&) |
| 123 | PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*) |
| 124 | PROXY_METHOD2(void, |
| 125 | AddIceCandidate, |
| 126 | std::unique_ptr<IceCandidateInterface>, |
| 127 | std::function<void(RTCError)>) |
| 128 | PROXY_METHOD1(bool, RemoveIceCandidates, const std::vector<cricket::Candidate>&) |
| 129 | PROXY_METHOD1(RTCError, SetBitrate, const BitrateSettings&) |
| 130 | PROXY_METHOD1(void, SetAudioPlayout, bool) |
| 131 | PROXY_METHOD1(void, SetAudioRecording, bool) |
| 132 | PROXY_METHOD1(rtc::scoped_refptr<DtlsTransportInterface>, |
| 133 | LookupDtlsTransportByMid, |
| 134 | const std::string&) |
| 135 | PROXY_CONSTMETHOD0(rtc::scoped_refptr<SctpTransportInterface>, GetSctpTransport) |
| 136 | PROXY_METHOD0(SignalingState, signaling_state) |
| 137 | PROXY_METHOD0(IceConnectionState, ice_connection_state) |
| 138 | PROXY_METHOD0(IceConnectionState, standardized_ice_connection_state) |
| 139 | PROXY_METHOD0(PeerConnectionState, peer_connection_state) |
| 140 | PROXY_METHOD0(IceGatheringState, ice_gathering_state) |
| 141 | PROXY_METHOD0(absl::optional<bool>, can_trickle_ice_candidates) |
| 142 | PROXY_METHOD1(void, AddAdaptationResource, rtc::scoped_refptr<Resource>) |
| 143 | PROXY_METHOD2(bool, |
| 144 | StartRtcEventLog, |
| 145 | std::unique_ptr<RtcEventLogOutput>, |
| 146 | int64_t) |
| 147 | PROXY_METHOD1(bool, StartRtcEventLog, std::unique_ptr<RtcEventLogOutput>) |
| 148 | PROXY_METHOD0(void, StopRtcEventLog) |
| 149 | PROXY_METHOD0(void, Close) |
| 150 | BYPASS_PROXY_CONSTMETHOD0(rtc::Thread*, signaling_thread) |
| 151 | END_PROXY_MAP() |
| 152 |
| 153 | } // namespace webrtc |
| 154 |
| 155 | #endif // API_PEER_CONNECTION_PROXY_H_ |
| 156 |