Add missing overrides in VideoEncoder proxies/adapters
Add: 1. OnPacketLossRateUpdate 2. OnRttUpdate 3. OnLossNotification Add them to: 1. VideoEncoderSoftwareFallbackWrapper 2. SimulcastEncoderAdapter 3. MultiplexEncoderAdapter Bug: None Change-Id: I4b0799f7d8c19211741f48da87106daccd39af95 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144030 Commit-Queue: Elad Alon <eladalon@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28423}
This commit is contained in:
parent
2ce1da5328
commit
65764e4ed7
@ -90,11 +90,18 @@ class VideoEncoderSoftwareFallbackWrapper final : public VideoEncoder {
|
||||
EncodedImageCallback* callback) override;
|
||||
|
||||
int32_t Release() override;
|
||||
|
||||
int32_t Encode(const VideoFrame& frame,
|
||||
const std::vector<VideoFrameType>* frame_types) override;
|
||||
// TOD(eladalon): Add OnPacketLossRateUpdate, OnRttUpdate and
|
||||
// OnLossNotification.
|
||||
|
||||
void OnPacketLossRateUpdate(float packet_loss_rate) override;
|
||||
|
||||
void OnRttUpdate(int64_t rtt_ms) override;
|
||||
|
||||
void OnLossNotification(const LossNotification& loss_notification) override;
|
||||
|
||||
void SetRates(const RateControlParameters& parameters) override;
|
||||
|
||||
EncoderInfo GetEncoderInfo() const override;
|
||||
|
||||
private:
|
||||
@ -278,6 +285,26 @@ void VideoEncoderSoftwareFallbackWrapper::SetRates(
|
||||
fallback_encoder_->SetRates(parameters);
|
||||
}
|
||||
|
||||
void VideoEncoderSoftwareFallbackWrapper::OnPacketLossRateUpdate(
|
||||
float packet_loss_rate) {
|
||||
VideoEncoder* encoder =
|
||||
use_fallback_encoder_ ? fallback_encoder_.get() : encoder_.get();
|
||||
encoder->OnPacketLossRateUpdate(packet_loss_rate);
|
||||
}
|
||||
|
||||
void VideoEncoderSoftwareFallbackWrapper::OnRttUpdate(int64_t rtt_ms) {
|
||||
VideoEncoder* encoder =
|
||||
use_fallback_encoder_ ? fallback_encoder_.get() : encoder_.get();
|
||||
encoder->OnRttUpdate(rtt_ms);
|
||||
}
|
||||
|
||||
void VideoEncoderSoftwareFallbackWrapper::OnLossNotification(
|
||||
const LossNotification& loss_notification) {
|
||||
VideoEncoder* encoder =
|
||||
use_fallback_encoder_ ? fallback_encoder_.get() : encoder_.get();
|
||||
encoder->OnLossNotification(loss_notification);
|
||||
}
|
||||
|
||||
VideoEncoder::EncoderInfo VideoEncoderSoftwareFallbackWrapper::GetEncoderInfo()
|
||||
const {
|
||||
EncoderInfo fallback_encoder_info = fallback_encoder_->GetEncoderInfo();
|
||||
|
||||
@ -534,6 +534,25 @@ void SimulcastEncoderAdapter::SetRates(
|
||||
}
|
||||
}
|
||||
|
||||
void SimulcastEncoderAdapter::OnPacketLossRateUpdate(float packet_loss_rate) {
|
||||
for (StreamInfo& info : streaminfos_) {
|
||||
info.encoder->OnPacketLossRateUpdate(packet_loss_rate);
|
||||
}
|
||||
}
|
||||
|
||||
void SimulcastEncoderAdapter::OnRttUpdate(int64_t rtt_ms) {
|
||||
for (StreamInfo& info : streaminfos_) {
|
||||
info.encoder->OnRttUpdate(rtt_ms);
|
||||
}
|
||||
}
|
||||
|
||||
void SimulcastEncoderAdapter::OnLossNotification(
|
||||
const LossNotification& loss_notification) {
|
||||
for (StreamInfo& info : streaminfos_) {
|
||||
info.encoder->OnLossNotification(loss_notification);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(brandtr): Add task checker to this member function, when all encoder
|
||||
// callbacks are coming in on the encoder queue.
|
||||
EncodedImageCallback::Result SimulcastEncoderAdapter::OnEncodedImage(
|
||||
|
||||
@ -52,8 +52,9 @@ class RTC_EXPORT SimulcastEncoderAdapter : public VideoEncoder {
|
||||
const std::vector<VideoFrameType>* frame_types) override;
|
||||
int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override;
|
||||
void SetRates(const RateControlParameters& parameters) override;
|
||||
// TOD(eladalon): Add OnPacketLossRateUpdate, OnRttUpdate and
|
||||
// OnLossNotification.
|
||||
void OnPacketLossRateUpdate(float packet_loss_rate) override;
|
||||
void OnRttUpdate(int64_t rtt_ms) override;
|
||||
void OnLossNotification(const LossNotification& loss_notification) override;
|
||||
|
||||
// Eventual handler for the contained encoders' EncodedImageCallbacks, but
|
||||
// called from an internal helper that also knows the correct stream
|
||||
|
||||
@ -48,9 +48,10 @@ class MultiplexEncoderAdapter : public VideoEncoder {
|
||||
const std::vector<VideoFrameType>* frame_types) override;
|
||||
int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override;
|
||||
void SetRates(const RateControlParameters& parameters) override;
|
||||
void OnPacketLossRateUpdate(float packet_loss_rate) override;
|
||||
void OnRttUpdate(int64_t rtt_ms) override;
|
||||
void OnLossNotification(const LossNotification& loss_notification) override;
|
||||
int Release() override;
|
||||
// TOD(eladalon): Add OnPacketLossRateUpdate, OnRttUpdate and
|
||||
// OnLossNotification.
|
||||
EncoderInfo GetEncoderInfo() const override;
|
||||
|
||||
EncodedImageCallback::Result OnEncodedImage(
|
||||
|
||||
@ -239,6 +239,25 @@ void MultiplexEncoderAdapter::SetRates(
|
||||
}
|
||||
}
|
||||
|
||||
void MultiplexEncoderAdapter::OnPacketLossRateUpdate(float packet_loss_rate) {
|
||||
for (auto& encoder : encoders_) {
|
||||
encoder->OnPacketLossRateUpdate(packet_loss_rate);
|
||||
}
|
||||
}
|
||||
|
||||
void MultiplexEncoderAdapter::OnRttUpdate(int64_t rtt_ms) {
|
||||
for (auto& encoder : encoders_) {
|
||||
encoder->OnRttUpdate(rtt_ms);
|
||||
}
|
||||
}
|
||||
|
||||
void MultiplexEncoderAdapter::OnLossNotification(
|
||||
const LossNotification& loss_notification) {
|
||||
for (auto& encoder : encoders_) {
|
||||
encoder->OnLossNotification(loss_notification);
|
||||
}
|
||||
}
|
||||
|
||||
int MultiplexEncoderAdapter::Release() {
|
||||
for (auto& encoder : encoders_) {
|
||||
const int rv = encoder->Release();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user