| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 const gpu::SyncToken& sync_token, | 121 const gpu::SyncToken& sync_token, |
| 122 double consumer_resource_utilization); | 122 double consumer_resource_utilization); |
| 123 | 123 |
| 124 const media::VideoCaptureFormat& GetVideoCaptureFormat() const; | 124 const media::VideoCaptureFormat& GetVideoCaptureFormat() const; |
| 125 | 125 |
| 126 bool has_received_frames() const { return has_received_frames_; } | 126 bool has_received_frames() const { return has_received_frames_; } |
| 127 | 127 |
| 128 // Worker functions on IO thread. Called by the VideoCaptureDeviceClient. | 128 // Worker functions on IO thread. Called by the VideoCaptureDeviceClient. |
| 129 virtual void DoIncomingCapturedVideoFrameOnIOThread( | 129 virtual void DoIncomingCapturedVideoFrameOnIOThread( |
| 130 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> buffer, | 130 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> buffer, |
| 131 const scoped_refptr<media::VideoFrame>& frame, | 131 const scoped_refptr<media::VideoFrame>& frame); |
| 132 const base::TimeTicks& timestamp); | |
| 133 virtual void DoErrorOnIOThread(); | 132 virtual void DoErrorOnIOThread(); |
| 134 virtual void DoLogOnIOThread(const std::string& message); | 133 virtual void DoLogOnIOThread(const std::string& message); |
| 135 virtual void DoBufferDestroyedOnIOThread(int buffer_id_to_drop); | 134 virtual void DoBufferDestroyedOnIOThread(int buffer_id_to_drop); |
| 136 | 135 |
| 137 private: | 136 private: |
| 138 struct ControllerClient; | 137 struct ControllerClient; |
| 139 typedef std::list<ControllerClient*> ControllerClients; | 138 typedef std::list<ControllerClient*> ControllerClients; |
| 140 | 139 |
| 141 // Notify renderer that a new buffer has been created. | 140 // Notify renderer that a new buffer has been created. |
| 142 void DoNewBufferOnIOThread(ControllerClient* client, | 141 void DoNewBufferOnIOThread(ControllerClient* client, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 168 media::VideoCaptureFormat video_capture_format_; | 167 media::VideoCaptureFormat video_capture_format_; |
| 169 | 168 |
| 170 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; | 169 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; |
| 171 | 170 |
| 172 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); | 171 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); |
| 173 }; | 172 }; |
| 174 | 173 |
| 175 } // namespace content | 174 } // namespace content |
| 176 | 175 |
| 177 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 176 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
| OLD | NEW |