webrtc视频设置最大码率

m76版本:
webrtc_video_engine.cc

 1. sdp    b=AS:1234  sdp中设置的最大码率 
 	  int stream_max_bitrate = parameters_.max_bitrate_bps;
	  
  2.   RtpSenderInternal设置的最大码率  RtpSenderInternal->setParameter();
	  if (rtp_parameters_.encodings[0].max_bitrate_bps &&
	      rtp_parameters_.encodings.size() == 1) {
	    stream_max_bitrate =
	        webrtc::MinPositive(*(rtp_parameters_.encodings[0].max_bitrate_bps),
	                            parameters_.max_bitrate_bps);
	  }
	
 3. sdp中 a=fmtp: x-google-max-bitrate=2134   指定的最大码率
	  // The codec max bitrate comes from the "x-google-max-bitrate" parameter
	  // attribute set in the SDP for a specific codec. As done in
	  // WebRtcVideoChannel::SetSendParameters, this value does not override the
	  // stream max_bitrate set above.
	  
	  int codec_max_bitrate_kbps;
	  if (codec.GetParam(kCodecParamMaxBitrate, &codec_max_bitrate_kbps) &&
	      stream_max_bitrate == -1) {
	    stream_max_bitrate = codec_max_bitrate_kbps * 1000;
	  }
	  encoder_config.max_bitrate_bps = stream_max_bitrate;

4.  pc提供下面接口,用于设置整个的pc的最大码率,最小码率,开始码率. 多个音频视频公用   的
  PeerConnectionInterface.SetBitrate(const BitrateSettings& bitrate);

1,3通过sdp设置的,2,4通过接口设置的

你可能感兴趣的:(webrtc-m76学习笔记)