OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 CVPixelBufferGetBytesPerRowOfPlane(videoFrame, kUVPlaneIndex); | 352 CVPixelBufferGetBytesPerRowOfPlane(videoFrame, kUVPlaneIndex); |
353 size_t uvPlaneHeight = | 353 size_t uvPlaneHeight = |
354 CVPixelBufferGetHeightOfPlane(videoFrame, kUVPlaneIndex); | 354 CVPixelBufferGetHeightOfPlane(videoFrame, kUVPlaneIndex); |
355 size_t frameSize = | 355 size_t frameSize = |
356 yPlaneBytesPerRow * yPlaneHeight + uvPlaneBytesPerRow * uvPlaneHeight; | 356 yPlaneBytesPerRow * yPlaneHeight + uvPlaneBytesPerRow * uvPlaneHeight; |
357 | 357 |
358 VideoCaptureCapability tempCaptureCapability; | 358 VideoCaptureCapability tempCaptureCapability; |
359 tempCaptureCapability.width = CVPixelBufferGetWidth(videoFrame); | 359 tempCaptureCapability.width = CVPixelBufferGetWidth(videoFrame); |
360 tempCaptureCapability.height = CVPixelBufferGetHeight(videoFrame); | 360 tempCaptureCapability.height = CVPixelBufferGetHeight(videoFrame); |
361 tempCaptureCapability.maxFPS = _capability.maxFPS; | 361 tempCaptureCapability.maxFPS = _capability.maxFPS; |
362 tempCaptureCapability.rawType = kVideoNV12; | 362 tempCaptureCapability.videoType = VideoType::kNV12; |
363 | 363 |
364 _owner->IncomingFrame(baseAddress, frameSize, tempCaptureCapability, 0); | 364 _owner->IncomingFrame(baseAddress, frameSize, tempCaptureCapability, 0); |
365 | 365 |
366 CVPixelBufferUnlockBaseAddress(videoFrame, kFlags); | 366 CVPixelBufferUnlockBaseAddress(videoFrame, kFlags); |
367 } | 367 } |
368 | 368 |
369 - (void)signalCaptureChangeEnd { | 369 - (void)signalCaptureChangeEnd { |
370 [_captureChangingCondition lock]; | 370 [_captureChangingCondition lock]; |
371 _captureChanging = NO; | 371 _captureChanging = NO; |
372 [_captureChangingCondition signal]; | 372 [_captureChangingCondition signal]; |
373 [_captureChangingCondition unlock]; | 373 [_captureChangingCondition unlock]; |
374 } | 374 } |
375 | 375 |
376 - (void)waitForCaptureChangeToFinish { | 376 - (void)waitForCaptureChangeToFinish { |
377 [_captureChangingCondition lock]; | 377 [_captureChangingCondition lock]; |
378 while (_captureChanging) { | 378 while (_captureChanging) { |
379 [_captureChangingCondition wait]; | 379 [_captureChangingCondition wait]; |
380 } | 380 } |
381 [_captureChangingCondition unlock]; | 381 [_captureChangingCondition unlock]; |
382 } | 382 } |
383 @end | 383 @end |
OLD | NEW |