Add OnLossNotification() to VideoEncoder and Vp8FrameBufferController

Bug: webrtc:10501
Change-Id: I33e8bfcf16cf24aadcfdf214d7d9bcd495bf9348
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131021
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27449}
This commit is contained in:
Elad Alon
2019-04-04 12:28:51 +02:00
committed by Commit Bot
parent f88aa97c52
commit 6c371ca700
11 changed files with 64 additions and 0 deletions

View File

@ -542,6 +542,9 @@ void DefaultTemporalLayers::OnPacketLossRateUpdate(float packet_loss_rate) {}
void DefaultTemporalLayers::OnRttUpdate(int64_t rtt_ms) {}
void DefaultTemporalLayers::OnLossNotification(
const VideoEncoder::LossNotification loss_notification) {}
TemplateStructure DefaultTemporalLayers::GetTemplateStructure(
int num_layers) const {
RTC_CHECK_LT(num_layers, 5);

View File

@ -61,6 +61,9 @@ class DefaultTemporalLayers final : public Vp8FrameBufferController {
void OnRttUpdate(int64_t rtt_ms) override;
void OnLossNotification(
const VideoEncoder::LossNotification loss_notification) override;
private:
struct DependencyInfo {
DependencyInfo() = default;

View File

@ -330,6 +330,13 @@ void LibvpxVp8Encoder::OnRttUpdate(int64_t rtt_ms) {
}
}
void LibvpxVp8Encoder::OnLossNotification(
const LossNotification& loss_notification) {
if (frame_buffer_controller_) {
frame_buffer_controller_->OnLossNotification(loss_notification);
}
}
void LibvpxVp8Encoder::SetStreamState(bool send_stream, int stream_idx) {
if (send_stream && !send_stream_[stream_idx]) {
// Need a key frame if we have not sent this stream before.

View File

@ -61,6 +61,8 @@ class LibvpxVp8Encoder : public VideoEncoder {
void OnRttUpdate(int64_t rtt_ms) override;
void OnLossNotification(const LossNotification& loss_notification) override;
EncoderInfo GetEncoderInfo() const override;
static vpx_enc_frame_flags_t EncodeFlags(const Vp8FrameConfig& references);

View File

@ -388,6 +388,9 @@ void ScreenshareLayers::OnPacketLossRateUpdate(float packet_loss_rate) {}
void ScreenshareLayers::OnRttUpdate(int64_t rtt_ms) {}
void ScreenshareLayers::OnLossNotification(
const VideoEncoder::LossNotification loss_notification) {}
TemplateStructure ScreenshareLayers::GetTemplateStructure(
int num_layers) const {
RTC_CHECK_LT(num_layers, 3);

View File

@ -65,6 +65,9 @@ class ScreenshareLayers final : public Vp8FrameBufferController {
void OnRttUpdate(int64_t rtt_ms) override;
void OnLossNotification(
const VideoEncoder::LossNotification loss_notification) override;
private:
enum class TemporalLayerState : int { kDrop, kTl0, kTl1, kTl1Sync };