Remove effectively dead code for allow_codec_switching

Bug: webrtc:11341
Change-Id: I88e3c1059f5ebcc9d693c0719534aaacd4b9199b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324283
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40990}
This commit is contained in:
Tommi 2023-10-22 17:15:50 +02:00 committed by WebRTC LUCI CQ
parent ad69832b7f
commit 5b186e98bc
7 changed files with 1 additions and 40 deletions

View file

@ -662,6 +662,7 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface {
bool enable_implicit_rollback = false; bool enable_implicit_rollback = false;
// Whether network condition based codec switching is allowed. // Whether network condition based codec switching is allowed.
// TODO(bugs.webrtc.org/11341): Remove this unsupported config value.
absl::optional<bool> allow_codec_switching; absl::optional<bool> allow_codec_switching;
// The delay before doing a usage histogram report for long-lived // The delay before doing a usage histogram report for long-lived

View file

@ -741,7 +741,6 @@ class FakeVideoMediaSendChannel
void SetSsrcListChangedCallback( void SetSsrcListChangedCallback(
absl::AnyInvocable<void(const std::set<uint32_t>&)> callback) override {} absl::AnyInvocable<void(const std::set<uint32_t>&)> callback) override {}
void SetVideoCodecSwitchingEnabled(bool enabled) override {}
bool SendCodecHasLntf() const override { return false; } bool SendCodecHasLntf() const override { return false; }
bool SendCodecHasNack() const override { return false; } bool SendCodecHasNack() const override { return false; }
absl::optional<int> SendCodecRtxTime() const override { absl::optional<int> SendCodecRtxTime() const override {

View file

@ -949,8 +949,6 @@ class VideoMediaSendChannelInterface : public MediaSendChannelInterface {
// Cause generation of a keyframe for `ssrc` on a sending channel. // Cause generation of a keyframe for `ssrc` on a sending channel.
virtual void GenerateSendKeyFrame(uint32_t ssrc, virtual void GenerateSendKeyFrame(uint32_t ssrc,
const std::vector<std::string>& rids) = 0; const std::vector<std::string>& rids) = 0;
// Enable network condition based codec switching.
virtual void SetVideoCodecSwitchingEnabled(bool enabled) = 0;
virtual bool GetStats(VideoMediaSendInfo* stats) = 0; virtual bool GetStats(VideoMediaSendInfo* stats) = 0;
// This fills the "bitrate parts" (rtx, video bitrate) of the // This fills the "bitrate parts" (rtx, video bitrate) of the
// BandwidthEstimationInfo, since that part that isn't possible to get // BandwidthEstimationInfo, since that part that isn't possible to get

View file

@ -1674,14 +1674,6 @@ void WebRtcVideoSendChannel::SetEncoderSelector(
} }
} }
void WebRtcVideoSendChannel::SetVideoCodecSwitchingEnabled(bool enabled) {
RTC_DCHECK_RUN_ON(&thread_checker_);
allow_codec_switching_ = enabled;
if (allow_codec_switching_) {
RTC_LOG(LS_INFO) << "Encoder switching enabled.";
}
}
WebRtcVideoSendChannel::WebRtcVideoSendStream::VideoSendStreamParameters:: WebRtcVideoSendChannel::WebRtcVideoSendStream::VideoSendStreamParameters::
VideoSendStreamParameters( VideoSendStreamParameters(
webrtc::VideoSendStream::Config config, webrtc::VideoSendStream::Config config,

View file

@ -225,8 +225,6 @@ class WebRtcVideoSendChannel : public MediaChannelUtil,
webrtc::VideoEncoderFactory::EncoderSelectorInterface* webrtc::VideoEncoderFactory::EncoderSelectorInterface*
encoder_selector) override; encoder_selector) override;
void SetVideoCodecSwitchingEnabled(bool enabled) override;
void SetSendCodecChangedCallback( void SetSendCodecChangedCallback(
absl::AnyInvocable<void()> callback) override { absl::AnyInvocable<void()> callback) override {
send_codec_changed_callback_ = std::move(callback); send_codec_changed_callback_ = std::move(callback);
@ -549,11 +547,6 @@ class WebRtcVideoSendChannel : public MediaChannelUtil,
rtc::scoped_refptr<webrtc::FrameTransformerInterface> rtc::scoped_refptr<webrtc::FrameTransformerInterface>
unsignaled_frame_transformer_ RTC_GUARDED_BY(thread_checker_); unsignaled_frame_transformer_ RTC_GUARDED_BY(thread_checker_);
// TODO(bugs.webrtc.org/11341): Remove this and relevant PC API. Presence
// of multiple negotiated codecs allows generic encoder fallback on failures.
// Presence of EncoderSelector allows switching to specific encoders.
bool allow_codec_switching_ = false;
// RTP parameters that need to be set when creating a video receive stream. // RTP parameters that need to be set when creating a video receive stream.
// Only used in Receiver mode - in Both mode, it reads those things from the // Only used in Receiver mode - in Both mode, it reads those things from the
// codec. // codec.

View file

@ -2660,7 +2660,6 @@ TEST_F(WebRtcVideoChannelBaseTest, SendCodecIsMovedToFrontInRtpParameters) {
parameters.codecs.push_back(GetEngineCodec("VP9")); parameters.codecs.push_back(GetEngineCodec("VP9"));
parameters.codecs.push_back(GetEngineCodec("VP8")); parameters.codecs.push_back(GetEngineCodec("VP8"));
EXPECT_TRUE(send_channel_->SetSenderParameters(parameters)); EXPECT_TRUE(send_channel_->SetSenderParameters(parameters));
send_channel_->SetVideoCodecSwitchingEnabled(true);
auto send_codecs = send_channel_->GetRtpSendParameters(kSsrc).codecs; auto send_codecs = send_channel_->GetRtpSendParameters(kSsrc).codecs;
ASSERT_EQ(send_codecs.size(), 2u); ASSERT_EQ(send_codecs.size(), 2u);

View file

@ -1676,27 +1676,6 @@ RTCError PeerConnection::SetConfiguration(
"Failed to apply configuration to PortAllocator."); "Failed to apply configuration to PortAllocator.");
} }
if (modified_config.allow_codec_switching.has_value()) {
std::vector<cricket::VideoMediaSendChannelInterface*> channels;
for (const auto& transceiver : rtp_manager()->transceivers()->List()) {
if (transceiver->media_type() != cricket::MEDIA_TYPE_VIDEO)
continue;
auto* video_channel = transceiver->internal()->channel();
if (video_channel)
channels.push_back(
static_cast<cricket::VideoMediaSendChannelInterface*>(
video_channel->media_send_channel()));
}
worker_thread()->BlockingCall(
[channels = std::move(channels),
allow_codec_switching = *modified_config.allow_codec_switching]() {
for (auto* ch : channels)
ch->SetVideoCodecSwitchingEnabled(allow_codec_switching);
});
}
configuration_ = modified_config; configuration_ = modified_config;
return RTCError::OK(); return RTCError::OK();
} }