| 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/capture/video/mac/video_capture_device_mac.h" | 5 #include "media/capture/video/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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 // cameras are normally suspended so the configuration must happen right | 409 // cameras are normally suspended so the configuration must happen right |
| 410 // before starting capture and during configuration. | 410 // before starting capture and during configuration. |
| 411 const std::string& device_model = device_name_.GetModel(); | 411 const std::string& device_model = device_name_.GetModel(); |
| 412 if (device_model.length() > 2 * kVidPidSize) { | 412 if (device_model.length() > 2 * kVidPidSize) { |
| 413 std::string vendor_id = device_model.substr(0, kVidPidSize); | 413 std::string vendor_id = device_model.substr(0, kVidPidSize); |
| 414 std::string model_id = device_model.substr(kVidPidSize + 1); | 414 std::string model_id = device_model.substr(kVidPidSize + 1); |
| 415 int vendor_id_as_int, model_id_as_int; | 415 int vendor_id_as_int, model_id_as_int; |
| 416 if (base::HexStringToInt(base::StringPiece(vendor_id), &vendor_id_as_int) && | 416 if (base::HexStringToInt(base::StringPiece(vendor_id), &vendor_id_as_int) && |
| 417 base::HexStringToInt(base::StringPiece(model_id), &model_id_as_int)) { | 417 base::HexStringToInt(base::StringPiece(model_id), &model_id_as_int)) { |
| 418 SetAntiFlickerInUsbDevice(vendor_id_as_int, model_id_as_int, | 418 SetAntiFlickerInUsbDevice(vendor_id_as_int, model_id_as_int, |
| 419 GetPowerLineFrequency(params)); | 419 GetPowerLineFrequency(params).get()); |
| 420 } | 420 } |
| 421 } | 421 } |
| 422 | 422 |
| 423 if (![capture_device_ startCapture]) { | 423 if (![capture_device_ startCapture]) { |
| 424 SetErrorState("Could not start capture device."); | 424 SetErrorState("Could not start capture device."); |
| 425 return; | 425 return; |
| 426 } | 426 } |
| 427 | 427 |
| 428 state_ = kCapturing; | 428 state_ = kCapturing; |
| 429 } | 429 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() | 560 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() |
| 561 width:capture_format_.frame_size.width() | 561 width:capture_format_.frame_size.width() |
| 562 frameRate:capture_format_.frame_rate]) { | 562 frameRate:capture_format_.frame_rate]) { |
| 563 ReceiveError("Could not configure capture device."); | 563 ReceiveError("Could not configure capture device."); |
| 564 return false; | 564 return false; |
| 565 } | 565 } |
| 566 return true; | 566 return true; |
| 567 } | 567 } |
| 568 | 568 |
| 569 } // namespace media | 569 } // namespace media |
| OLD | NEW |