Remove VideoEncoder::SetChannelParameters.
The SetChannelParameters function was used when WebRTC supported decoding
with errors, which we no longer do.
This cleanup CL is related to the work tracked by 9946.
Bug: webrtc:9946
Change-Id: Id2d5ed23031388f890c42651bfbe5f79eda701e5
Reviewed-on: https://webrtc-review.googlesource.com/c/108861
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25505}
diff --git a/api/test/mock_video_encoder.h b/api/test/mock_video_encoder.h
index e2f0942..166bf45 100644
--- a/api/test/mock_video_encoder.h
+++ b/api/test/mock_video_encoder.h
@@ -45,7 +45,6 @@
int32_t(EncodedImageCallback* callback));
MOCK_METHOD0(Release, int32_t());
MOCK_METHOD0(Reset, int32_t());
- MOCK_METHOD2(SetChannelParameters, int32_t(uint32_t packetLoss, int64_t rtt));
MOCK_METHOD2(SetRates, int32_t(uint32_t newBitRate, uint32_t frameRate));
MOCK_METHOD2(SetRateAllocation,
int32_t(const VideoBitrateAllocation& newBitRate,
diff --git a/api/video_codecs/test/video_encoder_software_fallback_wrapper_unittest.cc b/api/video_codecs/test/video_encoder_software_fallback_wrapper_unittest.cc
index fceea8b..fb3cdfd 100644
--- a/api/video_codecs/test/video_encoder_software_fallback_wrapper_unittest.cc
+++ b/api/video_codecs/test/video_encoder_software_fallback_wrapper_unittest.cc
@@ -78,11 +78,6 @@
return WEBRTC_VIDEO_CODEC_OK;
}
- int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override {
- ++set_channel_parameters_count_;
- return WEBRTC_VIDEO_CODEC_OK;
- }
-
int32_t SetRateAllocation(const VideoBitrateAllocation& bitrate_allocation,
uint32_t framerate) override {
++set_rates_count_;
@@ -101,7 +96,6 @@
int encode_count_ = 0;
EncodedImageCallback* encode_complete_callback_ = nullptr;
int release_count_ = 0;
- int set_channel_parameters_count_ = 0;
int set_rates_count_ = 0;
mutable int supports_native_handle_count_ = 0;
bool supports_native_handle_ = false;
@@ -263,15 +257,6 @@
}
TEST_F(VideoEncoderSoftwareFallbackWrapperTest,
- SetChannelParametersForwardedDuringFallback) {
- UtilizeFallbackEncoder();
- EXPECT_EQ(0, fake_encoder_->set_channel_parameters_count_);
- fallback_wrapper_->SetChannelParameters(1, 1);
- EXPECT_EQ(1, fake_encoder_->set_channel_parameters_count_);
- EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_->Release());
-}
-
-TEST_F(VideoEncoderSoftwareFallbackWrapperTest,
SetRatesForwardedDuringFallback) {
UtilizeFallbackEncoder();
EXPECT_EQ(1, fake_encoder_->set_rates_count_);
diff --git a/api/video_codecs/video_encoder.cc b/api/video_codecs/video_encoder.cc
index 468d50b..d9ca458 100644
--- a/api/video_codecs/video_encoder.cc
+++ b/api/video_codecs/video_encoder.cc
@@ -124,4 +124,8 @@
return EncoderInfo(GetScalingSettings(), SupportsNativeHandle(),
ImplementationName());
}
+
+int32_t VideoEncoder::SetChannelParameters(uint32_t packet_loss, int64_t rtt) {
+ return 0;
+}
} // namespace webrtc
diff --git a/api/video_codecs/video_encoder.h b/api/video_codecs/video_encoder.h
index 2f42b7d..1328bd5 100644
--- a/api/video_codecs/video_encoder.h
+++ b/api/video_codecs/video_encoder.h
@@ -203,7 +203,7 @@
// - rtt : Round-trip time in milliseconds
// Return value : WEBRTC_VIDEO_CODEC_OK if OK
// <0 - Errors: WEBRTC_VIDEO_CODEC_ERROR
- virtual int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) = 0;
+ virtual int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt);
// Inform the encoder about the new target bit rate.
//
diff --git a/api/video_codecs/video_encoder_software_fallback_wrapper.cc b/api/video_codecs/video_encoder_software_fallback_wrapper.cc
index 7bc69d6..fd06785 100644
--- a/api/video_codecs/video_encoder_software_fallback_wrapper.cc
+++ b/api/video_codecs/video_encoder_software_fallback_wrapper.cc
@@ -87,7 +87,6 @@
int32_t Encode(const VideoFrame& frame,
const CodecSpecificInfo* codec_specific_info,
const std::vector<FrameType>* frame_types) override;
- int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
int32_t SetRateAllocation(const VideoBitrateAllocation& bitrate_allocation,
uint32_t framerate) override;
EncoderInfo GetEncoderInfo() const override;
@@ -183,8 +182,6 @@
fallback_encoder_->RegisterEncodeCompleteCallback(callback_);
if (rates_set_)
fallback_encoder_->SetRateAllocation(bitrate_allocation_, framerate_);
- if (channel_parameters_set_)
- fallback_encoder_->SetChannelParameters(packet_loss_, rtt_);
// Since we're switching to the fallback encoder, Release the real encoder. It
// may be re-initialized via InitEncode later, and it will continue to get
@@ -204,7 +201,6 @@
max_payload_size_ = max_payload_size;
// Clear stored rate/channel parameters.
rates_set_ = false;
- channel_parameters_set_ = false;
ValidateSettingsForForcedFallback();
// Try to reinit forced software codec if it is in use.
@@ -268,18 +264,6 @@
return ret;
}
-int32_t VideoEncoderSoftwareFallbackWrapper::SetChannelParameters(
- uint32_t packet_loss,
- int64_t rtt) {
- channel_parameters_set_ = true;
- packet_loss_ = packet_loss;
- rtt_ = rtt;
- int32_t ret = encoder_->SetChannelParameters(packet_loss, rtt);
- if (use_fallback_encoder_)
- return fallback_encoder_->SetChannelParameters(packet_loss, rtt);
- return ret;
-}
-
int32_t VideoEncoderSoftwareFallbackWrapper::SetRateAllocation(
const VideoBitrateAllocation& bitrate_allocation,
uint32_t framerate) {
diff --git a/media/engine/fakewebrtcvideoengine.cc b/media/engine/fakewebrtcvideoengine.cc
index aabfc8f..2b92467 100644
--- a/media/engine/fakewebrtcvideoengine.cc
+++ b/media/engine/fakewebrtcvideoengine.cc
@@ -168,11 +168,6 @@
return WEBRTC_VIDEO_CODEC_OK;
}
-int32_t FakeWebRtcVideoEncoder::SetChannelParameters(uint32_t packetLoss,
- int64_t rtt) {
- return WEBRTC_VIDEO_CODEC_OK;
-}
-
int32_t FakeWebRtcVideoEncoder::SetRateAllocation(
const webrtc::VideoBitrateAllocation& allocation,
uint32_t framerate) {
diff --git a/media/engine/fakewebrtcvideoengine.h b/media/engine/fakewebrtcvideoengine.h
index f4287a3..6ed92a7 100644
--- a/media/engine/fakewebrtcvideoengine.h
+++ b/media/engine/fakewebrtcvideoengine.h
@@ -86,7 +86,6 @@
int32_t RegisterEncodeCompleteCallback(
webrtc::EncodedImageCallback* callback) override;
int32_t Release() override;
- int32_t SetChannelParameters(uint32_t packetLoss, int64_t rtt) override;
int32_t SetRateAllocation(const webrtc::VideoBitrateAllocation& allocation,
uint32_t framerate) override;
diff --git a/media/engine/scopedvideoencoder.cc b/media/engine/scopedvideoencoder.cc
index 288a378..db1148b 100644
--- a/media/engine/scopedvideoencoder.cc
+++ b/media/engine/scopedvideoencoder.cc
@@ -33,7 +33,6 @@
int32_t Encode(const webrtc::VideoFrame& frame,
const webrtc::CodecSpecificInfo* codec_specific_info,
const std::vector<webrtc::FrameType>* frame_types) override;
- int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
int32_t SetRates(uint32_t bitrate, uint32_t framerate) override;
int32_t SetRateAllocation(const webrtc::VideoBitrateAllocation& allocation,
uint32_t framerate) override;
@@ -72,11 +71,6 @@
return encoder_->Encode(frame, codec_specific_info, frame_types);
}
-int32_t ScopedVideoEncoder::SetChannelParameters(uint32_t packet_loss,
- int64_t rtt) {
- return encoder_->SetChannelParameters(packet_loss, rtt);
-}
-
int32_t ScopedVideoEncoder::SetRates(uint32_t bitrate, uint32_t framerate) {
return encoder_->SetRates(bitrate, framerate);
}
diff --git a/media/engine/simulcast_encoder_adapter.cc b/media/engine/simulcast_encoder_adapter.cc
index b9d571c..f2717b3 100644
--- a/media/engine/simulcast_encoder_adapter.cc
+++ b/media/engine/simulcast_encoder_adapter.cc
@@ -377,15 +377,6 @@
return WEBRTC_VIDEO_CODEC_OK;
}
-int SimulcastEncoderAdapter::SetChannelParameters(uint32_t packet_loss,
- int64_t rtt) {
- RTC_DCHECK_CALLED_SEQUENTIALLY(&encoder_queue_);
- for (size_t stream_idx = 0; stream_idx < streaminfos_.size(); ++stream_idx) {
- streaminfos_[stream_idx].encoder->SetChannelParameters(packet_loss, rtt);
- }
- return WEBRTC_VIDEO_CODEC_OK;
-}
-
int SimulcastEncoderAdapter::SetRateAllocation(
const VideoBitrateAllocation& bitrate,
uint32_t new_framerate) {
diff --git a/media/engine/simulcast_encoder_adapter.h b/media/engine/simulcast_encoder_adapter.h
index cf80b82..6cb47ef 100644
--- a/media/engine/simulcast_encoder_adapter.h
+++ b/media/engine/simulcast_encoder_adapter.h
@@ -48,7 +48,6 @@
const CodecSpecificInfo* codec_specific_info,
const std::vector<FrameType>* frame_types) override;
int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override;
- int SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
int SetRateAllocation(const VideoBitrateAllocation& bitrate,
uint32_t new_framerate) override;
diff --git a/media/engine/simulcast_encoder_adapter_unittest.cc b/media/engine/simulcast_encoder_adapter_unittest.cc
index 206c705..d99b414 100644
--- a/media/engine/simulcast_encoder_adapter_unittest.cc
+++ b/media/engine/simulcast_encoder_adapter_unittest.cc
@@ -210,8 +210,6 @@
return 0;
}
- MOCK_METHOD2(SetChannelParameters, int32_t(uint32_t packetLoss, int64_t rtt));
-
EncoderInfo GetEncoderInfo() const override {
EncoderInfo info;
info.supports_native_handle = supports_native_handle_;
@@ -315,15 +313,6 @@
return new SimulcastEncoderAdapter(factory_.get(), SdpVideoFormat("VP8"));
}
- void ExpectCallSetChannelParameters(uint32_t packetLoss, int64_t rtt) {
- EXPECT_TRUE(!factory_->encoders().empty());
- for (size_t i = 0; i < factory_->encoders().size(); ++i) {
- EXPECT_CALL(*factory_->encoders()[i],
- SetChannelParameters(packetLoss, rtt))
- .Times(1);
- }
- }
-
MockVideoEncoderFactory* factory() { return factory_.get(); }
private:
@@ -472,14 +461,6 @@
EXPECT_EQ(0, adapter_->InitEncode(&codec_, 1, 1200));
}
-TEST_F(TestSimulcastEncoderAdapterFake, SetChannelParameters) {
- SetupCodec();
- const uint32_t packetLoss = 5;
- const int64_t rtt = 30;
- helper_->ExpectCallSetChannelParameters(packetLoss, rtt);
- adapter_->SetChannelParameters(packetLoss, rtt);
-}
-
TEST_F(TestSimulcastEncoderAdapterFake, EncodedCallbackForDifferentEncoders) {
SetupCodec();
diff --git a/media/engine/vp8_encoder_simulcast_proxy.cc b/media/engine/vp8_encoder_simulcast_proxy.cc
index 3b31a16..1a2f577 100644
--- a/media/engine/vp8_encoder_simulcast_proxy.cc
+++ b/media/engine/vp8_encoder_simulcast_proxy.cc
@@ -55,11 +55,6 @@
return encoder_->RegisterEncodeCompleteCallback(callback);
}
-int VP8EncoderSimulcastProxy::SetChannelParameters(uint32_t packet_loss,
- int64_t rtt) {
- return encoder_->SetChannelParameters(packet_loss, rtt);
-}
-
int VP8EncoderSimulcastProxy::SetRateAllocation(
const VideoBitrateAllocation& bitrate,
uint32_t new_framerate) {
diff --git a/media/engine/vp8_encoder_simulcast_proxy.h b/media/engine/vp8_encoder_simulcast_proxy.h
index cb88f9b..d04624f 100644
--- a/media/engine/vp8_encoder_simulcast_proxy.h
+++ b/media/engine/vp8_encoder_simulcast_proxy.h
@@ -42,7 +42,6 @@
const CodecSpecificInfo* codec_specific_info,
const std::vector<FrameType>* frame_types) override;
int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override;
- int SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
int SetRateAllocation(const VideoBitrateAllocation& bitrate,
uint32_t new_framerate) override;
EncoderInfo GetEncoderInfo() const override;
diff --git a/media/engine/vp8_encoder_simulcast_proxy_unittest.cc b/media/engine/vp8_encoder_simulcast_proxy_unittest.cc
index d0a0dfc..b89c657 100644
--- a/media/engine/vp8_encoder_simulcast_proxy_unittest.cc
+++ b/media/engine/vp8_encoder_simulcast_proxy_unittest.cc
@@ -51,8 +51,6 @@
const CodecSpecificInfo* codecSpecificInfo,
const std::vector<FrameType>* frame_types) /* override */);
- MOCK_METHOD2(SetChannelParameters, int32_t(uint32_t packetLoss, int64_t rtt));
-
MOCK_CONST_METHOD0(ImplementationName, const char*());
};
diff --git a/modules/video_coding/codecs/h264/h264_encoder_impl.cc b/modules/video_coding/codecs/h264/h264_encoder_impl.cc
index 85082b8..e66ab9c 100644
--- a/modules/video_coding/codecs/h264/h264_encoder_impl.cc
+++ b/modules/video_coding/codecs/h264/h264_encoder_impl.cc
@@ -625,11 +625,6 @@
has_reported_error_ = true;
}
-int32_t H264EncoderImpl::SetChannelParameters(uint32_t packet_loss,
- int64_t rtt) {
- return WEBRTC_VIDEO_CODEC_OK;
-}
-
VideoEncoder::ScalingSettings H264EncoderImpl::GetScalingSettings() const {
return VideoEncoder::ScalingSettings(kLowH264QpThreshold,
kHighH264QpThreshold);
diff --git a/modules/video_coding/codecs/h264/h264_encoder_impl.h b/modules/video_coding/codecs/h264/h264_encoder_impl.h
index 0d25966..f6f7df0 100644
--- a/modules/video_coding/codecs/h264/h264_encoder_impl.h
+++ b/modules/video_coding/codecs/h264/h264_encoder_impl.h
@@ -74,9 +74,6 @@
VideoEncoder::ScalingSettings GetScalingSettings() const override;
- // Unsupported / Do nothing.
- int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
-
// Exposed for testing.
H264PacketizationMode PacketizationModeForTesting() const {
return packetization_mode_;
diff --git a/modules/video_coding/codecs/i420/include/i420.h b/modules/video_coding/codecs/i420/include/i420.h
index 580bc16..967286f 100644
--- a/modules/video_coding/codecs/i420/include/i420.h
+++ b/modules/video_coding/codecs/i420/include/i420.h
@@ -65,10 +65,6 @@
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
int Release() override;
- int SetChannelParameters(uint32_t /*packetLoss*/, int64_t /*rtt*/) override {
- return WEBRTC_VIDEO_CODEC_OK;
- }
-
private:
static uint8_t* InsertHeader(uint8_t* buffer,
uint16_t width,
diff --git a/modules/video_coding/codecs/multiplex/include/multiplex_encoder_adapter.h b/modules/video_coding/codecs/multiplex/include/multiplex_encoder_adapter.h
index 985bf39..235a360 100644
--- a/modules/video_coding/codecs/multiplex/include/multiplex_encoder_adapter.h
+++ b/modules/video_coding/codecs/multiplex/include/multiplex_encoder_adapter.h
@@ -46,7 +46,6 @@
const CodecSpecificInfo* codec_specific_info,
const std::vector<FrameType>* frame_types) override;
int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override;
- int SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
int SetRateAllocation(const VideoBitrateAllocation& bitrate,
uint32_t new_framerate) override;
int Release() override;
diff --git a/modules/video_coding/codecs/multiplex/multiplex_encoder_adapter.cc b/modules/video_coding/codecs/multiplex/multiplex_encoder_adapter.cc
index 5ea1fdc..4dabca7 100644
--- a/modules/video_coding/codecs/multiplex/multiplex_encoder_adapter.cc
+++ b/modules/video_coding/codecs/multiplex/multiplex_encoder_adapter.cc
@@ -202,16 +202,6 @@
return WEBRTC_VIDEO_CODEC_OK;
}
-int MultiplexEncoderAdapter::SetChannelParameters(uint32_t packet_loss,
- int64_t rtt) {
- for (auto& encoder : encoders_) {
- const int rv = encoder->SetChannelParameters(packet_loss, rtt);
- if (rv)
- return rv;
- }
- return WEBRTC_VIDEO_CODEC_OK;
-}
-
int MultiplexEncoderAdapter::SetRateAllocation(
const VideoBitrateAllocation& bitrate,
uint32_t framerate) {
diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
index e4be823..6207c36 100644
--- a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
+++ b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
@@ -925,10 +925,6 @@
: VideoEncoder::ScalingSettings::kOff;
}
-int LibvpxVp8Encoder::SetChannelParameters(uint32_t packetLoss, int64_t rtt) {
- return WEBRTC_VIDEO_CODEC_OK;
-}
-
int LibvpxVp8Encoder::RegisterEncodeCompleteCallback(
EncodedImageCallback* callback) {
encoded_complete_callback_ = callback;
diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h
index 362a079..37e3c8d 100644
--- a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h
+++ b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h
@@ -47,8 +47,6 @@
int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override;
- int SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
-
int SetRateAllocation(const VideoBitrateAllocation& bitrate,
uint32_t new_framerate) override;
diff --git a/modules/video_coding/codecs/vp9/vp9_impl.cc b/modules/video_coding/codecs/vp9/vp9_impl.cc
index 0cc5275..190735a 100644
--- a/modules/video_coding/codecs/vp9/vp9_impl.cc
+++ b/modules/video_coding/codecs/vp9/vp9_impl.cc
@@ -1239,10 +1239,6 @@
}
}
-int VP9EncoderImpl::SetChannelParameters(uint32_t packet_loss, int64_t rtt) {
- return WEBRTC_VIDEO_CODEC_OK;
-}
-
int VP9EncoderImpl::RegisterEncodeCompleteCallback(
EncodedImageCallback* callback) {
encoded_complete_callback_ = callback;
diff --git a/modules/video_coding/codecs/vp9/vp9_impl.h b/modules/video_coding/codecs/vp9/vp9_impl.h
index d8ce1ff..f0686b4 100644
--- a/modules/video_coding/codecs/vp9/vp9_impl.h
+++ b/modules/video_coding/codecs/vp9/vp9_impl.h
@@ -46,8 +46,6 @@
int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override;
- int SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
-
int SetRateAllocation(const VideoBitrateAllocation& bitrate_allocation,
uint32_t frame_rate) override;
diff --git a/modules/video_coding/generic_encoder.cc b/modules/video_coding/generic_encoder.cc
index 485fe78..fc08c3e 100644
--- a/modules/video_coding/generic_encoder.cc
+++ b/modules/video_coding/generic_encoder.cc
@@ -101,26 +101,14 @@
void VCMGenericEncoder::SetEncoderParameters(const EncoderParameters& params) {
RTC_DCHECK_RUNS_SERIALIZED(&race_checker_);
- bool channel_parameters_have_changed;
bool rates_have_changed;
{
rtc::CritScope lock(¶ms_lock_);
- channel_parameters_have_changed =
- params.loss_rate != encoder_params_.loss_rate ||
- params.rtt != encoder_params_.rtt;
rates_have_changed =
params.target_bitrate != encoder_params_.target_bitrate ||
params.input_frame_rate != encoder_params_.input_frame_rate;
encoder_params_ = params;
}
- if (channel_parameters_have_changed) {
- int res = encoder_->SetChannelParameters(params.loss_rate, params.rtt);
- if (res != 0) {
- RTC_LOG(LS_WARNING) << "Error set encoder parameters (loss = "
- << params.loss_rate << ", rtt = " << params.rtt
- << "): " << res;
- }
- }
if (rates_have_changed) {
int res = encoder_->SetRateAllocation(params.target_bitrate,
params.input_frame_rate);
diff --git a/modules/video_coding/include/mock/mock_video_codec_interface.h b/modules/video_coding/include/mock/mock_video_codec_interface.h
index bc591d3..7d00359 100644
--- a/modules/video_coding/include/mock/mock_video_codec_interface.h
+++ b/modules/video_coding/include/mock/mock_video_codec_interface.h
@@ -44,7 +44,6 @@
int32_t(EncodedImageCallback* callback));
MOCK_METHOD0(Release, int32_t());
MOCK_METHOD0(Reset, int32_t());
- MOCK_METHOD2(SetChannelParameters, int32_t(uint32_t packetLoss, int64_t rtt));
MOCK_METHOD2(SetRates, int32_t(uint32_t newBitRate, uint32_t frameRate));
MOCK_METHOD2(SetRateAllocation,
int32_t(const VideoBitrateAllocation& newBitRate,
diff --git a/modules/video_coding/video_sender_unittest.cc b/modules/video_coding/video_sender_unittest.cc
index fb55dc9..e423de5 100644
--- a/modules/video_coding/video_sender_unittest.cc
+++ b/modules/video_coding/video_sender_unittest.cc
@@ -369,9 +369,6 @@
// Expect initial call to SetChannelParameters. Rates are initialized through
// InitEncode and expects no additional call before the framerate (or bitrate)
// updates.
- EXPECT_CALL(encoder_, SetChannelParameters(kLossRate, kRtt))
- .Times(1)
- .WillOnce(Return(0));
sender_->SetChannelParameters(settings_.startBitrate * 1000, kLossRate, kRtt,
rate_allocator_.get(), nullptr);
while (clock_.TimeInMilliseconds() < start_time + kRateStatsWindowMs) {
diff --git a/sdk/android/api/org/webrtc/VideoEncoder.java b/sdk/android/api/org/webrtc/VideoEncoder.java
index 8dc7582..beb47df 100644
--- a/sdk/android/api/org/webrtc/VideoEncoder.java
+++ b/sdk/android/api/org/webrtc/VideoEncoder.java
@@ -216,7 +216,12 @@
* @param packetLoss How many packets are lost on average per 255 packets.
* @param roundTripTimeMs Round-trip time of the network in milliseconds.
*/
- @CalledByNative VideoCodecStatus setChannelParameters(short packetLoss, long roundTripTimeMs);
+ // TODO(webrtc:9946): Remove this function when downstream projects have been
+ // updated.
+ @Deprecated
+ default VideoCodecStatus setChannelParameters(short packetLoss, long roundTripTimeMs) {
+ return VideoCodecStatus.OK;
+ }
/** Sets the bitrate allocation and the target framerate for the encoder. */
@CalledByNative VideoCodecStatus setRateAllocation(BitrateAllocation allocation, int framerate);
diff --git a/sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java b/sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java
index ebf9de3..c36a68c 100644
--- a/sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java
+++ b/sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java
@@ -404,12 +404,6 @@
}
@Override
- public VideoCodecStatus setChannelParameters(short packetLoss, long roundTripTimeMs) {
- encodeThreadChecker.checkIsOnValidThread();
- return VideoCodecStatus.OK; // No op.
- }
-
- @Override
public VideoCodecStatus setRateAllocation(BitrateAllocation bitrateAllocation, int framerate) {
encodeThreadChecker.checkIsOnValidThread();
if (framerate > MAX_VIDEO_FRAMERATE) {
diff --git a/sdk/android/src/java/org/webrtc/WrappedNativeVideoEncoder.java b/sdk/android/src/java/org/webrtc/WrappedNativeVideoEncoder.java
index 07e8428..959cafc 100644
--- a/sdk/android/src/java/org/webrtc/WrappedNativeVideoEncoder.java
+++ b/sdk/android/src/java/org/webrtc/WrappedNativeVideoEncoder.java
@@ -33,11 +33,6 @@
}
@Override
- public VideoCodecStatus setChannelParameters(short packetLoss, long roundTripTimeMs) {
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- @Override
public VideoCodecStatus setRateAllocation(BitrateAllocation allocation, int framerate) {
throw new UnsupportedOperationException("Not implemented.");
}
diff --git a/sdk/android/src/jni/androidmediaencoder.cc b/sdk/android/src/jni/androidmediaencoder.cc
index 435bc71..d593548 100644
--- a/sdk/android/src/jni/androidmediaencoder.cc
+++ b/sdk/android/src/jni/androidmediaencoder.cc
@@ -105,8 +105,6 @@
int32_t RegisterEncodeCompleteCallback(
EncodedImageCallback* callback) override;
int32_t Release() override;
- int32_t SetChannelParameters(uint32_t /* packet_loss */,
- int64_t /* rtt */) override;
int32_t SetRateAllocation(const VideoBitrateAllocation& rate_allocation,
uint32_t frame_rate) override;
@@ -364,11 +362,6 @@
codec_settings->expect_encode_from_texture && has_egl_context_);
}
-int32_t MediaCodecVideoEncoder::SetChannelParameters(uint32_t /* packet_loss */,
- int64_t /* rtt */) {
- return WEBRTC_VIDEO_CODEC_OK;
-}
-
bool MediaCodecVideoEncoder::ResetCodec() {
RTC_DCHECK_CALLED_SEQUENTIALLY(&encoder_queue_checker_);
ALOGE << "Reset";
diff --git a/sdk/android/src/jni/videoencoderwrapper.cc b/sdk/android/src/jni/videoencoderwrapper.cc
index 50437be..5878a41 100644
--- a/sdk/android/src/jni/videoencoderwrapper.cc
+++ b/sdk/android/src/jni/videoencoderwrapper.cc
@@ -136,14 +136,6 @@
return HandleReturnCode(jni, ret, "encode");
}
-int32_t VideoEncoderWrapper::SetChannelParameters(uint32_t packet_loss,
- int64_t rtt) {
- JNIEnv* jni = AttachCurrentThreadIfNeeded();
- ScopedJavaLocalRef<jobject> ret = Java_VideoEncoder_setChannelParameters(
- jni, encoder_, (jshort)packet_loss, (jlong)rtt);
- return HandleReturnCode(jni, ret, "setChannelParameters");
-}
-
int32_t VideoEncoderWrapper::SetRateAllocation(
const VideoBitrateAllocation& allocation,
uint32_t framerate) {
diff --git a/sdk/android/src/jni/videoencoderwrapper.h b/sdk/android/src/jni/videoencoderwrapper.h
index c305605..d1cf502 100644
--- a/sdk/android/src/jni/videoencoderwrapper.h
+++ b/sdk/android/src/jni/videoencoderwrapper.h
@@ -45,8 +45,6 @@
const CodecSpecificInfo* codec_specific_info,
const std::vector<FrameType>* frame_types) override;
- int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
-
int32_t SetRateAllocation(const VideoBitrateAllocation& allocation,
uint32_t framerate) override;
diff --git a/sdk/objc/native/src/objc_video_encoder_factory.mm b/sdk/objc/native/src/objc_video_encoder_factory.mm
index ba7c3e9..68e8133 100644
--- a/sdk/objc/native/src/objc_video_encoder_factory.mm
+++ b/sdk/objc/native/src/objc_video_encoder_factory.mm
@@ -86,8 +86,6 @@
frameTypes:rtcFrameTypes];
}
- int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) { return WEBRTC_VIDEO_CODEC_OK; }
-
int32_t SetRates(uint32_t bitrate, uint32_t framerate) {
return [encoder_ setBitrate:bitrate framerate:framerate];
}
diff --git a/sdk/objc/unittests/objc_video_encoder_factory_tests.mm b/sdk/objc/unittests/objc_video_encoder_factory_tests.mm
index d009d51..2aa59cf 100644
--- a/sdk/objc/unittests/objc_video_encoder_factory_tests.mm
+++ b/sdk/objc/unittests/objc_video_encoder_factory_tests.mm
@@ -117,12 +117,6 @@
EXPECT_EQ(encoder->Release(), WEBRTC_VIDEO_CODEC_ERROR);
}
-TEST(ObjCVideoEncoderFactoryTest, SetChannelParametersAlwaysReturnsOK) {
- std::unique_ptr<webrtc::VideoEncoder> encoder = GetObjCEncoder(CreateErrorEncoderFactory());
-
- EXPECT_EQ(encoder->SetChannelParameters(1, 1), WEBRTC_VIDEO_CODEC_OK);
-}
-
TEST(ObjCVideoEncoderFactoryTest, SetRatesReturnsOKOnSuccess) {
std::unique_ptr<webrtc::VideoEncoder> encoder = GetObjCEncoder(CreateOKEncoderFactory());
diff --git a/test/configurable_frame_size_encoder.cc b/test/configurable_frame_size_encoder.cc
index 071845f..bdd61d0 100644
--- a/test/configurable_frame_size_encoder.cc
+++ b/test/configurable_frame_size_encoder.cc
@@ -70,11 +70,6 @@
return WEBRTC_VIDEO_CODEC_OK;
}
-int32_t ConfigurableFrameSizeEncoder::SetChannelParameters(uint32_t packet_loss,
- int64_t rtt) {
- return WEBRTC_VIDEO_CODEC_OK;
-}
-
int32_t ConfigurableFrameSizeEncoder::SetRateAllocation(
const VideoBitrateAllocation& allocation,
uint32_t framerate) {
diff --git a/test/configurable_frame_size_encoder.h b/test/configurable_frame_size_encoder.h
index 03dc149..f881513 100644
--- a/test/configurable_frame_size_encoder.h
+++ b/test/configurable_frame_size_encoder.h
@@ -37,8 +37,6 @@
int32_t Release() override;
- int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
-
int32_t SetRateAllocation(const VideoBitrateAllocation& allocation,
uint32_t framerate) override;
diff --git a/test/fake_encoder.cc b/test/fake_encoder.cc
index c151e4c..eeeaa0d 100644
--- a/test/fake_encoder.cc
+++ b/test/fake_encoder.cc
@@ -214,10 +214,6 @@
return 0;
}
-int32_t FakeEncoder::SetChannelParameters(uint32_t packet_loss, int64_t rtt) {
- return 0;
-}
-
int32_t FakeEncoder::SetRateAllocation(
const VideoBitrateAllocation& rate_allocation,
uint32_t framerate) {
diff --git a/test/fake_encoder.h b/test/fake_encoder.h
index 9eddb0f..2e6cdd1 100644
--- a/test/fake_encoder.h
+++ b/test/fake_encoder.h
@@ -41,7 +41,6 @@
int32_t RegisterEncodeCompleteCallback(
EncodedImageCallback* callback) override;
int32_t Release() override;
- int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
int32_t SetRateAllocation(const VideoBitrateAllocation& rate_allocation,
uint32_t framerate) override;
const char* ImplementationName() const override;
diff --git a/test/video_encoder_proxy_factory.h b/test/video_encoder_proxy_factory.h
index fa32ebc..9e5ea12 100644
--- a/test/video_encoder_proxy_factory.h
+++ b/test/video_encoder_proxy_factory.h
@@ -76,9 +76,6 @@
return encoder_->RegisterEncodeCompleteCallback(callback);
}
int32_t Release() override { return encoder_->Release(); }
- int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override {
- return encoder_->SetChannelParameters(packet_loss, rtt);
- }
int32_t SetRateAllocation(const VideoBitrateAllocation& rate_allocation,
uint32_t framerate) override {
return encoder_->SetRateAllocation(rate_allocation, framerate);
diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc
index 08d5d1f..700a038 100644
--- a/video/video_quality_test.cc
+++ b/video/video_quality_test.cc
@@ -111,9 +111,6 @@
}
return encoder_->Encode(frame, codec_specific_info, frame_types);
}
- int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override {
- return encoder_->SetChannelParameters(packet_loss, rtt);
- }
int32_t SetRates(uint32_t bitrate, uint32_t framerate) override {
return encoder_->SetRates(bitrate, framerate);
}
diff --git a/video/video_send_stream_tests.cc b/video/video_send_stream_tests.cc
index 4ec25af..a7edaea 100644
--- a/video/video_send_stream_tests.cc
+++ b/video/video_send_stream_tests.cc
@@ -2378,11 +2378,6 @@
return 0;
}
- int32_t SetChannelParameters(uint32_t packetLoss, int64_t rtt) override {
- EXPECT_TRUE(IsReadyForEncode());
- return 0;
- }
-
int32_t SetRates(uint32_t newBitRate, uint32_t frameRate) override {
EXPECT_TRUE(IsReadyForEncode());
return 0;