peer_connection_proxy.h 6.2 KB

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