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