Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(794)

Side by Side Diff: content/browser/media/capture/web_contents_video_capture_device.cc

Issue 274163004: Remove browser-side tracking of accelerated compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 415
416 // This message occurs on window resizes and visibility changes even when 416 // This message occurs on window resizes and visibility changes even when
417 // accelerated compositing is active, so we need to filter out these cases. 417 // accelerated compositing is active, so we need to filter out these cases.
418 if (!rwh || !rwh->GetView()) 418 if (!rwh || !rwh->GetView())
419 return; 419 return;
420 // Mac sends DID_UPDATE_BACKING_STORE messages to inform the capture system 420 // Mac sends DID_UPDATE_BACKING_STORE messages to inform the capture system
421 // of new software compositor frames, so always treat these messages as 421 // of new software compositor frames, so always treat these messages as
422 // signals of a new frame on Mac. 422 // signals of a new frame on Mac.
423 // http://crbug.com/333986 423 // http://crbug.com/333986
424 #if !defined(OS_MACOSX) 424 #if !defined(OS_MACOSX)
425 if (rwh->is_accelerated_compositing_active() && 425 if (rwh->GetView()->IsSurfaceAvailableForCopy())
426 rwh->GetView()->IsSurfaceAvailableForCopy())
427 return; 426 return;
428 #endif 427 #endif
429 428
430 TRACE_EVENT1("mirroring", "ContentCaptureSubscription::Observe", 429 TRACE_EVENT1("mirroring", "ContentCaptureSubscription::Observe",
431 "instance", this); 430 "instance", this);
432 431
433 base::Closure copy_done_callback; 432 base::Closure copy_done_callback;
434 scoped_refptr<media::VideoFrame> frame; 433 scoped_refptr<media::VideoFrame> frame;
435 RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback deliver_frame_cb; 434 RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback deliver_frame_cb;
436 const base::TimeTicks start_time = base::TimeTicks::Now(); 435 const base::TimeTicks start_time = base::TimeTicks::Now();
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 scoped_ptr<Client> client) { 813 scoped_ptr<Client> client) {
815 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); 814 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString();
816 core_->AllocateAndStart(params, client.Pass()); 815 core_->AllocateAndStart(params, client.Pass());
817 } 816 }
818 817
819 void WebContentsVideoCaptureDevice::StopAndDeAllocate() { 818 void WebContentsVideoCaptureDevice::StopAndDeAllocate() {
820 core_->StopAndDeAllocate(); 819 core_->StopAndDeAllocate();
821 } 820 }
822 821
823 } // namespace content 822 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698