Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: content/browser/media/capture/aura_window_capture_machine.cc

Issue 1204063005: Reland: Video Capture: extract storage info from pixel format in VideoCaptureFormat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheng@ nit on DCHECK_EQ(expected, actual) Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/media/capture/desktop_capture_device_aura_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 bool AuraWindowCaptureMachine::ProcessCopyOutputResponse( 299 bool AuraWindowCaptureMachine::ProcessCopyOutputResponse(
300 scoped_refptr<media::VideoFrame> video_frame, 300 scoped_refptr<media::VideoFrame> video_frame,
301 base::TimeTicks start_time, 301 base::TimeTicks start_time,
302 const CaptureFrameCallback& capture_frame_cb, 302 const CaptureFrameCallback& capture_frame_cb,
303 scoped_ptr<cc::CopyOutputResult> result) { 303 scoped_ptr<cc::CopyOutputResult> result) {
304 DCHECK_CURRENTLY_ON(BrowserThread::UI); 304 DCHECK_CURRENTLY_ON(BrowserThread::UI);
305 305
306 if (result->IsEmpty() || result->size().IsEmpty() || !desktop_window_) 306 if (result->IsEmpty() || result->size().IsEmpty() || !desktop_window_)
307 return false; 307 return false;
308 308
309 if (capture_params_.requested_format.pixel_format == 309 if (capture_params_.requested_format.pixel_storage ==
310 media::PIXEL_FORMAT_TEXTURE) { 310 media::PIXEL_STORAGE_TEXTURE) {
311 DCHECK_EQ(media::PIXEL_FORMAT_ARGB,
312 capture_params_.requested_format.pixel_format);
311 DCHECK(!video_frame.get()); 313 DCHECK(!video_frame.get());
312 cc::TextureMailbox texture_mailbox; 314 cc::TextureMailbox texture_mailbox;
313 scoped_ptr<cc::SingleReleaseCallback> release_callback; 315 scoped_ptr<cc::SingleReleaseCallback> release_callback;
314 result->TakeTexture(&texture_mailbox, &release_callback); 316 result->TakeTexture(&texture_mailbox, &release_callback);
315 DCHECK(texture_mailbox.IsTexture()); 317 DCHECK(texture_mailbox.IsTexture());
316 if (!texture_mailbox.IsTexture()) 318 if (!texture_mailbox.IsTexture())
317 return false; 319 return false;
318 video_frame = media::VideoFrame::WrapNativeTexture( 320 video_frame = media::VideoFrame::WrapNativeTexture(
319 media::VideoFrame::ARGB, 321 media::VideoFrame::ARGB,
320 gpu::MailboxHolder(texture_mailbox.mailbox(), texture_mailbox.target(), 322 gpu::MailboxHolder(texture_mailbox.mailbox(), texture_mailbox.target(),
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 479
478 void AuraWindowCaptureMachine::OnCompositingEnded( 480 void AuraWindowCaptureMachine::OnCompositingEnded(
479 ui::Compositor* compositor) { 481 ui::Compositor* compositor) {
480 // TODO(miu): The CopyOutputRequest should be made earlier, at WillCommit(). 482 // TODO(miu): The CopyOutputRequest should be made earlier, at WillCommit().
481 // http://crbug.com/492839 483 // http://crbug.com/492839
482 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( 484 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
483 &AuraWindowCaptureMachine::Capture, AsWeakPtr(), true)); 485 &AuraWindowCaptureMachine::Capture, AsWeakPtr(), true));
484 } 486 }
485 487
486 } // namespace content 488 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/capture/desktop_capture_device_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698