| 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 #ifndef MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ | 5 #ifndef MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ |
| 6 #define MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ | 6 #define MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 void ReportError(const tracked_objects::Location& from_here, | 91 void ReportError(const tracked_objects::Location& from_here, |
| 92 const std::string& reason); | 92 const std::string& reason); |
| 93 | 93 |
| 94 void OnConsumerReportingUtilization(int frame_number, double utilization); | 94 void OnConsumerReportingUtilization(int frame_number, double utilization); |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 friend class base::RefCountedThreadSafe<ThreadSafeCaptureOracle>; | 97 friend class base::RefCountedThreadSafe<ThreadSafeCaptureOracle>; |
| 98 virtual ~ThreadSafeCaptureOracle(); | 98 virtual ~ThreadSafeCaptureOracle(); |
| 99 | 99 |
| 100 // Callback invoked on completion of all captures. | 100 // Callback invoked on completion of all captures. |
| 101 void DidCaptureFrame( | 101 void DidCaptureFrame(int frame_number, |
| 102 int frame_number, | 102 VideoCaptureDevice::Client::Buffer buffer, |
| 103 std::unique_ptr<VideoCaptureDevice::Client::Buffer> buffer, | 103 base::TimeTicks capture_begin_time, |
| 104 base::TimeTicks capture_begin_time, | 104 base::TimeDelta estimated_frame_duration, |
| 105 base::TimeDelta estimated_frame_duration, | 105 scoped_refptr<VideoFrame> frame, |
| 106 scoped_refptr<VideoFrame> frame, | 106 base::TimeTicks reference_time, |
| 107 base::TimeTicks reference_time, | 107 bool success); |
| 108 bool success); | |
| 109 | 108 |
| 110 // Callback invoked once all consumers have finished with a delivered video | 109 // Callback invoked once all consumers have finished with a delivered video |
| 111 // frame. Consumer feedback signals are scanned from the frame's |metadata|. | 110 // frame. Consumer feedback signals are scanned from the frame's |metadata|. |
| 112 void DidConsumeFrame(int frame_number, | 111 void DidConsumeFrame(int frame_number, |
| 113 const media::VideoFrameMetadata* metadata); | 112 const media::VideoFrameMetadata* metadata); |
| 114 | 113 |
| 115 // Protects everything below it. | 114 // Protects everything below it. |
| 116 mutable base::Lock lock_; | 115 mutable base::Lock lock_; |
| 117 | 116 |
| 118 // Recipient of our capture activity. | 117 // Recipient of our capture activity. |
| 119 std::unique_ptr<VideoCaptureDevice::Client> client_; | 118 std::unique_ptr<VideoCaptureDevice::Client> client_; |
| 120 | 119 |
| 121 // Makes the decision to capture a frame. | 120 // Makes the decision to capture a frame. |
| 122 VideoCaptureOracle oracle_; | 121 VideoCaptureOracle oracle_; |
| 123 | 122 |
| 124 // The video capture parameters used to construct the oracle proxy. | 123 // The video capture parameters used to construct the oracle proxy. |
| 125 const VideoCaptureParams params_; | 124 const VideoCaptureParams params_; |
| 126 }; | 125 }; |
| 127 | 126 |
| 128 } // namespace media | 127 } // namespace media |
| 129 | 128 |
| 130 #endif // MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ | 129 #endif // MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ |
| OLD | NEW |