discord-jadx/app/src/main/java/c/i/a/c/j2/o.java

94 lines
4.6 KiB
Java

package c.i.a.c.j2;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
import com.airbnb.lottie.parser.AnimatableValueParser;
import java.nio.Buffer;
import java.nio.FloatBuffer;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
/* compiled from: VideoDecoderGLFrameRenderer */
public class o implements GLSurfaceView.Renderer, r {
public static final float[] i = {1.164f, 1.164f, 1.164f, 0.0f, -0.392f, 2.017f, 1.596f, -0.813f, 0.0f};
public static final float[] j = {1.164f, 1.164f, 1.164f, 0.0f, -0.213f, 2.112f, 1.793f, -0.533f, 0.0f};
public static final float[] k = {1.168f, 1.168f, 1.168f, 0.0f, -0.188f, 2.148f, 1.683f, -0.652f, 0.0f};
public static final String[] l = {"y_tex", "u_tex", "v_tex"};
public static final FloatBuffer m = AnimatableValueParser.O(new float[]{-1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, -1.0f});
public final int[] n = new int[3];
public final AtomicReference<q> o = new AtomicReference<>();
public FloatBuffer[] p = new FloatBuffer[3];
public int q;
public int[] r = new int[3];
/* renamed from: s reason: collision with root package name */
public int f923s;
public int[] t = new int[3];
public int[] u = new int[3];
public q v;
public o(GLSurfaceView gLSurfaceView) {
for (int i2 = 0; i2 < 3; i2++) {
int[] iArr = this.t;
this.u[i2] = -1;
iArr[i2] = -1;
}
}
@Override // android.opengl.GLSurfaceView.Renderer
public void onDrawFrame(GL10 gl10) {
q andSet = this.o.getAndSet(null);
if (andSet != null || this.v != null) {
if (andSet != null) {
q qVar = this.v;
if (qVar != null) {
Objects.requireNonNull(qVar);
throw null;
}
this.v = andSet;
}
Objects.requireNonNull(this.v);
GLES20.glUniformMatrix3fv(this.f923s, 1, false, j, 0);
Objects.requireNonNull(null);
throw null;
}
}
@Override // android.opengl.GLSurfaceView.Renderer
public void onSurfaceChanged(GL10 gl10, int i2, int i3) {
GLES20.glViewport(0, 0, i2, i3);
}
@Override // android.opengl.GLSurfaceView.Renderer
public void onSurfaceCreated(GL10 gl10, EGLConfig eGLConfig) {
int K = AnimatableValueParser.K("varying vec2 interp_tc_y;\nvarying vec2 interp_tc_u;\nvarying vec2 interp_tc_v;\nattribute vec4 in_pos;\nattribute vec2 in_tc_y;\nattribute vec2 in_tc_u;\nattribute vec2 in_tc_v;\nvoid main() {\n gl_Position = in_pos;\n interp_tc_y = in_tc_y;\n interp_tc_u = in_tc_u;\n interp_tc_v = in_tc_v;\n}\n", "precision mediump float;\nvarying vec2 interp_tc_y;\nvarying vec2 interp_tc_u;\nvarying vec2 interp_tc_v;\nuniform sampler2D y_tex;\nuniform sampler2D u_tex;\nuniform sampler2D v_tex;\nuniform mat3 mColorConversion;\nvoid main() {\n vec3 yuv;\n yuv.x = texture2D(y_tex, interp_tc_y).r - 0.0625;\n yuv.y = texture2D(u_tex, interp_tc_u).r - 0.5;\n yuv.z = texture2D(v_tex, interp_tc_v).r - 0.5;\n gl_FragColor = vec4(mColorConversion * yuv, 1.0);\n}\n");
this.q = K;
GLES20.glUseProgram(K);
int glGetAttribLocation = GLES20.glGetAttribLocation(this.q, "in_pos");
GLES20.glEnableVertexAttribArray(glGetAttribLocation);
GLES20.glVertexAttribPointer(glGetAttribLocation, 2, 5126, false, 0, (Buffer) m);
this.r[0] = GLES20.glGetAttribLocation(this.q, "in_tc_y");
GLES20.glEnableVertexAttribArray(this.r[0]);
this.r[1] = GLES20.glGetAttribLocation(this.q, "in_tc_u");
GLES20.glEnableVertexAttribArray(this.r[1]);
this.r[2] = GLES20.glGetAttribLocation(this.q, "in_tc_v");
GLES20.glEnableVertexAttribArray(this.r[2]);
AnimatableValueParser.r();
this.f923s = GLES20.glGetUniformLocation(this.q, "mColorConversion");
AnimatableValueParser.r();
GLES20.glGenTextures(3, this.n, 0);
for (int i2 = 0; i2 < 3; i2++) {
GLES20.glUniform1i(GLES20.glGetUniformLocation(this.q, l[i2]), i2);
GLES20.glActiveTexture(33984 + i2);
GLES20.glBindTexture(3553, this.n[i2]);
GLES20.glTexParameterf(3553, 10241, 9729.0f);
GLES20.glTexParameterf(3553, 10240, 9729.0f);
GLES20.glTexParameterf(3553, 10242, 33071.0f);
GLES20.glTexParameterf(3553, 10243, 33071.0f);
}
AnimatableValueParser.r();
AnimatableValueParser.r();
}
}