Stefan Holmer | dbdb3a0 | 2018-07-17 16:03:46 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 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 | |
Stefan Holmer | 9416ef8 | 2018-07-19 10:34:38 +0200 | [diff] [blame] | 11 | #ifndef CALL_RTP_VIDEO_SENDER_INTERFACE_H_ |
| 12 | #define CALL_RTP_VIDEO_SENDER_INTERFACE_H_ |
Stefan Holmer | dbdb3a0 | 2018-07-17 16:03:46 +0200 | [diff] [blame] | 13 | |
| 14 | #include <map> |
| 15 | #include <vector> |
| 16 | |
| 17 | #include "call/rtp_config.h" |
| 18 | #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| 19 | #include "modules/utility/include/process_thread.h" |
| 20 | #include "modules/video_coding/include/video_codec_interface.h" |
| 21 | |
| 22 | namespace webrtc { |
| 23 | class VideoBitrateAllocation; |
| 24 | struct FecProtectionParams; |
| 25 | |
Stefan Holmer | 9416ef8 | 2018-07-19 10:34:38 +0200 | [diff] [blame] | 26 | class RtpVideoSenderInterface : public EncodedImageCallback { |
Stefan Holmer | dbdb3a0 | 2018-07-17 16:03:46 +0200 | [diff] [blame] | 27 | public: |
| 28 | virtual void RegisterProcessThread(ProcessThread* module_process_thread) = 0; |
| 29 | virtual void DeRegisterProcessThread() = 0; |
| 30 | |
Stefan Holmer | 9416ef8 | 2018-07-19 10:34:38 +0200 | [diff] [blame] | 31 | // RtpVideoSender will only route packets if being active, all |
| 32 | // packets will be dropped otherwise. |
Stefan Holmer | dbdb3a0 | 2018-07-17 16:03:46 +0200 | [diff] [blame] | 33 | virtual void SetActive(bool active) = 0; |
| 34 | // Sets the sending status of the rtp modules and appropriately sets the |
Stefan Holmer | 9416ef8 | 2018-07-19 10:34:38 +0200 | [diff] [blame] | 35 | // RtpVideoSender to active if any rtp modules are active. |
Stefan Holmer | dbdb3a0 | 2018-07-17 16:03:46 +0200 | [diff] [blame] | 36 | virtual void SetActiveModules(const std::vector<bool> active_modules) = 0; |
| 37 | virtual bool IsActive() = 0; |
| 38 | |
| 39 | virtual void OnNetworkAvailability(bool network_available) = 0; |
| 40 | virtual std::map<uint32_t, RtpState> GetRtpStates() const = 0; |
| 41 | virtual std::map<uint32_t, RtpPayloadState> GetRtpPayloadStates() const = 0; |
| 42 | |
| 43 | virtual bool FecEnabled() const = 0; |
| 44 | |
| 45 | virtual bool NackEnabled() const = 0; |
| 46 | |
| 47 | virtual void DeliverRtcp(const uint8_t* packet, size_t length) = 0; |
| 48 | |
| 49 | virtual void ProtectionRequest(const FecProtectionParams* delta_params, |
| 50 | const FecProtectionParams* key_params, |
| 51 | uint32_t* sent_video_rate_bps, |
| 52 | uint32_t* sent_nack_rate_bps, |
| 53 | uint32_t* sent_fec_rate_bps) = 0; |
| 54 | |
| 55 | virtual void SetMaxRtpPacketSize(size_t max_rtp_packet_size) = 0; |
| 56 | virtual void OnBitrateAllocationUpdated( |
| 57 | const VideoBitrateAllocation& bitrate) = 0; |
| 58 | }; |
| 59 | } // namespace webrtc |
Stefan Holmer | 9416ef8 | 2018-07-19 10:34:38 +0200 | [diff] [blame] | 60 | #endif // CALL_RTP_VIDEO_SENDER_INTERFACE_H_ |