ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 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 | |
| 11 | // This file contains classes that implement RtpSenderInterface. |
| 12 | // An RtpSender associates a MediaStreamTrackInterface with an underlying |
| 13 | // transport (provided by AudioProviderInterface/VideoProviderInterface) |
| 14 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 15 | #ifndef PC_RTP_SENDER_H_ |
| 16 | #define PC_RTP_SENDER_H_ |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 17 | |
| 18 | #include <memory> |
| 19 | #include <string> |
Steve Anton | 36b29d1 | 2017-10-30 09:57:42 -0700 | [diff] [blame] | 20 | #include <vector> |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 21 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 22 | #include "api/media_stream_interface.h" |
| 23 | #include "api/rtp_sender_interface.h" |
| 24 | #include "media/base/audio_source.h" |
| 25 | #include "media/base/media_channel.h" |
| 26 | #include "pc/dtmf_sender.h" |
| 27 | #include "rtc_base/critical_section.h" |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 28 | |
| 29 | namespace webrtc { |
| 30 | |
Steve Anton | 2d8609c | 2018-01-23 16:38:46 -0800 | [diff] [blame] | 31 | class StatsCollector; |
| 32 | |
Florent Castelli | 892acf0 | 2018-10-01 22:47:20 +0200 | [diff] [blame] | 33 | bool UnimplementedRtpParameterHasValue(const RtpParameters& parameters); |
| 34 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 35 | // Internal interface used by PeerConnection. |
| 36 | class RtpSenderInternal : public RtpSenderInterface { |
| 37 | public: |
Steve Anton | 57858b3 | 2018-02-15 15:19:50 -0800 | [diff] [blame] | 38 | // Sets the underlying MediaEngine channel associated with this RtpSender. |
Amit Hilbuch | dd9390c | 2018-11-13 16:26:05 -0800 | [diff] [blame] | 39 | // A VoiceMediaChannel should be used for audio RtpSenders and |
| 40 | // a VideoMediaChannel should be used for video RtpSenders. |
| 41 | // Must call SetMediaChannel(nullptr) before the media channel is destroyed. |
| 42 | virtual void SetMediaChannel(cricket::MediaChannel* media_channel) = 0; |
Steve Anton | 57858b3 | 2018-02-15 15:19:50 -0800 | [diff] [blame] | 43 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 44 | // Used to set the SSRC of the sender, once a local description has been set. |
| 45 | // If |ssrc| is 0, this indiates that the sender should disconnect from the |
| 46 | // underlying transport (this occurs if the sender isn't seen in a local |
| 47 | // description). |
| 48 | virtual void SetSsrc(uint32_t ssrc) = 0; |
| 49 | |
Henrik Andreassson | cc18917 | 2019-05-20 09:01:38 +0000 | [diff] [blame] | 50 | virtual void set_stream_ids(const std::vector<std::string>& stream_ids) = 0; |
Florent Castelli | 892acf0 | 2018-10-01 22:47:20 +0200 | [diff] [blame] | 51 | virtual void set_init_send_encodings( |
| 52 | const std::vector<RtpEncodingParameters>& init_send_encodings) = 0; |
Harald Alvestrand | 4a7b3ac | 2019-01-17 10:39:40 +0100 | [diff] [blame] | 53 | virtual void set_transport( |
| 54 | rtc::scoped_refptr<DtlsTransportInterface> dtls_transport) = 0; |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 55 | |
| 56 | virtual void Stop() = 0; |
Steve Anton | 57858b3 | 2018-02-15 15:19:50 -0800 | [diff] [blame] | 57 | |
Amit Hilbuch | 619b294 | 2019-02-26 15:55:19 -0800 | [diff] [blame] | 58 | // |GetParameters| and |SetParameters| operate with a transactional model. |
| 59 | // Allow access to get/set parameters without invalidating transaction id. |
| 60 | virtual RtpParameters GetParametersInternal() const = 0; |
| 61 | virtual RTCError SetParametersInternal(const RtpParameters& parameters) = 0; |
| 62 | |
Steve Anton | 57858b3 | 2018-02-15 15:19:50 -0800 | [diff] [blame] | 63 | // Returns an ID that changes every time SetTrack() is called, but |
| 64 | // otherwise remains constant. Used to generate IDs for stats. |
| 65 | // The special value zero means that no track is attached. |
| 66 | virtual int AttachmentId() const = 0; |
Amit Hilbuch | 2297d33 | 2019-02-19 12:49:22 -0800 | [diff] [blame] | 67 | |
| 68 | // Disables the layers identified by the specified RIDs. |
| 69 | // If the specified list is empty, this is a no-op. |
| 70 | virtual RTCError DisableEncodingLayers( |
| 71 | const std::vector<std::string>& rid) = 0; |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 72 | }; |
| 73 | |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 74 | // Shared implementation for RtpSenderInternal interface. |
| 75 | class RtpSenderBase : public RtpSenderInternal, public ObserverInterface { |
| 76 | public: |
Guido Urdaneta | 1ff16c8 | 2019-05-20 19:31:53 +0200 | [diff] [blame] | 77 | class SetStreamsObserver { |
| 78 | public: |
| 79 | virtual ~SetStreamsObserver() = default; |
| 80 | virtual void OnSetStreams() = 0; |
| 81 | }; |
| 82 | |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 83 | // Sets the underlying MediaEngine channel associated with this RtpSender. |
| 84 | // A VoiceMediaChannel should be used for audio RtpSenders and |
| 85 | // a VideoMediaChannel should be used for video RtpSenders. |
| 86 | // Must call SetMediaChannel(nullptr) before the media channel is destroyed. |
| 87 | void SetMediaChannel(cricket::MediaChannel* media_channel) override; |
| 88 | |
| 89 | bool SetTrack(MediaStreamTrackInterface* track) override; |
| 90 | rtc::scoped_refptr<MediaStreamTrackInterface> track() const override { |
| 91 | return track_; |
| 92 | } |
| 93 | |
| 94 | RtpParameters GetParameters() const override; |
| 95 | RTCError SetParameters(const RtpParameters& parameters) override; |
| 96 | |
Amit Hilbuch | 619b294 | 2019-02-26 15:55:19 -0800 | [diff] [blame] | 97 | // |GetParameters| and |SetParameters| operate with a transactional model. |
| 98 | // Allow access to get/set parameters without invalidating transaction id. |
| 99 | RtpParameters GetParametersInternal() const override; |
| 100 | RTCError SetParametersInternal(const RtpParameters& parameters) override; |
| 101 | |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 102 | // Used to set the SSRC of the sender, once a local description has been set. |
| 103 | // If |ssrc| is 0, this indiates that the sender should disconnect from the |
| 104 | // underlying transport (this occurs if the sender isn't seen in a local |
| 105 | // description). |
| 106 | void SetSsrc(uint32_t ssrc) override; |
| 107 | uint32_t ssrc() const override { return ssrc_; } |
| 108 | |
| 109 | std::vector<std::string> stream_ids() const override { return stream_ids_; } |
Henrik Andreassson | cc18917 | 2019-05-20 09:01:38 +0000 | [diff] [blame] | 110 | void set_stream_ids(const std::vector<std::string>& stream_ids) override { |
| 111 | stream_ids_ = stream_ids; |
| 112 | } |
Guido Urdaneta | 1ff16c8 | 2019-05-20 19:31:53 +0200 | [diff] [blame] | 113 | void SetStreams(const std::vector<std::string>& stream_ids) override; |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 114 | |
| 115 | std::string id() const override { return id_; } |
| 116 | |
| 117 | void set_init_send_encodings( |
| 118 | const std::vector<RtpEncodingParameters>& init_send_encodings) override { |
| 119 | init_parameters_.encodings = init_send_encodings; |
| 120 | } |
| 121 | std::vector<RtpEncodingParameters> init_send_encodings() const override { |
| 122 | return init_parameters_.encodings; |
| 123 | } |
| 124 | |
| 125 | void set_transport( |
| 126 | rtc::scoped_refptr<DtlsTransportInterface> dtls_transport) override { |
| 127 | dtls_transport_ = dtls_transport; |
| 128 | } |
| 129 | rtc::scoped_refptr<DtlsTransportInterface> dtls_transport() const override { |
| 130 | return dtls_transport_; |
| 131 | } |
| 132 | |
| 133 | void SetFrameEncryptor( |
| 134 | rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor) override; |
| 135 | |
| 136 | rtc::scoped_refptr<FrameEncryptorInterface> GetFrameEncryptor() |
| 137 | const override { |
| 138 | return frame_encryptor_; |
| 139 | } |
| 140 | |
| 141 | void Stop() override; |
| 142 | |
| 143 | // Returns an ID that changes every time SetTrack() is called, but |
| 144 | // otherwise remains constant. Used to generate IDs for stats. |
| 145 | // The special value zero means that no track is attached. |
| 146 | int AttachmentId() const override { return attachment_id_; } |
| 147 | |
| 148 | // Disables the layers identified by the specified RIDs. |
| 149 | // If the specified list is empty, this is a no-op. |
| 150 | RTCError DisableEncodingLayers(const std::vector<std::string>& rid) override; |
| 151 | |
| 152 | protected: |
Guido Urdaneta | 1ff16c8 | 2019-05-20 19:31:53 +0200 | [diff] [blame] | 153 | // If |set_streams_observer| is not null, it is invoked when SetStreams() |
| 154 | // is called. |set_streams_observer| is not owned by this object. If not |
| 155 | // null, it must be valid at least until this sender becomes stopped. |
| 156 | RtpSenderBase(rtc::Thread* worker_thread, |
| 157 | const std::string& id, |
| 158 | SetStreamsObserver* set_streams_observer); |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 159 | // TODO(nisse): Since SSRC == 0 is technically valid, figure out |
| 160 | // some other way to test if we have a valid SSRC. |
| 161 | bool can_send_track() const { return track_ && ssrc_; } |
| 162 | |
| 163 | virtual std::string track_kind() const = 0; |
| 164 | |
| 165 | // Enable sending on the media channel. |
| 166 | virtual void SetSend() = 0; |
| 167 | // Disable sending on the media channel. |
| 168 | virtual void ClearSend() = 0; |
| 169 | |
| 170 | // Template method pattern to allow subclasses to add custom behavior for |
| 171 | // when tracks are attached, detached, and for adding tracks to statistics. |
| 172 | virtual void AttachTrack() {} |
| 173 | virtual void DetachTrack() {} |
| 174 | virtual void AddTrackToStats() {} |
| 175 | virtual void RemoveTrackFromStats() {} |
| 176 | |
| 177 | rtc::Thread* worker_thread_; |
| 178 | uint32_t ssrc_ = 0; |
| 179 | bool stopped_ = false; |
| 180 | int attachment_id_ = 0; |
| 181 | const std::string id_; |
| 182 | |
| 183 | std::vector<std::string> stream_ids_; |
| 184 | RtpParameters init_parameters_; |
| 185 | |
| 186 | cricket::MediaChannel* media_channel_ = nullptr; |
| 187 | rtc::scoped_refptr<MediaStreamTrackInterface> track_; |
| 188 | |
| 189 | rtc::scoped_refptr<DtlsTransportInterface> dtls_transport_; |
| 190 | rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor_; |
| 191 | // |last_transaction_id_| is used to verify that |SetParameters| is receiving |
| 192 | // the parameters object that was last returned from |GetParameters|. |
| 193 | // As such, it is used for internal verification and is not observable by the |
| 194 | // the client. It is marked as mutable to enable |GetParameters| to be a |
| 195 | // const method. |
| 196 | mutable absl::optional<std::string> last_transaction_id_; |
| 197 | std::vector<std::string> disabled_rids_; |
Guido Urdaneta | 1ff16c8 | 2019-05-20 19:31:53 +0200 | [diff] [blame] | 198 | |
| 199 | SetStreamsObserver* set_streams_observer_ = nullptr; |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 200 | }; |
| 201 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 202 | // LocalAudioSinkAdapter receives data callback as a sink to the local |
| 203 | // AudioTrack, and passes the data to the sink of AudioSource. |
| 204 | class LocalAudioSinkAdapter : public AudioTrackSinkInterface, |
| 205 | public cricket::AudioSource { |
| 206 | public: |
| 207 | LocalAudioSinkAdapter(); |
| 208 | virtual ~LocalAudioSinkAdapter(); |
| 209 | |
| 210 | private: |
| 211 | // AudioSinkInterface implementation. |
| 212 | void OnData(const void* audio_data, |
| 213 | int bits_per_sample, |
| 214 | int sample_rate, |
| 215 | size_t number_of_channels, |
| 216 | size_t number_of_frames) override; |
| 217 | |
| 218 | // cricket::AudioSource implementation. |
| 219 | void SetSink(cricket::AudioSource::Sink* sink) override; |
| 220 | |
| 221 | cricket::AudioSource::Sink* sink_; |
| 222 | // Critical section protecting |sink_|. |
| 223 | rtc::CriticalSection lock_; |
| 224 | }; |
| 225 | |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 226 | class AudioRtpSender : public DtmfProviderInterface, public RtpSenderBase { |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 227 | public: |
Steve Anton | 111fdfd | 2018-06-25 13:03:36 -0700 | [diff] [blame] | 228 | // Construct an RtpSender for audio with the given sender ID. |
| 229 | // The sender is initialized with no track to send and no associated streams. |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 230 | // StatsCollector provided so that Add/RemoveLocalAudioTrack can be called |
| 231 | // at the appropriate times. |
Guido Urdaneta | 1ff16c8 | 2019-05-20 19:31:53 +0200 | [diff] [blame] | 232 | // If |set_streams_observer| is not null, it is invoked when SetStreams() |
| 233 | // is called. |set_streams_observer| is not owned by this object. If not |
| 234 | // null, it must be valid at least until this sender becomes stopped. |
| 235 | static rtc::scoped_refptr<AudioRtpSender> Create( |
| 236 | rtc::Thread* worker_thread, |
| 237 | const std::string& id, |
| 238 | StatsCollector* stats, |
| 239 | SetStreamsObserver* set_streams_observer); |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 240 | virtual ~AudioRtpSender(); |
| 241 | |
deadbeef | 20cb0c1 | 2017-02-01 20:27:00 -0800 | [diff] [blame] | 242 | // DtmfSenderProvider implementation. |
| 243 | bool CanInsertDtmf() override; |
| 244 | bool InsertDtmf(int code, int duration) override; |
| 245 | sigslot::signal0<>* GetOnDestroyedSignal() override; |
| 246 | |
| 247 | // ObserverInterface implementation. |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 248 | void OnChanged() override; |
| 249 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 250 | cricket::MediaType media_type() const override { |
| 251 | return cricket::MEDIA_TYPE_AUDIO; |
| 252 | } |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 253 | std::string track_kind() const override { |
| 254 | return MediaStreamTrackInterface::kAudioKind; |
| 255 | } |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 256 | |
deadbeef | 20cb0c1 | 2017-02-01 20:27:00 -0800 | [diff] [blame] | 257 | rtc::scoped_refptr<DtmfSenderInterface> GetDtmfSender() const override; |
| 258 | |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 259 | protected: |
| 260 | AudioRtpSender(rtc::Thread* worker_thread, |
| 261 | const std::string& id, |
Guido Urdaneta | 1ff16c8 | 2019-05-20 19:31:53 +0200 | [diff] [blame] | 262 | StatsCollector* stats, |
| 263 | SetStreamsObserver* set_streams_observer); |
Benjamin Wright | d81ac95 | 2018-08-29 17:02:10 -0700 | [diff] [blame] | 264 | |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 265 | void SetSend() override; |
| 266 | void ClearSend() override; |
Benjamin Wright | d81ac95 | 2018-08-29 17:02:10 -0700 | [diff] [blame] | 267 | |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 268 | // Hooks to allow custom logic when tracks are attached and detached. |
| 269 | void AttachTrack() override; |
| 270 | void DetachTrack() override; |
| 271 | void AddTrackToStats() override; |
| 272 | void RemoveTrackFromStats() override; |
Amit Hilbuch | 2297d33 | 2019-02-19 12:49:22 -0800 | [diff] [blame] | 273 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 274 | private: |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 275 | cricket::VoiceMediaChannel* voice_media_channel() { |
| 276 | return static_cast<cricket::VoiceMediaChannel*>(media_channel_); |
| 277 | } |
| 278 | rtc::scoped_refptr<AudioTrackInterface> audio_track() const { |
| 279 | return rtc::scoped_refptr<AudioTrackInterface>( |
| 280 | static_cast<AudioTrackInterface*>(track_.get())); |
| 281 | } |
deadbeef | 20cb0c1 | 2017-02-01 20:27:00 -0800 | [diff] [blame] | 282 | sigslot::signal0<> SignalDestroyed; |
| 283 | |
Steve Anton | 111fdfd | 2018-06-25 13:03:36 -0700 | [diff] [blame] | 284 | StatsCollector* stats_ = nullptr; |
deadbeef | 20cb0c1 | 2017-02-01 20:27:00 -0800 | [diff] [blame] | 285 | rtc::scoped_refptr<DtmfSenderInterface> dtmf_sender_proxy_; |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 286 | bool cached_track_enabled_ = false; |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 287 | |
| 288 | // Used to pass the data callback from the |track_| to the other end of |
| 289 | // cricket::AudioSource. |
| 290 | std::unique_ptr<LocalAudioSinkAdapter> sink_adapter_; |
| 291 | }; |
| 292 | |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 293 | class VideoRtpSender : public RtpSenderBase { |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 294 | public: |
Steve Anton | 111fdfd | 2018-06-25 13:03:36 -0700 | [diff] [blame] | 295 | // Construct an RtpSender for video with the given sender ID. |
| 296 | // The sender is initialized with no track to send and no associated streams. |
Guido Urdaneta | 1ff16c8 | 2019-05-20 19:31:53 +0200 | [diff] [blame] | 297 | // If |set_streams_observer| is not null, it is invoked when SetStreams() |
| 298 | // is called. |set_streams_observer| is not owned by this object. If not |
| 299 | // null, it must be valid at least until this sender becomes stopped. |
| 300 | static rtc::scoped_refptr<VideoRtpSender> Create( |
| 301 | rtc::Thread* worker_thread, |
| 302 | const std::string& id, |
| 303 | SetStreamsObserver* set_streams_observer); |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 304 | virtual ~VideoRtpSender(); |
| 305 | |
| 306 | // ObserverInterface implementation |
| 307 | void OnChanged() override; |
| 308 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 309 | cricket::MediaType media_type() const override { |
| 310 | return cricket::MEDIA_TYPE_VIDEO; |
| 311 | } |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 312 | std::string track_kind() const override { |
| 313 | return MediaStreamTrackInterface::kVideoKind; |
Florent Castelli | 892acf0 | 2018-10-01 22:47:20 +0200 | [diff] [blame] | 314 | } |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 315 | |
deadbeef | 20cb0c1 | 2017-02-01 20:27:00 -0800 | [diff] [blame] | 316 | rtc::scoped_refptr<DtmfSenderInterface> GetDtmfSender() const override; |
| 317 | |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 318 | protected: |
Guido Urdaneta | 1ff16c8 | 2019-05-20 19:31:53 +0200 | [diff] [blame] | 319 | VideoRtpSender(rtc::Thread* worker_thread, |
| 320 | const std::string& id, |
| 321 | SetStreamsObserver* set_streams_observer); |
Benjamin Wright | d81ac95 | 2018-08-29 17:02:10 -0700 | [diff] [blame] | 322 | |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 323 | void SetSend() override; |
| 324 | void ClearSend() override; |
Benjamin Wright | d81ac95 | 2018-08-29 17:02:10 -0700 | [diff] [blame] | 325 | |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 326 | // Hook to allow custom logic when tracks are attached. |
| 327 | void AttachTrack() override; |
Amit Hilbuch | 2297d33 | 2019-02-19 12:49:22 -0800 | [diff] [blame] | 328 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 329 | private: |
Amit Hilbuch | ea7ef2a | 2019-02-19 15:20:21 -0800 | [diff] [blame] | 330 | cricket::VideoMediaChannel* video_media_channel() { |
| 331 | return static_cast<cricket::VideoMediaChannel*>(media_channel_); |
| 332 | } |
| 333 | rtc::scoped_refptr<VideoTrackInterface> video_track() const { |
| 334 | return rtc::scoped_refptr<VideoTrackInterface>( |
| 335 | static_cast<VideoTrackInterface*>(track_.get())); |
| 336 | } |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 337 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 338 | VideoTrackInterface::ContentHint cached_track_content_hint_ = |
| 339 | VideoTrackInterface::ContentHint::kNone; |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 340 | }; |
| 341 | |
| 342 | } // namespace webrtc |
| 343 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 344 | #endif // PC_RTP_SENDER_H_ |