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/aura_window_capture_machine.h" | 5 #include "content/browser/media/capture/aura_window_capture_machine.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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 scoped_ptr<cc::SingleReleaseCallback> release_callback; | 279 scoped_ptr<cc::SingleReleaseCallback> release_callback; |
280 result->TakeTexture(&texture_mailbox, &release_callback); | 280 result->TakeTexture(&texture_mailbox, &release_callback); |
281 DCHECK(texture_mailbox.IsTexture()); | 281 DCHECK(texture_mailbox.IsTexture()); |
282 if (!texture_mailbox.IsTexture()) | 282 if (!texture_mailbox.IsTexture()) |
283 return false; | 283 return false; |
284 video_frame = media::VideoFrame::WrapNativeTexture( | 284 video_frame = media::VideoFrame::WrapNativeTexture( |
285 gpu::MailboxHolder(texture_mailbox.mailbox(), texture_mailbox.target(), | 285 gpu::MailboxHolder(texture_mailbox.mailbox(), texture_mailbox.target(), |
286 texture_mailbox.sync_point()), | 286 texture_mailbox.sync_point()), |
287 base::Bind(&RunSingleReleaseCallback, base::Passed(&release_callback)), | 287 base::Bind(&RunSingleReleaseCallback, base::Passed(&release_callback)), |
288 result->size(), gfx::Rect(result->size()), result->size(), | 288 result->size(), gfx::Rect(result->size()), result->size(), |
289 base::TimeDelta(), false); | 289 base::TimeDelta(), false /* allow_overlay */, true /* has_alpha */); |
290 capture_frame_cb.Run(video_frame, start_time, true); | 290 capture_frame_cb.Run(video_frame, start_time, true); |
291 return true; | 291 return true; |
292 } else { | 292 } else { |
293 DCHECK(video_frame.get()); | 293 DCHECK(video_frame.get()); |
294 } | 294 } |
295 | 295 |
296 // Compute the dest size we want after the letterboxing resize. Make the | 296 // Compute the dest size we want after the letterboxing resize. Make the |
297 // coordinates and sizes even because we letterbox in YUV space | 297 // coordinates and sizes even because we letterbox in YUV space |
298 // (see CopyRGBToVideoFrame). They need to be even for the UV samples to | 298 // (see CopyRGBToVideoFrame). They need to be even for the UV samples to |
299 // line up correctly. | 299 // line up correctly. |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 window->GetHost()->compositor()->RemoveObserver(this); | 440 window->GetHost()->compositor()->RemoveObserver(this); |
441 } | 441 } |
442 | 442 |
443 void AuraWindowCaptureMachine::OnCompositingEnded( | 443 void AuraWindowCaptureMachine::OnCompositingEnded( |
444 ui::Compositor* compositor) { | 444 ui::Compositor* compositor) { |
445 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( | 445 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( |
446 &AuraWindowCaptureMachine::Capture, AsWeakPtr(), true)); | 446 &AuraWindowCaptureMachine::Capture, AsWeakPtr(), true)); |
447 } | 447 } |
448 | 448 |
449 } // namespace content | 449 } // namespace content |
OLD | NEW |