| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 const gfx::Point& cursor_position, | 289 const gfx::Point& cursor_position, |
| 290 scoped_ptr<cc::SingleReleaseCallback> release_callback, | 290 scoped_ptr<cc::SingleReleaseCallback> release_callback, |
| 291 bool result) { | 291 bool result) { |
| 292 if (!cursor_bitmap.isNull()) | 292 if (!cursor_bitmap.isNull()) |
| 293 RenderCursorOnVideoFrame(target, cursor_bitmap, cursor_position); | 293 RenderCursorOnVideoFrame(target, cursor_bitmap, cursor_position); |
| 294 release_callback->Run(0, false); | 294 release_callback->Run(0, false); |
| 295 capture_frame_cb.Run(target, start_time, result); | 295 capture_frame_cb.Run(target, start_time, result); |
| 296 } | 296 } |
| 297 | 297 |
| 298 void RunSingleReleaseCallback(scoped_ptr<cc::SingleReleaseCallback> cb, | 298 void RunSingleReleaseCallback(scoped_ptr<cc::SingleReleaseCallback> cb, |
| 299 const std::vector<uint32>& sync_points) { | 299 uint32 sync_point) { |
| 300 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 300 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 301 GLHelper* gl_helper = ImageTransportFactory::GetInstance()->GetGLHelper(); | 301 cb->Run(sync_point, false); |
| 302 DCHECK(gl_helper); | |
| 303 for (unsigned i = 0; i < sync_points.size(); i++) | |
| 304 gl_helper->WaitSyncPoint(sync_points[i]); | |
| 305 uint32 new_sync_point = gl_helper->InsertSyncPoint(); | |
| 306 cb->Run(new_sync_point, false); | |
| 307 } | 302 } |
| 308 | 303 |
| 309 void DesktopVideoCaptureMachine::DidCopyOutput( | 304 void DesktopVideoCaptureMachine::DidCopyOutput( |
| 310 scoped_refptr<media::VideoFrame> video_frame, | 305 scoped_refptr<media::VideoFrame> video_frame, |
| 311 base::TimeTicks start_time, | 306 base::TimeTicks start_time, |
| 312 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb, | 307 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb, |
| 313 scoped_ptr<cc::CopyOutputResult> result) { | 308 scoped_ptr<cc::CopyOutputResult> result) { |
| 314 static bool first_call = true; | 309 static bool first_call = true; |
| 315 | 310 |
| 316 bool succeeded = ProcessCopyOutputResponse( | 311 bool succeeded = ProcessCopyOutputResponse( |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 scoped_ptr<Client> client) { | 527 scoped_ptr<Client> client) { |
| 533 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); | 528 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); |
| 534 core_->AllocateAndStart(params, client.Pass()); | 529 core_->AllocateAndStart(params, client.Pass()); |
| 535 } | 530 } |
| 536 | 531 |
| 537 void DesktopCaptureDeviceAura::StopAndDeAllocate() { | 532 void DesktopCaptureDeviceAura::StopAndDeAllocate() { |
| 538 core_->StopAndDeAllocate(); | 533 core_->StopAndDeAllocate(); |
| 539 } | 534 } |
| 540 | 535 |
| 541 } // namespace content | 536 } // namespace content |
| OLD | NEW |