nisse | cae45d0 | 2017-04-24 05:53:20 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef CALL_RTP_TRANSPORT_CONTROLLER_SEND_INTERFACE_H_ |
| 12 | #define CALL_RTP_TRANSPORT_CONTROLLER_SEND_INTERFACE_H_ |
nisse | cae45d0 | 2017-04-24 05:53:20 -0700 | [diff] [blame] | 13 | |
| 14 | namespace webrtc { |
| 15 | |
Stefan Holmer | 5c8942a | 2017-08-22 16:16:44 +0200 | [diff] [blame] | 16 | class PacedSender; |
nisse | cae45d0 | 2017-04-24 05:53:20 -0700 | [diff] [blame] | 17 | class PacketRouter; |
| 18 | class RtpPacketSender; |
sprang | db2a9fc | 2017-08-09 06:42:32 -0700 | [diff] [blame] | 19 | struct RtpKeepAliveConfig; |
nisse | cae45d0 | 2017-04-24 05:53:20 -0700 | [diff] [blame] | 20 | class SendSideCongestionController; |
| 21 | class TransportFeedbackObserver; |
| 22 | |
| 23 | // An RtpTransportController should own everything related to the RTP |
| 24 | // transport to/from a remote endpoint. We should have separate |
| 25 | // interfaces for send and receive side, even if they are implemented |
| 26 | // by the same class. This is an ongoing refactoring project. At some |
| 27 | // point, this class should be promoted to a public api under |
| 28 | // webrtc/api/rtp/. |
| 29 | // |
| 30 | // For a start, this object is just a collection of the objects needed |
| 31 | // by the VideoSendStream constructor. The plan is to move ownership |
| 32 | // of all RTP-related objects here, and add methods to create per-ssrc |
| 33 | // objects which would then be passed to VideoSendStream. Eventually, |
| 34 | // direct accessors like packet_router() should be removed. |
| 35 | // |
| 36 | // This should also have a reference to the underlying |
| 37 | // webrtc::Transport(s). Currently, webrtc::Transport is implemented by |
eladalon | f184138 | 2017-06-12 01:16:46 -0700 | [diff] [blame] | 38 | // WebRtcVideoChannel and WebRtcVoiceMediaChannel, and owned by |
nisse | cae45d0 | 2017-04-24 05:53:20 -0700 | [diff] [blame] | 39 | // WebrtcSession. Video and audio always uses different transport |
| 40 | // objects, even in the common case where they are bundled over the |
| 41 | // same underlying transport. |
| 42 | // |
| 43 | // Extracting the logic of the webrtc::Transport from BaseChannel and |
| 44 | // subclasses into a separate class seems to be a prerequesite for |
| 45 | // moving the transport here. |
| 46 | class RtpTransportControllerSendInterface { |
| 47 | public: |
| 48 | virtual ~RtpTransportControllerSendInterface() {} |
| 49 | virtual PacketRouter* packet_router() = 0; |
Stefan Holmer | 5c8942a | 2017-08-22 16:16:44 +0200 | [diff] [blame] | 50 | virtual PacedSender* pacer() = 0; |
nisse | cae45d0 | 2017-04-24 05:53:20 -0700 | [diff] [blame] | 51 | // Currently returning the same pointer, but with different types. |
| 52 | virtual SendSideCongestionController* send_side_cc() = 0; |
| 53 | virtual TransportFeedbackObserver* transport_feedback_observer() = 0; |
| 54 | |
| 55 | virtual RtpPacketSender* packet_sender() = 0; |
sprang | db2a9fc | 2017-08-09 06:42:32 -0700 | [diff] [blame] | 56 | virtual const RtpKeepAliveConfig& keepalive_config() const = 0; |
Stefan Holmer | 5c8942a | 2017-08-22 16:16:44 +0200 | [diff] [blame] | 57 | |
| 58 | // SetAllocatedSendBitrateLimits sets bitrates limits imposed by send codec |
| 59 | // settings. |
| 60 | // |min_send_bitrate_bps| is the total minimum send bitrate required by all |
| 61 | // sending streams. This is the minimum bitrate the PacedSender will use. |
| 62 | // Note that SendSideCongestionController::OnNetworkChanged can still be |
| 63 | // called with a lower bitrate estimate. |max_padding_bitrate_bps| is the max |
| 64 | // bitrate the send streams request for padding. This can be higher than the |
| 65 | // current network estimate and tells the PacedSender how much it should max |
| 66 | // pad unless there is real packets to send. |
| 67 | virtual void SetAllocatedSendBitrateLimits(int min_send_bitrate_bps, |
| 68 | int max_padding_bitrate_bps) = 0; |
nisse | cae45d0 | 2017-04-24 05:53:20 -0700 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | } // namespace webrtc |
| 72 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 73 | #endif // CALL_RTP_TRANSPORT_CONTROLLER_SEND_INTERFACE_H_ |