rtp_video_sender_interface.h (2612B)
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 11 #ifndef CALL_RTP_VIDEO_SENDER_INTERFACE_H_ 12 #define CALL_RTP_VIDEO_SENDER_INTERFACE_H_ 13 14 #include <cstddef> 15 #include <cstdint> 16 #include <map> 17 #include <vector> 18 19 #include "api/array_view.h" 20 #include "api/call/bitrate_allocation.h" 21 #include "api/fec_controller_override.h" 22 #include "api/video/video_layers_allocation.h" 23 #include "api/video_codecs/video_encoder.h" 24 #include "call/rtp_config.h" 25 #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" 26 #include "modules/rtp_rtcp/source/rtp_sequence_number_map.h" 27 28 namespace webrtc { 29 class VideoBitrateAllocation; 30 struct FecProtectionParams; 31 32 class RtpVideoSenderInterface : public EncodedImageCallback, 33 public FecControllerOverride { 34 public: 35 // Sets weather or not RTP packets is allowed to be sent on this sender. 36 virtual void SetSending(bool enabled) = 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 void DeliverRtcp(ArrayView<const uint8_t> packet) = 0; 44 45 virtual void OnBitrateAllocationUpdated( 46 const VideoBitrateAllocation& bitrate) = 0; 47 virtual void OnVideoLayersAllocationUpdated( 48 const VideoLayersAllocation& allocation) = 0; 49 virtual void OnBitrateUpdated(BitrateAllocationUpdate update, 50 int framerate) = 0; 51 virtual void OnTransportOverheadChanged( 52 size_t transport_overhead_bytes_per_packet) = 0; 53 virtual uint32_t GetPayloadBitrateBps() const = 0; 54 virtual uint32_t GetProtectionBitrateBps() const = 0; 55 virtual void SetEncodingData(size_t width, 56 size_t height, 57 size_t num_temporal_layers) = 0; 58 virtual void SetCsrcs(ArrayView<const uint32_t> csrcs) = 0; 59 virtual std::vector<RtpSequenceNumberMap::Info> GetSentRtpPacketInfos( 60 uint32_t ssrc, 61 ArrayView<const uint16_t> sequence_numbers) const = 0; 62 63 // Implements FecControllerOverride. 64 void SetFecAllowed(bool fec_allowed) override = 0; 65 }; 66 } // namespace webrtc 67 #endif // CALL_RTP_VIDEO_SENDER_INTERFACE_H_