| 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 | // PeerConnection proxy objects will be constructed with two thread pointers, |
| 24 | // signaling and network. The proxy macros don't have 'network' specific macros |
| 25 | // and support for a secondary thread is provided via 'SECONDARY' macros. |
| 26 | // TODO(deadbeef): Move this to .cc file and out of api/. What threads methods |
| 27 | // are called on is an implementation detail. |
| 28 | BEGIN_PROXY_MAP(PeerConnection) |
| 29 | PROXY_PRIMARY_THREAD_DESTRUCTOR() |
| 30 | PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, local_streams) |
| 31 | PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, remote_streams) |
| 32 | PROXY_METHOD1(bool, AddStream, MediaStreamInterface*) |
| 33 | PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*) |
| 34 | PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>, |
| 35 | AddTrack, |
| 36 | rtc::scoped_refptr<MediaStreamTrackInterface>, |
| 37 | const std::vector<std::string>&) |
| 38 | PROXY_METHOD1(bool, RemoveTrack, RtpSenderInterface*) |
| 39 | PROXY_METHOD1(RTCError, RemoveTrackNew, rtc::scoped_refptr<RtpSenderInterface>) |
| 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&) |
| 54 | PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>, |
| 55 | CreateSender, |
| 56 | const std::string&, |
| 57 | const std::string&) |
| 58 | PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpSenderInterface>>, |
| 59 | GetSenders) |
| 60 | PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpReceiverInterface>>, |
| 61 | GetReceivers) |
| 62 | PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>, |
| 63 | GetTransceivers) |
| 64 | PROXY_METHOD3(bool, |
| 65 | GetStats, |
| 66 | StatsObserver*, |
| 67 | MediaStreamTrackInterface*, |
| 68 | StatsOutputLevel) |
| 69 | PROXY_METHOD1(void, GetStats, RTCStatsCollectorCallback*) |
| 70 | PROXY_METHOD2(void, |
| 71 | GetStats, |
| 72 | rtc::scoped_refptr<RtpSenderInterface>, |
| 73 | rtc::scoped_refptr<RTCStatsCollectorCallback>) |
| 74 | PROXY_METHOD2(void, |
| 75 | GetStats, |
| 76 | rtc::scoped_refptr<RtpReceiverInterface>, |
| 77 | rtc::scoped_refptr<RTCStatsCollectorCallback>) |
| 78 | PROXY_METHOD0(void, ClearStatsCache) |
| 79 | PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>, |
| 80 | CreateDataChannel, |
| 81 | const std::string&, |
| 82 | const DataChannelInit*) |
| 83 | PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description) |
| 84 | PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description) |
| 85 | PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, |
| 86 | current_local_description) |
| 87 | PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, |
| 88 | current_remote_description) |
| 89 | PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, |
| 90 | pending_local_description) |
| 91 | PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, |
| 92 | pending_remote_description) |
| 93 | PROXY_METHOD0(void, RestartIce) |
| 94 | PROXY_METHOD2(void, |
| 95 | CreateOffer, |
| 96 | CreateSessionDescriptionObserver*, |
| 97 | const RTCOfferAnswerOptions&) |
| 98 | PROXY_METHOD2(void, |
| 99 | CreateAnswer, |
| 100 | CreateSessionDescriptionObserver*, |
| 101 | const RTCOfferAnswerOptions&) |
| 102 | PROXY_METHOD2(void, |
| 103 | SetLocalDescription, |
| 104 | std::unique_ptr<SessionDescriptionInterface>, |
| 105 | rtc::scoped_refptr<SetLocalDescriptionObserverInterface>) |
| 106 | PROXY_METHOD1(void, |
| 107 | SetLocalDescription, |
| 108 | rtc::scoped_refptr<SetLocalDescriptionObserverInterface>) |
| 109 | PROXY_METHOD2(void, |
| 110 | SetLocalDescription, |
| 111 | SetSessionDescriptionObserver*, |
| 112 | SessionDescriptionInterface*) |
| 113 | PROXY_METHOD1(void, SetLocalDescription, SetSessionDescriptionObserver*) |
| 114 | PROXY_METHOD2(void, |
| 115 | SetRemoteDescription, |
| 116 | std::unique_ptr<SessionDescriptionInterface>, |
| 117 | rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>) |
| 118 | PROXY_METHOD2(void, |
| 119 | SetRemoteDescription, |
| 120 | SetSessionDescriptionObserver*, |
| 121 | SessionDescriptionInterface*) |
| 122 | PROXY_METHOD1(bool, ShouldFireNegotiationNeededEvent, uint32_t) |
| 123 | PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration) |
| 124 | PROXY_METHOD1(RTCError, |
| 125 | SetConfiguration, |
| 126 | const PeerConnectionInterface::RTCConfiguration&) |
| 127 | PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*) |
| 128 | PROXY_METHOD2(void, |
| 129 | AddIceCandidate, |
| 130 | std::unique_ptr<IceCandidateInterface>, |
| 131 | std::function<void(RTCError)>) |
| 132 | PROXY_METHOD1(bool, RemoveIceCandidates, const std::vector<cricket::Candidate>&) |
| 133 | PROXY_METHOD1(RTCError, SetBitrate, const BitrateSettings&) |
| 134 | PROXY_METHOD1(void, SetAudioPlayout, bool) |
| 135 | PROXY_METHOD1(void, SetAudioRecording, bool) |
| 136 | // This method will be invoked on the network thread. See |
| 137 | // PeerConnectionFactory::CreatePeerConnectionOrError for more details. |
| 138 | PROXY_SECONDARY_METHOD1(rtc::scoped_refptr<DtlsTransportInterface>, |
| 139 | LookupDtlsTransportByMid, |
| 140 | const std::string&) |
| 141 | // This method will be invoked on the network thread. See |
| 142 | // PeerConnectionFactory::CreatePeerConnectionOrError for more details. |
| 143 | PROXY_SECONDARY_CONSTMETHOD0(rtc::scoped_refptr<SctpTransportInterface>, |
| 144 | GetSctpTransport) |
| 145 | PROXY_METHOD0(SignalingState, signaling_state) |
| 146 | PROXY_METHOD0(IceConnectionState, ice_connection_state) |
| 147 | PROXY_METHOD0(IceConnectionState, standardized_ice_connection_state) |
| 148 | PROXY_METHOD0(PeerConnectionState, peer_connection_state) |
| 149 | PROXY_METHOD0(IceGatheringState, ice_gathering_state) |
| 150 | PROXY_METHOD0(absl::optional<bool>, can_trickle_ice_candidates) |
| 151 | PROXY_METHOD1(void, AddAdaptationResource, rtc::scoped_refptr<Resource>) |
| 152 | PROXY_METHOD2(bool, |
| 153 | StartRtcEventLog, |
| 154 | std::unique_ptr<RtcEventLogOutput>, |
| 155 | int64_t) |
| 156 | PROXY_METHOD1(bool, StartRtcEventLog, std::unique_ptr<RtcEventLogOutput>) |
| 157 | PROXY_METHOD0(void, StopRtcEventLog) |
| 158 | PROXY_METHOD0(void, Close) |
| 159 | BYPASS_PROXY_CONSTMETHOD0(rtc::Thread*, signaling_thread) |
| 160 | END_PROXY_MAP() |
| 161 |
| 162 | } // namespace webrtc |
| 163 |
| 164 | #endif // API_PEER_CONNECTION_PROXY_H_ |
| 165 |