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