blob: 51cf56b609237eeef98ec047bc7a9d2ffd3b549c [file] [log] [blame]
Stefan Holmerdbdb3a02018-07-17 16:03:46 +02001/*
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 Holmer9416ef82018-07-19 10:34:38 +020011#ifndef CALL_RTP_VIDEO_SENDER_INTERFACE_H_
12#define CALL_RTP_VIDEO_SENDER_INTERFACE_H_
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020013
14#include <map>
15#include <vector>
16
Elad Alon8b60e8b2019-04-08 14:14:05 +020017#include "absl/types/optional.h"
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020018#include "call/rtp_config.h"
19#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
Elad Alon8b60e8b2019-04-08 14:14:05 +020020#include "modules/rtp_rtcp/source/rtp_sequence_number_map.h"
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020021#include "modules/utility/include/process_thread.h"
22#include "modules/video_coding/include/video_codec_interface.h"
23
24namespace webrtc {
25class VideoBitrateAllocation;
26struct FecProtectionParams;
27
Stefan Holmer9416ef82018-07-19 10:34:38 +020028class RtpVideoSenderInterface : public EncodedImageCallback {
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020029 public:
30 virtual void RegisterProcessThread(ProcessThread* module_process_thread) = 0;
31 virtual void DeRegisterProcessThread() = 0;
32
Stefan Holmer9416ef82018-07-19 10:34:38 +020033 // RtpVideoSender will only route packets if being active, all
34 // packets will be dropped otherwise.
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020035 virtual void SetActive(bool active) = 0;
36 // Sets the sending status of the rtp modules and appropriately sets the
Stefan Holmer9416ef82018-07-19 10:34:38 +020037 // RtpVideoSender to active if any rtp modules are active.
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020038 virtual void SetActiveModules(const std::vector<bool> active_modules) = 0;
39 virtual bool IsActive() = 0;
40
41 virtual void OnNetworkAvailability(bool network_available) = 0;
42 virtual std::map<uint32_t, RtpState> GetRtpStates() const = 0;
43 virtual std::map<uint32_t, RtpPayloadState> GetRtpPayloadStates() const = 0;
44
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020045 virtual void DeliverRtcp(const uint8_t* packet, size_t length) = 0;
46
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020047 virtual void OnBitrateAllocationUpdated(
48 const VideoBitrateAllocation& bitrate) = 0;
Stefan Holmer64be7fa2018-10-04 15:21:55 +020049 virtual void OnBitrateUpdated(uint32_t bitrate_bps,
50 uint8_t fraction_loss,
51 int64_t rtt,
52 int framerate) = 0;
53 virtual void OnTransportOverheadChanged(
54 size_t transport_overhead_bytes_per_packet) = 0;
55 virtual uint32_t GetPayloadBitrateBps() const = 0;
56 virtual uint32_t GetProtectionBitrateBps() const = 0;
57 virtual void SetEncodingData(size_t width,
58 size_t height,
59 size_t num_temporal_layers) = 0;
Elad Alon8b60e8b2019-04-08 14:14:05 +020060 virtual absl::optional<RtpSequenceNumberMap::Info> GetSentRtpPacketInfo(
61 uint32_t ssrc,
62 uint16_t seq_num) const = 0;
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020063};
64} // namespace webrtc
Stefan Holmer9416ef82018-07-19 10:34:38 +020065#endif // CALL_RTP_VIDEO_SENDER_INTERFACE_H_