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

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/RTCEAGLVideoView.m

Issue 2202823004: iOS: Add support for rendering native CVPixelBuffers directly (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Move guard. 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 | « webrtc/sdk/BUILD.gn ('k') | webrtc/sdk/objc/Framework/Classes/RTCI420Shader.mm » ('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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // These methods may be called on non-main thread. 203 // These methods may be called on non-main thread.
204 - (void)setSize:(CGSize)size { 204 - (void)setSize:(CGSize)size {
205 __weak RTCEAGLVideoView *weakSelf = self; 205 __weak RTCEAGLVideoView *weakSelf = self;
206 dispatch_async(dispatch_get_main_queue(), ^{ 206 dispatch_async(dispatch_get_main_queue(), ^{
207 RTCEAGLVideoView *strongSelf = weakSelf; 207 RTCEAGLVideoView *strongSelf = weakSelf;
208 [strongSelf.delegate videoView:strongSelf didChangeVideoSize:size]; 208 [strongSelf.delegate videoView:strongSelf didChangeVideoSize:size];
209 }); 209 });
210 } 210 }
211 211
212 - (void)renderFrame:(RTCVideoFrame *)frame { 212 - (void)renderFrame:(RTCVideoFrame *)frame {
213 #if !TARGET_OS_IPHONE
213 // Generate the i420 frame on video send thread instead of main thread. 214 // Generate the i420 frame on video send thread instead of main thread.
214 // TODO(tkchin): Remove this once RTCEAGLVideoView supports uploading 215 // TODO(tkchin): Remove this once RTCEAGLVideoView supports uploading
215 // CVPixelBuffer textures. 216 // CVPixelBuffer textures on OSX.
216 [frame convertBufferIfNeeded]; 217 [frame convertBufferIfNeeded];
218 #endif
217 self.videoFrame = frame; 219 self.videoFrame = frame;
218 } 220 }
219 221
220 #pragma mark - Private 222 #pragma mark - Private
221 223
222 - (void)displayLinkTimerDidFire { 224 - (void)displayLinkTimerDidFire {
223 // Don't render unless video frame have changed or the view content 225 // Don't render unless video frame have changed or the view content
224 // has explicitly been marked dirty. 226 // has explicitly been marked dirty.
225 if (!_isDirty && _glRenderer.lastDrawnFrame == self.videoFrame) { 227 if (!_isDirty && _glRenderer.lastDrawnFrame == self.videoFrame) {
226 return; 228 return;
(...skipping 27 matching lines...) Expand all
254 256
255 - (void)didBecomeActive { 257 - (void)didBecomeActive {
256 [self setupGL]; 258 [self setupGL];
257 } 259 }
258 260
259 - (void)willResignActive { 261 - (void)willResignActive {
260 [self teardownGL]; 262 [self teardownGL];
261 } 263 }
262 264
263 @end 265 @end
OLDNEW
« no previous file with comments | « webrtc/sdk/BUILD.gn ('k') | webrtc/sdk/objc/Framework/Classes/RTCI420Shader.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698