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/base/constructormagic.h" | 23 #include "webrtc/base/constructormagic.h" |
24 #include "webrtc/base/sigslot.h" | 24 #include "webrtc/base/sigslot.h" |
25 #include "webrtc/base/thread.h" | 25 #include "webrtc/base/thread.h" |
26 #include "webrtc/call/call.h" | 26 #include "webrtc/call/call.h" |
27 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 27 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
28 #include "webrtc/media/base/mediachannel.h" // For MediaConfig. | 28 #include "webrtc/media/base/mediachannel.h" // For MediaConfig. |
29 #include "webrtc/pc/channelmanager.h" | 29 #include "webrtc/pc/channelmanager.h" |
30 #include "webrtc/pc/mediacontroller.h" | |
31 | 30 |
32 namespace webrtc { | 31 namespace webrtc { |
33 | 32 |
34 class RtpTransportAdapter; | 33 class RtpTransportAdapter; |
35 class OrtcRtpSenderAdapter; | 34 class OrtcRtpSenderAdapter; |
36 class OrtcRtpReceiverAdapter; | 35 class OrtcRtpReceiverAdapter; |
37 | 36 |
38 // Implementation of RtpTransportControllerInterface. Wraps a MediaController, | 37 // Implementation of RtpTransportControllerInterface. Wraps a MediaController, |
39 // a VoiceChannel and VideoChannel, and maintains a list of dependent RTP | 38 // a VoiceChannel and VideoChannel, and maintains a list of dependent RTP |
40 // transports. | 39 // transports. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 protected: | 122 protected: |
124 RtpTransportControllerAdapter* GetInternal() override { return this; } | 123 RtpTransportControllerAdapter* GetInternal() override { return this; } |
125 | 124 |
126 private: | 125 private: |
127 // Only expected to be called by RtpTransportControllerAdapter::CreateProxied. | 126 // Only expected to be called by RtpTransportControllerAdapter::CreateProxied. |
128 RtpTransportControllerAdapter(const cricket::MediaConfig& config, | 127 RtpTransportControllerAdapter(const cricket::MediaConfig& config, |
129 cricket::ChannelManager* channel_manager, | 128 cricket::ChannelManager* channel_manager, |
130 webrtc::RtcEventLog* event_log, | 129 webrtc::RtcEventLog* event_log, |
131 rtc::Thread* signaling_thread, | 130 rtc::Thread* signaling_thread, |
132 rtc::Thread* worker_thread); | 131 rtc::Thread* worker_thread); |
| 132 void Init_w(); |
| 133 void Close_w(); |
133 | 134 |
134 // These return an error if another of the same type of object is already | 135 // These return an error if another of the same type of object is already |
135 // attached, or if |transport_proxy| can't be used with the sender/receiver | 136 // attached, or if |transport_proxy| can't be used with the sender/receiver |
136 // due to the limitation that the sender/receiver of the same media type must | 137 // due to the limitation that the sender/receiver of the same media type must |
137 // use the same transport. | 138 // use the same transport. |
138 RTCError AttachAudioSender(OrtcRtpSenderAdapter* sender, | 139 RTCError AttachAudioSender(OrtcRtpSenderAdapter* sender, |
139 RtpTransportInterface* inner_transport); | 140 RtpTransportInterface* inner_transport); |
140 RTCError AttachVideoSender(OrtcRtpSenderAdapter* sender, | 141 RTCError AttachVideoSender(OrtcRtpSenderAdapter* sender, |
141 RtpTransportInterface* inner_transport); | 142 RtpTransportInterface* inner_transport); |
142 RTCError AttachAudioReceiver(OrtcRtpReceiverAdapter* receiver, | 143 RTCError AttachAudioReceiver(OrtcRtpReceiverAdapter* receiver, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 cricket::MediaContentDescription* remote_description); | 185 cricket::MediaContentDescription* remote_description); |
185 | 186 |
186 rtc::Thread* signaling_thread_; | 187 rtc::Thread* signaling_thread_; |
187 rtc::Thread* worker_thread_; | 188 rtc::Thread* worker_thread_; |
188 // |transport_proxies_| and |inner_audio_transport_|/|inner_audio_transport_| | 189 // |transport_proxies_| and |inner_audio_transport_|/|inner_audio_transport_| |
189 // are somewhat redundant, but the latter are only set when | 190 // are somewhat redundant, but the latter are only set when |
190 // RtpSenders/RtpReceivers are attached to the transport. | 191 // RtpSenders/RtpReceivers are attached to the transport. |
191 std::vector<RtpTransportInterface*> transport_proxies_; | 192 std::vector<RtpTransportInterface*> transport_proxies_; |
192 RtpTransportInterface* inner_audio_transport_ = nullptr; | 193 RtpTransportInterface* inner_audio_transport_ = nullptr; |
193 RtpTransportInterface* inner_video_transport_ = nullptr; | 194 RtpTransportInterface* inner_video_transport_ = nullptr; |
194 std::unique_ptr<MediaControllerInterface> media_controller_; | 195 const cricket::MediaConfig media_config_; |
| 196 cricket::ChannelManager* channel_manager_; |
| 197 webrtc::RtcEventLog* event_log_; |
| 198 std::unique_ptr<Call> call_; |
195 | 199 |
196 // BaseChannel takes content descriptions as input, so we store them here | 200 // BaseChannel takes content descriptions as input, so we store them here |
197 // such that they can be updated when a new RtpSenderAdapter/ | 201 // such that they can be updated when a new RtpSenderAdapter/ |
198 // RtpReceiverAdapter attaches itself. | 202 // RtpReceiverAdapter attaches itself. |
199 cricket::AudioContentDescription local_audio_description_; | 203 cricket::AudioContentDescription local_audio_description_; |
200 cricket::AudioContentDescription remote_audio_description_; | 204 cricket::AudioContentDescription remote_audio_description_; |
201 cricket::VideoContentDescription local_video_description_; | 205 cricket::VideoContentDescription local_video_description_; |
202 cricket::VideoContentDescription remote_video_description_; | 206 cricket::VideoContentDescription remote_video_description_; |
203 cricket::VoiceChannel* voice_channel_ = nullptr; | 207 cricket::VoiceChannel* voice_channel_ = nullptr; |
204 cricket::VideoChannel* video_channel_ = nullptr; | 208 cricket::VideoChannel* video_channel_ = nullptr; |
205 bool have_audio_sender_ = false; | 209 bool have_audio_sender_ = false; |
206 bool have_video_sender_ = false; | 210 bool have_video_sender_ = false; |
207 bool have_audio_receiver_ = false; | 211 bool have_audio_receiver_ = false; |
208 bool have_video_receiver_ = false; | 212 bool have_video_receiver_ = false; |
209 | 213 |
210 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpTransportControllerAdapter); | 214 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpTransportControllerAdapter); |
211 }; | 215 }; |
212 | 216 |
213 } // namespace webrtc | 217 } // namespace webrtc |
214 | 218 |
215 #endif // WEBRTC_ORTC_RTPTRANSPORTCONTROLLERADAPTER_H_ | 219 #endif // WEBRTC_ORTC_RTPTRANSPORTCONTROLLERADAPTER_H_ |
OLD | NEW |