| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "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" |
| 11 | 11 |
| 12 namespace content { | 12 namespace media { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 // This value controls how many redundant, timer-base captures occur when the | 16 // This value controls how many redundant, timer-base captures occur when the |
| 17 // content is static. Redundantly capturing the same frame allows iterative | 17 // content is static. Redundantly capturing the same frame allows iterative |
| 18 // quality enhancement, and also allows the buffer to fill in "buffered mode". | 18 // quality enhancement, and also allows the buffer to fill in "buffered mode". |
| 19 // | 19 // |
| 20 // TODO(nick): Controlling this here is a hack and a layering violation, since | 20 // TODO(nick): Controlling this here is a hack and a layering violation, since |
| 21 // it's a strategy specific to the WebRTC consumer, and probably just papers | 21 // it's a strategy specific to the WebRTC consumer, and probably just papers |
| 22 // over some frame dropping and quality bugs. It should either be controlled at | 22 // over some frame dropping and quality bugs. It should either be controlled at |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 DCHECK_LE(frame_number, next_frame_number_); | 164 DCHECK_LE(frame_number, next_frame_number_); |
| 165 DCHECK_LT(next_frame_number_ - frame_number, kMaxFrameTimestamps); | 165 DCHECK_LT(next_frame_number_ - frame_number, kMaxFrameTimestamps); |
| 166 return frame_timestamps_[frame_number % kMaxFrameTimestamps]; | 166 return frame_timestamps_[frame_number % kMaxFrameTimestamps]; |
| 167 } | 167 } |
| 168 | 168 |
| 169 void VideoCaptureOracle::SetFrameTimestamp(int frame_number, | 169 void VideoCaptureOracle::SetFrameTimestamp(int frame_number, |
| 170 base::TimeTicks timestamp) { | 170 base::TimeTicks timestamp) { |
| 171 frame_timestamps_[frame_number % kMaxFrameTimestamps] = timestamp; | 171 frame_timestamps_[frame_number % kMaxFrameTimestamps] = timestamp; |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace content | 174 } // namespace media |
| OLD | NEW |