OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_ORTC_RTPTRANSPORTCONTROLLERADAPTER_H_ | 11 #ifndef WEBRTC_ORTC_RTPTRANSPORTCONTROLLERADAPTER_H_ |
12 #define WEBRTC_ORTC_RTPTRANSPORTCONTROLLERADAPTER_H_ | 12 #define WEBRTC_ORTC_RTPTRANSPORTCONTROLLERADAPTER_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <set> | 15 #include <set> |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/api/ortc/ortcrtpreceiverinterface.h" | 19 #include "webrtc/api/ortc/ortcrtpreceiverinterface.h" |
20 #include "webrtc/api/ortc/ortcrtpsenderinterface.h" | 20 #include "webrtc/api/ortc/ortcrtpsenderinterface.h" |
21 #include "webrtc/api/ortc/rtptransportcontrollerinterface.h" | 21 #include "webrtc/api/ortc/rtptransportcontrollerinterface.h" |
22 #include "webrtc/api/ortc/srtptransportinterface.h" | 22 #include "webrtc/api/ortc/srtptransportinterface.h" |
23 #include "webrtc/call/call.h" | 23 #include "webrtc/call/call.h" |
| 24 #include "webrtc/call/rtp_transport_controller_send.h" |
24 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 25 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
25 #include "webrtc/media/base/mediachannel.h" // For MediaConfig. | 26 #include "webrtc/media/base/mediachannel.h" // For MediaConfig. |
26 #include "webrtc/pc/channelmanager.h" | 27 #include "webrtc/pc/channelmanager.h" |
27 #include "webrtc/rtc_base/constructormagic.h" | 28 #include "webrtc/rtc_base/constructormagic.h" |
28 #include "webrtc/rtc_base/sigslot.h" | 29 #include "webrtc/rtc_base/sigslot.h" |
29 #include "webrtc/rtc_base/thread.h" | 30 #include "webrtc/rtc_base/thread.h" |
30 | 31 |
31 namespace webrtc { | 32 namespace webrtc { |
32 | 33 |
33 class RtpTransportAdapter; | 34 class RtpTransportAdapter; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 ~RtpTransportControllerAdapter() override; | 71 ~RtpTransportControllerAdapter() override; |
71 | 72 |
72 // RtpTransportControllerInterface implementation. | 73 // RtpTransportControllerInterface implementation. |
73 std::vector<RtpTransportInterface*> GetTransports() const override; | 74 std::vector<RtpTransportInterface*> GetTransports() const override; |
74 | 75 |
75 // These methods are used by OrtcFactory to create RtpTransports, RtpSenders | 76 // These methods are used by OrtcFactory to create RtpTransports, RtpSenders |
76 // and RtpReceivers using this controller. Called "CreateProxied" because | 77 // and RtpReceivers using this controller. Called "CreateProxied" because |
77 // these methods return proxies that will safely call methods on the correct | 78 // these methods return proxies that will safely call methods on the correct |
78 // thread. | 79 // thread. |
79 RTCErrorOr<std::unique_ptr<RtpTransportInterface>> CreateProxiedRtpTransport( | 80 RTCErrorOr<std::unique_ptr<RtpTransportInterface>> CreateProxiedRtpTransport( |
80 const RtcpParameters& rtcp_parameters, | 81 const RtpTransportParameters& rtcp_parameters, |
81 PacketTransportInterface* rtp, | 82 PacketTransportInterface* rtp, |
82 PacketTransportInterface* rtcp); | 83 PacketTransportInterface* rtcp); |
83 | 84 |
84 RTCErrorOr<std::unique_ptr<SrtpTransportInterface>> | 85 RTCErrorOr<std::unique_ptr<SrtpTransportInterface>> |
85 CreateProxiedSrtpTransport(const RtcpParameters& rtcp_parameters, | 86 CreateProxiedSrtpTransport(const RtpTransportParameters& rtcp_parameters, |
86 PacketTransportInterface* rtp, | 87 PacketTransportInterface* rtp, |
87 PacketTransportInterface* rtcp); | 88 PacketTransportInterface* rtcp); |
88 | 89 |
89 // |transport_proxy| needs to be a proxy to a transport because the | 90 // |transport_proxy| needs to be a proxy to a transport because the |
90 // application may call GetTransport() on the returned sender or receiver, | 91 // application may call GetTransport() on the returned sender or receiver, |
91 // and expects it to return a thread-safe transport proxy. | 92 // and expects it to return a thread-safe transport proxy. |
92 RTCErrorOr<std::unique_ptr<OrtcRtpSenderInterface>> CreateProxiedRtpSender( | 93 RTCErrorOr<std::unique_ptr<OrtcRtpSenderInterface>> CreateProxiedRtpSender( |
93 cricket::MediaType kind, | 94 cricket::MediaType kind, |
94 RtpTransportInterface* transport_proxy); | 95 RtpTransportInterface* transport_proxy); |
95 RTCErrorOr<std::unique_ptr<OrtcRtpReceiverInterface>> | 96 RTCErrorOr<std::unique_ptr<OrtcRtpReceiverInterface>> |
96 CreateProxiedRtpReceiver(cricket::MediaType kind, | 97 CreateProxiedRtpReceiver(cricket::MediaType kind, |
97 RtpTransportInterface* transport_proxy); | 98 RtpTransportInterface* transport_proxy); |
98 | 99 |
99 // Methods used internally by other "adapter" classes. | 100 // Methods used internally by other "adapter" classes. |
100 rtc::Thread* signaling_thread() const { return signaling_thread_; } | 101 rtc::Thread* signaling_thread() const { return signaling_thread_; } |
101 rtc::Thread* worker_thread() const { return worker_thread_; } | 102 rtc::Thread* worker_thread() const { return worker_thread_; } |
102 | 103 |
103 RTCError SetRtcpParameters(const RtcpParameters& parameters, | 104 // |parameters.keepalive| will be set for ALL RTP transports in the call. |
104 RtpTransportInterface* inner_transport); | 105 RTCError SetRtpTransportParameters(const RtpTransportParameters& parameters, |
| 106 RtpTransportInterface* inner_transport); |
| 107 void SetRtpTransportParameters_w(const RtpTransportParameters& parameters); |
105 | 108 |
106 cricket::VoiceChannel* voice_channel() { return voice_channel_; } | 109 cricket::VoiceChannel* voice_channel() { return voice_channel_; } |
107 cricket::VideoChannel* video_channel() { return video_channel_; } | 110 cricket::VideoChannel* video_channel() { return video_channel_; } |
108 | 111 |
109 // |primary_ssrc| out parameter is filled with either | 112 // |primary_ssrc| out parameter is filled with either |
110 // |parameters.encodings[0].ssrc|, or a generated SSRC if that's left unset. | 113 // |parameters.encodings[0].ssrc|, or a generated SSRC if that's left unset. |
111 RTCError ValidateAndApplyAudioSenderParameters( | 114 RTCError ValidateAndApplyAudioSenderParameters( |
112 const RtpParameters& parameters, | 115 const RtpParameters& parameters, |
113 uint32_t* primary_ssrc); | 116 uint32_t* primary_ssrc); |
114 RTCError ValidateAndApplyVideoSenderParameters( | 117 RTCError ValidateAndApplyVideoSenderParameters( |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 189 |
187 rtc::Thread* signaling_thread_; | 190 rtc::Thread* signaling_thread_; |
188 rtc::Thread* worker_thread_; | 191 rtc::Thread* worker_thread_; |
189 // |transport_proxies_| and |inner_audio_transport_|/|inner_audio_transport_| | 192 // |transport_proxies_| and |inner_audio_transport_|/|inner_audio_transport_| |
190 // are somewhat redundant, but the latter are only set when | 193 // are somewhat redundant, but the latter are only set when |
191 // RtpSenders/RtpReceivers are attached to the transport. | 194 // RtpSenders/RtpReceivers are attached to the transport. |
192 std::vector<RtpTransportInterface*> transport_proxies_; | 195 std::vector<RtpTransportInterface*> transport_proxies_; |
193 RtpTransportInterface* inner_audio_transport_ = nullptr; | 196 RtpTransportInterface* inner_audio_transport_ = nullptr; |
194 RtpTransportInterface* inner_video_transport_ = nullptr; | 197 RtpTransportInterface* inner_video_transport_ = nullptr; |
195 const cricket::MediaConfig media_config_; | 198 const cricket::MediaConfig media_config_; |
| 199 RtpKeepAliveConfig keepalive_; |
196 cricket::ChannelManager* channel_manager_; | 200 cricket::ChannelManager* channel_manager_; |
197 webrtc::RtcEventLog* event_log_; | 201 webrtc::RtcEventLog* event_log_; |
198 std::unique_ptr<Call> call_; | 202 std::unique_ptr<Call> call_; |
| 203 webrtc::RtpTransportControllerSend* call_send_rtp_transport_controller_; |
199 | 204 |
200 // BaseChannel takes content descriptions as input, so we store them here | 205 // BaseChannel takes content descriptions as input, so we store them here |
201 // such that they can be updated when a new RtpSenderAdapter/ | 206 // such that they can be updated when a new RtpSenderAdapter/ |
202 // RtpReceiverAdapter attaches itself. | 207 // RtpReceiverAdapter attaches itself. |
203 cricket::AudioContentDescription local_audio_description_; | 208 cricket::AudioContentDescription local_audio_description_; |
204 cricket::AudioContentDescription remote_audio_description_; | 209 cricket::AudioContentDescription remote_audio_description_; |
205 cricket::VideoContentDescription local_video_description_; | 210 cricket::VideoContentDescription local_video_description_; |
206 cricket::VideoContentDescription remote_video_description_; | 211 cricket::VideoContentDescription remote_video_description_; |
207 cricket::VoiceChannel* voice_channel_ = nullptr; | 212 cricket::VoiceChannel* voice_channel_ = nullptr; |
208 cricket::VideoChannel* video_channel_ = nullptr; | 213 cricket::VideoChannel* video_channel_ = nullptr; |
209 bool have_audio_sender_ = false; | 214 bool have_audio_sender_ = false; |
210 bool have_video_sender_ = false; | 215 bool have_video_sender_ = false; |
211 bool have_audio_receiver_ = false; | 216 bool have_audio_receiver_ = false; |
212 bool have_video_receiver_ = false; | 217 bool have_video_receiver_ = false; |
213 | 218 |
214 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpTransportControllerAdapter); | 219 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpTransportControllerAdapter); |
215 }; | 220 }; |
216 | 221 |
217 } // namespace webrtc | 222 } // namespace webrtc |
218 | 223 |
219 #endif // WEBRTC_ORTC_RTPTRANSPORTCONTROLLERADAPTER_H_ | 224 #endif // WEBRTC_ORTC_RTPTRANSPORTCONTROLLERADAPTER_H_ |
OLD | NEW |