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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // maximum frame size. | 84 // maximum frame size. |
85 void UpdateCaptureSize(const gfx::Size& source_size); | 85 void UpdateCaptureSize(const gfx::Size& source_size); |
86 | 86 |
87 // Stop new captures from happening (but doesn't forget the client). | 87 // Stop new captures from happening (but doesn't forget the client). |
88 void Stop(); | 88 void Stop(); |
89 | 89 |
90 // Signal an error to the client. | 90 // Signal an error to the client. |
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 // Signal device started to the client. |
| 95 void ReportStarted(); |
| 96 |
94 void OnConsumerReportingUtilization(int frame_number, double utilization); | 97 void OnConsumerReportingUtilization(int frame_number, double utilization); |
95 | 98 |
96 private: | 99 private: |
97 friend class base::RefCountedThreadSafe<ThreadSafeCaptureOracle>; | 100 friend class base::RefCountedThreadSafe<ThreadSafeCaptureOracle>; |
98 virtual ~ThreadSafeCaptureOracle(); | 101 virtual ~ThreadSafeCaptureOracle(); |
99 | 102 |
100 // Callback invoked on completion of all captures. | 103 // Callback invoked on completion of all captures. |
101 void DidCaptureFrame(int frame_number, | 104 void DidCaptureFrame(int frame_number, |
102 VideoCaptureDevice::Client::Buffer buffer, | 105 VideoCaptureDevice::Client::Buffer buffer, |
103 base::TimeTicks capture_begin_time, | 106 base::TimeTicks capture_begin_time, |
(...skipping 11 matching lines...) Expand all Loading... |
115 mutable base::Lock lock_; | 118 mutable base::Lock lock_; |
116 | 119 |
117 // Recipient of our capture activity. | 120 // Recipient of our capture activity. |
118 std::unique_ptr<VideoCaptureDevice::Client> client_; | 121 std::unique_ptr<VideoCaptureDevice::Client> client_; |
119 | 122 |
120 // Makes the decision to capture a frame. | 123 // Makes the decision to capture a frame. |
121 VideoCaptureOracle oracle_; | 124 VideoCaptureOracle oracle_; |
122 | 125 |
123 // The video capture parameters used to construct the oracle proxy. | 126 // The video capture parameters used to construct the oracle proxy. |
124 const VideoCaptureParams params_; | 127 const VideoCaptureParams params_; |
| 128 |
| 129 // OnStarted() event has been reported. |
| 130 bool capture_; |
125 }; | 131 }; |
126 | 132 |
127 } // namespace media | 133 } // namespace media |
128 | 134 |
129 #endif // MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ | 135 #endif // MEDIA_CAPTURE_CONTENT_THREAD_SAFE_CAPTURE_ORACLE_H_ |
OLD | NEW |