ObjC: Split out NV12 texture uploading into separate class
This CL splits out the code in RTCNV12Shader.mm for uploading byte
buffers to textures into its own class RTCNV12TextureCache. The purpose
is to prepare for allowing clients to inject their own shaders.
RTCNV12TextureCache will be used in the generic code, while the actual
shaders in RTCNV12Shader will be customizable by the client.
BUG=webrtc:7473
Review-Url: https://codereview.webrtc.org/2835203003
Cr-Commit-Position: refs/heads/master@{#17902}
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCNV12TextureCache.h b/webrtc/sdk/objc/Framework/Classes/RTCNV12TextureCache.h
new file mode 100644
index 0000000..0aa7a57
--- /dev/null
+++ b/webrtc/sdk/objc/Framework/Classes/RTCNV12TextureCache.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2017 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#import <GLKit/GLKit.h>
+
+@class RTCVideoFrame;
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface RTCNV12TextureCache : NSObject
+
+@property(nonatomic, readonly) GLuint yTexture;
+@property(nonatomic, readonly) GLuint uvTexture;
+
+- (nullable instancetype)initWithContext:(EAGLContext *)context;
+
+- (BOOL)uploadFrameToTextures:(RTCVideoFrame *)frame;
+
+- (void)releaseTextures;
+
+@end
+
+NS_ASSUME_NONNULL_END