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_SCREEN_CAPTURE_DEVICE_CORE_H_ | 5 #ifndef MEDIA_CAPTURE_CONTENT_SCREEN_CAPTURE_DEVICE_CORE_H_ |
6 #define MEDIA_CAPTURE_CONTENT_SCREEN_CAPTURE_DEVICE_CORE_H_ | 6 #define MEDIA_CAPTURE_CONTENT_SCREEN_CAPTURE_DEVICE_CORE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 ScreenCaptureDeviceCore(std::unique_ptr<VideoCaptureMachine> capture_machine); | 82 ScreenCaptureDeviceCore(std::unique_ptr<VideoCaptureMachine> capture_machine); |
83 virtual ~ScreenCaptureDeviceCore(); | 83 virtual ~ScreenCaptureDeviceCore(); |
84 | 84 |
85 // Asynchronous requests to change ScreenCaptureDeviceCore state. | 85 // Asynchronous requests to change ScreenCaptureDeviceCore state. |
86 void AllocateAndStart(const VideoCaptureParams& params, | 86 void AllocateAndStart(const VideoCaptureParams& params, |
87 std::unique_ptr<VideoCaptureDevice::Client> client); | 87 std::unique_ptr<VideoCaptureDevice::Client> client); |
88 void RequestRefreshFrame(); | 88 void RequestRefreshFrame(); |
89 void Suspend(); | 89 void Suspend(); |
90 void Resume(); | 90 void Resume(); |
91 void StopAndDeAllocate(); | 91 void StopAndDeAllocate(); |
| 92 void OnConsumerReportingUtilization(int frame_id, double utilization); |
92 | 93 |
93 private: | 94 private: |
94 // Flag indicating current state. | 95 // Flag indicating current state. |
95 enum State { kIdle, kCapturing, kSuspended, kError, kLastCaptureState }; | 96 enum State { kIdle, kCapturing, kSuspended, kError, kLastCaptureState }; |
96 | 97 |
97 void TransitionStateTo(State next_state); | 98 void TransitionStateTo(State next_state); |
98 | 99 |
99 // Called back in response to StartCaptureMachine(). |success| is true if | 100 // Called back in response to StartCaptureMachine(). |success| is true if |
100 // capture machine succeeded to start. | 101 // capture machine succeeded to start. |
101 void CaptureStarted(bool success); | 102 void CaptureStarted(bool success); |
(...skipping 17 matching lines...) Expand all Loading... |
119 // capture pipeline. Besides the VideoCaptureDevice itself, it is the only | 120 // capture pipeline. Besides the VideoCaptureDevice itself, it is the only |
120 // component of the system with direct access to |client_|. | 121 // component of the system with direct access to |client_|. |
121 scoped_refptr<ThreadSafeCaptureOracle> oracle_proxy_; | 122 scoped_refptr<ThreadSafeCaptureOracle> oracle_proxy_; |
122 | 123 |
123 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureDeviceCore); | 124 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureDeviceCore); |
124 }; | 125 }; |
125 | 126 |
126 } // namespace media | 127 } // namespace media |
127 | 128 |
128 #endif // MEDIA_CAPTURE_CONTENT_SCREEN_CAPTURE_DEVICE_CORE_H_ | 129 #endif // MEDIA_CAPTURE_CONTENT_SCREEN_CAPTURE_DEVICE_CORE_H_ |
OLD | NEW |