webrtc/call/rtp_video_sender_interface.h
Per Kjellander 59ade0172f Reland "Remame VideoSendStream::UpdateActiveSimulcastLayers to StartPerRtpStream"
This reverts commit 75170be4ac.

Reason for revert: Perf regression not affecting open source.

Original change's description:
> Revert "Remame VideoSendStream::UpdateActiveSimulcastLayers to StartPerRtpStream"
>
> This reverts commit d8c4de7172.
>
> Reason for revert: Tentative revert due to possible perf regression. b/260123362
>
> Original change's description:
> > Remame VideoSendStream::UpdateActiveSimulcastLayers to StartPerRtpStream
> >
> > VideoSendStreamImpl::Start and VideoSendStream::Start are not used by PeerConnections, only StartPerRtpStream.
> > Therefore this cl:
> > - Change implementation of VideoSendStream::Start to use VideoSendStream::StartPerRtpStream. VideoSendstream::Start is kept for convenience.
> > - Remove VideoSendStreamImpl::Start() since it was only used by tests that use call and is confusing.
> > - RtpVideoSender::SetActive is removed/changed to RtpVideoSender::Stop(). For normal operations RtpVideoSender::SetActiveModules is used.
> >
> > Bug: none
> > Change-Id: I43b153250b07c02fe63c84e3c4cec18d4ec0d47a
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283660
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Commit-Queue: Per Kjellander <perkj@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#38698}
>
> Bug: none
> Change-Id: I4f0d27679e51361b9ec54d2ae8e4d972527875d1
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284940
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Auto-Submit: Per Kjellander <perkj@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38725}

Bug: b/260400659
Change-Id: Ie8e545edcad85284a7d612183a8e4201672d0b5e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285900
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#38794}
2022-12-02 12:03:25 +00:00

69 lines
2.7 KiB
C++

/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef CALL_RTP_VIDEO_SENDER_INTERFACE_H_
#define CALL_RTP_VIDEO_SENDER_INTERFACE_H_
#include <map>
#include <vector>
#include "absl/types/optional.h"
#include "api/array_view.h"
#include "api/call/bitrate_allocation.h"
#include "api/fec_controller_override.h"
#include "api/video/video_layers_allocation.h"
#include "call/rtp_config.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/rtp_sequence_number_map.h"
#include "modules/video_coding/include/video_codec_interface.h"
namespace webrtc {
class VideoBitrateAllocation;
struct FecProtectionParams;
class RtpVideoSenderInterface : public EncodedImageCallback,
public FecControllerOverride {
public:
// Sets the sending status of the rtp modules and appropriately sets the
// RtpVideoSender to active if any rtp modules are active.
// A module will only send packet if beeing active.
virtual void SetActiveModules(const std::vector<bool>& active_modules) = 0;
// Set the sending status of all rtp modules to inactive.
virtual void Stop() = 0;
virtual bool IsActive() = 0;
virtual void OnNetworkAvailability(bool network_available) = 0;
virtual std::map<uint32_t, RtpState> GetRtpStates() const = 0;
virtual std::map<uint32_t, RtpPayloadState> GetRtpPayloadStates() const = 0;
virtual void DeliverRtcp(const uint8_t* packet, size_t length) = 0;
virtual void OnBitrateAllocationUpdated(
const VideoBitrateAllocation& bitrate) = 0;
virtual void OnVideoLayersAllocationUpdated(
const VideoLayersAllocation& allocation) = 0;
virtual void OnBitrateUpdated(BitrateAllocationUpdate update,
int framerate) = 0;
virtual void OnTransportOverheadChanged(
size_t transport_overhead_bytes_per_packet) = 0;
virtual uint32_t GetPayloadBitrateBps() const = 0;
virtual uint32_t GetProtectionBitrateBps() const = 0;
virtual void SetEncodingData(size_t width,
size_t height,
size_t num_temporal_layers) = 0;
virtual std::vector<RtpSequenceNumberMap::Info> GetSentRtpPacketInfos(
uint32_t ssrc,
rtc::ArrayView<const uint16_t> sequence_numbers) const = 0;
// Implements FecControllerOverride.
void SetFecAllowed(bool fec_allowed) override = 0;
};
} // namespace webrtc
#endif // CALL_RTP_VIDEO_SENDER_INTERFACE_H_