blob: 93ba415b537ff27d5a1f72dd410cc10cc154813c [file] [log] [blame]
Steve Anton6e634bf2017-11-13 10:44:53 -08001/*
2 * Copyright 2017 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
Steve Anton10542f22019-01-11 09:11:00 -080011#ifndef PC_RTP_TRANSCEIVER_H_
12#define PC_RTP_TRANSCEIVER_H_
Steve Anton6e634bf2017-11-13 10:44:53 -080013
Harald Alvestrand5761e7b2021-01-29 14:45:08 +000014#include <stddef.h>
15
Harald Alvestrand5761e7b2021-01-29 14:45:08 +000016#include <functional>
Harald Alvestrand3af79d12022-04-29 15:04:58 +000017#include <memory>
Steve Anton6e634bf2017-11-13 10:44:53 -080018#include <string>
19#include <vector>
20
Harald Alvestrand5761e7b2021-01-29 14:45:08 +000021#include "absl/types/optional.h"
22#include "api/array_view.h"
Harald Alvestrand8f429922022-05-04 10:32:30 +000023#include "api/audio_options.h"
Harald Alvestrandc24a2182022-02-23 13:44:59 +000024#include "api/jsep.h"
Harald Alvestrand5761e7b2021-01-29 14:45:08 +000025#include "api/media_types.h"
Harald Alvestrand5761e7b2021-01-29 14:45:08 +000026#include "api/rtc_error.h"
27#include "api/rtp_parameters.h"
Harald Alvestrandc24a2182022-02-23 13:44:59 +000028#include "api/rtp_receiver_interface.h"
29#include "api/rtp_sender_interface.h"
Harald Alvestrand5761e7b2021-01-29 14:45:08 +000030#include "api/rtp_transceiver_direction.h"
Steve Anton10542f22019-01-11 09:11:00 -080031#include "api/rtp_transceiver_interface.h"
Harald Alvestrand5761e7b2021-01-29 14:45:08 +000032#include "api/scoped_refptr.h"
33#include "api/task_queue/task_queue_base.h"
Harald Alvestrand8f429922022-05-04 10:32:30 +000034#include "api/video/video_bitrate_allocator_factory.h"
35#include "media/base/media_channel.h"
Ruslan Burakov501bfba2019-02-11 10:29:19 +010036#include "pc/channel_interface.h"
Harald Alvestrandc3fa7c32022-05-22 10:57:01 +000037#include "pc/connection_context.h"
Markus Handella1b82012021-05-26 18:56:30 +020038#include "pc/proxy.h"
Steve Anton10542f22019-01-11 09:11:00 -080039#include "pc/rtp_receiver.h"
Markus Handelle93fe6c2021-05-20 22:46:31 +020040#include "pc/rtp_receiver_proxy.h"
Steve Anton10542f22019-01-11 09:11:00 -080041#include "pc/rtp_sender.h"
Markus Handelle93fe6c2021-05-20 22:46:31 +020042#include "pc/rtp_sender_proxy.h"
Harald Alvestrandc24a2182022-02-23 13:44:59 +000043#include "pc/rtp_transport_internal.h"
44#include "pc/session_description.h"
Tommi99c8a802021-04-27 15:00:00 +020045#include "rtc_base/task_utils/pending_task_safety_flag.h"
Harald Alvestrand5761e7b2021-01-29 14:45:08 +000046#include "rtc_base/third_party/sigslot/sigslot.h"
47#include "rtc_base/thread_annotations.h"
Steve Anton6e634bf2017-11-13 10:44:53 -080048
Harald Alvestrand9e334b72022-05-04 13:38:31 +000049namespace cricket {
50class ChannelManager;
Harald Alvestrandc3fa7c32022-05-22 10:57:01 +000051class MediaEngineInterface;
Harald Alvestrand9e334b72022-05-04 13:38:31 +000052}
53
Steve Anton6e634bf2017-11-13 10:44:53 -080054namespace webrtc {
55
Harald Alvestrand8f429922022-05-04 10:32:30 +000056class PeerConnectionSdpMethods;
57
Steve Anton6e634bf2017-11-13 10:44:53 -080058// Implementation of the public RtpTransceiverInterface.
59//
60// The RtpTransceiverInterface is only intended to be used with a PeerConnection
61// that enables Unified Plan SDP. Thus, the methods that only need to implement
62// public API features and are not used internally can assume exactly one sender
63// and receiver.
64//
65// Since the RtpTransceiver is used internally by PeerConnection for tracking
66// RtpSenders, RtpReceivers, and BaseChannels, and PeerConnection needs to be
67// backwards compatible with Plan B SDP, this implementation is more flexible
68// than that required by the WebRTC specification.
69//
70// With Plan B SDP, an RtpTransceiver can have any number of senders and
71// receivers which map to a=ssrc lines in the m= section.
72// With Unified Plan SDP, an RtpTransceiver will have exactly one sender and one
73// receiver which are encapsulated by the m= section.
74//
75// This class manages the RtpSenders, RtpReceivers, and BaseChannel associated
76// with this m= section. Since the transceiver, senders, and receivers are
77// reference counted and can be referenced from JavaScript (in Chromium), these
78// objects must be ready to live for an arbitrary amount of time. The
Harald Alvestrand8f429922022-05-04 10:32:30 +000079// BaseChannel is not reference counted, so
80// the PeerConnection must take care of creating/deleting the BaseChannel.
Steve Anton6e634bf2017-11-13 10:44:53 -080081//
82// The RtpTransceiver is specialized to either audio or video according to the
83// MediaType specified in the constructor. Audio RtpTransceivers will have
84// AudioRtpSenders, AudioRtpReceivers, and a VoiceChannel. Video RtpTransceivers
85// will have VideoRtpSenders, VideoRtpReceivers, and a VideoChannel.
Tomas Gunnarsson0d5ce622022-03-18 15:57:15 +010086class RtpTransceiver : public RtpTransceiverInterface,
87 public sigslot::has_slots<> {
Steve Anton6e634bf2017-11-13 10:44:53 -080088 public:
Steve Anton79e79602017-11-20 10:25:56 -080089 // Construct a Plan B-style RtpTransceiver with no senders, receivers, or
90 // channel set.
Artem Titov880fa812021-07-30 22:30:23 +020091 // `media_type` specifies the type of RtpTransceiver (and, by transitivity,
Steve Anton6e634bf2017-11-13 10:44:53 -080092 // the type of senders, receivers, and channel). Can either by audio or video.
Harald Alvestrandc3fa7c32022-05-22 10:57:01 +000093 RtpTransceiver(cricket::MediaType media_type, ConnectionContext* context);
Steve Anton79e79602017-11-20 10:25:56 -080094 // Construct a Unified Plan-style RtpTransceiver with the given sender and
95 // receiver. The media type will be derived from the media types of the sender
96 // and receiver. The sender and receiver should have the same media type.
Artem Titov880fa812021-07-30 22:30:23 +020097 // `HeaderExtensionsToOffer` is used for initializing the return value of
Markus Handell0357b3e2020-03-16 13:40:51 +010098 // HeaderExtensionsToOffer().
Steve Anton79e79602017-11-20 10:25:56 -080099 RtpTransceiver(
100 rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender,
101 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
Florent Castelli2d9d82e2019-04-23 19:25:51 +0200102 receiver,
Harald Alvestrandc3fa7c32022-05-22 10:57:01 +0000103 ConnectionContext* context,
Harald Alvestrand280054f2020-11-10 13:12:53 +0000104 std::vector<RtpHeaderExtensionCapability> HeaderExtensionsToOffer,
105 std::function<void()> on_negotiation_needed);
Steve Anton6e634bf2017-11-13 10:44:53 -0800106 ~RtpTransceiver() override;
107
Harald Alvestrandc3fa7c32022-05-22 10:57:01 +0000108 // Not copyable or movable.
109 RtpTransceiver(const RtpTransceiver&) = delete;
110 RtpTransceiver& operator=(const RtpTransceiver&) = delete;
111 // RtpTransceiver(RtpTransceiver&&) = delete;
112 RtpTransceiver& operator=(RtpTransceiver&&) = delete;
113
Steve Anton6e634bf2017-11-13 10:44:53 -0800114 // Returns the Voice/VideoChannel set for this transceiver. May be null if
115 // the transceiver is not in the currently set local/remote description.
Harald Alvestrand3af79d12022-04-29 15:04:58 +0000116 cricket::ChannelInterface* channel() const { return channel_.get(); }
Steve Anton6e634bf2017-11-13 10:44:53 -0800117
Harald Alvestrand8f429922022-05-04 10:32:30 +0000118 // Creates the Voice/VideoChannel and sets it.
119 RTCError CreateChannel(
120 absl::string_view mid,
121 Call* call_ptr,
122 const cricket::MediaConfig& media_config,
123 bool srtp_required,
124 CryptoOptions crypto_options,
125 const cricket::AudioOptions& audio_options,
126 const cricket::VideoOptions& video_options,
127 VideoBitrateAllocatorFactory* video_bitrate_allocator_factory,
128 std::function<RtpTransportInternal*(absl::string_view)> transport_lookup);
129
Steve Anton6e634bf2017-11-13 10:44:53 -0800130 // Sets the Voice/VideoChannel. The caller must pass in the correct channel
Tomas Gunnarsson4f8a58c2022-01-19 11:36:23 +0100131 // implementation based on the type of the transceiver. The call must
132 // furthermore be made on the signaling thread.
133 //
134 // `channel`: The channel instance to be associated with the transceiver.
Harald Alvestranddaee8702022-04-29 11:42:55 +0000135 // This must be a valid pointer.
136 // The state of the object
Tomas Gunnarsson4f8a58c2022-01-19 11:36:23 +0100137 // is expected to be newly constructed and not initalized for network
138 // activity (see next parameter for more).
139 //
Harald Alvestrand3af79d12022-04-29 15:04:58 +0000140 // The transceiver takes ownership of `channel`.
Tomas Gunnarsson4f8a58c2022-01-19 11:36:23 +0100141 //
Harald Alvestranddaee8702022-04-29 11:42:55 +0000142 // `transport_lookup`: This
Tomas Gunnarsson4f8a58c2022-01-19 11:36:23 +0100143 // callback function will be used to look up the `RtpTransport` object
144 // to associate with the channel via `BaseChannel::SetRtpTransport`.
145 // The lookup function will be called on the network thread, synchronously
146 // during the call to `SetChannel`. This means that the caller of
147 // `SetChannel()` may provide a callback function that references state
148 // that exists within the calling scope of SetChannel (e.g. a variable
149 // on the stack).
150 // The reason for this design is to limit the number of times we jump
151 // synchronously to the network thread from the signaling thread.
152 // The callback allows us to combine the transport lookup with network
153 // state initialization of the channel object.
Harald Alvestranddaee8702022-04-29 11:42:55 +0000154 // ClearChannel() must be used before calling SetChannel() again.
Harald Alvestrand3af79d12022-04-29 15:04:58 +0000155 void SetChannel(std::unique_ptr<cricket::ChannelInterface> channel,
Tomas Gunnarsson4f8a58c2022-01-19 11:36:23 +0100156 std::function<RtpTransportInternal*(const std::string&)>
157 transport_lookup);
Steve Anton6e634bf2017-11-13 10:44:53 -0800158
Harald Alvestrand19ebabc2022-04-28 13:31:17 +0000159 // Clear the association between the transceiver and the channel.
160 void ClearChannel();
161
Steve Anton6e634bf2017-11-13 10:44:53 -0800162 // Adds an RtpSender of the appropriate type to be owned by this transceiver.
163 // Must not be null.
164 void AddSender(
165 rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender);
166
167 // Removes the given RtpSender. Returns false if the sender is not owned by
168 // this transceiver.
169 bool RemoveSender(RtpSenderInterface* sender);
170
171 // Returns a vector of the senders owned by this transceiver.
172 std::vector<rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
173 senders() const {
174 return senders_;
175 }
176
177 // Adds an RtpReceiver of the appropriate type to be owned by this
178 // transceiver. Must not be null.
179 void AddReceiver(
180 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
181 receiver);
182
183 // Removes the given RtpReceiver. Returns false if the sender is not owned by
184 // this transceiver.
185 bool RemoveReceiver(RtpReceiverInterface* receiver);
186
187 // Returns a vector of the receivers owned by this transceiver.
188 std::vector<
189 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
190 receivers() const {
191 return receivers_;
192 }
193
Steve Antonf9381f02017-12-14 10:23:57 -0800194 // Returns the backing object for the transceiver's Unified Plan sender.
195 rtc::scoped_refptr<RtpSenderInternal> sender_internal() const;
196
197 // Returns the backing object for the transceiver's Unified Plan receiver.
198 rtc::scoped_refptr<RtpReceiverInternal> receiver_internal() const;
199
Steve Antondcc3c022017-12-22 16:02:54 -0800200 // RtpTransceivers are not associated until they have a corresponding media
201 // section set in SetLocalDescription or SetRemoteDescription. Therefore,
202 // when setting a local offer we need a way to remember which transceiver was
203 // used to create which media section in the offer. Storing the mline index
204 // in CreateOffer is specified in JSEP to allow us to do that.
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200205 absl::optional<size_t> mline_index() const { return mline_index_; }
206 void set_mline_index(absl::optional<size_t> mline_index) {
Steve Antondcc3c022017-12-22 16:02:54 -0800207 mline_index_ = mline_index;
208 }
209
210 // Sets the MID for this transceiver. If the MID is not null, then the
211 // transceiver is considered "associated" with the media section that has the
212 // same MID.
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200213 void set_mid(const absl::optional<std::string>& mid) { mid_ = mid; }
Steve Antondcc3c022017-12-22 16:02:54 -0800214
215 // Sets the intended direction for this transceiver. Intended to be used
216 // internally over SetDirection since this does not trigger a negotiation
217 // needed callback.
218 void set_direction(RtpTransceiverDirection direction) {
219 direction_ = direction;
220 }
221
222 // Sets the current direction for this transceiver as negotiated in an offer/
223 // answer exchange. The current direction is null before an answer with this
224 // transceiver has been set.
225 void set_current_direction(RtpTransceiverDirection direction);
226
Steve Anton0f5400a2018-07-17 14:25:36 -0700227 // Sets the fired direction for this transceiver. The fired direction is null
228 // until SetRemoteDescription is called or an answer is set (either local or
Henrik Boström0a162762022-05-02 15:47:52 +0200229 // remote) after which the only valid reason to go back to null is rollback.
230 void set_fired_direction(absl::optional<RtpTransceiverDirection> direction);
Steve Anton0f5400a2018-07-17 14:25:36 -0700231
Steve Antonf9381f02017-12-14 10:23:57 -0800232 // According to JSEP rules for SetRemoteDescription, RtpTransceivers can be
233 // reused only if they were added by AddTrack.
234 void set_created_by_addtrack(bool created_by_addtrack) {
235 created_by_addtrack_ = created_by_addtrack;
236 }
Eldar Rello353a7182019-11-25 18:49:44 +0200237 // If AddTrack has been called then transceiver can't be removed during
238 // rollback.
239 void set_reused_for_addtrack(bool reused_for_addtrack) {
240 reused_for_addtrack_ = reused_for_addtrack;
241 }
242
Steve Antonf9381f02017-12-14 10:23:57 -0800243 bool created_by_addtrack() const { return created_by_addtrack_; }
244
Eldar Rello353a7182019-11-25 18:49:44 +0200245 bool reused_for_addtrack() const { return reused_for_addtrack_; }
246
Steve Antonf9381f02017-12-14 10:23:57 -0800247 // Returns true if this transceiver has ever had the current direction set to
248 // sendonly or sendrecv.
249 bool has_ever_been_used_to_send() const {
250 return has_ever_been_used_to_send_;
251 }
252
Harald Alvestrand6060df52020-08-11 09:54:02 +0200253 // Informs the transceiver that its owning
254 // PeerConnection is closed.
255 void SetPeerConnectionClosed();
256
Harald Alvestrandc75c4282020-08-26 12:17:54 +0000257 // Executes the "stop the RTCRtpTransceiver" procedure from
258 // the webrtc-pc specification, described under the stop() method.
259 void StopTransceiverProcedure();
260
Steve Anton52d86772018-02-20 15:48:12 -0800261 // Fired when the RtpTransceiver state changes such that negotiation is now
262 // needed (e.g., in response to a direction change).
Harald Alvestrand280054f2020-11-10 13:12:53 +0000263 // sigslot::signal0<> SignalNegotiationNeeded;
Steve Anton52d86772018-02-20 15:48:12 -0800264
Steve Anton6e634bf2017-11-13 10:44:53 -0800265 // RtpTransceiverInterface implementation.
Steve Anton69470252018-02-09 11:43:08 -0800266 cricket::MediaType media_type() const override;
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200267 absl::optional<std::string> mid() const override;
Steve Anton6e634bf2017-11-13 10:44:53 -0800268 rtc::scoped_refptr<RtpSenderInterface> sender() const override;
269 rtc::scoped_refptr<RtpReceiverInterface> receiver() const override;
270 bool stopped() const override;
Harald Alvestrand6060df52020-08-11 09:54:02 +0200271 bool stopping() const override;
Steve Anton6e634bf2017-11-13 10:44:53 -0800272 RtpTransceiverDirection direction() const override;
Harald Alvestrand6060df52020-08-11 09:54:02 +0200273 RTCError SetDirectionWithError(
274 RtpTransceiverDirection new_direction) override;
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200275 absl::optional<RtpTransceiverDirection> current_direction() const override;
Steve Anton0f5400a2018-07-17 14:25:36 -0700276 absl::optional<RtpTransceiverDirection> fired_direction() const override;
Harald Alvestrand6060df52020-08-11 09:54:02 +0200277 RTCError StopStandard() override;
278 void StopInternal() override;
Florent Castelli2d9d82e2019-04-23 19:25:51 +0200279 RTCError SetCodecPreferences(
280 rtc::ArrayView<RtpCodecCapability> codecs) override;
281 std::vector<RtpCodecCapability> codec_preferences() const override {
282 return codec_preferences_;
283 }
Markus Handell0357b3e2020-03-16 13:40:51 +0100284 std::vector<RtpHeaderExtensionCapability> HeaderExtensionsToOffer()
285 const override;
Markus Handell5932fe12020-12-17 22:19:40 +0100286 std::vector<RtpHeaderExtensionCapability> HeaderExtensionsNegotiated()
287 const override;
Markus Handell755c65d2020-06-24 01:06:10 +0200288 RTCError SetOfferedRtpHeaderExtensions(
289 rtc::ArrayView<const RtpHeaderExtensionCapability>
290 header_extensions_to_offer) override;
Steve Anton6e634bf2017-11-13 10:44:53 -0800291
Tommicc7a3682021-05-04 14:59:38 +0200292 // Called on the signaling thread when the local or remote content description
293 // is updated. Used to update the negotiated header extensions.
294 // TODO(tommi): The implementation of this method is currently very simple and
295 // only used for updating the negotiated headers. However, we're planning to
296 // move all the updates done on the channel from the transceiver into this
297 // method. This will happen with the ownership of the channel object being
298 // moved into the transceiver.
299 void OnNegotiationUpdate(SdpType sdp_type,
300 const cricket::MediaContentDescription* content);
301
Steve Anton6e634bf2017-11-13 10:44:53 -0800302 private:
Harald Alvestrandc3fa7c32022-05-22 10:57:01 +0000303 cricket::MediaEngineInterface* media_engine() const {
304 return context_->media_engine();
305 }
Harald Alvestrandc3fa7c32022-05-22 10:57:01 +0000306 ConnectionContext* context() const { return context_; }
Tommi99c8a802021-04-27 15:00:00 +0200307 void OnFirstPacketReceived();
Harald Alvestrand6060df52020-08-11 09:54:02 +0200308 void StopSendingAndReceiving();
Harald Alvestranddaee8702022-04-29 11:42:55 +0000309 // Delete a channel, and ensure that references to its media channel
310 // are updated before deleting it.
311 void PushNewMediaChannelAndDeleteChannel(
Harald Alvestrand3af79d12022-04-29 15:04:58 +0000312 std::unique_ptr<cricket::ChannelInterface> channel_to_delete);
Steve Anton60776752018-01-10 11:51:34 -0800313
Harald Alvestrand6060df52020-08-11 09:54:02 +0200314 // Enforce that this object is created, used and destroyed on one thread.
Tommi99c8a802021-04-27 15:00:00 +0200315 TaskQueueBase* const thread_;
Steve Anton6e634bf2017-11-13 10:44:53 -0800316 const bool unified_plan_;
317 const cricket::MediaType media_type_;
Tommi99c8a802021-04-27 15:00:00 +0200318 rtc::scoped_refptr<PendingTaskSafetyFlag> signaling_thread_safety_;
Steve Anton6e634bf2017-11-13 10:44:53 -0800319 std::vector<rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
320 senders_;
321 std::vector<
322 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
323 receivers_;
324
Tommi99c8a802021-04-27 15:00:00 +0200325 bool stopped_ RTC_GUARDED_BY(thread_) = false;
Harald Alvestrand6060df52020-08-11 09:54:02 +0200326 bool stopping_ RTC_GUARDED_BY(thread_) = false;
327 bool is_pc_closed_ = false;
Steve Anton6e634bf2017-11-13 10:44:53 -0800328 RtpTransceiverDirection direction_ = RtpTransceiverDirection::kInactive;
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200329 absl::optional<RtpTransceiverDirection> current_direction_;
Steve Anton0f5400a2018-07-17 14:25:36 -0700330 absl::optional<RtpTransceiverDirection> fired_direction_;
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200331 absl::optional<std::string> mid_;
332 absl::optional<size_t> mline_index_;
Steve Antonf9381f02017-12-14 10:23:57 -0800333 bool created_by_addtrack_ = false;
Eldar Rello353a7182019-11-25 18:49:44 +0200334 bool reused_for_addtrack_ = false;
Steve Antonf9381f02017-12-14 10:23:57 -0800335 bool has_ever_been_used_to_send_ = false;
Steve Anton6e634bf2017-11-13 10:44:53 -0800336
Harald Alvestrand19ebabc2022-04-28 13:31:17 +0000337 // Accessed on both thread_ and the network thread. Considered safe
338 // because all access on the network thread is within an invoke()
339 // from thread_.
Harald Alvestrand3af79d12022-04-29 15:04:58 +0000340 std::unique_ptr<cricket::ChannelInterface> channel_ = nullptr;
Harald Alvestrandc3fa7c32022-05-22 10:57:01 +0000341 ConnectionContext* const context_;
Florent Castelli2d9d82e2019-04-23 19:25:51 +0200342 std::vector<RtpCodecCapability> codec_preferences_;
Markus Handell755c65d2020-06-24 01:06:10 +0200343 std::vector<RtpHeaderExtensionCapability> header_extensions_to_offer_;
Tommicc7a3682021-05-04 14:59:38 +0200344
Artem Titov880fa812021-07-30 22:30:23 +0200345 // `negotiated_header_extensions_` is read and written to on the signaling
Tommicc7a3682021-05-04 14:59:38 +0200346 // thread from the SdpOfferAnswerHandler class (e.g.
347 // PushdownMediaDescription().
348 cricket::RtpHeaderExtensions negotiated_header_extensions_
349 RTC_GUARDED_BY(thread_);
350
Harald Alvestrand280054f2020-11-10 13:12:53 +0000351 const std::function<void()> on_negotiation_needed_;
Steve Anton6e634bf2017-11-13 10:44:53 -0800352};
353
Mirko Bonadei9d9b8de2021-02-26 09:51:26 +0100354BEGIN_PRIMARY_PROXY_MAP(RtpTransceiver)
Harald Alvestrand5761e7b2021-01-29 14:45:08 +0000355
Mirko Bonadei9d9b8de2021-02-26 09:51:26 +0100356PROXY_PRIMARY_THREAD_DESTRUCTOR()
Tomas Gunnarssonfc83cdc2020-09-10 13:04:50 +0200357BYPASS_PROXY_CONSTMETHOD0(cricket::MediaType, media_type)
Nico Weber22f99252019-02-20 10:13:16 -0500358PROXY_CONSTMETHOD0(absl::optional<std::string>, mid)
359PROXY_CONSTMETHOD0(rtc::scoped_refptr<RtpSenderInterface>, sender)
360PROXY_CONSTMETHOD0(rtc::scoped_refptr<RtpReceiverInterface>, receiver)
361PROXY_CONSTMETHOD0(bool, stopped)
Harald Alvestrand6060df52020-08-11 09:54:02 +0200362PROXY_CONSTMETHOD0(bool, stopping)
Nico Weber22f99252019-02-20 10:13:16 -0500363PROXY_CONSTMETHOD0(RtpTransceiverDirection, direction)
Harald Alvestrand6060df52020-08-11 09:54:02 +0200364PROXY_METHOD1(webrtc::RTCError, SetDirectionWithError, RtpTransceiverDirection)
Nico Weber22f99252019-02-20 10:13:16 -0500365PROXY_CONSTMETHOD0(absl::optional<RtpTransceiverDirection>, current_direction)
366PROXY_CONSTMETHOD0(absl::optional<RtpTransceiverDirection>, fired_direction)
Harald Alvestrand6060df52020-08-11 09:54:02 +0200367PROXY_METHOD0(webrtc::RTCError, StopStandard)
368PROXY_METHOD0(void, StopInternal)
Florent Castelli2d9d82e2019-04-23 19:25:51 +0200369PROXY_METHOD1(webrtc::RTCError,
370 SetCodecPreferences,
371 rtc::ArrayView<RtpCodecCapability>)
372PROXY_CONSTMETHOD0(std::vector<RtpCodecCapability>, codec_preferences)
Markus Handell0357b3e2020-03-16 13:40:51 +0100373PROXY_CONSTMETHOD0(std::vector<RtpHeaderExtensionCapability>,
374 HeaderExtensionsToOffer)
Markus Handell5932fe12020-12-17 22:19:40 +0100375PROXY_CONSTMETHOD0(std::vector<RtpHeaderExtensionCapability>,
376 HeaderExtensionsNegotiated)
Markus Handell755c65d2020-06-24 01:06:10 +0200377PROXY_METHOD1(webrtc::RTCError,
378 SetOfferedRtpHeaderExtensions,
379 rtc::ArrayView<const RtpHeaderExtensionCapability>)
Markus Handell3d46d0b2021-05-27 21:42:57 +0200380END_PROXY_MAP(RtpTransceiver)
Steve Anton6e634bf2017-11-13 10:44:53 -0800381
382} // namespace webrtc
383
Steve Anton10542f22019-01-11 09:11:00 -0800384#endif // PC_RTP_TRANSCEIVER_H_