QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 CameraMarkerImageRender.java 源代码,内容仅作参考
package com.tencent.mtt.external.explorerone.newcamera.ar.render;
import android.content.Context;
import android.graphics.SurfaceTexture;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import com.tencent.common.threadpool.BrowserExecutorSupplier;
import com.tencent.mtt.external.explorerone.camera.data.ARMarkerInfo;
import com.tencent.mtt.external.explorerone.camera.utils.ARDataHelper;
import com.tencent.mtt.external.explorerone.newcamera.ar.gl.ITarResultHolder;
import com.tencent.mtt.external.explorerone.newcamera.ar.gl.data.ARMarkerResult;
import com.tencent.mtt.external.explorerone.newcamera.ar.gl.data.ARResult;
import com.tencent.mtt.external.explorerone.newcamera.ar.page.CameraMarkerPage;
import com.tencent.mtt.external.explorerone.newcamera.qbscansdk.ARExploreCameraBaseProvider;
import com.tencent.mtt.external.explorerone.newcamera.qbscansdk.ARExploreService;
import com.tencent.mtt.external.explorerone.newcamera.qbscansdk.export.IQBAREngineManagerService;
import com.tencent.mtt.external.market.AppMarket.ModuleType;
import com.tencent.mtt.qb2d.engine.QB2DEngine;
import com.tencent.mtt.qb2d.engine.node.QB2DImageView;
import com.tencent.tar.Config;
import com.tencent.tar.camera.ImageFrame;
import java.util.LinkedList;
import java.util.Queue;
import org.json.JSONObject;
public class CameraMarkerImageRender extends CameraMarkerBaseRenderer implements Handler.Callback, ARExploreService.IRefreshDataCallback {
Config e;
private int l;
private int m;
private int n;
private int o;
private ARExploreService t;
private ARExploreCameraBaseProvider u;
private Context x;
private ARMarkerInfo y;
private CameraMarkerPage z;
private Object h = new Object();
private GLImage i = null;
private QB2DImageView j = null;
private QB2DEngine k = null;
float[] f52117b = new float[16];
float[] f52118c = new float[16];
float[] f52119d = new float[16];
private float[] p = new float[16];
private boolean q = false;
private Queue<ARResult> r = new LinkedList();
private boolean s = false;
private boolean v = false;
private boolean w = false;
protected Handler f = new Handler(Looper.getMainLooper(), this);
protected Handler g = new Handler(BrowserExecutorSupplier.getLooperForRunLongTime(), this);
private int A = 100;
private long B = 0;
private long C = 0;
public CameraMarkerImageRender(Context context, CameraMarkerPage cameraMarkerPage, ARMarkerInfo aRMarkerInfo) {
this.y = aRMarkerInfo;
this.z = cameraMarkerPage;
a(context);
}
private void a(Context context) {
this.x = context;
this.i = new GLImageNv21(false);
this.t = ARExploreService.a(k());
this.t.a(this);
this.u = this.t.b();
this.e = new Config(context);
this.e.enableMarkerless();
this.e.setIntegerValue(516, 1);
this.e.setIntegerValue(513, 1);
this.e.enable(Config.ENABLE_LOGGER);
this.e.setIntegerValue(Config.SYSTEM_LOCK, 167910892);
this.e.enable(263);
this.e.enable(Config.ENABLE_KEY_FRAME_SIZE);
this.e.enable(Config.ENABLE_MAP_POINTS_SIZE);
this.e.enable(Config.ENABLE_TIME_CONSUME_LOG);
this.e.disable(Config.ENABLE_NATIVE_SOFT_IMU);
this.l = this.e.getIntegerValue(514);
this.m = this.e.getIntegerValue(515);
}
private void n() {
ARExploreService aRExploreService = this.t;
if (aRExploreService != null) {
aRExploreService.a(this.x, this.e);
}
}
@Override
public void a() {
}
@Override
public void a(int i) {
if (i != 0) {
this.s = false;
} else {
if (this.s) {
return;
}
this.s = true;
m();
}
this.f.sendEmptyMessage(ModuleType._ModuleType_Update);
}
@Override
public void a(int i, int i2, Object obj) {
k();
}
@Override
public void a(int i, byte[] bArr, String str, float[] fArr, float[] fArr2, int i2) {
if (i != this.A || bArr == null) {
return;
}
this.C = System.currentTimeMillis();
this.B = this.C;
ARResult.ARResultBuilder a2 = ARResult.ARResultBuilder.a();
ImageFrame.ImageFrameBuilder createBuilder = ImageFrame.createBuilder();
createBuilder.setFormat(3).setWidth(this.l).setHeight(this.m).setFrameId(i2).setData(bArr);
ARMarkerResult.ARResultBuilder a3 = ARMarkerResult.ARResultBuilder.a();
a3.a(createBuilder.build());
a3.b(0);
a3.a(fArr == null ? -1 : 0);
a3.a(fArr);
a3.b(fArr2);
a3.c(this.f52117b);
a2.a(a3.b());
a2.a(1);
synchronized (this.h) {
if (this.r.size() >= 5) {
this.r.poll();
}
this.r.offer(a2.b());
}
this.C = System.currentTimeMillis();
this.B = this.C;
}
@Override
public void a(ITarResultHolder iTarResultHolder) {
}
@Override
public void b() {
if (this.q) {
return;
}
this.q = true;
}
@Override
public void b(int i) {
k();
}
@Override
public void b(int i, int i2, Object obj) {
if (i != k()) {
return;
}
this.f.removeMessages(i2);
Message obtainMessage = this.f.obtainMessage(i2);
obtainMessage.obj = obj;
this.f.sendMessage(obtainMessage);
}
@Override
public void c() {
if (this.q) {
this.q = false;
ARExploreService aRExploreService = this.t;
if (aRExploreService != null) {
aRExploreService.m();
this.t.d("marker0");
this.t = null;
}
}
}
@Override
public void c(int i, int i2, Object obj) {
if (i != k()) {
return;
}
this.g.removeMessages(i2);
Message obtainMessage = this.g.obtainMessage(i2);
obtainMessage.what = i2;
this.g.sendMessage(obtainMessage);
}
@Override
public void d() {
this.q = false;
ARExploreService aRExploreService = this.t;
if (aRExploreService != null) {
aRExploreService.j();
this.t.b(this);
this.t = null;
}
if (this.v) {
this.v = false;
}
}
@Override
public void e() {
}
@Override
public void f() {
}
@Override
public void g() {
}
@Override
public boolean handleMessage(Message message) {
int i = message.what;
if (i == 1) {
ARExploreService aRExploreService = this.t;
if (aRExploreService != null) {
aRExploreService.b(1);
this.t.b(true);
this.t.d(false);
this.t.l();
this.t.a("marker0", "https://res.imtt.qq.com/camera/10-0.jpg");
}
} else if (i != 3 && i != 5) {
if (i == 7) {
ARExploreService aRExploreService2 = this.t;
if (aRExploreService2 != null) {
aRExploreService2.d("marker0");
}
} else if (i == 10000001) {
n();
l();
} else if (i != 33 && i == 34) {
this.z.b(false);
}
}
return false;
}
public int k() {
return this.A;
}
public void l() {
IQBAREngineManagerService f;
JSONObject a2;
ARExploreCameraBaseProvider aRExploreCameraBaseProvider = this.u;
if (aRExploreCameraBaseProvider == null || (f = aRExploreCameraBaseProvider.f()) == null || (a2 = f.a(1, this.n, this.o, 0.1f, 1000.0f)) == null) {
return;
}
ARDataHelper.a(this.f52117b, a2.optJSONArray("projectMatrix"));
}
protected void m() {
this.v = true;
}
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i, int i2) {
}
@Override
public void onSurfaceTextureSizeChanged(int i, int i2) {
}
}