| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_CAPTURE_VIDEO_CAPTURE_ORACLE_H_ | 5 #ifndef MEDIA_CAPTURE_CONTENT_VIDEO_CAPTURE_ORACLE_H_ |
| 6 #define MEDIA_CAPTURE_VIDEO_CAPTURE_ORACLE_H_ | 6 #define MEDIA_CAPTURE_CONTENT_VIDEO_CAPTURE_ORACLE_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "media/base/media_export.h" | 11 #include "media/base/media_export.h" |
| 12 #include "media/capture/content/animated_content_sampler.h" | 12 #include "media/capture/content/animated_content_sampler.h" |
| 13 #include "media/capture/content/capture_resolution_chooser.h" | 13 #include "media/capture/content/capture_resolution_chooser.h" |
| 14 #include "media/capture/content/feedback_signal_accumulator.h" | 14 #include "media/capture/content/feedback_signal_accumulator.h" |
| 15 #include "media/capture/content/smooth_event_sampler.h" | 15 #include "media/capture/content/smooth_event_sampler.h" |
| 16 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // be non-zero if the call returned true. | 91 // be non-zero if the call returned true. |
| 92 base::TimeDelta estimated_frame_duration() const { | 92 base::TimeDelta estimated_frame_duration() const { |
| 93 return duration_of_next_frame_; | 93 return duration_of_next_frame_; |
| 94 } | 94 } |
| 95 | 95 |
| 96 // Returns the capture frame size the client should use. This is updated by | 96 // Returns the capture frame size the client should use. This is updated by |
| 97 // calls to ObserveEventAndDecideCapture(). The oracle prevents too-frequent | 97 // calls to ObserveEventAndDecideCapture(). The oracle prevents too-frequent |
| 98 // changes to the capture size, to avoid stressing the end-to-end pipeline. | 98 // changes to the capture size, to avoid stressing the end-to-end pipeline. |
| 99 gfx::Size capture_size() const { return capture_size_; } | 99 gfx::Size capture_size() const { return capture_size_; } |
| 100 | 100 |
| 101 // Returns the oracle's estimate of animation content currently being active. |
| 102 bool IsAnimationActive() const; |
| 103 |
| 101 private: | 104 private: |
| 102 // Retrieve/Assign a frame timestamp by capture |frame_number|. Only valid | 105 // Retrieve/Assign a frame timestamp by capture |frame_number|. Only valid |
| 103 // when IsFrameInRecentHistory(frame_number) returns true. | 106 // when IsFrameInRecentHistory(frame_number) returns true. |
| 104 base::TimeTicks GetFrameTimestamp(int frame_number) const; | 107 base::TimeTicks GetFrameTimestamp(int frame_number) const; |
| 105 void SetFrameTimestamp(int frame_number, base::TimeTicks timestamp); | 108 void SetFrameTimestamp(int frame_number, base::TimeTicks timestamp); |
| 106 | 109 |
| 107 // Returns true if the frame timestamp ring-buffer currently includes a | 110 // Returns true if the frame timestamp ring-buffer currently includes a |
| 108 // slot for the given |frame_number|. | 111 // slot for the given |frame_number|. |
| 109 bool IsFrameInRecentHistory(int frame_number) const; | 112 bool IsFrameInRecentHistory(int frame_number) const; |
| 110 | 113 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 base::TimeTicks start_time_of_underutilization_; | 195 base::TimeTicks start_time_of_underutilization_; |
| 193 | 196 |
| 194 // The timestamp of the frame where |content_sampler_| last detected | 197 // The timestamp of the frame where |content_sampler_| last detected |
| 195 // animation. This determines whether capture size increases will be | 198 // animation. This determines whether capture size increases will be |
| 196 // aggressive (because content is not animating). | 199 // aggressive (because content is not animating). |
| 197 base::TimeTicks last_time_animation_was_detected_; | 200 base::TimeTicks last_time_animation_was_detected_; |
| 198 }; | 201 }; |
| 199 | 202 |
| 200 } // namespace media | 203 } // namespace media |
| 201 | 204 |
| 202 #endif // MEDIA_CAPTURE_VIDEO_CAPTURE_ORACLE_H_ | 205 #endif // MEDIA_CAPTURE_CONTENT_VIDEO_CAPTURE_ORACLE_H_ |
| OLD | NEW |