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 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 GetPowerLineFrequency(params)); | 353 GetPowerLineFrequency(params)); |
354 } | 354 } |
355 } | 355 } |
356 | 356 |
357 if (![capture_device_ startCapture]) { | 357 if (![capture_device_ startCapture]) { |
358 SetErrorState(FROM_HERE, "Could not start capture device."); | 358 SetErrorState(FROM_HERE, "Could not start capture device."); |
359 return; | 359 return; |
360 } | 360 } |
361 | 361 |
362 state_ = kCapturing; | 362 state_ = kCapturing; |
| 363 client_->OnStarted(); |
363 } | 364 } |
364 | 365 |
365 void VideoCaptureDeviceMac::StopAndDeAllocate() { | 366 void VideoCaptureDeviceMac::StopAndDeAllocate() { |
366 DCHECK(task_runner_->BelongsToCurrentThread()); | 367 DCHECK(task_runner_->BelongsToCurrentThread()); |
367 DCHECK(state_ == kCapturing || state_ == kError) << state_; | 368 DCHECK(state_ == kCapturing || state_ == kError) << state_; |
368 | 369 |
369 [capture_device_ setCaptureDevice:nil]; | 370 [capture_device_ setCaptureDevice:nil]; |
370 [capture_device_ setFrameReceiver:nil]; | 371 [capture_device_ setFrameReceiver:nil]; |
371 client_.reset(); | 372 client_.reset(); |
372 state_ = kIdle; | 373 state_ = kIdle; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() | 489 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() |
489 width:capture_format_.frame_size.width() | 490 width:capture_format_.frame_size.width() |
490 frameRate:capture_format_.frame_rate]) { | 491 frameRate:capture_format_.frame_rate]) { |
491 ReceiveError(FROM_HERE, "Could not configure capture device."); | 492 ReceiveError(FROM_HERE, "Could not configure capture device."); |
492 return false; | 493 return false; |
493 } | 494 } |
494 return true; | 495 return true; |
495 } | 496 } |
496 | 497 |
497 } // namespace media | 498 } // namespace media |
OLD | NEW |