Add OnFrameDropped() to Vp8FrameBufferController
Prior to this CL, this was indicated by passing |size_bytes| = 0 to the method. Bug: webrtc:10501 Change-Id: Icff3bb83344834dc62d62bde5ec5d05096a08e11 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132712 Reviewed-by: Niels Moller <nisse@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Commit-Queue: Elad Alon <eladalon@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27620}
This commit is contained in:
@ -454,14 +454,15 @@ void DefaultTemporalLayers::OnEncodeDone(size_t stream_index,
|
||||
RTC_DCHECK_LT(stream_index, StreamCount());
|
||||
RTC_DCHECK_GT(num_layers_, 0);
|
||||
|
||||
auto pending_frame = pending_frames_.find(rtp_timestamp);
|
||||
RTC_DCHECK(pending_frame != pending_frames_.end());
|
||||
|
||||
if (size_bytes == 0) {
|
||||
pending_frames_.erase(pending_frame);
|
||||
RTC_LOG(LS_WARNING) << "Empty frame; treating as dropped.";
|
||||
OnFrameDropped(stream_index, rtp_timestamp);
|
||||
return;
|
||||
}
|
||||
|
||||
auto pending_frame = pending_frames_.find(rtp_timestamp);
|
||||
RTC_DCHECK(pending_frame != pending_frames_.end());
|
||||
|
||||
PendingFrame& frame = pending_frame->second;
|
||||
const Vp8FrameConfig& frame_config = frame.dependency_info.frame_config;
|
||||
#if RTC_DCHECK_IS_ON
|
||||
@ -539,6 +540,13 @@ void DefaultTemporalLayers::OnEncodeDone(size_t stream_index,
|
||||
}
|
||||
}
|
||||
|
||||
void DefaultTemporalLayers::OnFrameDropped(size_t stream_index,
|
||||
uint32_t rtp_timestamp) {
|
||||
auto pending_frame = pending_frames_.find(rtp_timestamp);
|
||||
RTC_DCHECK(pending_frame != pending_frames_.end());
|
||||
pending_frames_.erase(pending_frame);
|
||||
}
|
||||
|
||||
void DefaultTemporalLayers::OnPacketLossRateUpdate(float packet_loss_rate) {}
|
||||
|
||||
void DefaultTemporalLayers::OnRttUpdate(int64_t rtt_ms) {}
|
||||
|
||||
@ -57,6 +57,8 @@ class DefaultTemporalLayers final : public Vp8FrameBufferController {
|
||||
int qp,
|
||||
CodecSpecificInfo* info) override;
|
||||
|
||||
void OnFrameDropped(size_t stream_index, uint32_t rtp_timestamp) override;
|
||||
|
||||
void OnPacketLossRateUpdate(float packet_loss_rate) override;
|
||||
|
||||
void OnRttUpdate(int64_t rtt_ms) override;
|
||||
|
||||
@ -1105,8 +1105,8 @@ int LibvpxVp8Encoder::GetEncodedPartitions(const VideoFrame& input_image) {
|
||||
result = WEBRTC_VIDEO_CODEC_TARGET_BITRATE_OVERSHOOT;
|
||||
if (encoded_images_[encoder_idx].size() == 0) {
|
||||
// Dropped frame that will be re-encoded.
|
||||
frame_buffer_controller_->OnEncodeDone(
|
||||
stream_idx, input_image.timestamp(), 0, false, 0, nullptr);
|
||||
frame_buffer_controller_->OnFrameDropped(stream_idx,
|
||||
input_image.timestamp());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -280,8 +280,8 @@ void ScreenshareLayers::OnEncodeDone(size_t stream_index,
|
||||
RTC_DCHECK_LT(stream_index, StreamCount());
|
||||
|
||||
if (size_bytes == 0) {
|
||||
layers_[active_layer_].state = TemporalLayer::State::kDropped;
|
||||
++stats_.num_overshoots_;
|
||||
RTC_LOG(LS_WARNING) << "Empty frame; treating as dropped.";
|
||||
OnFrameDropped(stream_index, rtp_timestamp);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -383,6 +383,12 @@ void ScreenshareLayers::OnEncodeDone(size_t stream_index,
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenshareLayers::OnFrameDropped(size_t stream_index,
|
||||
uint32_t rtp_timestamp) {
|
||||
layers_[active_layer_].state = TemporalLayer::State::kDropped;
|
||||
++stats_.num_overshoots_;
|
||||
}
|
||||
|
||||
void ScreenshareLayers::OnPacketLossRateUpdate(float packet_loss_rate) {}
|
||||
|
||||
void ScreenshareLayers::OnRttUpdate(int64_t rtt_ms) {}
|
||||
|
||||
@ -61,6 +61,8 @@ class ScreenshareLayers final : public Vp8FrameBufferController {
|
||||
int qp,
|
||||
CodecSpecificInfo* info) override;
|
||||
|
||||
void OnFrameDropped(size_t stream_index, uint32_t rtp_timestamp) override;
|
||||
|
||||
void OnPacketLossRateUpdate(float packet_loss_rate) override;
|
||||
|
||||
void OnRttUpdate(int64_t rtt_ms) override;
|
||||
|
||||
Reference in New Issue
Block a user