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

Side by Side Diff: webrtc/api/objc/RTCVideoFrame.mm

Issue 1885443002: Rename some cricket::VideoFrame methods, to align with webrtc::VideoFrame. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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 | « webrtc/api/java/jni/peerconnection_jni.cc ('k') | webrtc/media/base/fakevideorenderer.h » ('j') | 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 86
87 - (CVPixelBufferRef)nativeHandle { 87 - (CVPixelBufferRef)nativeHandle {
88 return static_cast<CVPixelBufferRef>(_videoFrame->GetNativeHandle()); 88 return static_cast<CVPixelBufferRef>(_videoFrame->GetNativeHandle());
89 } 89 }
90 90
91 - (void)convertBufferIfNeeded { 91 - (void)convertBufferIfNeeded {
92 if (!_i420Buffer) { 92 if (!_i420Buffer) {
93 if (_videoFrame->GetNativeHandle()) { 93 if (_videoFrame->GetNativeHandle()) {
94 // Convert to I420. 94 // Convert to I420.
95 _i420Buffer = _videoFrame->GetVideoFrameBuffer()->NativeToI420Buffer(); 95 _i420Buffer = _videoFrame->video_frame_buffer()->NativeToI420Buffer();
96 } else { 96 } else {
97 // Should already be I420. 97 // Should already be I420.
98 _i420Buffer = _videoFrame->GetVideoFrameBuffer(); 98 _i420Buffer = _videoFrame->video_frame_buffer();
99 } 99 }
100 } 100 }
101 } 101 }
102 102
103 #pragma mark - Private 103 #pragma mark - Private
104 104
105 - (instancetype)initWithNativeFrame:(const cricket::VideoFrame *)nativeFrame { 105 - (instancetype)initWithNativeFrame:(const cricket::VideoFrame *)nativeFrame {
106 if (self = [super init]) { 106 if (self = [super init]) {
107 // Keep a shallow copy of the video frame. The underlying frame buffer is 107 // Keep a shallow copy of the video frame. The underlying frame buffer is
108 // not copied. 108 // not copied.
109 _videoFrame.reset(nativeFrame->Copy()); 109 _videoFrame.reset(nativeFrame->Copy());
110 } 110 }
111 return self; 111 return self;
112 } 112 }
113 113
114 - (rtc::scoped_refptr<webrtc::VideoFrameBuffer>)i420Buffer { 114 - (rtc::scoped_refptr<webrtc::VideoFrameBuffer>)i420Buffer {
115 [self convertBufferIfNeeded]; 115 [self convertBufferIfNeeded];
116 return _i420Buffer; 116 return _i420Buffer;
117 } 117 }
118 118
119 @end 119 @end
OLDNEW
« no previous file with comments | « webrtc/api/java/jni/peerconnection_jni.cc ('k') | webrtc/media/base/fakevideorenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698