Disable frame dropper for screenshare mode.
BUG=1466 Review URL: https://webrtc-codereview.appspot.com/1170004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3629 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -15,12 +15,30 @@
|
||||
namespace webrtc
|
||||
{
|
||||
|
||||
const float kDefaultKeyFrameSizeAvgKBits = 0.9f;
|
||||
const float kDefaultKeyFrameRatio = 0.99f;
|
||||
const float kDefaultDropRatioAlpha = 0.9f;
|
||||
const float kDefaultDropRatioMax = 0.96f;
|
||||
const float kDefaultMaxTimeToDropFrames = 4.0f; // In seconds.
|
||||
|
||||
FrameDropper::FrameDropper()
|
||||
:
|
||||
_keyFrameSizeAvgKbits(0.9f),
|
||||
_keyFrameRatio(0.99f),
|
||||
_dropRatio(0.9f, 0.96f),
|
||||
_enabled(true)
|
||||
_keyFrameSizeAvgKbits(kDefaultKeyFrameSizeAvgKBits),
|
||||
_keyFrameRatio(kDefaultKeyFrameRatio),
|
||||
_dropRatio(kDefaultDropRatioAlpha, kDefaultDropRatioMax),
|
||||
_enabled(true),
|
||||
_max_time_drops(kDefaultMaxTimeToDropFrames)
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
FrameDropper::FrameDropper(float max_time_drops)
|
||||
:
|
||||
_keyFrameSizeAvgKbits(kDefaultKeyFrameSizeAvgKBits),
|
||||
_keyFrameRatio(kDefaultKeyFrameRatio),
|
||||
_dropRatio(kDefaultDropRatioAlpha, kDefaultDropRatioMax),
|
||||
_enabled(true),
|
||||
_max_time_drops(max_time_drops)
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
@ -138,6 +156,10 @@ FrameDropper::Leak(WebRtc_UWord32 inputFrameRate)
|
||||
_keyFrameCount--;
|
||||
}
|
||||
_accumulator -= T;
|
||||
if (_accumulator < 0.0f)
|
||||
{
|
||||
_accumulator = 0.0f;
|
||||
}
|
||||
UpdateRatio();
|
||||
}
|
||||
|
||||
@ -192,10 +214,6 @@ FrameDropper::UpdateRatio()
|
||||
{
|
||||
_dropRatio.Apply(1.0f, 0.0f);
|
||||
}
|
||||
if (_accumulator < 0.0f)
|
||||
{
|
||||
_accumulator = 0.0f;
|
||||
}
|
||||
_wasBelowMax = _accumulator < _accumulatorMax;
|
||||
}
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ class FrameDropper
|
||||
{
|
||||
public:
|
||||
FrameDropper();
|
||||
explicit FrameDropper(float max_time_drops);
|
||||
virtual ~FrameDropper() {}
|
||||
|
||||
// Resets the FrameDropper to its initial state.
|
||||
@ -66,7 +67,6 @@ public:
|
||||
// instruction of when to drop frames.
|
||||
virtual float ActualFrameRate(WebRtc_UWord32 inputFrameRate) const;
|
||||
|
||||
|
||||
private:
|
||||
void FillBucket(float inKbits, float outKbits);
|
||||
void UpdateRatio();
|
||||
|
||||
Reference in New Issue
Block a user