Use int64_t more consistently for times, in particular for RTT values.
Existing code was inconsistent about whether to use uint16_t, int, unsigned int, or uint32_t, and sometimes silently truncated one to another, or truncated int64_t. Because most core time-handling functions use int64_t, being consistent about using int64_t unless otherwise necessary minimizes the number of explicit or implicit casts. BUG=chromium:81439 TEST=none R=henrik.lundin@webrtc.org, holmer@google.com, tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/31349004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@8045 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -14,18 +14,13 @@
|
||||
#include "webrtc/system_wrappers/interface/logging.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
// Used in determining whether a frame is decodable.
|
||||
enum {kRttThreshold = 100}; // Not decodable if Rtt is lower than this.
|
||||
|
||||
// Do not decode frames if the number of packets is between these two
|
||||
// thresholds.
|
||||
static const float kLowPacketPercentageThreshold = 0.2f;
|
||||
static const float kHighPacketPercentageThreshold = 0.8f;
|
||||
namespace {
|
||||
|
||||
uint16_t BufferToUWord16(const uint8_t* dataBuffer) {
|
||||
return (dataBuffer[0] << 8) | dataBuffer[1];
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
VCMSessionInfo::VCMSessionInfo()
|
||||
@ -233,6 +228,12 @@ void VCMSessionInfo::UpdateDecodableSession(const FrameData& frame_data) {
|
||||
return;
|
||||
// TODO(agalusza): Account for bursty loss.
|
||||
// TODO(agalusza): Refine these values to better approximate optimal ones.
|
||||
// Do not decode frames if the RTT is lower than this.
|
||||
const int64_t kRttThreshold = 100;
|
||||
// Do not decode frames if the number of packets is between these two
|
||||
// thresholds.
|
||||
const float kLowPacketPercentageThreshold = 0.2f;
|
||||
const float kHighPacketPercentageThreshold = 0.8f;
|
||||
if (frame_data.rtt_ms < kRttThreshold
|
||||
|| frame_type_ == kVideoFrameKey
|
||||
|| !HaveFirstPacket()
|
||||
|
||||
Reference in New Issue
Block a user