package v30; import android.opengl.GLES20; import java.nio.Buffer; import lh4.h; import x30.b; import z30.c; public final class a extends b { /* renamed from: m reason: collision with root package name */ public int f322798m; /* renamed from: n reason: collision with root package name */ public int f322799n; /* renamed from: o reason: collision with root package name */ public int f322800o; /* renamed from: p reason: collision with root package name */ public int f322801p; /* renamed from: q reason: collision with root package name */ public int f322802q; /* renamed from: r reason: collision with root package name */ public int f322803r; /* renamed from: s reason: collision with root package name */ public int f322804s; /* renamed from: t reason: collision with root package name */ public b.a f322805t; /* renamed from: u reason: collision with root package name */ public int f322806u; /* JADX WARNING: Illegal instructions before constructor call */ public a(int i15, int i16, int i17, int i18, int i19, int i25, h hVar) { super(i15, i16, r3, r4, r5); int i26; int i27; int i28; if ((i25 & 4) != 0) { i26 = i15; } else { i26 = i17; } if ((i25 & 8) != 0) { i27 = i16; } else { i27 = i18; } if ((i25 & 16) != 0) { i28 = 1; } else { i28 = i19; } this.f322806u = -1; int e15 = z30.a.f350453a.e("\n attribute vec4 a_position;\n attribute vec2 a_texCoord;\n varying vec2 v_texCoord;\n uniform mat4 uMatrix;\n void main() {\n gl_Position = uMatrix * a_position;\n v_texCoord = a_texCoord;\n }\n ", "\n #ifdef GL_ES\n precision highp float;\n #endif\n\n varying vec2 v_texCoord;\n uniform sampler2D y_texture;\n uniform sampler2D u_texture;\n uniform sampler2D v_texture;\n\n void main () {\n float r, g, b, y, u, v;\n\n //We had put the Y values of each pixel to the R,G,B components by GL_LUMINANCE,\n //that's why we're pulling it from the R component, we could also use G or B\n y = texture2D(y_texture, v_texCoord).r;\n\n //We had put the U and V values of each pixel to the A and R,G,B components of the\n //texture respectively using GL_LUMINANCE_ALPHA. Since U,V bytes are interspread\n //in the texture, this is probably the fastest way to use them in the shader\n //GL_LUMINANCE_ALPHA is a luminance/alpha pair, so r correspond to v, and\n //a correspond to u\n //NV21 is a VUVU pair\n v = texture2D(v_texture, v_texCoord).r;\n u = texture2D(u_texture, v_texCoord).r;\n u = u - 0.5;\n v = v - 0.5;\n\n //The numbers are just YUV to RGB conversion constants\n //https://en.wikipedia.org/wiki/YUV#Y.E2.80.B2UV420sp_.28NV21.29_to_RGB_conversion_.28Android.29\n r = y + 1.370705 * v;\n g = y - 0.337633 * u - 0.698001 * v;\n b = y + 1.732446 * u;\n\n //We finally set the RGB color of our pixel\n gl_FragColor = vec4(r, g, b, 1.0);\n }\n "); this.f322798m = e15; if (e15 == 0) { b40.b.f10473a.e("MicroMsg.MTR.GLRenderProcI420ToRgb", "checkInit, load program failed!", new Object[0]); } this.f322800o = GLES20.glGetAttribLocation(this.f322798m, "a_position"); this.f322799n = GLES20.glGetAttribLocation(this.f322798m, "a_texCoord"); this.f322801p = GLES20.glGetUniformLocation(this.f322798m, "y_texture"); this.f322802q = GLES20.glGetUniformLocation(this.f322798m, "u_texture"); this.f322803r = GLES20.glGetUniformLocation(this.f322798m, "v_texture"); this.f322804s = GLES20.glGetUniformLocation(this.f322798m, "uMatrix"); } @Override // v30.b public void a() { super.a(); GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); } /* JADX WARNING: Removed duplicated region for block: B:18:0x0041 */ /* JADX WARNING: Removed duplicated region for block: B:26:0x005f */ /* JADX WARNING: Removed duplicated region for block: B:29:0x0071 */ /* JADX WARNING: Removed duplicated region for block: B:33:0x007b */ @Override // v30.b public void c() { c cVar; c cVar2; GLES20.glClear(16640); GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); int i15 = this.f322798m; if (i15 != 0 && this.f322809c > 0 && this.f322810d > 0) { GLES20.glUseProgram(i15); b.a aVar = this.f322805t; if (aVar != null) { GLES20.glActiveTexture(33984); int i16 = this.f322806u; c cVar3 = null; if (i16 >= 0) { GLES20.glBindTexture(3553, i16); } else { if (aVar.f336703d) { b.C6046b bVar = aVar.f336700a; if (bVar.f336706b) { cVar2 = bVar.f336705a; if (cVar2 != null) { cVar2.A0(); } } } cVar2 = null; if (cVar2 != null) { } } GLES20.glUniform1i(this.f322801p, 0); GLES20.glActiveTexture(33985); if (aVar.f336703d) { b.C6046b bVar2 = aVar.f336701b; if (bVar2.f336706b) { cVar = bVar2.f336705a; if (cVar != null) { cVar.A0(); } GLES20.glUniform1i(this.f322802q, 1); GLES20.glActiveTexture(33986); if (aVar.f336703d) { b.C6046b bVar3 = aVar.f336702c; if (bVar3.f336706b) { cVar3 = bVar3.f336705a; } } if (cVar3 != null) { cVar3.A0(); } GLES20.glUniform1i(this.f322803r, 2); } } cVar = null; if (cVar != null) { } GLES20.glUniform1i(this.f322802q, 1); GLES20.glActiveTexture(33986); if (aVar.f336703d) { } if (cVar3 != null) { } GLES20.glUniform1i(this.f322803r, 2); } GLES20.glUniformMatrix4fv(this.f322804s, 1, false, this.f322814h, 0); this.f322813g.position(0); GLES20.glVertexAttribPointer(this.f322800o, 2, 5126, false, 0, (Buffer) this.f322813g); GLES20.glEnableVertexAttribArray(this.f322800o); this.f322812f.position(0); GLES20.glVertexAttribPointer(this.f322799n, 2, 5126, false, 0, (Buffer) this.f322812f); GLES20.glEnableVertexAttribArray(this.f322799n); GLES20.glDrawArrays(5, 0, 4); GLES20.glDisableVertexAttribArray(this.f322800o); GLES20.glDisableVertexAttribArray(this.f322799n); GLES20.glBindTexture(3553, 0); } } }