This is a reland of 49734dc0faa69616a58a1a95c7fc61a4610793cf Patchset 2 contains a fix for the fuzzer set up. Since we now parse an RtpPacket out of the fuzzer data, the header needs to be correct, otherwise we fail before even reaching the FEC code that we actually want to test. Bug: webrtc:11340, chromium:1052323, chromium:1055974 TBR=stefan@webrtc.org Original change's description: > Reland "Refactors UlpFec and FlexFec to use a common interface." > > This is a reland of 11af1d7444fd7438766b7bc52cbd64752d72e32e > > Original change's description: > > Refactors UlpFec and FlexFec to use a common interface. > > > > The new VideoFecGenerator is now injected into RtpSenderVideo, > > and generalizes the usage. > > This also prepares for being able to genera FEC in the RTP egress > > module. > > > > Bug: webrtc:11340 > > Change-Id: I8aa873129b2fb4131eb3399ee88f6ea2747155a3 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168347 > > Reviewed-by: Stefan Holmer <stefan@webrtc.org> > > Reviewed-by: Sebastian Jansson <srte@webrtc.org> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> > > Commit-Queue: Erik Språng <sprang@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#30515} > > Bug: webrtc:11340, chromium:1052323 > Change-Id: Id646047365f1c46cca9e6f3e8eefa5151207b4a0 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168608 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Stefan Holmer <stefan@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#30593} Bug: webrtc:11340, chromium:1052323 Change-Id: Ib8925f44e2edfcfeadc95c845c3bfc23822604ed Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169222 Commit-Queue: Erik Språng <sprang@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30724}
52 lines
2.1 KiB
C++
52 lines
2.1 KiB
C++
/*
|
|
* Copyright (c) 2019 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 MODULES_RTP_RTCP_SOURCE_VIDEO_FEC_GENERATOR_H_
|
|
#define MODULES_RTP_RTCP_SOURCE_VIDEO_FEC_GENERATOR_H_
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include "api/units/data_rate.h"
|
|
#include "modules/include/module_fec_types.h"
|
|
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
|
|
|
|
namespace webrtc {
|
|
|
|
class VideoFecGenerator {
|
|
public:
|
|
VideoFecGenerator() = default;
|
|
virtual ~VideoFecGenerator() = default;
|
|
|
|
enum class FecType { kFlexFec, kUlpFec };
|
|
virtual FecType GetFecType() const = 0;
|
|
// Returns the SSRC used for FEC packets (i.e. FlexFec SSRC).
|
|
virtual absl::optional<uint32_t> FecSsrc() = 0;
|
|
// Returns the overhead, in bytes per packet, for FEC (and possibly RED).
|
|
virtual size_t MaxPacketOverhead() const = 0;
|
|
// Current rate of FEC packets generated, including all RTP-level headers.
|
|
virtual DataRate CurrentFecRate() const = 0;
|
|
// Set FEC rates, max frames before FEC is sent, and type of FEC masks.
|
|
virtual void SetProtectionParameters(
|
|
const FecProtectionParams& delta_params,
|
|
const FecProtectionParams& key_params) = 0;
|
|
// Called on new media packet to be protected. The generator may choose
|
|
// to generate FEC packets at this time, if so they will be stored in an
|
|
// internal buffer.
|
|
virtual void AddPacketAndGenerateFec(const RtpPacketToSend& packet) = 0;
|
|
// Get (and remove) and FEC packets pending in the generator. These packets
|
|
// will lack sequence numbers, that needs to be set externally.
|
|
// TODO(bugs.webrtc.org/11340): Actually FlexFec sets seq#, fix that!
|
|
virtual std::vector<std::unique_ptr<RtpPacketToSend>> GetFecPackets() = 0;
|
|
};
|
|
|
|
} // namespace webrtc
|
|
#endif // MODULES_RTP_RTCP_SOURCE_VIDEO_FEC_GENERATOR_H_
|