| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/browser/media/capture/desktop_capture_device_aura.h" | 5 #include "content/browser/media/capture/desktop_capture_device_aura.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 const base::TimeTicks start_time = base::TimeTicks::Now(); | 271 const base::TimeTicks start_time = base::TimeTicks::Now(); |
| 272 const VideoCaptureOracle::Event event = | 272 const VideoCaptureOracle::Event event = |
| 273 dirty ? VideoCaptureOracle::kCompositorUpdate | 273 dirty ? VideoCaptureOracle::kCompositorUpdate |
| 274 : VideoCaptureOracle::kTimerPoll; | 274 : VideoCaptureOracle::kTimerPoll; |
| 275 if (oracle_proxy_->ObserveEventAndDecideCapture( | 275 if (oracle_proxy_->ObserveEventAndDecideCapture( |
| 276 event, gfx::Rect(), start_time, &frame, &capture_frame_cb)) { | 276 event, gfx::Rect(), start_time, &frame, &capture_frame_cb)) { |
| 277 scoped_ptr<cc::CopyOutputRequest> request = | 277 scoped_ptr<cc::CopyOutputRequest> request = |
| 278 cc::CopyOutputRequest::CreateRequest( | 278 cc::CopyOutputRequest::CreateRequest( |
| 279 base::Bind(&DesktopVideoCaptureMachine::DidCopyOutput, | 279 base::Bind(&DesktopVideoCaptureMachine::DidCopyOutput, |
| 280 AsWeakPtr(), frame, start_time, capture_frame_cb)); | 280 AsWeakPtr(), frame, start_time, capture_frame_cb)); |
| 281 gfx::Rect window_rect = | 281 gfx::Rect window_rect = gfx::Rect(desktop_window_->bounds().width(), |
| 282 ui::ConvertRectToPixel(desktop_window_->layer(), | 282 desktop_window_->bounds().height()); |
| 283 gfx::Rect(desktop_window_->bounds().width(), | |
| 284 desktop_window_->bounds().height())); | |
| 285 request->set_area(window_rect); | 283 request->set_area(window_rect); |
| 286 desktop_window_->layer()->RequestCopyOfOutput(request.Pass()); | 284 desktop_window_->layer()->RequestCopyOfOutput(request.Pass()); |
| 287 } | 285 } |
| 288 } | 286 } |
| 289 | 287 |
| 290 void CopyOutputFinishedForVideo( | 288 void CopyOutputFinishedForVideo( |
| 291 base::TimeTicks start_time, | 289 base::TimeTicks start_time, |
| 292 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb, | 290 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb, |
| 293 const scoped_refptr<media::VideoFrame>& target, | 291 const scoped_refptr<media::VideoFrame>& target, |
| 294 const SkBitmap& cursor_bitmap, | 292 const SkBitmap& cursor_bitmap, |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 scoped_ptr<Client> client) { | 529 scoped_ptr<Client> client) { |
| 532 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); | 530 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); |
| 533 core_->AllocateAndStart(params, client.Pass()); | 531 core_->AllocateAndStart(params, client.Pass()); |
| 534 } | 532 } |
| 535 | 533 |
| 536 void DesktopCaptureDeviceAura::StopAndDeAllocate() { | 534 void DesktopCaptureDeviceAura::StopAndDeAllocate() { |
| 537 core_->StopAndDeAllocate(); | 535 core_->StopAndDeAllocate(); |
| 538 } | 536 } |
| 539 | 537 |
| 540 } // namespace content | 538 } // namespace content |
| OLD | NEW |