Refactor some receive-side stats.

Removes polling of CName as well as receive codec statistics in favor of
internal callbacks keeping a statistics struct up to date.

R=mflodman@webrtc.org, stefan@webrtc.org
BUG=1667

Review URL: https://webrtc-codereview.appspot.com/28259005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7950 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org
2014-12-18 13:50:16 +00:00
parent 98c04b38a8
commit ce4e9a3562
38 changed files with 235 additions and 178 deletions

View File

@ -94,7 +94,7 @@ class VCMJitterBuffer {
// Get the number of received frames, by type, since the jitter buffer
// was started.
std::map<FrameType, uint32_t> FrameStatistics() const;
FrameCounts FrameStatistics() const;
// The number of packets discarded by the jitter buffer because the decoder
// won't be able to decode them.
@ -184,6 +184,8 @@ class VCMJitterBuffer {
// corresponding to the start and end of the continuous complete buffer.
void RenderBufferSize(uint32_t* timestamp_start, uint32_t* timestamp_end);
void RegisterFrameCountObserver(FrameCountObserver* observer);
private:
class SequenceNumberLessThan {
public:
@ -254,7 +256,8 @@ class VCMJitterBuffer {
// Updates the frame statistics.
// Counts only complete frames, so decodable incomplete frames will not be
// counted.
void CountFrame(const VCMFrameBuffer& frame);
void CountFrame(const VCMFrameBuffer& frame)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
// Update rolling average of packets per frame.
void UpdateAveragePacketsPerFrame(int current_number_packets_);
@ -301,7 +304,8 @@ class VCMJitterBuffer {
// Statistics.
// Frame counts for each type (key, delta, ...)
std::map<FrameType, uint32_t> receive_statistics_;
FrameCountObserver* frame_count_observer_ GUARDED_BY(crit_sect_);
FrameCounts receive_statistics_;
// Latest calculated frame rates of incoming stream.
unsigned int incoming_frame_rate_;
unsigned int incoming_frame_count_;