Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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 | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #import <Foundation/Foundation.h> | |
| 12 #if TARGET_OS_IPHONE | |
| 13 #import <GLKit/GLKit.h> | |
| 14 #else | |
| 15 #import <AppKit/NSOpenGL.h> | |
| 16 #endif | |
| 17 | |
| 18 NS_ASSUME_NONNULL_BEGIN | |
| 19 | |
| 20 @class RTCI420Frame; | |
| 21 | |
| 22 // RTCOpenGLVideoRenderer issues appropriate OpenGL commands to draw a frame to | |
| 23 // the currently bound framebuffer. Supports OpenGL 3.2 and OpenGLES 2.0. OpenGL | |
| 24 // framebuffer creation and management should be handled elsewhere using the | |
| 25 // same context used to initialize this class. | |
| 26 @interface RTCOpenGLVideoRenderer : NSObject | |
| 27 | |
| 28 // The last successfully drawn frame. Used to avoid drawing frames unnecessarily | |
| 29 // hence saving battery life by reducing load. | |
| 30 @property(nonatomic, readonly) RTCI420Frame *lastDrawnFrame; | |
| 31 | |
| 32 #if TARGET_OS_IPHONE | |
| 33 - (instancetype)initWithContext:(EAGLContext*)context NS_DESIGNATED_INITIALIZER; | |
|
tkchin_webrtc
2015/12/21 12:57:49
update *
hjon
2015/12/21 20:01:44
Done.
| |
| 34 #else | |
| 35 - (instancetype)initWithContext:(NSOpenGLContext*)context | |
| 36 NS_DESIGNATED_INITIALIZER; | |
| 37 #endif | |
| 38 | |
| 39 // Draws |frame| onto the currently bound OpenGL framebuffer. |setupGL| must be | |
| 40 // called before this function will succeed. | |
| 41 - (BOOL)drawFrame:(RTCI420Frame *)frame; | |
| 42 | |
| 43 // The following methods are used to manage OpenGL resources. On iOS | |
| 44 // applications should release resources when placed in background for use in | |
| 45 // the foreground application. In fact, attempting to call OpenGLES commands | |
| 46 // while in background will result in application termination. | |
| 47 | |
| 48 // Sets up the OpenGL state needed for rendering. | |
| 49 - (void)setupGL; | |
| 50 // Tears down the OpenGL state created by |setupGL|. | |
| 51 - (void)teardownGL; | |
| 52 | |
| 53 - (instancetype)init NS_UNAVAILABLE; | |
| 54 | |
| 55 @end | |
| 56 | |
| 57 NS_ASSUME_NONNULL_END | |
| OLD | NEW |