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

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

Issue 312803002: Android media: VideoFrame should not store so many sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make VideoFrame keep only one sync point per client Created 6 years, 6 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/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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 const gfx::Point& cursor_position, 298 const gfx::Point& cursor_position,
299 scoped_ptr<cc::SingleReleaseCallback> release_callback, 299 scoped_ptr<cc::SingleReleaseCallback> release_callback,
300 bool result) { 300 bool result) {
301 if (!cursor_bitmap.isNull()) 301 if (!cursor_bitmap.isNull())
302 RenderCursorOnVideoFrame(target, cursor_bitmap, cursor_position); 302 RenderCursorOnVideoFrame(target, cursor_bitmap, cursor_position);
303 release_callback->Run(0, false); 303 release_callback->Run(0, false);
304 capture_frame_cb.Run(target, start_time, result); 304 capture_frame_cb.Run(target, start_time, result);
305 } 305 }
306 306
307 void RunSingleReleaseCallback(scoped_ptr<cc::SingleReleaseCallback> cb, 307 void RunSingleReleaseCallback(scoped_ptr<cc::SingleReleaseCallback> cb,
308 const std::vector<uint32>& sync_points) { 308 const std::map<uintptr_t, uint32>& sync_points) {
309 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 309 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
310 GLHelper* gl_helper = ImageTransportFactory::GetInstance()->GetGLHelper(); 310 GLHelper* gl_helper = ImageTransportFactory::GetInstance()->GetGLHelper();
311 DCHECK(gl_helper); 311 DCHECK(gl_helper);
312 for (unsigned i = 0; i < sync_points.size(); i++) 312 for (std::map<uintptr_t, uint32>::const_iterator iter = sync_points.begin();
313 gl_helper->WaitSyncPoint(sync_points[i]); 313 iter != sync_points.end();
314 iter++) {
315 gl_helper->WaitSyncPoint(iter->second);
316 }
314 uint32 new_sync_point = gl_helper->InsertSyncPoint(); 317 uint32 new_sync_point = gl_helper->InsertSyncPoint();
315 cb->Run(new_sync_point, false); 318 cb->Run(new_sync_point, false);
316 } 319 }
317 320
318 void DesktopVideoCaptureMachine::DidCopyOutput( 321 void DesktopVideoCaptureMachine::DidCopyOutput(
319 scoped_refptr<media::VideoFrame> video_frame, 322 scoped_refptr<media::VideoFrame> video_frame,
320 base::TimeTicks start_time, 323 base::TimeTicks start_time,
321 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb, 324 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb,
322 scoped_ptr<cc::CopyOutputResult> result) { 325 scoped_ptr<cc::CopyOutputResult> result) {
323 static bool first_call = true; 326 static bool first_call = true;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 scoped_ptr<Client> client) { 531 scoped_ptr<Client> client) {
529 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); 532 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString();
530 core_->AllocateAndStart(params, client.Pass()); 533 core_->AllocateAndStart(params, client.Pass());
531 } 534 }
532 535
533 void DesktopCaptureDeviceAura::StopAndDeAllocate() { 536 void DesktopCaptureDeviceAura::StopAndDeAllocate() {
534 core_->StopAndDeAllocate(); 537 core_->StopAndDeAllocate();
535 } 538 }
536 539
537 } // namespace content 540 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698