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

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/Video/RTCShader.h

Issue 2869143002: iOS: Add interface for injecting custom shaders (Closed)
Patch Set: Rebase Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 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
11 #import <Foundation/Foundation.h> 11 #import "WebRTC/RTCVideoFrame.h"
12 12
13 #import "RTCOpenGLDefines.h" 13 RTC_EXTERN const char kRTCVertexShaderSource[];
14 14
15 @class RTCVideoFrame; 15 RTC_EXTERN GLuint RTCCreateShader(GLenum type, const GLchar *source);
16 16 RTC_EXTERN GLuint RTCCreateProgram(GLuint vertexShader, GLuint fragmentShader);
17 @protocol RTCShader <NSObject> 17 RTC_EXTERN GLuint RTCCreateProgramFromFragmentSource(const char fragmentShaderSo urce[]);
18 18 RTC_EXTERN BOOL RTCCreateVertexBuffer(GLuint* vertexBuffer,
19 - (BOOL)drawFrame:(RTCVideoFrame *)frame; 19 GLuint* vertexArray);
20 20 RTC_EXTERN void RTCSetVertexData(RTCVideoRotation rotation);
21 @end
22
23 // Shader for non-native I420 frames.
24 @interface RTCI420Shader : NSObject <RTCShader>
25
26 - (instancetype)init NS_UNAVAILABLE;
27 - (instancetype)initWithContext:(GlContextType *)context NS_DESIGNATED_INITIALIZ ER;
28 - (BOOL)drawFrame:(RTCVideoFrame *)frame;
29
30 @end
31
32 // Native CVPixelBufferRef rendering is only supported on iPhone because it
33 // depends on CVOpenGLESTextureCacheCreate.
34 #if TARGET_OS_IPHONE
35
36 // Shader for native NV12 frames.
37 @interface RTCNativeNV12Shader : NSObject <RTCShader>
38
39 - (instancetype)init NS_UNAVAILABLE;
40 - (instancetype)initWithContext:(GlContextType *)context NS_DESIGNATED_INITIALIZ ER;
41 - (BOOL)drawFrame:(RTCVideoFrame *)frame;
42
43 @end
44
45 #endif // TARGET_OS_IPHONE
OLDNEW
« no previous file with comments | « webrtc/sdk/objc/Framework/Classes/Video/RTCNativeNV12Shader.mm ('k') | webrtc/sdk/objc/Framework/Classes/Video/RTCShader.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698