| 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 SetErrorState("Could not start capture device."); | 433 SetErrorState("Could not start capture device."); |
| 434 return; | 434 return; |
| 435 } | 435 } |
| 436 | 436 |
| 437 state_ = kCapturing; | 437 state_ = kCapturing; |
| 438 } | 438 } |
| 439 | 439 |
| 440 void VideoCaptureDeviceMac::StopAndDeAllocate() { | 440 void VideoCaptureDeviceMac::StopAndDeAllocate() { |
| 441 DCHECK(task_runner_->BelongsToCurrentThread()); | 441 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 442 DCHECK(state_ == kCapturing || state_ == kError) << state_; | 442 DCHECK(state_ == kCapturing || state_ == kError) << state_; |
| 443 [capture_device_ stopCapture]; | |
| 444 | 443 |
| 445 [capture_device_ setCaptureDevice:nil]; | 444 [capture_device_ setCaptureDevice:nil]; |
| 446 [capture_device_ setFrameReceiver:nil]; | 445 [capture_device_ setFrameReceiver:nil]; |
| 447 client_.reset(); | 446 client_.reset(); |
| 448 state_ = kIdle; | 447 state_ = kIdle; |
| 449 tried_to_square_pixels_ = false; | 448 tried_to_square_pixels_ = false; |
| 450 } | 449 } |
| 451 | 450 |
| 452 bool VideoCaptureDeviceMac::Init( | 451 bool VideoCaptureDeviceMac::Init( |
| 453 VideoCaptureDevice::Name::CaptureApiType capture_api_type) { | 452 VideoCaptureDevice::Name::CaptureApiType capture_api_type) { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() | 574 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() |
| 576 width:capture_format_.frame_size.width() | 575 width:capture_format_.frame_size.width() |
| 577 frameRate:capture_format_.frame_rate]) { | 576 frameRate:capture_format_.frame_rate]) { |
| 578 ReceiveError("Could not configure capture device."); | 577 ReceiveError("Could not configure capture device."); |
| 579 return false; | 578 return false; |
| 580 } | 579 } |
| 581 return true; | 580 return true; |
| 582 } | 581 } |
| 583 | 582 |
| 584 } // namespace media | 583 } // namespace media |
| OLD | NEW |