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

Side by Side Diff: content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc

Issue 2857303002: [Mojo Video Capture] Implement a VideoCaptureProvider using the Mojo service (part 2) (Closed)
Patch Set: Added back update to |state_| which was accidentally dropped in PatchSet 3 Created 3 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
« no previous file with comments | « no previous file | content/browser/renderer_host/media/service_launched_video_capture_device.h » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/renderer_host/media/in_process_video_capture_device_la uncher.h" 5 #include "content/browser/renderer_host/media/in_process_video_capture_device_la uncher.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "content/browser/media/capture/desktop_capture_device_uma_types.h" 9 #include "content/browser/media/capture/desktop_capture_device_uma_types.h"
10 #include "content/browser/media/capture/web_contents_video_capture_device.h" 10 #include "content/browser/media/capture/web_contents_video_capture_device.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 DCHECK_CURRENTLY_ON(BrowserThread::IO); 77 DCHECK_CURRENTLY_ON(BrowserThread::IO);
78 DCHECK(state_ == State::READY_TO_LAUNCH); 78 DCHECK(state_ == State::READY_TO_LAUNCH);
79 79
80 const int max_buffers = 80 const int max_buffers =
81 (stream_type == MEDIA_TAB_VIDEO_CAPTURE ? kMaxNumberOfBuffersForTabCapture 81 (stream_type == MEDIA_TAB_VIDEO_CAPTURE ? kMaxNumberOfBuffersForTabCapture
82 : kMaxNumberOfBuffers); 82 : kMaxNumberOfBuffers);
83 83
84 auto device_client = CreateDeviceClient(max_buffers, std::move(receiver)); 84 auto device_client = CreateDeviceClient(max_buffers, std::move(receiver));
85 85
86 base::Closure start_capture_closure; 86 base::Closure start_capture_closure;
87 // Use of |this| is safe, because |done_cb| guarantees that |this| 87 // Use of Unretained |this| is safe, because |done_cb| guarantees that |this|
88 // stays alive. 88 // stays alive.
89 ReceiveDeviceCallback after_start_capture_callback = media::BindToCurrentLoop( 89 ReceiveDeviceCallback after_start_capture_callback = media::BindToCurrentLoop(
90 base::Bind(&InProcessVideoCaptureDeviceLauncher::OnDeviceStarted, 90 base::Bind(&InProcessVideoCaptureDeviceLauncher::OnDeviceStarted,
91 base::Unretained(this), callbacks, base::Passed(&done_cb))); 91 base::Unretained(this), callbacks, base::Passed(&done_cb)));
92 92
93 switch (stream_type) { 93 switch (stream_type) {
94 case MEDIA_DEVICE_VIDEO_CAPTURE: { 94 case MEDIA_DEVICE_VIDEO_CAPTURE: {
95 start_capture_closure = 95 start_capture_closure =
96 base::Bind(&InProcessVideoCaptureDeviceLauncher:: 96 base::Bind(&InProcessVideoCaptureDeviceLauncher::
97 DoStartDeviceCaptureOnDeviceThread, 97 DoStartDeviceCaptureOnDeviceThread,
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 if (!video_capture_device) { 280 if (!video_capture_device) {
281 result_callback.Run(nullptr); 281 result_callback.Run(nullptr);
282 return; 282 return;
283 } 283 }
284 284
285 video_capture_device->AllocateAndStart(params, std::move(device_client)); 285 video_capture_device->AllocateAndStart(params, std::move(device_client));
286 result_callback.Run(std::move(video_capture_device)); 286 result_callback.Run(std::move(video_capture_device));
287 } 287 }
288 288
289 } // namespace content 289 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/service_launched_video_capture_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698