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 // Implementation notes: This needs to work on a variety of hardware | 5 // Implementation notes: This needs to work on a variety of hardware |
6 // configurations where the speed of the CPU and GPU greatly affect overall | 6 // configurations where the speed of the CPU and GPU greatly affect overall |
7 // performance. Spanning several threads, the process of capturing has been | 7 // performance. Spanning several threads, the process of capturing has been |
8 // split up into four conceptual stages: | 8 // split up into four conceptual stages: |
9 // | 9 // |
10 // 1. Reserve Buffer: Before a frame can be captured, a slot in the client's | 10 // 1. Reserve Buffer: Before a frame can be captured, a slot in the client's |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 int fullscreen_widget_id_; | 303 int fullscreen_widget_id_; |
304 | 304 |
305 // Last known RenderView size. | 305 // Last known RenderView size. |
306 gfx::Size last_view_size_; | 306 gfx::Size last_view_size_; |
307 | 307 |
308 // Responsible for forwarding events from the active RenderWidgetHost to the | 308 // Responsible for forwarding events from the active RenderWidgetHost to the |
309 // oracle, and initiating captures accordingly. | 309 // oracle, and initiating captures accordingly. |
310 scoped_ptr<ContentCaptureSubscription> subscription_; | 310 scoped_ptr<ContentCaptureSubscription> subscription_; |
311 | 311 |
312 // Weak pointer factory used to invalidate callbacks. | 312 // Weak pointer factory used to invalidate callbacks. |
| 313 // NOTE: Weak pointers must be invalidated before all other member variables. |
313 base::WeakPtrFactory<WebContentsCaptureMachine> weak_ptr_factory_; | 314 base::WeakPtrFactory<WebContentsCaptureMachine> weak_ptr_factory_; |
314 | 315 |
315 DISALLOW_COPY_AND_ASSIGN(WebContentsCaptureMachine); | 316 DISALLOW_COPY_AND_ASSIGN(WebContentsCaptureMachine); |
316 }; | 317 }; |
317 | 318 |
318 // Responsible for logging the effective frame rate. | 319 // Responsible for logging the effective frame rate. |
319 // TODO(nick): Make this compatible with the push model and hook it back up. | 320 // TODO(nick): Make this compatible with the push model and hook it back up. |
320 class VideoFrameDeliveryLog { | 321 class VideoFrameDeliveryLog { |
321 public: | 322 public: |
322 VideoFrameDeliveryLog(); | 323 VideoFrameDeliveryLog(); |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 scoped_ptr<Client> client) { | 822 scoped_ptr<Client> client) { |
822 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); | 823 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); |
823 core_->AllocateAndStart(params, client.Pass()); | 824 core_->AllocateAndStart(params, client.Pass()); |
824 } | 825 } |
825 | 826 |
826 void WebContentsVideoCaptureDevice::StopAndDeAllocate() { | 827 void WebContentsVideoCaptureDevice::StopAndDeAllocate() { |
827 core_->StopAndDeAllocate(); | 828 core_->StopAndDeAllocate(); |
828 } | 829 } |
829 | 830 |
830 } // namespace content | 831 } // namespace content |
OLD | NEW |