bool WebRtcVideoChannel::AddSendStream(const StreamParams& sp)
調用AddSendStream()方法時,首先檢驗StreamParams參數是否有效,然後判斷SSRC是否可用。創建WebRtcVideoSendStream實例的時候,將參數傳遞給WebRtcVideoSendStream對象。參數sp經過CreateRtpParametersWithEncodings處理後,賦值給rtp_parameters_。
webrtc::DegradationPreference
WebRtcVideoChannel::WebRtcVideoSendStream::GetDegradationPreference() const {
// Do not adapt resolution for screen content as this will likely
// result in blurry and unreadable text.
// |this| acts like a VideoSource to make sure SinkWants are handled on the
// correct thread.
webrtc::DegradationPreference degradation_preference;
if (rtp_parameters_.degradation_preference !=
webrtc::DegradationPreference::BALANCED) {
// If the degradationPreference is different from the default value, assume
// it is what we want, regardless of trials or other internal settings.
degradation_preference = rtp_parameters_.degradation_preference;
} else