Remove implicit-int-conversion warnings.
BUG=webrtc:1348, webrtc:261 R=stefan@webrtc.org Review URL: https://codereview.webrtc.org/1184443005. Cr-Commit-Position: refs/heads/master@{#9464}
This commit is contained in:
parent
ff4ea9310e
commit
ae37abbf6a
@ -54,16 +54,6 @@ source_set("video_engine_core") {
|
|||||||
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_win) {
|
|
||||||
cflags = [
|
|
||||||
# TODO(jschuh): Bug 1348: fix size_t to int truncations.
|
|
||||||
"/wd4267", # size_t to int truncation.
|
|
||||||
|
|
||||||
# Bug 261.
|
|
||||||
"/wd4373", # legacy warning for ignoring const / volatile in signatures.
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
"..:webrtc_common",
|
"..:webrtc_common",
|
||||||
"../common_video",
|
"../common_video",
|
||||||
|
@ -250,7 +250,7 @@ class OveruseFrameDetector::FrameQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Reset() { frame_times_.clear(); }
|
void Reset() { frame_times_.clear(); }
|
||||||
int NumFrames() const { return frame_times_.size(); }
|
int NumFrames() const { return static_cast<int>(frame_times_.size()); }
|
||||||
int last_processing_time_ms() const { return last_processing_time_ms_; }
|
int last_processing_time_ms() const { return last_processing_time_ms_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -70,8 +70,8 @@ RTCPReportBlock ReportBlockStats::AggregateAndStore(
|
|||||||
// Fraction lost since previous report block.
|
// Fraction lost since previous report block.
|
||||||
aggregate.fractionLost =
|
aggregate.fractionLost =
|
||||||
FractionLost(num_lost_sequence_numbers, num_sequence_numbers);
|
FractionLost(num_lost_sequence_numbers, num_sequence_numbers);
|
||||||
aggregate.jitter =
|
aggregate.jitter = static_cast<uint32_t>(
|
||||||
(aggregate.jitter + report_blocks.size() / 2) / report_blocks.size();
|
(aggregate.jitter + report_blocks.size() / 2) / report_blocks.size());
|
||||||
return aggregate;
|
return aggregate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,8 +66,6 @@
|
|||||||
'vie_remb.cc',
|
'vie_remb.cc',
|
||||||
'vie_sync_module.cc',
|
'vie_sync_module.cc',
|
||||||
], # source
|
], # source
|
||||||
# TODO(jschuh): Bug 1348: fix size_t to int truncations.
|
|
||||||
'msvs_disabled_warnings': [ 4267, ],
|
|
||||||
},
|
},
|
||||||
], # targets
|
], # targets
|
||||||
'conditions': [
|
'conditions': [
|
||||||
|
@ -271,23 +271,32 @@ void ViEChannel::UpdateHistograms() {
|
|||||||
rtp_rtx.Add(rtx);
|
rtp_rtx.Add(rtx);
|
||||||
elapsed_sec = rtp_rtx.TimeSinceFirstPacketInMs(now) / 1000;
|
elapsed_sec = rtp_rtx.TimeSinceFirstPacketInMs(now) / 1000;
|
||||||
if (elapsed_sec > metrics::kMinRunTimeInSeconds) {
|
if (elapsed_sec > metrics::kMinRunTimeInSeconds) {
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.BitrateReceivedInKbps",
|
RTC_HISTOGRAM_COUNTS_10000(
|
||||||
rtp_rtx.transmitted.TotalBytes() * 8 / elapsed_sec / 1000);
|
"WebRTC.Video.BitrateReceivedInKbps",
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.MediaBitrateReceivedInKbps",
|
static_cast<int>(rtp_rtx.transmitted.TotalBytes() * 8 / elapsed_sec /
|
||||||
rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000);
|
1000));
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.PaddingBitrateReceivedInKbps",
|
RTC_HISTOGRAM_COUNTS_10000(
|
||||||
rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec / 1000);
|
"WebRTC.Video.MediaBitrateReceivedInKbps",
|
||||||
|
static_cast<int>(rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000));
|
||||||
|
RTC_HISTOGRAM_COUNTS_10000(
|
||||||
|
"WebRTC.Video.PaddingBitrateReceivedInKbps",
|
||||||
|
static_cast<int>(rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec /
|
||||||
|
1000));
|
||||||
RTC_HISTOGRAM_COUNTS_10000(
|
RTC_HISTOGRAM_COUNTS_10000(
|
||||||
"WebRTC.Video.RetransmittedBitrateReceivedInKbps",
|
"WebRTC.Video.RetransmittedBitrateReceivedInKbps",
|
||||||
rtp_rtx.retransmitted.TotalBytes() * 8 / elapsed_sec / 1000);
|
static_cast<int>(rtp_rtx.retransmitted.TotalBytes() * 8 /
|
||||||
|
elapsed_sec / 1000));
|
||||||
uint32_t ssrc = 0;
|
uint32_t ssrc = 0;
|
||||||
if (vie_receiver_.GetRtxSsrc(&ssrc)) {
|
if (vie_receiver_.GetRtxSsrc(&ssrc)) {
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RtxBitrateReceivedInKbps",
|
RTC_HISTOGRAM_COUNTS_10000(
|
||||||
rtx.transmitted.TotalBytes() * 8 / elapsed_sec / 1000);
|
"WebRTC.Video.RtxBitrateReceivedInKbps",
|
||||||
|
static_cast<int>(rtx.transmitted.TotalBytes() * 8 / elapsed_sec /
|
||||||
|
1000));
|
||||||
}
|
}
|
||||||
if (vie_receiver_.IsFecEnabled()) {
|
if (vie_receiver_.IsFecEnabled()) {
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.FecBitrateReceivedInKbps",
|
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.FecBitrateReceivedInKbps",
|
||||||
rtp_rtx.fec.TotalBytes() * 8 / elapsed_sec / 1000);
|
static_cast<int>(rtp_rtx.fec.TotalBytes() *
|
||||||
|
8 / elapsed_sec / 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -305,25 +314,34 @@ void ViEChannel::UpdateHistogramsAtStopSend() {
|
|||||||
if (elapsed_sec < metrics::kMinRunTimeInSeconds) {
|
if (elapsed_sec < metrics::kMinRunTimeInSeconds) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.BitrateSentInKbps",
|
RTC_HISTOGRAM_COUNTS_100000(
|
||||||
rtp_rtx.transmitted.TotalBytes() * 8 / elapsed_sec / 1000);
|
"WebRTC.Video.BitrateSentInKbps",
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.MediaBitrateSentInKbps",
|
static_cast<int>(rtp_rtx.transmitted.TotalBytes() * 8 / elapsed_sec /
|
||||||
rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000);
|
1000));
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.PaddingBitrateSentInKbps",
|
RTC_HISTOGRAM_COUNTS_10000(
|
||||||
rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec / 1000);
|
"WebRTC.Video.MediaBitrateSentInKbps",
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RetransmittedBitrateSentInKbps",
|
static_cast<int>(rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000));
|
||||||
rtp_rtx.retransmitted.TotalBytes() * 8 / elapsed_sec / 1000);
|
RTC_HISTOGRAM_COUNTS_10000(
|
||||||
|
"WebRTC.Video.PaddingBitrateSentInKbps",
|
||||||
|
static_cast<int>(rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec /
|
||||||
|
1000));
|
||||||
|
RTC_HISTOGRAM_COUNTS_10000(
|
||||||
|
"WebRTC.Video.RetransmittedBitrateSentInKbps",
|
||||||
|
static_cast<int>(rtp_rtx.retransmitted.TotalBytes() * 8 / elapsed_sec /
|
||||||
|
1000));
|
||||||
if (rtp_rtcp_->RtxSendStatus() != kRtxOff) {
|
if (rtp_rtcp_->RtxSendStatus() != kRtxOff) {
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RtxBitrateSentInKbps",
|
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RtxBitrateSentInKbps",
|
||||||
rtx.transmitted.TotalBytes() * 8 / elapsed_sec / 1000);
|
static_cast<int>(rtx.transmitted.TotalBytes() *
|
||||||
|
8 / elapsed_sec / 1000));
|
||||||
}
|
}
|
||||||
bool fec_enabled = false;
|
bool fec_enabled = false;
|
||||||
uint8_t pltype_red;
|
uint8_t pltype_red;
|
||||||
uint8_t pltype_fec;
|
uint8_t pltype_fec;
|
||||||
rtp_rtcp_->GenericFECStatus(fec_enabled, pltype_red, pltype_fec);
|
rtp_rtcp_->GenericFECStatus(fec_enabled, pltype_red, pltype_fec);
|
||||||
if (fec_enabled) {
|
if (fec_enabled) {
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.FecBitrateSentInKbps",
|
RTC_HISTOGRAM_COUNTS_10000(
|
||||||
rtp_rtx.fec.TotalBytes() * 8 / elapsed_sec / 1000);
|
"WebRTC.Video.FecBitrateSentInKbps",
|
||||||
|
static_cast<int>(rtp_rtx.fec.TotalBytes() * 8 / elapsed_sec / 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,8 +393,8 @@ int32_t ViEChannel::SetSendCodec(const VideoCodec& video_codec,
|
|||||||
if (video_codec.numberOfSimulcastStreams > 0) {
|
if (video_codec.numberOfSimulcastStreams > 0) {
|
||||||
// Set correct bitrate to base layer.
|
// Set correct bitrate to base layer.
|
||||||
// Create our simulcast RTP modules.
|
// Create our simulcast RTP modules.
|
||||||
int num_modules_to_add =
|
int num_modules_to_add = video_codec.numberOfSimulcastStreams -
|
||||||
video_codec.numberOfSimulcastStreams - simulcast_rtp_rtcp_.size() - 1;
|
static_cast<int>(simulcast_rtp_rtcp_.size()) - 1;
|
||||||
if (num_modules_to_add < 0) {
|
if (num_modules_to_add < 0) {
|
||||||
num_modules_to_add = 0;
|
num_modules_to_add = 0;
|
||||||
}
|
}
|
||||||
@ -425,8 +443,9 @@ int32_t ViEChannel::SetSendCodec(const VideoCodec& video_codec,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove last in list if we have too many.
|
// Remove last in list if we have too many.
|
||||||
for (int j = simulcast_rtp_rtcp_.size();
|
for (size_t j = simulcast_rtp_rtcp_.size();
|
||||||
j > (video_codec.numberOfSimulcastStreams - 1); j--) {
|
j > static_cast<size_t>(video_codec.numberOfSimulcastStreams - 1);
|
||||||
|
j--) {
|
||||||
RtpRtcp* rtp_rtcp = simulcast_rtp_rtcp_.back();
|
RtpRtcp* rtp_rtcp = simulcast_rtp_rtcp_.back();
|
||||||
deregistered_modules.push_back(rtp_rtcp);
|
deregistered_modules.push_back(rtp_rtcp);
|
||||||
rtp_rtcp->SetSendingStatus(false);
|
rtp_rtcp->SetSendingStatus(false);
|
||||||
|
@ -163,8 +163,9 @@ bool ViEEncoder::Init() {
|
|||||||
CriticalSectionScoped cs(data_cs_.get());
|
CriticalSectionScoped cs(data_cs_.get());
|
||||||
send_padding_ = video_codec.numberOfSimulcastStreams > 1;
|
send_padding_ = video_codec.numberOfSimulcastStreams > 1;
|
||||||
}
|
}
|
||||||
if (vcm_->RegisterSendCodec(&video_codec, number_of_cores_,
|
if (vcm_->RegisterSendCodec(
|
||||||
PayloadRouter::DefaultMaxPayloadLength()) !=
|
&video_codec, number_of_cores_,
|
||||||
|
static_cast<uint32_t>(PayloadRouter::DefaultMaxPayloadLength())) !=
|
||||||
0) {
|
0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -298,8 +299,9 @@ int32_t ViEEncoder::DeRegisterExternalEncoder(uint8_t pl_type) {
|
|||||||
// for realz. https://code.google.com/p/chromium/issues/detail?id=348222
|
// for realz. https://code.google.com/p/chromium/issues/detail?id=348222
|
||||||
current_send_codec.extra_options = NULL;
|
current_send_codec.extra_options = NULL;
|
||||||
size_t max_data_payload_length = send_payload_router_->MaxPayloadLength();
|
size_t max_data_payload_length = send_payload_router_->MaxPayloadLength();
|
||||||
if (vcm_->RegisterSendCodec(¤t_send_codec, number_of_cores_,
|
if (vcm_->RegisterSendCodec(
|
||||||
max_data_payload_length) != VCM_OK) {
|
¤t_send_codec, number_of_cores_,
|
||||||
|
static_cast<uint32_t>(max_data_payload_length)) != VCM_OK) {
|
||||||
LOG(LS_INFO) << "De-registered the currently used external encoder ("
|
LOG(LS_INFO) << "De-registered the currently used external encoder ("
|
||||||
<< static_cast<int>(pl_type) << ") and therefore tried to "
|
<< static_cast<int>(pl_type) << ") and therefore tried to "
|
||||||
<< "register the corresponding internal encoder, but none "
|
<< "register the corresponding internal encoder, but none "
|
||||||
@ -354,7 +356,8 @@ int32_t ViEEncoder::SetEncoder(const webrtc::VideoCodec& video_codec) {
|
|||||||
|
|
||||||
size_t max_data_payload_length = send_payload_router_->MaxPayloadLength();
|
size_t max_data_payload_length = send_payload_router_->MaxPayloadLength();
|
||||||
if (vcm_->RegisterSendCodec(&modified_video_codec, number_of_cores_,
|
if (vcm_->RegisterSendCodec(&modified_video_codec, number_of_cores_,
|
||||||
max_data_payload_length) != VCM_OK) {
|
static_cast<uint32_t>(max_data_payload_length)) !=
|
||||||
|
VCM_OK) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -627,7 +630,8 @@ int32_t ViEEncoder::UpdateProtectionMethod(bool nack, bool fec) {
|
|||||||
codec.startBitrate = (current_bitrate_bps + 500) / 1000;
|
codec.startBitrate = (current_bitrate_bps + 500) / 1000;
|
||||||
size_t max_payload_length = send_payload_router_->MaxPayloadLength();
|
size_t max_payload_length = send_payload_router_->MaxPayloadLength();
|
||||||
if (vcm_->RegisterSendCodec(&codec, number_of_cores_,
|
if (vcm_->RegisterSendCodec(&codec, number_of_cores_,
|
||||||
max_payload_length) != 0) {
|
static_cast<uint32_t>(max_payload_length)) !=
|
||||||
|
0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,13 +69,14 @@ ViEReceiver::~ViEReceiver() {
|
|||||||
void ViEReceiver::UpdateHistograms() {
|
void ViEReceiver::UpdateHistograms() {
|
||||||
FecPacketCounter counter = fec_receiver_->GetPacketCounter();
|
FecPacketCounter counter = fec_receiver_->GetPacketCounter();
|
||||||
if (counter.num_packets > 0) {
|
if (counter.num_packets > 0) {
|
||||||
RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedFecPacketsInPercent",
|
RTC_HISTOGRAM_PERCENTAGE(
|
||||||
counter.num_fec_packets * 100 / counter.num_packets);
|
"WebRTC.Video.ReceivedFecPacketsInPercent",
|
||||||
|
static_cast<int>(counter.num_fec_packets * 100 / counter.num_packets));
|
||||||
}
|
}
|
||||||
if (counter.num_fec_packets > 0) {
|
if (counter.num_fec_packets > 0) {
|
||||||
RTC_HISTOGRAM_PERCENTAGE(
|
RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.RecoveredMediaPacketsInPercentOfFec",
|
||||||
"WebRTC.Video.RecoveredMediaPacketsInPercentOfFec",
|
static_cast<int>(counter.num_recovered_packets *
|
||||||
counter.num_recovered_packets * 100 / counter.num_fec_packets);
|
100 / counter.num_fec_packets));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user