| 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 <IOKit/IOCFPlugIn.h> | 7 #include <IOKit/IOCFPlugIn.h> |
| 8 #include <IOKit/usb/IOUSBLib.h> | 8 #include <IOKit/usb/IOUSBLib.h> |
| 9 #include <IOKit/usb/USBSpec.h> | 9 #include <IOKit/usb/USBSpec.h> |
| 10 | 10 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 &video_control_interface)) { | 299 &video_control_interface)) { |
| 300 return; | 300 return; |
| 301 } | 301 } |
| 302 base::mac::ScopedIOPluginInterface<IOCFPlugInInterface> | 302 base::mac::ScopedIOPluginInterface<IOCFPlugInInterface> |
| 303 plugin_interface_ref(video_control_interface); | 303 plugin_interface_ref(video_control_interface); |
| 304 | 304 |
| 305 SetAntiFlickerInVideoControlInterface(video_control_interface, frequency); | 305 SetAntiFlickerInVideoControlInterface(video_control_interface, frequency); |
| 306 } | 306 } |
| 307 } | 307 } |
| 308 | 308 |
| 309 // TODO(mcasas): Remove the following static methods when they are no longer | |
| 310 // referenced from VideoCaptureDeviceFactory, i.e. when all OS platforms have | |
| 311 // splitted the VideoCaptureDevice into VideoCaptureDevice and | |
| 312 // VideoCaptureDeviceFactory. | |
| 313 | |
| 314 // static | |
| 315 VideoCaptureDevice* VideoCaptureDevice::Create( | |
| 316 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | |
| 317 const Name& device_name) { | |
| 318 NOTREACHED(); | |
| 319 return NULL; | |
| 320 } | |
| 321 // static | |
| 322 void VideoCaptureDevice::GetDeviceNames(Names* device_names) { | |
| 323 NOTREACHED(); | |
| 324 } | |
| 325 | |
| 326 // static | |
| 327 void VideoCaptureDevice::GetDeviceSupportedFormats( | |
| 328 const Name& device, | |
| 329 VideoCaptureFormats* supported_formats) { | |
| 330 NOTREACHED(); | |
| 331 } | |
| 332 | |
| 333 const std::string VideoCaptureDevice::Name::GetModel() const { | 309 const std::string VideoCaptureDevice::Name::GetModel() const { |
| 334 // Both PID and VID are 4 characters. | 310 // Both PID and VID are 4 characters. |
| 335 if (unique_id_.size() < 2 * kVidPidSize) { | 311 if (unique_id_.size() < 2 * kVidPidSize) { |
| 336 return ""; | 312 return ""; |
| 337 } | 313 } |
| 338 | 314 |
| 339 // The last characters of device id is a concatenation of VID and then PID. | 315 // The last characters of device id is a concatenation of VID and then PID. |
| 340 const size_t vid_location = unique_id_.size() - 2 * kVidPidSize; | 316 const size_t vid_location = unique_id_.size() - 2 * kVidPidSize; |
| 341 std::string id_vendor = unique_id_.substr(vid_location, kVidPidSize); | 317 std::string id_vendor = unique_id_.substr(vid_location, kVidPidSize); |
| 342 const size_t pid_location = unique_id_.size() - kVidPidSize; | 318 const size_t pid_location = unique_id_.size() - kVidPidSize; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() | 550 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() |
| 575 width:capture_format_.frame_size.width() | 551 width:capture_format_.frame_size.width() |
| 576 frameRate:capture_format_.frame_rate]) { | 552 frameRate:capture_format_.frame_rate]) { |
| 577 ReceiveError("Could not configure capture device."); | 553 ReceiveError("Could not configure capture device."); |
| 578 return false; | 554 return false; |
| 579 } | 555 } |
| 580 return true; | 556 return true; |
| 581 } | 557 } |
| 582 | 558 |
| 583 } // namespace media | 559 } // namespace media |
| OLD | NEW |