| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 result->TakeTexture(&texture_mailbox, &release_callback); | 356 result->TakeTexture(&texture_mailbox, &release_callback); |
| 357 DCHECK(texture_mailbox.IsTexture()); | 357 DCHECK(texture_mailbox.IsTexture()); |
| 358 if (!texture_mailbox.IsTexture()) | 358 if (!texture_mailbox.IsTexture()) |
| 359 return false; | 359 return false; |
| 360 video_frame = media::VideoFrame::WrapNativeTexture( | 360 video_frame = media::VideoFrame::WrapNativeTexture( |
| 361 make_scoped_ptr(new gpu::MailboxHolder(texture_mailbox.mailbox(), | 361 make_scoped_ptr(new gpu::MailboxHolder(texture_mailbox.mailbox(), |
| 362 texture_mailbox.target(), | 362 texture_mailbox.target(), |
| 363 texture_mailbox.sync_point())), | 363 texture_mailbox.sync_point())), |
| 364 base::Bind(&RunSingleReleaseCallback, base::Passed(&release_callback)), | 364 base::Bind(&RunSingleReleaseCallback, base::Passed(&release_callback)), |
| 365 result->size(), gfx::Rect(result->size()), result->size(), | 365 result->size(), gfx::Rect(result->size()), result->size(), |
| 366 base::TimeDelta(), media::VideoFrame::ReadPixelsCB(), false); | 366 base::TimeDelta(), false); |
| 367 capture_frame_cb.Run(video_frame, start_time, true); | 367 capture_frame_cb.Run(video_frame, start_time, true); |
| 368 return true; | 368 return true; |
| 369 } | 369 } |
| 370 | 370 |
| 371 // Compute the dest size we want after the letterboxing resize. Make the | 371 // Compute the dest size we want after the letterboxing resize. Make the |
| 372 // coordinates and sizes even because we letterbox in YUV space | 372 // coordinates and sizes even because we letterbox in YUV space |
| 373 // (see CopyRGBToVideoFrame). They need to be even for the UV samples to | 373 // (see CopyRGBToVideoFrame). They need to be even for the UV samples to |
| 374 // line up correctly. | 374 // line up correctly. |
| 375 // The video frame's coded_size() and the result's size() are both physical | 375 // The video frame's coded_size() and the result's size() are both physical |
| 376 // pixels. | 376 // pixels. |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 scoped_ptr<Client> client) { | 532 scoped_ptr<Client> client) { |
| 533 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); | 533 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); |
| 534 core_->AllocateAndStart(params, client.Pass()); | 534 core_->AllocateAndStart(params, client.Pass()); |
| 535 } | 535 } |
| 536 | 536 |
| 537 void DesktopCaptureDeviceAura::StopAndDeAllocate() { | 537 void DesktopCaptureDeviceAura::StopAndDeAllocate() { |
| 538 core_->StopAndDeAllocate(); | 538 core_->StopAndDeAllocate(); |
| 539 } | 539 } |
| 540 | 540 |
| 541 } // namespace content | 541 } // namespace content |
| OLD | NEW |