peer_connection_proxy.h 6.6 KB

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