blob: 0d47845944b2b86b93fc354f5d758f75d944b964 [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
11#ifndef CALL_VIDEO_RTP_SENDER_INTERFACE_H_
12#define CALL_VIDEO_RTP_SENDER_INTERFACE_H_
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
22namespace webrtc {
23class VideoBitrateAllocation;
24struct FecProtectionParams;
25
26class VideoRtpSenderInterface : public EncodedImageCallback {
27 public:
28 virtual void RegisterProcessThread(ProcessThread* module_process_thread) = 0;
29 virtual void DeRegisterProcessThread() = 0;
30
31 // PayloadRouter will only route packets if being active, all packets will be
32 // dropped otherwise.
33 virtual void SetActive(bool active) = 0;
34 // Sets the sending status of the rtp modules and appropriately sets the
35 // payload router to active if any rtp modules are active.
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
60#endif // CALL_VIDEO_RTP_SENDER_INTERFACE_H_