Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 036a1fd

Browse files
taste1981jianjunz
authored andcommitted
Fix gpra crash caused by INTEL_GPRA macro (#129)
1 parent 481dda4 commit 036a1fd

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

BUILD.gn

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ config("common_config") {
293293
defines += [ "WEBRTC_ENABLE_PROTOBUF=0" ]
294294
}
295295

296+
if (owt_use_gpra) {
297+
defines += [ "INTEL_GPRA" ]
298+
}
299+
296300
if (rtc_include_internal_audio_device) {
297301
defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
298302
}

modules/congestion_controller/goog_cc/goog_cc_network_control.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ NetworkControlUpdate GoogCcNetworkController::OnRoundTripTimeUpdate(
318318
if (delay_based_bwe_)
319319
delay_based_bwe_->OnRttUpdate(msg.round_trip_time);
320320
#ifdef INTEL_GPRA
321+
// If gpra is working, gcc_ will not be set.
321322
if (delay_based_bwe_gcc_)
322323
delay_based_bwe_gcc_->OnRttUpdate(msg.round_trip_time);
323324
#endif
@@ -390,6 +391,7 @@ NetworkControlUpdate GoogCcNetworkController::OnStreamsConfig(
390391
if (delay_based_bwe_)
391392
delay_based_bwe_->SetMinBitrate(min_data_rate_);
392393
#ifdef INTEL_GPRA
394+
// if GPRA is built but not enabled, we will use gcc.
393395
if (delay_based_bwe_gcc_)
394396
delay_based_bwe_gcc_->SetMinBitrate(min_data_rate_);
395397
#endif

modules/congestion_controller/rtp/transport_feedback_adapter.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ TransportFeedbackAdapter::ProcessTransportFeedbackInner(
199199
// time stamps.
200200
if (last_timestamp_.IsInfinite()) {
201201
current_offset_ = feedback_receive_time;
202+
#ifdef INTEL_GPRA
203+
current_offset_ms_ = feedback_receive_time.ms();
204+
#endif
202205
} else {
203206
// TODO(srte): We shouldn't need to do rounding here.
204207
const TimeDelta delta = feedback.GetBaseDelta(last_timestamp_)
@@ -207,8 +210,14 @@ TransportFeedbackAdapter::ProcessTransportFeedbackInner(
207210
if (delta < Timestamp::Zero() - current_offset_) {
208211
RTC_LOG(LS_WARNING) << "Unexpected feedback timestamp received.";
209212
current_offset_ = feedback_receive_time;
213+
#ifdef INTEL_GPRA
214+
current_offset_ms_ = feedback_receive_time.ms();
215+
#endif
210216
} else {
211217
current_offset_ += delta;
218+
#ifdef INTEL_GPRA
219+
current_offset_ms_ += delta.ms();
220+
#endif
212221
}
213222
}
214223
last_timestamp_ = feedback.BaseTime();

modules/congestion_controller/rtp/transport_feedback_adapter.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ class TransportFeedbackAdapter {
9393
// Sequence numbers are never negative, using -1 as it always < a real
9494
// sequence number.
9595
int64_t last_ack_seq_num_ = -1;
96+
#ifdef INTEL_GPRA
97+
int64_t current_offset_ms_ = -1;
98+
#endif
9699
InFlightBytesTracker in_flight_;
97100

98101
Timestamp current_offset_ = Timestamp::MinusInfinity();

0 commit comments

Comments
 (0)