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}
This commit is contained in:
@ -625,11 +625,6 @@ void H264EncoderImpl::ReportError() {
|
||||
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);
|
||||
|
@ -74,9 +74,6 @@ class H264EncoderImpl : public H264Encoder {
|
||||
|
||||
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_;
|
||||
|
@ -65,10 +65,6 @@ class I420Encoder : public VideoEncoder {
|
||||
// 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,
|
||||
|
@ -46,7 +46,6 @@ class MultiplexEncoderAdapter : public VideoEncoder {
|
||||
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;
|
||||
|
@ -202,16 +202,6 @@ int MultiplexEncoderAdapter::RegisterEncodeCompleteCallback(
|
||||
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) {
|
||||
|
@ -925,10 +925,6 @@ VideoEncoder::ScalingSettings LibvpxVp8Encoder::GetScalingSettings() const {
|
||||
: 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;
|
||||
|
@ -47,8 +47,6 @@ class LibvpxVp8Encoder : public VideoEncoder {
|
||||
|
||||
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;
|
||||
|
||||
|
@ -1239,10 +1239,6 @@ void VP9EncoderImpl::DeliverBufferedFrame(bool end_of_picture) {
|
||||
}
|
||||
}
|
||||
|
||||
int VP9EncoderImpl::SetChannelParameters(uint32_t packet_loss, int64_t rtt) {
|
||||
return WEBRTC_VIDEO_CODEC_OK;
|
||||
}
|
||||
|
||||
int VP9EncoderImpl::RegisterEncodeCompleteCallback(
|
||||
EncodedImageCallback* callback) {
|
||||
encoded_complete_callback_ = callback;
|
||||
|
@ -46,8 +46,6 @@ class VP9EncoderImpl : public VP9Encoder {
|
||||
|
||||
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;
|
||||
|
||||
|
@ -101,26 +101,14 @@ int32_t VCMGenericEncoder::Encode(const VideoFrame& frame,
|
||||
|
||||
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);
|
||||
|
@ -44,7 +44,6 @@ class MockVideoEncoder : public VideoEncoder {
|
||||
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,
|
||||
|
@ -369,9 +369,6 @@ TEST_F(TestVideoSenderWithMockEncoder,
|
||||
// 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) {
|
||||
|
Reference in New Issue
Block a user