Unverified 提交 394d092e authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo 提交者: GitHub

Issue 357 (#380)

* libwebrtc dep: always provide positive time values in int64_t type
* libwebrtc dep: replace assert() with MS_ASSERT()
* Fixes #357
上级 ae3674b8
...@@ -36,7 +36,7 @@ TargetRateConstraints ConvertConstraints(int min_bitrate_bps, ...@@ -36,7 +36,7 @@ TargetRateConstraints ConvertConstraints(int min_bitrate_bps,
int max_bitrate_bps, int max_bitrate_bps,
int start_bitrate_bps) { int start_bitrate_bps) {
TargetRateConstraints msg; TargetRateConstraints msg;
msg.at_time = Timestamp::ms(DepLibUV::GetTimeMs()); msg.at_time = Timestamp::ms(DepLibUV::GetTimeMsInt64());
msg.min_data_rate = msg.min_data_rate =
min_bitrate_bps >= 0 ? DataRate::bps(min_bitrate_bps) : DataRate::Zero(); min_bitrate_bps >= 0 ? DataRate::bps(min_bitrate_bps) : DataRate::Zero();
msg.max_data_rate = max_bitrate_bps > 0 ? DataRate::bps(max_bitrate_bps) msg.max_data_rate = max_bitrate_bps > 0 ? DataRate::bps(max_bitrate_bps)
...@@ -63,7 +63,7 @@ RtpTransportControllerSend::RtpTransportControllerSend( ...@@ -63,7 +63,7 @@ RtpTransportControllerSend::RtpTransportControllerSend(
observer_(nullptr), observer_(nullptr),
controller_factory_override_(controller_factory), controller_factory_override_(controller_factory),
process_interval_(controller_factory_override_->GetProcessInterval()), process_interval_(controller_factory_override_->GetProcessInterval()),
last_report_block_time_(Timestamp::ms(DepLibUV::GetTimeMs())), last_report_block_time_(Timestamp::ms(DepLibUV::GetTimeMsInt64())),
send_side_bwe_with_overhead_( send_side_bwe_with_overhead_(
webrtc::field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")), webrtc::field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")),
transport_overhead_bytes_per_packet_(0), transport_overhead_bytes_per_packet_(0),
...@@ -147,7 +147,7 @@ void RtpTransportControllerSend::OnNetworkAvailability(bool network_available) { ...@@ -147,7 +147,7 @@ void RtpTransportControllerSend::OnNetworkAvailability(bool network_available) {
MS_DEBUG_DEV("SignalNetworkState:%s", network_available ? "Up" : "Down"); MS_DEBUG_DEV("SignalNetworkState:%s", network_available ? "Up" : "Down");
NetworkAvailability msg; NetworkAvailability msg;
msg.at_time = Timestamp::ms(DepLibUV::GetTimeMs()); msg.at_time = Timestamp::ms(DepLibUV::GetTimeMsInt64());
msg.network_available = network_available; msg.network_available = network_available;
if (network_available_ == msg.network_available) if (network_available_ == msg.network_available)
...@@ -194,7 +194,7 @@ void RtpTransportControllerSend::OnTransportOverheadChanged( ...@@ -194,7 +194,7 @@ void RtpTransportControllerSend::OnTransportOverheadChanged(
void RtpTransportControllerSend::OnReceivedEstimatedBitrate(uint32_t bitrate) { void RtpTransportControllerSend::OnReceivedEstimatedBitrate(uint32_t bitrate) {
RemoteBitrateReport msg; RemoteBitrateReport msg;
msg.receive_time = Timestamp::ms(DepLibUV::GetTimeMs()); msg.receive_time = Timestamp::ms(DepLibUV::GetTimeMsInt64());
msg.bandwidth = DataRate::bps(bitrate); msg.bandwidth = DataRate::bps(bitrate);
PostUpdates(controller_->OnRemoteBitrateReport(msg)); PostUpdates(controller_->OnRemoteBitrateReport(msg));
...@@ -220,14 +220,14 @@ void RtpTransportControllerSend::OnAddPacket( ...@@ -220,14 +220,14 @@ void RtpTransportControllerSend::OnAddPacket(
packet_info, packet_info,
send_side_bwe_with_overhead_ ? transport_overhead_bytes_per_packet_.load() send_side_bwe_with_overhead_ ? transport_overhead_bytes_per_packet_.load()
: 0, : 0,
Timestamp::ms(DepLibUV::GetTimeMs())); Timestamp::ms(DepLibUV::GetTimeMsInt64()));
} }
void RtpTransportControllerSend::OnTransportFeedback( void RtpTransportControllerSend::OnTransportFeedback(
const RTC::RTCP::FeedbackRtpTransportPacket& feedback) { const RTC::RTCP::FeedbackRtpTransportPacket& feedback) {
absl::optional<TransportPacketsFeedback> feedback_msg = absl::optional<TransportPacketsFeedback> feedback_msg =
transport_feedback_adapter_.ProcessTransportFeedback( transport_feedback_adapter_.ProcessTransportFeedback(
feedback, Timestamp::ms(DepLibUV::GetTimeMs())); feedback, Timestamp::ms(DepLibUV::GetTimeMsInt64()));
if (feedback_msg) if (feedback_msg)
PostUpdates(controller_->OnTransportPacketsFeedback(*feedback_msg)); PostUpdates(controller_->OnTransportPacketsFeedback(*feedback_msg));
pacer_.UpdateOutstandingData( pacer_.UpdateOutstandingData(
...@@ -236,7 +236,7 @@ void RtpTransportControllerSend::OnTransportFeedback( ...@@ -236,7 +236,7 @@ void RtpTransportControllerSend::OnTransportFeedback(
void RtpTransportControllerSend::OnRemoteNetworkEstimate( void RtpTransportControllerSend::OnRemoteNetworkEstimate(
NetworkStateEstimate estimate) { NetworkStateEstimate estimate) {
estimate.update_time = Timestamp::ms(DepLibUV::GetTimeMs()); estimate.update_time = Timestamp::ms(DepLibUV::GetTimeMsInt64());
controller_->OnNetworkStateEstimate(estimate); controller_->OnNetworkStateEstimate(estimate);
} }
...@@ -258,7 +258,7 @@ void RtpTransportControllerSend::MaybeCreateControllers() { ...@@ -258,7 +258,7 @@ void RtpTransportControllerSend::MaybeCreateControllers() {
control_handler_ = absl::make_unique<CongestionControlHandler>(); control_handler_ = absl::make_unique<CongestionControlHandler>();
initial_config_.constraints.at_time = initial_config_.constraints.at_time =
Timestamp::ms(DepLibUV::GetTimeMs()); Timestamp::ms(DepLibUV::GetTimeMsInt64());
controller_ = controller_factory_override_->Create(initial_config_); controller_ = controller_factory_override_->Create(initial_config_);
process_interval_ = controller_factory_override_->GetProcessInterval(); process_interval_ = controller_factory_override_->GetProcessInterval();
...@@ -271,13 +271,13 @@ void RtpTransportControllerSend::UpdateControllerWithTimeInterval() { ...@@ -271,13 +271,13 @@ void RtpTransportControllerSend::UpdateControllerWithTimeInterval() {
MS_ASSERT(controller_, "controller not set"); MS_ASSERT(controller_, "controller not set");
ProcessInterval msg; ProcessInterval msg;
msg.at_time = Timestamp::ms(DepLibUV::GetTimeMs()); msg.at_time = Timestamp::ms(DepLibUV::GetTimeMsInt64());
PostUpdates(controller_->OnProcessInterval(msg)); PostUpdates(controller_->OnProcessInterval(msg));
} }
void RtpTransportControllerSend::UpdateStreamsConfig() { void RtpTransportControllerSend::UpdateStreamsConfig() {
streams_config_.at_time = Timestamp::ms(DepLibUV::GetTimeMs()); streams_config_.at_time = Timestamp::ms(DepLibUV::GetTimeMsInt64());
if (controller_) if (controller_)
PostUpdates(controller_->OnStreamsConfig(streams_config_)); PostUpdates(controller_->OnStreamsConfig(streams_config_));
} }
......
...@@ -85,7 +85,7 @@ void AlrDetector::OnBytesSent(size_t bytes_sent, int64_t send_time_ms) { ...@@ -85,7 +85,7 @@ void AlrDetector::OnBytesSent(size_t bytes_sent, int64_t send_time_ms) {
bool state_changed = false; bool state_changed = false;
if (alr_budget_.budget_ratio() > start_budget_level_ratio_ && if (alr_budget_.budget_ratio() > start_budget_level_ratio_ &&
!alr_started_time_ms_) { !alr_started_time_ms_) {
alr_started_time_ms_.emplace(DepLibUV::GetTimeMs()); alr_started_time_ms_.emplace(DepLibUV::GetTimeMsInt64());
state_changed = true; state_changed = true;
} else if (alr_budget_.budget_ratio() < stop_budget_level_ratio_ && } else if (alr_budget_.budget_ratio() < stop_budget_level_ratio_ &&
alr_started_time_ms_) { alr_started_time_ms_) {
......
...@@ -53,7 +53,7 @@ PacedSender::PacedSender(PacketRouter* packet_router, ...@@ -53,7 +53,7 @@ PacedSender::PacedSender(PacketRouter* packet_router,
prober_(*field_trials_), prober_(*field_trials_),
probing_send_failure_(false), probing_send_failure_(false),
pacing_bitrate_kbps_(0), pacing_bitrate_kbps_(0),
time_last_process_us_(DepLibUV::GetTimeUs()), time_last_process_us_(DepLibUV::GetTimeUsInt64()),
first_sent_packet_ms_(-1), first_sent_packet_ms_(-1),
packet_counter_(0), packet_counter_(0),
account_for_audio_(false) { account_for_audio_(false) {
...@@ -66,7 +66,7 @@ void PacedSender::CreateProbeCluster(int bitrate_bps, int cluster_id) { ...@@ -66,7 +66,7 @@ void PacedSender::CreateProbeCluster(int bitrate_bps, int cluster_id) {
// TODO: REMOVE // TODO: REMOVE
// MS_DEBUG_DEV("---- bitrate_bps:%d, cluster_id:%d", bitrate_bps, cluster_id); // MS_DEBUG_DEV("---- bitrate_bps:%d, cluster_id:%d", bitrate_bps, cluster_id);
prober_.CreateProbeCluster(bitrate_bps, DepLibUV::GetTimeMs(), cluster_id); prober_.CreateProbeCluster(bitrate_bps, DepLibUV::GetTimeMsInt64(), cluster_id);
} }
void PacedSender::Pause() { void PacedSender::Pause() {
...@@ -138,7 +138,7 @@ void PacedSender::SetAccountForAudioPackets(bool account_for_audio) { ...@@ -138,7 +138,7 @@ void PacedSender::SetAccountForAudioPackets(bool account_for_audio) {
int64_t PacedSender::TimeUntilNextProcess() { int64_t PacedSender::TimeUntilNextProcess() {
int64_t elapsed_time_us = int64_t elapsed_time_us =
DepLibUV::GetTimeUs() - time_last_process_us_; DepLibUV::GetTimeUsInt64() - time_last_process_us_;
int64_t elapsed_time_ms = (elapsed_time_us + 500) / 1000; int64_t elapsed_time_ms = (elapsed_time_us + 500) / 1000;
// When paused we wake up every 500 ms to send a padding packet to ensure // When paused we wake up every 500 ms to send a padding packet to ensure
// we won't get stuck in the paused state due to no feedback being received. // we won't get stuck in the paused state due to no feedback being received.
...@@ -146,7 +146,7 @@ int64_t PacedSender::TimeUntilNextProcess() { ...@@ -146,7 +146,7 @@ int64_t PacedSender::TimeUntilNextProcess() {
return std::max<int64_t>(kPausedProcessIntervalMs - elapsed_time_ms, 0); return std::max<int64_t>(kPausedProcessIntervalMs - elapsed_time_ms, 0);
if (prober_.IsProbing()) { if (prober_.IsProbing()) {
int64_t ret = prober_.TimeUntilNextProbe(DepLibUV::GetTimeMs()); int64_t ret = prober_.TimeUntilNextProbe(DepLibUV::GetTimeMsInt64());
if (ret > 0 || (ret == 0 && !probing_send_failure_)) if (ret > 0 || (ret == 0 && !probing_send_failure_))
return ret; return ret;
} }
...@@ -167,7 +167,7 @@ int64_t PacedSender::UpdateTimeAndGetElapsedMs(int64_t now_us) { ...@@ -167,7 +167,7 @@ int64_t PacedSender::UpdateTimeAndGetElapsedMs(int64_t now_us) {
} }
void PacedSender::Process() { void PacedSender::Process() {
int64_t now_us = DepLibUV::GetTimeUs(); int64_t now_us = DepLibUV::GetTimeUsInt64();
int64_t elapsed_time_ms = UpdateTimeAndGetElapsedMs(now_us); int64_t elapsed_time_ms = UpdateTimeAndGetElapsedMs(now_us);
if (paused_) if (paused_)
...@@ -221,7 +221,7 @@ void PacedSender::Process() { ...@@ -221,7 +221,7 @@ void PacedSender::Process() {
if (bytes_sent != 0) if (bytes_sent != 0)
{ {
auto now = DepLibUV::GetTimeUs(); auto now = DepLibUV::GetTimeUsInt64();
OnPaddingSent(now, bytes_sent); OnPaddingSent(now, bytes_sent);
prober_.ProbeSent((now + 500) / 1000, bytes_sent); prober_.ProbeSent((now + 500) / 1000, bytes_sent);
...@@ -256,7 +256,7 @@ size_t PacedSender::PaddingBytesToAdd( ...@@ -256,7 +256,7 @@ size_t PacedSender::PaddingBytesToAdd(
void PacedSender::OnPacketSent(size_t size) { void PacedSender::OnPacketSent(size_t size) {
if (first_sent_packet_ms_ == -1) if (first_sent_packet_ms_ == -1)
first_sent_packet_ms_ = DepLibUV::GetTimeMs(); first_sent_packet_ms_ = DepLibUV::GetTimeMsInt64();
// Update media bytes sent. // Update media bytes sent.
UpdateBudgetWithBytesSent(size); UpdateBudgetWithBytesSent(size);
......
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
#include "rtc_base/numerics/safe_minmax.h" #include "rtc_base/numerics/safe_minmax.h"
#include "Logger.hpp" #include "Logger.hpp"
#include "MediaSoupErrors.hpp"
#include <inttypes.h> #include <inttypes.h>
#include <algorithm> #include <algorithm>
#include <cassert>
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>
#include <string> #include <string>
...@@ -365,7 +365,7 @@ DataRate AimdRateControl::ChangeBitrate(DataRate new_bitrate, ...@@ -365,7 +365,7 @@ DataRate AimdRateControl::ChangeBitrate(DataRate new_bitrate,
break; break;
default: default:
assert(false); MS_THROW_ERROR("unknown rate control state");
} }
return ClampBitrate(new_bitrate, estimated_throughput); return ClampBitrate(new_bitrate, estimated_throughput);
} }
...@@ -436,7 +436,7 @@ void AimdRateControl::ChangeState(const RateControlInput& input, ...@@ -436,7 +436,7 @@ void AimdRateControl::ChangeState(const RateControlInput& input,
rate_control_state_ = kRcHold; rate_control_state_ = kRcHold;
break; break;
default: default:
assert(false); MS_THROW_ERROR("unknown input.bw_state");
} }
} }
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include "Logger.hpp" #include "Logger.hpp"
#include <cassert>
namespace webrtc { namespace webrtc {
static const int kBurstDeltaThresholdMs = 5; static const int kBurstDeltaThresholdMs = 5;
...@@ -40,9 +38,9 @@ bool InterArrival::ComputeDeltas(uint32_t timestamp, ...@@ -40,9 +38,9 @@ bool InterArrival::ComputeDeltas(uint32_t timestamp,
uint32_t* timestamp_delta, uint32_t* timestamp_delta,
int64_t* arrival_time_delta_ms, int64_t* arrival_time_delta_ms,
int* packet_size_delta) { int* packet_size_delta) {
assert(timestamp_delta != NULL); MS_ASSERT(timestamp_delta != nullptr, "timestamp_delta is null");
assert(arrival_time_delta_ms != NULL); MS_ASSERT(arrival_time_delta_ms != nullptr, "arrival_time_delta_ms is null");
assert(packet_size_delta != NULL); MS_ASSERT(packet_size_delta != nullptr, "packet_size_delta is null");
bool calculated_deltas = false; bool calculated_deltas = false;
if (current_timestamp_group_.IsFirstPacket()) { if (current_timestamp_group_.IsFirstPacket()) {
// We don't have enough data to update the filter, so we store it until we // We don't have enough data to update the filter, so we store it until we
...@@ -87,7 +85,9 @@ bool InterArrival::ComputeDeltas(uint32_t timestamp, ...@@ -87,7 +85,9 @@ bool InterArrival::ComputeDeltas(uint32_t timestamp,
} else { } else {
num_consecutive_reordered_packets_ = 0; num_consecutive_reordered_packets_ = 0;
} }
assert(*arrival_time_delta_ms >= 0);
MS_ASSERT(*arrival_time_delta_ms >= 0, "arrival_time_delta_ms is < 0");
*packet_size_delta = static_cast<int>(current_timestamp_group_.size) - *packet_size_delta = static_cast<int>(current_timestamp_group_.size) -
static_cast<int>(prev_timestamp_group_.size); static_cast<int>(prev_timestamp_group_.size);
calculated_deltas = true; calculated_deltas = true;
...@@ -143,7 +143,11 @@ bool InterArrival::BelongsToBurst(int64_t arrival_time_ms, ...@@ -143,7 +143,11 @@ bool InterArrival::BelongsToBurst(int64_t arrival_time_ms,
if (!burst_grouping_) { if (!burst_grouping_) {
return false; return false;
} }
assert(current_timestamp_group_.complete_time_ms >= 0);
MS_ASSERT(
current_timestamp_group_.complete_time_ms >= 0,
"current_timestamp_group_.complete_time_ms < 0");
int64_t arrival_time_delta_ms = int64_t arrival_time_delta_ms =
arrival_time_ms - current_timestamp_group_.complete_time_ms; arrival_time_ms - current_timestamp_group_.complete_time_ms;
uint32_t timestamp_diff = timestamp - current_timestamp_group_.timestamp; uint32_t timestamp_diff = timestamp - current_timestamp_group_.timestamp;
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "Logger.hpp" #include "Logger.hpp"
#include <assert.h>
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
#include <algorithm> #include <algorithm>
...@@ -108,7 +107,9 @@ void OveruseEstimator::Update(int64_t t_delta, ...@@ -108,7 +107,9 @@ void OveruseEstimator::Update(int64_t t_delta,
bool positive_semi_definite = bool positive_semi_definite =
E_[0][0] + E_[1][1] >= 0 && E_[0][0] + E_[1][1] >= 0 &&
E_[0][0] * E_[1][1] - E_[0][1] * E_[1][0] >= 0 && E_[0][0] >= 0; E_[0][0] * E_[1][1] - E_[0][1] * E_[1][0] >= 0 && E_[0][0] >= 0;
assert(positive_semi_definite);
MS_ASSERT(positive_semi_definite, "positive_semi_definite is not true");
if (!positive_semi_definite) { if (!positive_semi_definite) {
MS_ERROR("The over-use estimator's covariance matrix is no longer " MS_ERROR("The over-use estimator's covariance matrix is no longer "
"semi-definite."); "semi-definite.");
......
...@@ -247,7 +247,7 @@ void RemoteBitrateEstimatorAbsSendTime::IncomingPacketInfo( ...@@ -247,7 +247,7 @@ void RemoteBitrateEstimatorAbsSendTime::IncomingPacketInfo(
uint32_t timestamp = send_time_24bits << kAbsSendTimeInterArrivalUpshift; uint32_t timestamp = send_time_24bits << kAbsSendTimeInterArrivalUpshift;
int64_t send_time_ms = static_cast<int64_t>(timestamp) * kTimestampToMs; int64_t send_time_ms = static_cast<int64_t>(timestamp) * kTimestampToMs;
int64_t now_ms = DepLibUV::GetTimeMs(); int64_t now_ms = DepLibUV::GetTimeMsInt64();
// TODO(holmer): SSRCs are only needed for REMB, should be broken out from // TODO(holmer): SSRCs are only needed for REMB, should be broken out from
// here. // here.
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "common.hpp" #include "common.hpp"
#include <uv.h> #include <uv.h>
#include <limits>
class DepLibUV class DepLibUV
{ {
...@@ -27,6 +28,36 @@ public: ...@@ -27,6 +28,36 @@ public:
{ {
return uv_hrtime(); return uv_hrtime();
} }
// Used within libwebrtc dependency which uses int64_t possitive values for
// time representation.
static int64_t GetTimeMsInt64()
{
static constexpr uint64_t MaxInt64{ std::numeric_limits<int64_t>::max() };
uint64_t time = DepLibUV::GetTimeMs();
if (time > MaxInt64 )
{
time -= MaxInt64 - 1;
}
return static_cast<int64_t>(time);
}
// Used within libwebrtc dependency which uses int64_t possitive values for
// time representation.
static int64_t GetTimeUsInt64()
{
static constexpr uint64_t MaxInt64{ std::numeric_limits<int64_t>::max() };
uint64_t time = DepLibUV::GetTimeUs();
if (time > MaxInt64 )
{
time -= MaxInt64 - 1;
}
return static_cast<int64_t>(time);
}
private: private:
static uv_loop_t* loop; static uv_loop_t* loop;
......
...@@ -61,9 +61,9 @@ namespace RTC ...@@ -61,9 +61,9 @@ namespace RTC
void TransportDisconnected(); void TransportDisconnected();
void InsertPacket(webrtc::RtpPacketSendInfo& packetInfo); void InsertPacket(webrtc::RtpPacketSendInfo& packetInfo);
webrtc::PacedPacketInfo GetPacingInfo(); webrtc::PacedPacketInfo GetPacingInfo();
void PacketSent(webrtc::RtpPacketSendInfo& packetInfo, uint64_t nowMs); void PacketSent(webrtc::RtpPacketSendInfo& packetInfo, int64_t nowMs);
void ReceiveEstimatedBitrate(uint32_t bitrate); void ReceiveEstimatedBitrate(uint32_t bitrate);
void ReceiveRtcpReceiverReport(const webrtc::RTCPReportBlock& report, float rtt, uint64_t nowMs); void ReceiveRtcpReceiverReport(const webrtc::RTCPReportBlock& report, float rtt, int64_t nowMs);
void ReceiveRtcpTransportFeedback(const RTC::RTCP::FeedbackRtpTransportPacket* feedback); void ReceiveRtcpTransportFeedback(const RTC::RTCP::FeedbackRtpTransportPacket* feedback);
void SetDesiredBitrate(uint32_t desiredBitrate, bool force); void SetDesiredBitrate(uint32_t desiredBitrate, bool force);
const Bitrates& GetBitrates() const const Bitrates& GetBitrates() const
......
...@@ -1632,7 +1632,7 @@ namespace RTC ...@@ -1632,7 +1632,7 @@ namespace RTC
// if (this->tccClient) // if (this->tccClient)
// { // {
// this->tccClient->ReceiveRtcpReceiverReport(report, consumer->GetRtt(), // this->tccClient->ReceiveRtcpReceiverReport(report, consumer->GetRtt(),
// DepLibUV::GetTimeMs()); // DepLibUV::GetTimeMsInt64());
// } // }
continue; continue;
...@@ -2255,7 +2255,7 @@ namespace RTC ...@@ -2255,7 +2255,7 @@ namespace RTC
auto* cb = new onSendCallback([tccClient, &packetInfo, senderBwe, &sentInfo](bool sent) { auto* cb = new onSendCallback([tccClient, &packetInfo, senderBwe, &sentInfo](bool sent) {
if (sent) if (sent)
{ {
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMs()); tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
sentInfo.sentAtMs = DepLibUV::GetTimeMs(); sentInfo.sentAtMs = DepLibUV::GetTimeMs();
...@@ -2267,7 +2267,7 @@ namespace RTC ...@@ -2267,7 +2267,7 @@ namespace RTC
#else #else
auto* cb = new onSendCallback([tccClient, &packetInfo](bool sent) { auto* cb = new onSendCallback([tccClient, &packetInfo](bool sent) {
if (sent) if (sent)
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMs()); tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
}); });
SendRtpPacket(packet, cb); SendRtpPacket(packet, cb);
......
...@@ -87,7 +87,7 @@ namespace RTC ...@@ -87,7 +87,7 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
auto nowMs = DepLibUV::GetTimeMs(); auto nowMs = DepLibUV::GetTimeMsInt64();
this->bitrates.desiredBitrate = 0u; this->bitrates.desiredBitrate = 0u;
this->bitrates.effectiveDesiredBitrate = 0u; this->bitrates.effectiveDesiredBitrate = 0u;
...@@ -111,7 +111,7 @@ namespace RTC ...@@ -111,7 +111,7 @@ namespace RTC
return this->rtpTransportControllerSend->packet_sender()->GetPacingInfo(); return this->rtpTransportControllerSend->packet_sender()->GetPacingInfo();
} }
void TransportCongestionControlClient::PacketSent(webrtc::RtpPacketSendInfo& packetInfo, uint64_t nowMs) void TransportCongestionControlClient::PacketSent(webrtc::RtpPacketSendInfo& packetInfo, int64_t nowMs)
{ {
MS_TRACE(); MS_TRACE();
...@@ -128,12 +128,12 @@ namespace RTC ...@@ -128,12 +128,12 @@ namespace RTC
} }
void TransportCongestionControlClient::ReceiveRtcpReceiverReport( void TransportCongestionControlClient::ReceiveRtcpReceiverReport(
const webrtc::RTCPReportBlock& report, float rtt, uint64_t nowMs) const webrtc::RTCPReportBlock& report, float rtt, int64_t nowMs)
{ {
MS_TRACE(); MS_TRACE();
this->rtpTransportControllerSend->OnReceivedRtcpReceiverReport( this->rtpTransportControllerSend->OnReceivedRtcpReceiverReport(
{ report }, static_cast<int64_t>(rtt), static_cast<int64_t>(nowMs)); { report }, static_cast<int64_t>(rtt), nowMs);
} }
void TransportCongestionControlClient::ReceiveRtcpTransportFeedback( void TransportCongestionControlClient::ReceiveRtcpTransportFeedback(
...@@ -148,7 +148,7 @@ namespace RTC ...@@ -148,7 +148,7 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
auto nowMs = DepLibUV::GetTimeMs(); auto nowMs = DepLibUV::GetTimeMsInt64();
// Manage it via trending and increase it a bit to avoid immediate oscillations. // Manage it via trending and increase it a bit to avoid immediate oscillations.
if (!force) if (!force)
...@@ -217,7 +217,7 @@ namespace RTC ...@@ -217,7 +217,7 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
uint64_t nowMs = DepLibUV::GetTimeMs(); uint64_t nowMs = DepLibUV::GetTimeMsInt64();
bool notify{ false }; bool notify{ false };
// Ignore if first event. // Ignore if first event.
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论