| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // otherwise. | 302 // otherwise. |
| 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. NOTE: This must always |
| 313 // be last so it's invalidated before other member variables might be |
| 314 // accessed. |
| 313 base::WeakPtrFactory<WebContentsCaptureMachine> weak_ptr_factory_; | 315 base::WeakPtrFactory<WebContentsCaptureMachine> weak_ptr_factory_; |
| 314 | 316 |
| 315 DISALLOW_COPY_AND_ASSIGN(WebContentsCaptureMachine); | 317 DISALLOW_COPY_AND_ASSIGN(WebContentsCaptureMachine); |
| 316 }; | 318 }; |
| 317 | 319 |
| 318 // Responsible for logging the effective frame rate. | 320 // Responsible for logging the effective frame rate. |
| 319 // TODO(nick): Make this compatible with the push model and hook it back up. | 321 // TODO(nick): Make this compatible with the push model and hook it back up. |
| 320 class VideoFrameDeliveryLog { | 322 class VideoFrameDeliveryLog { |
| 321 public: | 323 public: |
| 322 VideoFrameDeliveryLog(); | 324 VideoFrameDeliveryLog(); |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 scoped_ptr<Client> client) { | 820 scoped_ptr<Client> client) { |
| 819 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); | 821 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); |
| 820 core_->AllocateAndStart(params, client.Pass()); | 822 core_->AllocateAndStart(params, client.Pass()); |
| 821 } | 823 } |
| 822 | 824 |
| 823 void WebContentsVideoCaptureDevice::StopAndDeAllocate() { | 825 void WebContentsVideoCaptureDevice::StopAndDeAllocate() { |
| 824 core_->StopAndDeAllocate(); | 826 core_->StopAndDeAllocate(); |
| 825 } | 827 } |
| 826 | 828 |
| 827 } // namespace content | 829 } // namespace content |
| OLD | NEW |