| 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 #import "media/video/capture/mac/video_capture_device_qtkit_mac.h" | 5 #import "media/video/capture/mac/video_capture_device_qtkit_mac.h" |
| 6 | 6 |
| 7 #import <QTKit/QTKit.h> | 7 #import <QTKit/QTKit.h> |
| 8 | 8 |
| 9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 expectedBytesPerRow); | 259 expectedBytesPerRow); |
| 260 } | 260 } |
| 261 | 261 |
| 262 addressToPass = adjustedAddress; | 262 addressToPass = adjustedAddress; |
| 263 frameSize = frameHeight * expectedBytesPerRow; | 263 frameSize = frameHeight * expectedBytesPerRow; |
| 264 } | 264 } |
| 265 media::VideoCaptureCapability captureCapability; | 265 media::VideoCaptureCapability captureCapability; |
| 266 captureCapability.width = frameWidth_; | 266 captureCapability.width = frameWidth_; |
| 267 captureCapability.height = frameHeight_; | 267 captureCapability.height = frameHeight_; |
| 268 captureCapability.frame_rate = frameRate_; | 268 captureCapability.frame_rate = frameRate_; |
| 269 captureCapability.color = media::VideoCaptureCapability::kARGB; | 269 captureCapability.color = media::kARGB; |
| 270 captureCapability.expected_capture_delay = 0; | 270 captureCapability.expected_capture_delay = 0; |
| 271 captureCapability.interlaced = false; | 271 captureCapability.interlaced = false; |
| 272 | 272 |
| 273 // Deliver the captured video frame. | 273 // Deliver the captured video frame. |
| 274 frameReceiver_->ReceiveFrame(addressToPass, frameSize, captureCapability); | 274 frameReceiver_->ReceiveFrame(addressToPass, frameSize, captureCapability); |
| 275 | 275 |
| 276 CVPixelBufferUnlockBaseAddress(videoFrame, kLockFlags); | 276 CVPixelBufferUnlockBaseAddress(videoFrame, kLockFlags); |
| 277 } | 277 } |
| 278 [lock_ unlock]; | 278 [lock_ unlock]; |
| 279 } | 279 } |
| 280 | 280 |
| 281 - (void)handleNotification:(NSNotification *)errorNotification { | 281 - (void)handleNotification:(NSNotification *)errorNotification { |
| 282 NSError * error = (NSError *)[[errorNotification userInfo] | 282 NSError * error = (NSError *)[[errorNotification userInfo] |
| 283 objectForKey:QTCaptureSessionErrorKey]; | 283 objectForKey:QTCaptureSessionErrorKey]; |
| 284 frameReceiver_->ReceiveError([[error localizedDescription] UTF8String]); | 284 frameReceiver_->ReceiveError([[error localizedDescription] UTF8String]); |
| 285 } | 285 } |
| 286 | 286 |
| 287 @end | 287 @end |
| OLD | NEW |