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

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

Issue 1117423002: media: Let VideoFrame carry more than one native texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reveman's comments. Created 5 years, 7 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
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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 if (capture_params_.requested_format.pixel_format == 275 if (capture_params_.requested_format.pixel_format ==
276 media::PIXEL_FORMAT_TEXTURE) { 276 media::PIXEL_FORMAT_TEXTURE) {
277 DCHECK(!video_frame.get()); 277 DCHECK(!video_frame.get());
278 cc::TextureMailbox texture_mailbox; 278 cc::TextureMailbox texture_mailbox;
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 make_scoped_ptr(new gpu::MailboxHolder(texture_mailbox.mailbox(), 285 gpu::MailboxHolder(texture_mailbox.mailbox(), texture_mailbox.target(),
286 texture_mailbox.target(), 286 texture_mailbox.sync_point()),
287 texture_mailbox.sync_point())),
288 base::Bind(&RunSingleReleaseCallback, base::Passed(&release_callback)), 287 base::Bind(&RunSingleReleaseCallback, base::Passed(&release_callback)),
289 result->size(), gfx::Rect(result->size()), result->size(), 288 result->size(), gfx::Rect(result->size()), result->size(),
290 base::TimeDelta(), false); 289 base::TimeDelta(), false);
291 capture_frame_cb.Run(video_frame, start_time, true); 290 capture_frame_cb.Run(video_frame, start_time, true);
292 return true; 291 return true;
293 } else { 292 } else {
294 DCHECK(video_frame.get()); 293 DCHECK(video_frame.get());
295 } 294 }
296 295
297 // 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
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 window->GetHost()->compositor()->RemoveObserver(this); 440 window->GetHost()->compositor()->RemoveObserver(this);
442 } 441 }
443 442
444 void AuraWindowCaptureMachine::OnCompositingEnded( 443 void AuraWindowCaptureMachine::OnCompositingEnded(
445 ui::Compositor* compositor) { 444 ui::Compositor* compositor) {
446 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( 445 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
447 &AuraWindowCaptureMachine::Capture, AsWeakPtr(), true)); 446 &AuraWindowCaptureMachine::Capture, AsWeakPtr(), true));
448 } 447 }
449 448
450 } // namespace content 449 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698