| 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 // VideoCaptureController is the glue between a VideoCaptureDevice and all | 5 // VideoCaptureController is the glue between a VideoCaptureDevice and all |
| 6 // VideoCaptureHosts that have connected to it. A controller exists on behalf of | 6 // VideoCaptureHosts that have connected to it. A controller exists on behalf of |
| 7 // one (and only one) VideoCaptureDevice; both are owned by the | 7 // one (and only one) VideoCaptureDevice; both are owned by the |
| 8 // VideoCaptureManager. | 8 // VideoCaptureManager. |
| 9 // | 9 // |
| 10 // The VideoCaptureController is responsible for: | 10 // The VideoCaptureController is responsible for: |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 bool HasActiveClient() const; | 113 bool HasActiveClient() const; |
| 114 | 114 |
| 115 // Return true if there is client paused. | 115 // Return true if there is client paused. |
| 116 bool HasPausedClient() const; | 116 bool HasPausedClient() const; |
| 117 | 117 |
| 118 // API called directly by VideoCaptureManager in case the device is | 118 // API called directly by VideoCaptureManager in case the device is |
| 119 // prematurely closed. | 119 // prematurely closed. |
| 120 void StopSession(int session_id); | 120 void StopSession(int session_id); |
| 121 | 121 |
| 122 // Return a buffer with id |buffer_id| previously given in | 122 // Return a buffer with id |buffer_id| previously given in |
| 123 // VideoCaptureControllerEventHandler::OnBufferReady. In the case that the | 123 // VideoCaptureControllerEventHandler::OnBufferReady. |
| 124 // buffer was backed by a texture, |sync_token| will be waited on before | 124 // If the consumer provided resource utilization |
| 125 // destroying or recycling the texture, to synchronize with texture users in | |
| 126 // the renderer process. If the consumer provided resource utilization | |
| 127 // feedback, this will be passed here (-1.0 indicates no feedback). | 125 // feedback, this will be passed here (-1.0 indicates no feedback). |
| 128 void ReturnBuffer(VideoCaptureControllerID id, | 126 void ReturnBuffer(VideoCaptureControllerID id, |
| 129 VideoCaptureControllerEventHandler* event_handler, | 127 VideoCaptureControllerEventHandler* event_handler, |
| 130 int buffer_id, | 128 int buffer_id, |
| 131 const gpu::SyncToken& sync_token, | |
| 132 double consumer_resource_utilization); | 129 double consumer_resource_utilization); |
| 133 | 130 |
| 134 const media::VideoCaptureFormat& GetVideoCaptureFormat() const; | 131 const media::VideoCaptureFormat& GetVideoCaptureFormat() const; |
| 135 | 132 |
| 136 bool has_received_frames() const { return has_received_frames_; } | 133 bool has_received_frames() const { return has_received_frames_; } |
| 137 | 134 |
| 138 // Implementation of media::VideoFrameReceiver interface: | 135 // Implementation of media::VideoFrameReceiver interface: |
| 139 void OnIncomingCapturedVideoFrame( | 136 void OnIncomingCapturedVideoFrame( |
| 140 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> buffer, | 137 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> buffer, |
| 141 scoped_refptr<media::VideoFrame> frame) override; | 138 scoped_refptr<media::VideoFrame> frame) override; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 media::VideoCaptureFormat video_capture_format_; | 206 media::VideoCaptureFormat video_capture_format_; |
| 210 | 207 |
| 211 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; | 208 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; |
| 212 | 209 |
| 213 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); | 210 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); |
| 214 }; | 211 }; |
| 215 | 212 |
| 216 } // namespace content | 213 } // namespace content |
| 217 | 214 |
| 218 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 215 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
| OLD | NEW |