OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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_CALL_RTP_TRANSPORT_CONTROLLER_SEND_H_ | 11 #ifndef WEBRTC_CALL_RTP_TRANSPORT_CONTROLLER_SEND_H_ |
12 #define WEBRTC_CALL_RTP_TRANSPORT_CONTROLLER_SEND_H_ | 12 #define WEBRTC_CALL_RTP_TRANSPORT_CONTROLLER_SEND_H_ |
13 | 13 |
| 14 #include "webrtc/base/constructormagic.h" |
| 15 #include "webrtc/call/rtp_transport_controller_send_interface.h" |
| 16 #include "webrtc/modules/congestion_controller/include/send_side_congestion_cont
roller.h" |
| 17 |
14 namespace webrtc { | 18 namespace webrtc { |
| 19 class Clock; |
| 20 class RtcEventLog; |
15 | 21 |
16 class Module; | 22 // TODO(nisse): When we get the underlying transports here, we should |
17 class PacketRouter; | 23 // have one object implementing RtpTransportControllerSendInterface |
18 class RtpPacketSender; | 24 // per transport, sharing the same congestion controller. |
19 class SendSideCongestionController; | 25 class RtpTransportControllerSend : public RtpTransportControllerSendInterface { |
20 class TransportFeedbackObserver; | 26 public: |
| 27 RtpTransportControllerSend(Clock* clock, webrtc::RtcEventLog* event_log); |
21 | 28 |
22 // An RtpTransportController should own everything related to the RTP | 29 void RegisterNetworkObserver( |
23 // transport to/from a remote endpoint. We should have separate | 30 SendSideCongestionController::Observer* observer); |
24 // interfaces for send and receive side, even if they are implemented | |
25 // by the same class. This is an ongoing refactoring project. At some | |
26 // point, this class should be promoted to a public api under | |
27 // webrtc/api/rtp/. | |
28 // | |
29 // For a start, this object is just a collection of the objects needed | |
30 // by the VideoSendStream constructor. The plan is to move ownership | |
31 // of all RTP-related objects here, and add methods to create per-ssrc | |
32 // objects which would then be passed to VideoSendStream. Eventually, | |
33 // direct accessors like packet_router() should be removed. | |
34 // | |
35 // This should also have a reference to the underlying | |
36 // webrtc::Transport(s). Currently, webrtc::Transport is implemented by | |
37 // WebRtcVideoChannel2 and WebRtcVoiceMediaChannel, and owned by | |
38 // WebrtcSession. Video and audio always uses different transport | |
39 // objects, even in the common case where they are bundled over the | |
40 // same underlying transport. | |
41 // | |
42 // Extracting the logic of the webrtc::Transport from BaseChannel and | |
43 // subclasses into a separate class seems to be a prerequesite for | |
44 // moving the transport here. | |
45 class RtpTransportControllerSendInterface { | |
46 public: | |
47 virtual ~RtpTransportControllerSendInterface() {} | |
48 virtual PacketRouter* packet_router() = 0; | |
49 // Currently returning the same pointer, but with different types. | |
50 virtual SendSideCongestionController* send_side_cc() = 0; | |
51 virtual TransportFeedbackObserver* transport_feedback_observer() = 0; | |
52 | 31 |
53 virtual RtpPacketSender* packet_sender() = 0; | 32 // Implements RtpTransportControllerSendInterface |
| 33 PacketRouter* packet_router() override { return &packet_router_; } |
| 34 SendSideCongestionController* send_side_cc() override { |
| 35 return &send_side_cc_; |
| 36 } |
| 37 TransportFeedbackObserver* transport_feedback_observer() override { |
| 38 return &send_side_cc_; |
| 39 } |
| 40 RtpPacketSender* packet_sender() override { return send_side_cc_.pacer(); } |
| 41 |
| 42 private: |
| 43 PacketRouter packet_router_; |
| 44 SendSideCongestionController send_side_cc_; |
| 45 |
| 46 RTC_DISALLOW_COPY_AND_ASSIGN(RtpTransportControllerSend); |
54 }; | 47 }; |
55 | 48 |
56 } // namespace webrtc | 49 } // namespace webrtc |
57 | 50 |
58 #endif // WEBRTC_CALL_RTP_TRANSPORT_CONTROLLER_SEND_H_ | 51 #endif // WEBRTC_CALL_RTP_TRANSPORT_CONTROLLER_SEND_H_ |
OLD | NEW |