Fixes the frameRate stats by grouping the frames by timestamp.
R=stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1536004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4138 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -382,8 +382,17 @@ VCMMediaOptimization::UpdateWithEncodedData(int encodedLength,
|
|||||||
{
|
{
|
||||||
const int64_t now_ms = _clock->TimeInMilliseconds();
|
const int64_t now_ms = _clock->TimeInMilliseconds();
|
||||||
PurgeOldFrameSamples(now_ms);
|
PurgeOldFrameSamples(now_ms);
|
||||||
|
if (_encodedFrameSamples.size() > 0 &&
|
||||||
|
_encodedFrameSamples.back().timestamp == timestamp) {
|
||||||
|
// Frames having the same timestamp are generated from the same input
|
||||||
|
// frame. We don't want to double count them, but only increment the
|
||||||
|
// size_bytes.
|
||||||
|
_encodedFrameSamples.back().size_bytes += encodedLength;
|
||||||
|
_encodedFrameSamples.back().time_complete_ms = now_ms;
|
||||||
|
} else {
|
||||||
_encodedFrameSamples.push_back(VCMEncodedFrameSample(
|
_encodedFrameSamples.push_back(VCMEncodedFrameSample(
|
||||||
encodedLength, timestamp, now_ms));
|
encodedLength, timestamp, now_ms));
|
||||||
|
}
|
||||||
UpdateSentBitrate(now_ms);
|
UpdateSentBitrate(now_ms);
|
||||||
UpdateSentFramerate();
|
UpdateSentFramerate();
|
||||||
if(encodedLength > 0)
|
if(encodedLength > 0)
|
||||||
|
Reference in New Issue
Block a user