Expose functionality to convert TextureBuffer to I420.

Bug: webrtc:8392
Change-Id: I79682efbef3aecbba904aa5047b229833fae25e8
Reviewed-on: https://webrtc-review.googlesource.com/8940
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20313}
This commit is contained in:
Sami Kalliomäki
2017-10-16 11:20:26 +02:00
committed by Commit Bot
parent 6bf43d2818
commit cb98b11b71
11 changed files with 227 additions and 95 deletions

View File

@ -11,6 +11,8 @@
package org.webrtc;
import android.graphics.Matrix;
import android.opengl.GLES11Ext;
import android.opengl.GLES20;
import java.nio.ByteBuffer;
/**
@ -88,7 +90,20 @@ public class VideoFrame {
* Interface for buffers that are stored as a single texture, either in OES or RGB format.
*/
public interface TextureBuffer extends Buffer {
enum Type { OES, RGB }
enum Type {
OES(GLES11Ext.GL_TEXTURE_EXTERNAL_OES),
RGB(GLES20.GL_TEXTURE_2D);
private final int glTarget;
private Type(final int glTarget) {
this.glTarget = glTarget;
}
public int getGlTarget() {
return glTarget;
}
}
Type getType();
int getTextureId();