| OLD | NEW |
| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 InProcessVideoCaptureDeviceLauncher::~InProcessVideoCaptureDeviceLauncher() { | 65 InProcessVideoCaptureDeviceLauncher::~InProcessVideoCaptureDeviceLauncher() { |
| 66 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 66 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 67 DCHECK(state_ == State::READY_TO_LAUNCH); | 67 DCHECK(state_ == State::READY_TO_LAUNCH); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync( | 70 void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync( |
| 71 const std::string& device_id, | 71 const std::string& device_id, |
| 72 MediaStreamType stream_type, | 72 MediaStreamType stream_type, |
| 73 const media::VideoCaptureParams& params, | 73 const media::VideoCaptureParams& params, |
| 74 base::WeakPtr<media::VideoFrameReceiver> receiver, | 74 base::WeakPtr<media::VideoFrameReceiver> receiver, |
| 75 base::OnceClosure /* connection_lost_cb */, |
| 75 Callbacks* callbacks, | 76 Callbacks* callbacks, |
| 76 base::OnceClosure done_cb) { | 77 base::OnceClosure done_cb) { |
| 77 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 78 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 78 DCHECK(state_ == State::READY_TO_LAUNCH); | 79 DCHECK(state_ == State::READY_TO_LAUNCH); |
| 79 | 80 |
| 80 const int max_buffers = | 81 const int max_buffers = |
| 81 (stream_type == MEDIA_TAB_VIDEO_CAPTURE ? kMaxNumberOfBuffersForTabCapture | 82 (stream_type == MEDIA_TAB_VIDEO_CAPTURE ? kMaxNumberOfBuffersForTabCapture |
| 82 : kMaxNumberOfBuffers); | 83 : kMaxNumberOfBuffers); |
| 83 | 84 |
| 84 auto device_client = CreateDeviceClient(max_buffers, std::move(receiver)); | 85 auto device_client = CreateDeviceClient(max_buffers, std::move(receiver)); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 if (!video_capture_device) { | 292 if (!video_capture_device) { |
| 292 result_callback.Run(nullptr); | 293 result_callback.Run(nullptr); |
| 293 return; | 294 return; |
| 294 } | 295 } |
| 295 | 296 |
| 296 video_capture_device->AllocateAndStart(params, std::move(device_client)); | 297 video_capture_device->AllocateAndStart(params, std::move(device_client)); |
| 297 result_callback.Run(std::move(video_capture_device)); | 298 result_callback.Run(std::move(video_capture_device)); |
| 298 } | 299 } |
| 299 | 300 |
| 300 } // namespace content | 301 } // namespace content |
| OLD | NEW |