| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "media/capture/content/thread_safe_capture_oracle.h" | 5 #include "media/capture/content/thread_safe_capture_oracle.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 TRACE_EVENT_INSTANT1("gpu.capture", "FpsRateLimited", | 78 TRACE_EVENT_INSTANT1("gpu.capture", "FpsRateLimited", |
| 79 TRACE_EVENT_SCOPE_THREAD, "trigger", | 79 TRACE_EVENT_SCOPE_THREAD, "trigger", |
| 80 VideoCaptureOracle::EventAsString(event)); | 80 VideoCaptureOracle::EventAsString(event)); |
| 81 return false; | 81 return false; |
| 82 } | 82 } |
| 83 | 83 |
| 84 visible_size = oracle_.capture_size(); | 84 visible_size = oracle_.capture_size(); |
| 85 // TODO(miu): Clients should request exact padding, instead of this | 85 // TODO(miu): Clients should request exact padding, instead of this |
| 86 // memory-wasting hack to make frames that are compatible with all HW | 86 // memory-wasting hack to make frames that are compatible with all HW |
| 87 // encoders. http://crbug.com/555911 | 87 // encoders. http://crbug.com/555911 |
| 88 coded_size.SetSize(base::bits::Align(visible_size.width(), 16u), | 88 coded_size.SetSize(base::bits::Align(visible_size.width(), 16), |
| 89 base::bits::Align(visible_size.height(), 16u)); | 89 base::bits::Align(visible_size.height(), 16)); |
| 90 | 90 |
| 91 if (event == VideoCaptureOracle::kPassiveRefreshRequest) { | 91 if (event == VideoCaptureOracle::kPassiveRefreshRequest) { |
| 92 output_buffer = client_->ResurrectLastOutputBuffer( | 92 output_buffer = client_->ResurrectLastOutputBuffer( |
| 93 coded_size, params_.requested_format.pixel_format, | 93 coded_size, params_.requested_format.pixel_format, |
| 94 params_.requested_format.pixel_storage); | 94 params_.requested_format.pixel_storage); |
| 95 if (!output_buffer) { | 95 if (!output_buffer) { |
| 96 TRACE_EVENT_INSTANT0("gpu.capture", "ResurrectionFailed", | 96 TRACE_EVENT_INSTANT0("gpu.capture", "ResurrectionFailed", |
| 97 TRACE_EVENT_SCOPE_THREAD); | 97 TRACE_EVENT_SCOPE_THREAD); |
| 98 return false; | 98 return false; |
| 99 } | 99 } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // destructor. |metadata| is still valid for read-access at this point. | 243 // destructor. |metadata| is still valid for read-access at this point. |
| 244 double utilization = -1.0; | 244 double utilization = -1.0; |
| 245 if (metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, | 245 if (metadata->GetDouble(media::VideoFrameMetadata::RESOURCE_UTILIZATION, |
| 246 &utilization)) { | 246 &utilization)) { |
| 247 base::AutoLock guard(lock_); | 247 base::AutoLock guard(lock_); |
| 248 oracle_.RecordConsumerFeedback(frame_number, utilization); | 248 oracle_.RecordConsumerFeedback(frame_number, utilization); |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace media | 252 } // namespace media |
| OLD | NEW |