mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Add setting for jitter buffer max packets
Co-authored-by: Jim Gustafson <jim@signal.org>
This commit is contained in:
parent
79676c3da1
commit
db3d421794
4 changed files with 12 additions and 9 deletions
|
@ -102,8 +102,8 @@ void PacketBuffer::Flush(StatisticsCalculator* stats) {
|
|||
// RingRTC change to log more information around audio jitter buffer flushes
|
||||
auto prev_recv_ts = Timestamp::Micros(0);
|
||||
auto num_out_of_order = 0;
|
||||
auto num_gaps_below_15ms = 0;
|
||||
auto num_gaps_above_40ms = 0;
|
||||
auto num_gaps_below_40ms = 0;
|
||||
auto num_gaps_above_90ms = 0;
|
||||
|
||||
for (auto& p : buffer_) {
|
||||
LogPacketDiscarded(p.priority.codec_level, stats);
|
||||
|
@ -112,10 +112,10 @@ void PacketBuffer::Flush(StatisticsCalculator* stats) {
|
|||
|
||||
if (gap_us < 0) {
|
||||
num_out_of_order++;
|
||||
} else if (gap_us < 15000) {
|
||||
num_gaps_below_15ms++;
|
||||
} else if (gap_us > 40000) {
|
||||
num_gaps_above_40ms++;
|
||||
} else if (gap_us < 40000) {
|
||||
num_gaps_below_40ms++;
|
||||
} else if (gap_us > 90000) {
|
||||
num_gaps_above_90ms++;
|
||||
}
|
||||
}
|
||||
prev_recv_ts = p.packet_info.receive_time();
|
||||
|
@ -131,8 +131,8 @@ void PacketBuffer::Flush(StatisticsCalculator* stats) {
|
|||
<< ", ms_since_first_insert=" << first.waiting_time->ElapsedMs()
|
||||
<< ", ms_since_last_insert=" << last.waiting_time->ElapsedMs()
|
||||
<< ", num_out_of_order=" << num_out_of_order
|
||||
<< ", num_gaps_below_15ms=" << num_gaps_below_15ms
|
||||
<< ", num_gaps_above_40ms=" << num_gaps_above_40ms;
|
||||
<< ", num_gaps_below_40ms=" << num_gaps_below_40ms
|
||||
<< ", num_gaps_above_90ms=" << num_gaps_above_90ms;
|
||||
}
|
||||
buffer_.clear();
|
||||
stats->FlushedPacketBuffer();
|
||||
|
|
|
@ -95,7 +95,7 @@ InputVolumeStatsReporter::InputVolumeStatsReporter(InputVolumeType type)
|
|||
.update_average = CreateAverageHistogram(type, "UpdateAverage")}),
|
||||
cannot_log_stats_(!histograms_.AllPointersSet()) {
|
||||
if (cannot_log_stats_) {
|
||||
RTC_LOG(LS_WARNING) << "Will not log any `" << MetricNamePrefix(type)
|
||||
RTC_LOG(LS_INFO) << "Will not log any `" << MetricNamePrefix(type)
|
||||
<< "*` histogram stats.";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ RUSTEXPORT webrtc::PeerConnectionInterface* Rust_createPeerConnection(
|
|||
webrtc::PeerConnectionFactoryOwner* factory_owner_borrowed_rc,
|
||||
webrtc::rffi::PeerConnectionObserverRffi* observer_borrowed,
|
||||
RffiPeerConnectionKind kind,
|
||||
int audio_jitter_buffer_max_packets,
|
||||
RffiIceServer ice_server,
|
||||
webrtc::AudioTrackInterface* outgoing_audio_track_borrowed_rc,
|
||||
webrtc::VideoTrackInterface* outgoing_video_track_borrowed_rc);
|
||||
|
|
|
@ -297,6 +297,7 @@ RUSTEXPORT PeerConnectionInterface* Rust_createPeerConnection(
|
|||
PeerConnectionFactoryOwner* factory_owner_borrowed_rc,
|
||||
PeerConnectionObserverRffi* observer_borrowed,
|
||||
RffiPeerConnectionKind kind,
|
||||
int audio_jitter_buffer_max_packets,
|
||||
RffiIceServer ice_server,
|
||||
webrtc::AudioTrackInterface* outgoing_audio_track_borrowed_rc,
|
||||
webrtc::VideoTrackInterface* outgoing_video_track_borrowed_rc) {
|
||||
|
@ -311,6 +312,7 @@ RUSTEXPORT PeerConnectionInterface* Rust_createPeerConnection(
|
|||
} else if (kind == RffiPeerConnectionKind::kGroupCall) {
|
||||
config.tcp_candidate_policy = PeerConnectionInterface::kTcpCandidatePolicyEnabled;
|
||||
}
|
||||
config.audio_jitter_buffer_max_packets = audio_jitter_buffer_max_packets;
|
||||
config.sdp_semantics = SdpSemantics::kPlanB_DEPRECATED;
|
||||
if (ice_server.urls_size > 0) {
|
||||
webrtc::PeerConnectionInterface::IceServer rtc_ice_server;
|
||||
|
|
Loading…
Reference in a new issue