| 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 #include "content/browser/media/capture/video_capture_oracle.h" | 5 #include "content/browser/media/capture/video_capture_oracle.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 if (event_time < last_event_time_[event]) { | 83 if (event_time < last_event_time_[event]) { |
| 84 LOG(WARNING) << "Event time is not monotonically non-decreasing. " | 84 LOG(WARNING) << "Event time is not monotonically non-decreasing. " |
| 85 << "Deciding not to capture this frame."; | 85 << "Deciding not to capture this frame."; |
| 86 return false; | 86 return false; |
| 87 } | 87 } |
| 88 last_event_time_[event] = event_time; | 88 last_event_time_[event] = event_time; |
| 89 | 89 |
| 90 bool should_sample; | 90 bool should_sample; |
| 91 switch (event) { | 91 switch (event) { |
| 92 case kCompositorUpdate: | 92 case kCompositorUpdate: |
| 93 case kSoftwarePaint: | |
| 94 smoothing_sampler_.ConsiderPresentationEvent(event_time); | 93 smoothing_sampler_.ConsiderPresentationEvent(event_time); |
| 95 content_sampler_.ConsiderPresentationEvent(damage_rect, event_time); | 94 content_sampler_.ConsiderPresentationEvent(damage_rect, event_time); |
| 96 if (content_sampler_.HasProposal()) { | 95 if (content_sampler_.HasProposal()) { |
| 97 should_sample = content_sampler_.ShouldSample(); | 96 should_sample = content_sampler_.ShouldSample(); |
| 98 if (should_sample) | 97 if (should_sample) |
| 99 event_time = content_sampler_.frame_timestamp(); | 98 event_time = content_sampler_.frame_timestamp(); |
| 100 } else { | 99 } else { |
| 101 should_sample = smoothing_sampler_.ShouldSample(); | 100 should_sample = smoothing_sampler_.ShouldSample(); |
| 102 } | 101 } |
| 103 break; | 102 break; |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 if (borrowed_time_ >= min_capture_period_) { | 417 if (borrowed_time_ >= min_capture_period_) { |
| 419 borrowed_time_ -= min_capture_period_; | 418 borrowed_time_ -= min_capture_period_; |
| 420 frame_timestamp_ = base::TimeTicks(); | 419 frame_timestamp_ = base::TimeTicks(); |
| 421 } else { | 420 } else { |
| 422 sequence_offset_ += advancement; | 421 sequence_offset_ += advancement; |
| 423 frame_timestamp_ = timebase + sequence_offset_; | 422 frame_timestamp_ = timebase + sequence_offset_; |
| 424 } | 423 } |
| 425 } | 424 } |
| 426 | 425 |
| 427 } // namespace content | 426 } // namespace content |
| OLD | NEW |