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" |
| 20 #include "webrtc/api/ortc/ortcrtpsenderinterface.h" |
| 21 #include "webrtc/api/ortc/rtptransportcontrollerinterface.h" |
| 22 #include "webrtc/api/ortc/srtptransportinterface.h" |
19 #include "webrtc/base/constructormagic.h" | 23 #include "webrtc/base/constructormagic.h" |
20 #include "webrtc/base/sigslot.h" | 24 #include "webrtc/base/sigslot.h" |
21 #include "webrtc/base/thread.h" | 25 #include "webrtc/base/thread.h" |
22 #include "webrtc/call/call.h" | 26 #include "webrtc/call/call.h" |
23 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 27 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
24 #include "webrtc/api/ortc/ortcrtpreceiverinterface.h" | 28 #include "webrtc/media/base/mediachannel.h" // For MediaConfig. |
25 #include "webrtc/api/ortc/ortcrtpsenderinterface.h" | |
26 #include "webrtc/api/ortc/rtptransportcontrollerinterface.h" | |
27 #include "webrtc/api/ortc/rtptransportinterface.h" | |
28 #include "webrtc/pc/channelmanager.h" | 29 #include "webrtc/pc/channelmanager.h" |
29 #include "webrtc/pc/mediacontroller.h" | 30 #include "webrtc/pc/mediacontroller.h" |
30 #include "webrtc/media/base/mediachannel.h" // For MediaConfig. | |
31 | 31 |
32 namespace webrtc { | 32 namespace webrtc { |
33 | 33 |
34 class RtpTransportAdapter; | 34 class RtpTransportAdapter; |
35 class OrtcRtpSenderAdapter; | 35 class OrtcRtpSenderAdapter; |
36 class OrtcRtpReceiverAdapter; | 36 class OrtcRtpReceiverAdapter; |
37 | 37 |
38 // Implementation of RtpTransportControllerInterface. Wraps a MediaController, | 38 // Implementation of RtpTransportControllerInterface. Wraps a MediaController, |
39 // a VoiceChannel and VideoChannel, and maintains a list of dependent RTP | 39 // a VoiceChannel and VideoChannel, and maintains a list of dependent RTP |
40 // transports. | 40 // transports. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 std::vector<RtpTransportInterface*> GetTransports() const override; | 74 std::vector<RtpTransportInterface*> GetTransports() const override; |
75 | 75 |
76 // These methods are used by OrtcFactory to create RtpTransports, RtpSenders | 76 // These methods are used by OrtcFactory to create RtpTransports, RtpSenders |
77 // and RtpReceivers using this controller. Called "CreateProxied" because | 77 // and RtpReceivers using this controller. Called "CreateProxied" because |
78 // 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 |
79 // thread. | 79 // thread. |
80 RTCErrorOr<std::unique_ptr<RtpTransportInterface>> CreateProxiedRtpTransport( | 80 RTCErrorOr<std::unique_ptr<RtpTransportInterface>> CreateProxiedRtpTransport( |
81 const RtcpParameters& rtcp_parameters, | 81 const RtcpParameters& rtcp_parameters, |
82 PacketTransportInterface* rtp, | 82 PacketTransportInterface* rtp, |
83 PacketTransportInterface* rtcp); | 83 PacketTransportInterface* rtcp); |
| 84 |
| 85 RTCErrorOr<std::unique_ptr<SrtpTransportInterface>> |
| 86 CreateProxiedSrtpTransport(const RtcpParameters& rtcp_parameters, |
| 87 PacketTransportInterface* rtp, |
| 88 PacketTransportInterface* rtcp); |
| 89 |
84 // |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 |
85 // application may call GetTransport() on the returned sender or receiver, | 91 // application may call GetTransport() on the returned sender or receiver, |
86 // and expects it to return a thread-safe transport proxy. | 92 // and expects it to return a thread-safe transport proxy. |
87 RTCErrorOr<std::unique_ptr<OrtcRtpSenderInterface>> CreateProxiedRtpSender( | 93 RTCErrorOr<std::unique_ptr<OrtcRtpSenderInterface>> CreateProxiedRtpSender( |
88 cricket::MediaType kind, | 94 cricket::MediaType kind, |
89 RtpTransportInterface* transport_proxy); | 95 RtpTransportInterface* transport_proxy); |
90 RTCErrorOr<std::unique_ptr<OrtcRtpReceiverInterface>> | 96 RTCErrorOr<std::unique_ptr<OrtcRtpReceiverInterface>> |
91 CreateProxiedRtpReceiver(cricket::MediaType kind, | 97 CreateProxiedRtpReceiver(cricket::MediaType kind, |
92 RtpTransportInterface* transport_proxy); | 98 RtpTransportInterface* transport_proxy); |
93 | 99 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // |description| is the matching description where existing SSRCs can be | 169 // |description| is the matching description where existing SSRCs can be |
164 // found. | 170 // found. |
165 // | 171 // |
166 // This is a member function because it may need to generate SSRCs that don't | 172 // This is a member function because it may need to generate SSRCs that don't |
167 // match existing ones, which is more than ToStreamParamsVec does. | 173 // match existing ones, which is more than ToStreamParamsVec does. |
168 RTCErrorOr<cricket::StreamParamsVec> MakeSendStreamParamsVec( | 174 RTCErrorOr<cricket::StreamParamsVec> MakeSendStreamParamsVec( |
169 std::vector<RtpEncodingParameters> encodings, | 175 std::vector<RtpEncodingParameters> encodings, |
170 const std::string& cname, | 176 const std::string& cname, |
171 const cricket::MediaContentDescription& description) const; | 177 const cricket::MediaContentDescription& description) const; |
172 | 178 |
| 179 // If the |rtp_transport| is a SrtpTransport, set the cryptos of the |
| 180 // audio/video content descriptions. |
| 181 RTCError MaybeSetCryptos( |
| 182 RtpTransportInterface* rtp_transport, |
| 183 cricket::MediaContentDescription* local_description, |
| 184 cricket::MediaContentDescription* remote_description); |
| 185 |
173 rtc::Thread* signaling_thread_; | 186 rtc::Thread* signaling_thread_; |
174 rtc::Thread* worker_thread_; | 187 rtc::Thread* worker_thread_; |
175 // |transport_proxies_| and |inner_audio_transport_|/|inner_audio_transport_| | 188 // |transport_proxies_| and |inner_audio_transport_|/|inner_audio_transport_| |
176 // are somewhat redundant, but the latter are only set when | 189 // are somewhat redundant, but the latter are only set when |
177 // RtpSenders/RtpReceivers are attached to the transport. | 190 // RtpSenders/RtpReceivers are attached to the transport. |
178 std::vector<RtpTransportInterface*> transport_proxies_; | 191 std::vector<RtpTransportInterface*> transport_proxies_; |
179 RtpTransportInterface* inner_audio_transport_ = nullptr; | 192 RtpTransportInterface* inner_audio_transport_ = nullptr; |
180 RtpTransportInterface* inner_video_transport_ = nullptr; | 193 RtpTransportInterface* inner_video_transport_ = nullptr; |
181 std::unique_ptr<MediaControllerInterface> media_controller_; | 194 std::unique_ptr<MediaControllerInterface> media_controller_; |
182 | 195 |
(...skipping 10 matching lines...) Expand all Loading... |
193 bool have_video_sender_ = false; | 206 bool have_video_sender_ = false; |
194 bool have_audio_receiver_ = false; | 207 bool have_audio_receiver_ = false; |
195 bool have_video_receiver_ = false; | 208 bool have_video_receiver_ = false; |
196 | 209 |
197 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpTransportControllerAdapter); | 210 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpTransportControllerAdapter); |
198 }; | 211 }; |
199 | 212 |
200 } // namespace webrtc | 213 } // namespace webrtc |
201 | 214 |
202 #endif // WEBRTC_ORTC_RTPTRANSPORTCONTROLLERADAPTER_H_ | 215 #endif // WEBRTC_ORTC_RTPTRANSPORTCONTROLLERADAPTER_H_ |
OLD | NEW |