OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/video/capture/mac/video_capture_device_mac.h" | 5 #include "media/video/capture/mac/video_capture_device_mac.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 // The last characters of device id is a concatenation of VID and then PID. | 144 // The last characters of device id is a concatenation of VID and then PID. |
145 const size_t vid_location = unique_id_.size() - 2 * kVidPidSize; | 145 const size_t vid_location = unique_id_.size() - 2 * kVidPidSize; |
146 std::string id_vendor = unique_id_.substr(vid_location, kVidPidSize); | 146 std::string id_vendor = unique_id_.substr(vid_location, kVidPidSize); |
147 const size_t pid_location = unique_id_.size() - kVidPidSize; | 147 const size_t pid_location = unique_id_.size() - kVidPidSize; |
148 std::string id_product = unique_id_.substr(pid_location, kVidPidSize); | 148 std::string id_product = unique_id_.substr(pid_location, kVidPidSize); |
149 | 149 |
150 return id_vendor + ":" + id_product; | 150 return id_vendor + ":" + id_product; |
151 } | 151 } |
152 | 152 |
153 VideoCaptureDevice* VideoCaptureDevice::Create(const Name& device_name) { | 153 VideoCaptureDevice* VideoCaptureDevice::Create( |
| 154 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 155 const Name& device_name) { |
154 VideoCaptureDeviceMac* capture_device = | 156 VideoCaptureDeviceMac* capture_device = |
155 new VideoCaptureDeviceMac(device_name); | 157 new VideoCaptureDeviceMac(device_name); |
156 if (!capture_device->Init()) { | 158 if (!capture_device->Init()) { |
157 LOG(ERROR) << "Could not initialize VideoCaptureDevice."; | 159 LOG(ERROR) << "Could not initialize VideoCaptureDevice."; |
158 delete capture_device; | 160 delete capture_device; |
159 capture_device = NULL; | 161 capture_device = NULL; |
160 } | 162 } |
161 return capture_device; | 163 return capture_device; |
162 } | 164 } |
163 | 165 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() | 379 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() |
378 width:capture_format_.frame_size.width() | 380 width:capture_format_.frame_size.width() |
379 frameRate:capture_format_.frame_rate]) { | 381 frameRate:capture_format_.frame_rate]) { |
380 ReceiveError("Could not configure capture device."); | 382 ReceiveError("Could not configure capture device."); |
381 return false; | 383 return false; |
382 } | 384 } |
383 return true; | 385 return true; |
384 } | 386 } |
385 | 387 |
386 } // namespace media | 388 } // namespace media |
OLD | NEW |