| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 // Return a buffer with id |buffer_id| previously given in | 91 // Return a buffer with id |buffer_id| previously given in |
| 92 // VideoCaptureControllerEventHandler::OnBufferReady. | 92 // VideoCaptureControllerEventHandler::OnBufferReady. |
| 93 // If the consumer provided resource utilization | 93 // If the consumer provided resource utilization |
| 94 // feedback, this will be passed here (-1.0 indicates no feedback). | 94 // feedback, this will be passed here (-1.0 indicates no feedback). |
| 95 void ReturnBuffer(VideoCaptureControllerID id, | 95 void ReturnBuffer(VideoCaptureControllerID id, |
| 96 VideoCaptureControllerEventHandler* event_handler, | 96 VideoCaptureControllerEventHandler* event_handler, |
| 97 int buffer_id, | 97 int buffer_id, |
| 98 double consumer_resource_utilization); | 98 double consumer_resource_utilization); |
| 99 | 99 |
| 100 const media::VideoCaptureFormat& GetVideoCaptureFormat() const; | 100 const base::Optional<media::VideoCaptureFormat> GetVideoCaptureFormat() const; |
| 101 | 101 |
| 102 bool has_received_frames() const { return has_received_frames_; } | 102 bool has_received_frames() const { return has_received_frames_; } |
| 103 | 103 |
| 104 // Implementation of media::VideoFrameReceiver interface: | 104 // Implementation of media::VideoFrameReceiver interface: |
| 105 void OnNewBufferHandle( | 105 void OnNewBufferHandle( |
| 106 int buffer_id, | 106 int buffer_id, |
| 107 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer::HandleProvider> | 107 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer::HandleProvider> |
| 108 handle_provider) override; | 108 handle_provider) override; |
| 109 void OnFrameReadyInBuffer( | 109 void OnFrameReadyInBuffer( |
| 110 int buffer_id, | 110 int buffer_id, |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 234 |
| 235 // Takes on only the states 'STARTING', 'STARTED' and 'ERROR'. 'ERROR' is an | 235 // Takes on only the states 'STARTING', 'STARTED' and 'ERROR'. 'ERROR' is an |
| 236 // absorbing state which stops the flow of data to clients. | 236 // absorbing state which stops the flow of data to clients. |
| 237 VideoCaptureState state_; | 237 VideoCaptureState state_; |
| 238 | 238 |
| 239 int next_buffer_context_id_ = 0; | 239 int next_buffer_context_id_ = 0; |
| 240 | 240 |
| 241 // True if the controller has received a video frame from the device. | 241 // True if the controller has received a video frame from the device. |
| 242 bool has_received_frames_; | 242 bool has_received_frames_; |
| 243 | 243 |
| 244 media::VideoCaptureFormat video_capture_format_; | 244 base::Optional<media::VideoCaptureFormat> video_capture_format_; |
| 245 | 245 |
| 246 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; | 246 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; |
| 247 | 247 |
| 248 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); | 248 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); |
| 249 }; | 249 }; |
| 250 | 250 |
| 251 } // namespace content | 251 } // namespace content |
| 252 | 252 |
| 253 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 253 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
| OLD | NEW |