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