| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 // Return a buffer with id |buffer_id| previously given in | 110 // Return a buffer with id |buffer_id| previously given in |
| 111 // VideoCaptureControllerEventHandler::OnBufferReady. In the case that the | 111 // VideoCaptureControllerEventHandler::OnBufferReady. In the case that the |
| 112 // buffer was backed by a texture, |sync_point| will be waited on before | 112 // buffer was backed by a texture, |sync_point| will be waited on before |
| 113 // destroying or recycling the texture, to synchronize with texture users in | 113 // destroying or recycling the texture, to synchronize with texture users in |
| 114 // the renderer process. If the consumer provided resource utilization | 114 // the renderer process. If the consumer provided resource utilization |
| 115 // feedback, this will be passed here (-1.0 indicates no feedback). | 115 // feedback, this will be passed here (-1.0 indicates no feedback). |
| 116 void ReturnBuffer(VideoCaptureControllerID id, | 116 void ReturnBuffer(VideoCaptureControllerID id, |
| 117 VideoCaptureControllerEventHandler* event_handler, | 117 VideoCaptureControllerEventHandler* event_handler, |
| 118 int buffer_id, | 118 int buffer_id, |
| 119 uint32 sync_point, | 119 const gpu::SyncToken& sync_token, |
| 120 double consumer_resource_utilization); | 120 double consumer_resource_utilization); |
| 121 | 121 |
| 122 const media::VideoCaptureFormat& GetVideoCaptureFormat() const; | 122 const media::VideoCaptureFormat& GetVideoCaptureFormat() const; |
| 123 | 123 |
| 124 bool has_received_frames() const { return has_received_frames_; } | 124 bool has_received_frames() const { return has_received_frames_; } |
| 125 | 125 |
| 126 // Worker functions on IO thread. Called by the VideoCaptureDeviceClient. | 126 // Worker functions on IO thread. Called by the VideoCaptureDeviceClient. |
| 127 virtual void DoIncomingCapturedVideoFrameOnIOThread( | 127 virtual void DoIncomingCapturedVideoFrameOnIOThread( |
| 128 scoped_ptr<media::VideoCaptureDevice::Client::Buffer> buffer, | 128 scoped_ptr<media::VideoCaptureDevice::Client::Buffer> buffer, |
| 129 const scoped_refptr<media::VideoFrame>& frame, | 129 const scoped_refptr<media::VideoFrame>& frame, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 media::VideoCaptureFormat video_capture_format_; | 161 media::VideoCaptureFormat video_capture_format_; |
| 162 | 162 |
| 163 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; | 163 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; |
| 164 | 164 |
| 165 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); | 165 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); |
| 166 }; | 166 }; |
| 167 | 167 |
| 168 } // namespace content | 168 } // namespace content |
| 169 | 169 |
| 170 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 170 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
| OLD | NEW |