Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Side by Side Diff: media/capture/video/mac/video_capture_device_mac.mm

Issue 1323093006: Change the media::PowerLineFrequency from an enum class to a proper class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass around PowerLineFrequency objects in VideoCaptureDevice instead of integers Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/capture/video/linux/video_capture_device_linux.cc ('k') | media/capture/video/video_capture_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698