| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 bool AuraWindowCaptureMachine::ProcessCopyOutputResponse( | 271 bool AuraWindowCaptureMachine::ProcessCopyOutputResponse( |
| 272 scoped_refptr<media::VideoFrame> video_frame, | 272 scoped_refptr<media::VideoFrame> video_frame, |
| 273 base::TimeTicks start_time, | 273 base::TimeTicks start_time, |
| 274 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb, | 274 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb, |
| 275 scoped_ptr<cc::CopyOutputResult> result) { | 275 scoped_ptr<cc::CopyOutputResult> result) { |
| 276 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 276 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 277 | 277 |
| 278 if (result->IsEmpty() || result->size().IsEmpty() || !desktop_window_) | 278 if (result->IsEmpty() || result->size().IsEmpty() || !desktop_window_) |
| 279 return false; | 279 return false; |
| 280 | 280 |
| 281 if (capture_params_.requested_format.pixel_format == | 281 if (capture_params_.requested_format.pixel_storage == |
| 282 media::PIXEL_FORMAT_TEXTURE) { | 282 media::PIXEL_STORAGE_TEXTURE) { |
| 283 DCHECK(!video_frame.get()); | 283 DCHECK(!video_frame.get()); |
| 284 cc::TextureMailbox texture_mailbox; | 284 cc::TextureMailbox texture_mailbox; |
| 285 scoped_ptr<cc::SingleReleaseCallback> release_callback; | 285 scoped_ptr<cc::SingleReleaseCallback> release_callback; |
| 286 result->TakeTexture(&texture_mailbox, &release_callback); | 286 result->TakeTexture(&texture_mailbox, &release_callback); |
| 287 DCHECK(texture_mailbox.IsTexture()); | 287 DCHECK(texture_mailbox.IsTexture()); |
| 288 if (!texture_mailbox.IsTexture()) | 288 if (!texture_mailbox.IsTexture()) |
| 289 return false; | 289 return false; |
| 290 video_frame = media::VideoFrame::WrapNativeTexture( | 290 video_frame = media::VideoFrame::WrapNativeTexture( |
| 291 media::VideoFrame::ARGB, | 291 media::VideoFrame::ARGB, |
| 292 gpu::MailboxHolder(texture_mailbox.mailbox(), texture_mailbox.target(), | 292 gpu::MailboxHolder(texture_mailbox.mailbox(), texture_mailbox.target(), |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 449 |
| 450 void AuraWindowCaptureMachine::OnCompositingEnded( | 450 void AuraWindowCaptureMachine::OnCompositingEnded( |
| 451 ui::Compositor* compositor) { | 451 ui::Compositor* compositor) { |
| 452 // TODO(miu): The CopyOutputRequest should be made earlier, at WillCommit(). | 452 // TODO(miu): The CopyOutputRequest should be made earlier, at WillCommit(). |
| 453 // http://crbug.com/492839 | 453 // http://crbug.com/492839 |
| 454 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( | 454 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( |
| 455 &AuraWindowCaptureMachine::Capture, AsWeakPtr(), true)); | 455 &AuraWindowCaptureMachine::Capture, AsWeakPtr(), true)); |
| 456 } | 456 } |
| 457 | 457 |
| 458 } // namespace content | 458 } // namespace content |
| OLD | NEW |