android webrtc jitter buffer大小设置

1. PeerConnectionClient.java

设置在如下接口:

private void createPeerConnectionInternal(Context context,EglBase.Context renderEGLContext) {
  rtcConfig.audioJitterBufferMaxPackets = 30; //设置jitter buffter大小为30
}

2. PeerConnection.java文件

public RTCConfiguration(List iceServers) {
      iceTransportsType = IceTransportsType.ALL;
      bundlePolicy = BundlePolicy.BALANCED;
      rtcpMuxPolicy = RtcpMuxPolicy.REQUIRE;
      tcpCandidatePolicy = TcpCandidatePolicy.ENABLED;
      candidateNetworkPolicy = candidateNetworkPolicy.ALL;
      this.iceServers = iceServers;
      audioJitterBufferMaxPackets = 50;
      audioJitterBufferFastAccelerate = false;
      iceConnectionReceivingTimeout = -1;
      iceBackupCandidatePairPingInterval = -1;
      keyType = KeyType.ECDSA;
      continualGatheringPolicy = ContinualGatheringPolicy.GATHER_ONCE;
      iceCandidatePoolSize = 0;
      pruneTurnPorts = false;
      presumeWritableWhenFullyRelayed = false;
      iceCheckMinInterval = null;
      disableIPv6OnWifi = false;
    }
  };

参数为audioJitterBufferMaxPackets

2. webrtc源码限制最小只能为20

webrtcvoiceengine.cc

bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in){

  if (options.audio_jitter_buffer_max_packets) {
    channel_config_.acm_config.neteq_config.max_packets_in_buffer =
        std::max(20, *options.audio_jitter_buffer_max_packets);
  }

}

以上就是webrtc jitter buffer大小设置

转载于:https://my.oschina.net/xgcode/blog/2208218

你可能感兴趣的:(android webrtc jitter buffer大小设置)