blob: c69f1bab02a5b27887f2fcdf7e0b54d53179d437 [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
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
Stefan Holmer9416ef82018-07-19 10:34:38 +020026class RtpVideoSenderInterface : public EncodedImageCallback {
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020027 public:
28 virtual void RegisterProcessThread(ProcessThread* module_process_thread) = 0;
29 virtual void DeRegisterProcessThread() = 0;
30
Stefan Holmer9416ef82018-07-19 10:34:38 +020031 // RtpVideoSender will only route packets if being active, all
32 // packets will be dropped otherwise.
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020033 virtual void SetActive(bool active) = 0;
34 // Sets the sending status of the rtp modules and appropriately sets the
Stefan Holmer9416ef82018-07-19 10:34:38 +020035 // RtpVideoSender to active if any rtp modules are active.
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020036 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 Holmer9416ef82018-07-19 10:34:38 +020060#endif // CALL_RTP_VIDEO_SENDER_INTERFACE_H_