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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 const gpu::SyncToken& sync_token, | 123 const gpu::SyncToken& sync_token, |
124 double consumer_resource_utilization); | 124 double consumer_resource_utilization); |
125 | 125 |
126 const media::VideoCaptureFormat& GetVideoCaptureFormat() const; | 126 const media::VideoCaptureFormat& GetVideoCaptureFormat() const; |
127 | 127 |
128 bool has_received_frames() const { return has_received_frames_; } | 128 bool has_received_frames() const { return has_received_frames_; } |
129 | 129 |
130 // Implementation of media::VideoFrameReceiver interface: | 130 // Implementation of media::VideoFrameReceiver interface: |
131 void OnIncomingCapturedVideoFrame( | 131 void OnIncomingCapturedVideoFrame( |
132 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> buffer, | 132 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> buffer, |
133 const scoped_refptr<media::VideoFrame>& frame) override; | 133 scoped_refptr<media::VideoFrame> frame) override; |
134 void OnError() override; | 134 void OnError() override; |
135 void OnLog(const std::string& message) override; | 135 void OnLog(const std::string& message) override; |
136 void OnBufferDestroyed(int buffer_id_to_drop) override; | 136 void OnBufferDestroyed(int buffer_id_to_drop) override; |
137 | 137 |
138 private: | 138 private: |
139 struct ControllerClient; | 139 struct ControllerClient; |
140 typedef std::list<std::unique_ptr<ControllerClient>> ControllerClients; | 140 typedef std::list<std::unique_ptr<ControllerClient>> ControllerClients; |
141 | 141 |
142 // Notify renderer that a new buffer has been created. | 142 // Notify renderer that a new buffer has been created. |
143 void DoNewBufferOnIOThread(ControllerClient* client, | 143 void DoNewBufferOnIOThread(ControllerClient* client, |
(...skipping 25 matching lines...) Expand all Loading... |
169 media::VideoCaptureFormat video_capture_format_; | 169 media::VideoCaptureFormat video_capture_format_; |
170 | 170 |
171 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; | 171 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; |
172 | 172 |
173 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); | 173 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); |
174 }; | 174 }; |
175 | 175 |
176 } // namespace content | 176 } // namespace content |
177 | 177 |
178 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 178 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
OLD | NEW |