Android: Add helper class for generating OpenGL shaders

This CL adds a helper class GlShaderBuilder to build an instances of
RendererCommon.GlDrawer that can accept multiple input sources
(OES, RGB, or YUV) using a generic fragment shader as input.

Bug: webrtc:9355
Change-Id: I14a0a280d2b6f838984f7b60897cc0c58e2a948a
Reviewed-on: https://webrtc-review.googlesource.com/80940
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23622}
This commit is contained in:
Magnus Jedvert
2018-06-15 09:33:20 +02:00
committed by Commit Bot
parent 8643b78750
commit 65c61dcfce
7 changed files with 572 additions and 414 deletions

View File

@ -31,7 +31,12 @@ public class RendererCommon {
public void onFrameResolutionChanged(int videoWidth, int videoHeight, int rotation);
}
/** Interface for rendering frames on an EGLSurface. */
/**
* Interface for rendering frames on an EGLSurface with specified viewport location. Rotation,
* mirror, and cropping is specified using a 4x4 texture coordinate transform matrix. The frame
* input can either be an OES texture, RGB texture, or YUV textures in I420 format. The function
* release() must be called manually to free the resources held by this object.
*/
public static interface GlDrawer {
/**
* Functions for drawing frames with different sources. The rendering surface target is