| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_factory_mac.h" | 5 #include "media/video/capture/mac/video_capture_device_factory_mac.h" |
| 6 | 6 |
| 7 #import <IOKit/audio/IOAudioTypes.h> | 7 #import <IOKit/audio/IOAudioTypes.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 void VideoCaptureDeviceFactoryMac::EnumerateDeviceNames(const base::Callback< | 166 void VideoCaptureDeviceFactoryMac::EnumerateDeviceNames(const base::Callback< |
| 167 void(scoped_ptr<media::VideoCaptureDevice::Names>)>& callback) { | 167 void(scoped_ptr<media::VideoCaptureDevice::Names>)>& callback) { |
| 168 DCHECK(thread_checker_.CalledOnValidThread()); | 168 DCHECK(thread_checker_.CalledOnValidThread()); |
| 169 if (AVFoundationGlue::IsAVFoundationSupported()) { | 169 if (AVFoundationGlue::IsAVFoundationSupported()) { |
| 170 scoped_ptr<VideoCaptureDevice::Names> device_names( | 170 scoped_ptr<VideoCaptureDevice::Names> device_names( |
| 171 new VideoCaptureDevice::Names()); | 171 new VideoCaptureDevice::Names()); |
| 172 GetDeviceNames(device_names.get()); | 172 GetDeviceNames(device_names.get()); |
| 173 callback.Run(device_names.Pass()); | 173 callback.Run(device_names.Pass()); |
| 174 } else { | 174 } else { |
| 175 DVLOG(1) << "Enumerating video capture devices using QTKit"; | 175 DVLOG(1) << "Enumerating video capture devices using QTKit"; |
| 176 base::PostTaskAndReplyWithResult(ui_task_runner_, FROM_HERE, | 176 base::PostTaskAndReplyWithResult( |
| 177 ui_task_runner_.get(), |
| 178 FROM_HERE, |
| 177 base::Bind(&EnumerateDevicesUsingQTKit), | 179 base::Bind(&EnumerateDevicesUsingQTKit), |
| 178 base::Bind(&RunDevicesEnumeratedCallback, callback)); | 180 base::Bind(&RunDevicesEnumeratedCallback, callback)); |
| 179 } | 181 } |
| 180 } | 182 } |
| 181 | 183 |
| 182 void VideoCaptureDeviceFactoryMac::GetDeviceSupportedFormats( | 184 void VideoCaptureDeviceFactoryMac::GetDeviceSupportedFormats( |
| 183 const VideoCaptureDevice::Name& device, | 185 const VideoCaptureDevice::Name& device, |
| 184 VideoCaptureFormats* supported_formats) { | 186 VideoCaptureFormats* supported_formats) { |
| 185 DCHECK(thread_checker_.CalledOnValidThread()); | 187 DCHECK(thread_checker_.CalledOnValidThread()); |
| 186 if (device.capture_api_type() == VideoCaptureDevice::Name::AVFOUNDATION) { | 188 if (device.capture_api_type() == VideoCaptureDevice::Name::AVFOUNDATION) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 200 kBlacklistedCameras[i].capture_frame_rate, | 202 kBlacklistedCameras[i].capture_frame_rate, |
| 201 media::PIXEL_FORMAT_UYVY)); | 203 media::PIXEL_FORMAT_UYVY)); |
| 202 break; | 204 break; |
| 203 } | 205 } |
| 204 } | 206 } |
| 205 } | 207 } |
| 206 } | 208 } |
| 207 } | 209 } |
| 208 | 210 |
| 209 } // namespace media | 211 } // namespace media |
| OLD | NEW |