diff --git a/talk/media/webrtc/webrtcvideoengine.cc b/talk/media/webrtc/webrtcvideoengine.cc index 8d8b36cc2..1ee397582 100644 --- a/talk/media/webrtc/webrtcvideoengine.cc +++ b/talk/media/webrtc/webrtcvideoengine.cc @@ -2884,7 +2884,7 @@ bool WebRtcVideoMediaChannel::SetStartSendBandwidth(int bps) { } // On success, SetSendCodec() will reset |send_start_bitrate_| to |bps/1000|, - // by calling MaybeChangeBitrates. That method will also clamp the + // by calling SanitizeBitrates. That method will also clamp the // start bitrate between min and max, consistent with the override behavior // in SetMaxSendBandwidth. webrtc::VideoCodec new_codec = *send_codec_; @@ -3659,7 +3659,7 @@ bool WebRtcVideoMediaChannel::SetSendCodec( << "for ssrc: " << ssrc << "."; } else { StreamParams* send_params = send_channel->stream_params(); - MaybeChangeBitrates(channel_id, &target_codec); + SanitizeBitrates(channel_id, &target_codec); webrtc::VideoCodec current_codec; if (!engine()->vie()->codec()->GetSendCodec(channel_id, current_codec)) { // Compare against existing configured send codec. @@ -3946,7 +3946,7 @@ bool WebRtcVideoMediaChannel::MaybeResetVieSendCodec( vie_codec.codecSpecific.VP8.denoisingOn = enable_denoising; vie_codec.codecSpecific.VP8.frameDroppingOn = vp8_frame_dropping; } - MaybeChangeBitrates(channel_id, &vie_codec); + SanitizeBitrates(channel_id, &vie_codec); if (engine()->vie()->codec()->SetSendCodec(channel_id, vie_codec) != 0) { LOG_RTCERR1(SetSendCodec, channel_id); @@ -3984,7 +3984,7 @@ bool WebRtcVideoMediaChannel::MaybeResetVieSendCodec( return true; } -void WebRtcVideoMediaChannel::MaybeChangeBitrates( +void WebRtcVideoMediaChannel::SanitizeBitrates( int channel_id, webrtc::VideoCodec* codec) { codec->minBitrate = GetBitrate(codec->minBitrate, kMinVideoBitrate); codec->startBitrate = GetBitrate(codec->startBitrate, kStartVideoBitrate); diff --git a/talk/media/webrtc/webrtcvideoengine.h b/talk/media/webrtc/webrtcvideoengine.h index fb0c4e130..275f03943 100644 --- a/talk/media/webrtc/webrtcvideoengine.h +++ b/talk/media/webrtc/webrtcvideoengine.h @@ -310,6 +310,10 @@ class WebRtcVideoMediaChannel : public rtc::MessageHandler, virtual int SendPacket(int channel, const void* data, int len); virtual int SendRTCPPacket(int channel, const void* data, int len); + // Checks the current bitrate estimate and modifies the bitrates + // accordingly, including converting kAutoBandwidth to the correct defaults. + virtual void SanitizeBitrates( + int channel_id, webrtc::VideoCodec* video_codec); virtual void LogSendCodecChange(const std::string& reason); bool SetPrimaryAndRtxSsrcs( int channel_id, int idx, uint32 primary_ssrc, @@ -361,9 +365,6 @@ class WebRtcVideoMediaChannel : public rtc::MessageHandler, bool MaybeResetVieSendCodec(WebRtcVideoChannelSendInfo* send_channel, int new_width, int new_height, bool is_screencast, bool* reset); - // Checks the current bitrate estimate and modifies the bitrates - // accordingly, including converting kAutoBandwidth to the correct defaults. - void MaybeChangeBitrates(int channel_id, webrtc::VideoCodec* video_codec); // Helper function for starting the sending of media on all channels or // |channel_id|. Note that these two function do not change |sending_|. bool StartSend();