summaryrefslogtreecommitdiff
path: root/video_engine/overuse_frame_detector.h
diff options
context:
space:
mode:
authorasapersson@webrtc.org <asapersson@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2013-12-04 13:47:44 +0000
committerasapersson@webrtc.org <asapersson@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2013-12-04 13:47:44 +0000
commitf1630b1f53156a9723ae5431f2fb1e54786593b9 (patch)
tree19f22929a072dcc8a0c6a838eee4bbd8e3820910 /video_engine/overuse_frame_detector.h
parentc0d6b2de39b3dd012f6554789693d5ec9904b90a (diff)
downloadwebrtc-f1630b1f53156a9723ae5431f2fb1e54786593b9.tar.gz
Added a delay measurement, measures the time between an incoming captured frame until the frame is being processed. Measures the delay per second.
R=mflodman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/4249004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5212 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'video_engine/overuse_frame_detector.h')
-rw-r--r--video_engine/overuse_frame_detector.h34
1 files changed, 32 insertions, 2 deletions
diff --git a/video_engine/overuse_frame_detector.h b/video_engine/overuse_frame_detector.h
index 356e27fe..7cbb21ce 100644
--- a/video_engine/overuse_frame_detector.h
+++ b/video_engine/overuse_frame_detector.h
@@ -71,19 +71,43 @@ class OveruseFrameDetector : public Module {
// Called for each captured frame.
void FrameCaptured(int width, int height);
+ // Called when the processing of a captured frame is started.
+ void FrameProcessingStarted();
+
+ // Called for each encoded frame.
void FrameEncoded(int encode_time_ms);
+ // Accessors.
+ // The last estimated jitter based on the incoming captured frames.
int last_capture_jitter_ms() const;
// Running average of reported encode time (FrameEncoded()).
// Only used for stats.
- int avg_encode_time_ms() const;
+ int AvgEncodeTimeMs() const;
+
+ // The average encode time divided by the average time difference between
+ // incoming captured frames.
+ // This variable is currently only used for statistics.
+ int EncodeUsagePercent() const;
+
+ // The current time delay between an incoming captured frame (FrameCaptured())
+ // until the frame is being processed (FrameProcessingStarted()).
+ // (Note: if a new frame is received before an old frame has been processed,
+ // the old frame is skipped).
+ // The delay is returned as the delay in ms per second.
+ // This variable is currently only used for statistics.
+ int AvgCaptureQueueDelayMsPerS() const;
+ int CaptureQueueDelayMsPerS() const;
// Implements Module.
virtual int32_t TimeUntilNextProcess() OVERRIDE;
virtual int32_t Process() OVERRIDE;
private:
+ class EncodeTimeAvg;
+ class EncodeUsage;
+ class CaptureQueueDelay;
+
bool IsOverusing();
bool IsUnderusing(int64_t time_now);
@@ -113,7 +137,13 @@ class OveruseFrameDetector : public Module {
// Number of pixels of last captured frame.
int num_pixels_;
- float avg_encode_time_ms_;
+ int last_capture_jitter_ms_;
+
+ int64_t last_encode_sample_ms_;
+ scoped_ptr<EncodeTimeAvg> encode_time_;
+ scoped_ptr<EncodeUsage> encode_usage_;
+
+ scoped_ptr<CaptureQueueDelay> capture_queue_delay_;
DISALLOW_COPY_AND_ASSIGN(OveruseFrameDetector);
};