| 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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 DVLOG(1) << "WebContents::FromRenderViewHost(" << rvh << ") returned NULL."; | 693 DVLOG(1) << "WebContents::FromRenderViewHost(" << rvh << ") returned NULL."; |
| 694 return false; | 694 return false; |
| 695 } | 695 } |
| 696 | 696 |
| 697 void WebContentsCaptureMachine::WebContentsDestroyed( | 697 void WebContentsCaptureMachine::WebContentsDestroyed( |
| 698 WebContents* web_contents) { | 698 WebContents* web_contents) { |
| 699 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 699 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 700 | 700 |
| 701 subscription_.reset(); | 701 subscription_.reset(); |
| 702 web_contents->DecrementCapturerCount(); | 702 web_contents->DecrementCapturerCount(); |
| 703 oracle_proxy_->ReportError(); | 703 oracle_proxy_->ReportError("WebContentsDestroyed()"); |
| 704 } | 704 } |
| 705 | 705 |
| 706 RenderWidgetHost* WebContentsCaptureMachine::GetTarget() { | 706 RenderWidgetHost* WebContentsCaptureMachine::GetTarget() { |
| 707 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 707 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 708 if (!web_contents()) | 708 if (!web_contents()) |
| 709 return NULL; | 709 return NULL; |
| 710 | 710 |
| 711 RenderWidgetHost* rwh = NULL; | 711 RenderWidgetHost* rwh = NULL; |
| 712 if (fullscreen_widget_id_ != MSG_ROUTING_NONE) { | 712 if (fullscreen_widget_id_ != MSG_ROUTING_NONE) { |
| 713 RenderProcessHost* process = web_contents()->GetRenderProcessHost(); | 713 RenderProcessHost* process = web_contents()->GetRenderProcessHost(); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 scoped_ptr<Client> client) { | 806 scoped_ptr<Client> client) { |
| 807 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); | 807 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); |
| 808 impl_->AllocateAndStart(params, client.Pass()); | 808 impl_->AllocateAndStart(params, client.Pass()); |
| 809 } | 809 } |
| 810 | 810 |
| 811 void WebContentsVideoCaptureDevice::StopAndDeAllocate() { | 811 void WebContentsVideoCaptureDevice::StopAndDeAllocate() { |
| 812 impl_->StopAndDeAllocate(); | 812 impl_->StopAndDeAllocate(); |
| 813 } | 813 } |
| 814 | 814 |
| 815 } // namespace content | 815 } // namespace content |
| OLD | NEW |