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

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm

Issue 2226933005: remove unnecessary double allocation (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 _captureSession = captureSession; 400 _captureSession = captureSession;
401 return YES; 401 return YES;
402 } 402 }
403 403
404 - (AVCaptureVideoDataOutput *)videoDataOutput { 404 - (AVCaptureVideoDataOutput *)videoDataOutput {
405 if (!_videoDataOutput) { 405 if (!_videoDataOutput) {
406 // Make the capturer output NV12. Ideally we want I420 but that's not 406 // Make the capturer output NV12. Ideally we want I420 but that's not
407 // currently supported on iPhone / iPad. 407 // currently supported on iPhone / iPad.
408 AVCaptureVideoDataOutput *videoDataOutput = 408 AVCaptureVideoDataOutput *videoDataOutput =
409 [[AVCaptureVideoDataOutput alloc] init]; 409 [[AVCaptureVideoDataOutput alloc] init];
410 videoDataOutput = [[AVCaptureVideoDataOutput alloc] init];
411 videoDataOutput.videoSettings = @{ 410 videoDataOutput.videoSettings = @{
412 (NSString *)kCVPixelBufferPixelFormatTypeKey : 411 (NSString *)kCVPixelBufferPixelFormatTypeKey :
413 @(kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) 412 @(kCVPixelFormatType_420YpCbCr8BiPlanarFullRange)
414 }; 413 };
415 videoDataOutput.alwaysDiscardsLateVideoFrames = NO; 414 videoDataOutput.alwaysDiscardsLateVideoFrames = NO;
416 [videoDataOutput setSampleBufferDelegate:self queue:self.frameQueue]; 415 [videoDataOutput setSampleBufferDelegate:self queue:self.frameQueue];
417 _videoDataOutput = videoDataOutput; 416 _videoDataOutput = videoDataOutput;
418 } 417 }
419 return _videoDataOutput; 418 return _videoDataOutput;
420 } 419 }
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 } 717 }
719 718
720 OnFrame(cricket::WebRtcVideoFrame(buffer, webrtc::kVideoRotation_0, 719 OnFrame(cricket::WebRtcVideoFrame(buffer, webrtc::kVideoRotation_0,
721 translated_camera_time_us, 0), 720 translated_camera_time_us, 0),
722 captured_width, captured_height); 721 captured_width, captured_height);
723 722
724 CVBufferRelease(image_buffer); 723 CVBufferRelease(image_buffer);
725 } 724 }
726 725
727 } // namespace webrtc 726 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698