APLICACIONES DE REALIDAD AUMENTADA PARA EL …

216
APLICACIONES DE REALIDAD AUMENTADA PARA EL APRENDIZAJE DE PATRONES EDUCATIVOS” (MANUAL DE SISTEMA) Por: Edison Alfredo Arrieta Montañez Sebastian Camilo Montañez Caicedo UNIVERSIDAD COOPERATIVA DE COLOMBIA SEDE BOGOTA FACULTAD DE INGENIERIA Programa INGENIERIA DE SISTEMAS BOGOTA D.C 2018

Transcript of APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Page 1: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

“APLICACIONES DE REALIDAD AUMENTADA PARA EL APRENDIZAJE

DE PATRONES EDUCATIVOS”

(MANUAL DE SISTEMA)

Por:

Edison Alfredo Arrieta Montañez

Sebastian Camilo Montañez Caicedo

UNIVERSIDAD COOPERATIVA DE COLOMBIA

SEDE BOGOTA

FACULTAD DE INGENIERIA

Programa INGENIERIA DE SISTEMAS

BOGOTA D.C

2018

Page 2: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

“APLICACIONES DE REALIDAD AUMENTADA PARA EL APRENDIZAJE

DE PATRONES EDUCATIVOS”

(MANUAL DE SISTEMA)

Por:

Edison Alfredo Arrieta Montañez

Sebastian Camilo Montañez Caicedo

Instructores:

Jaime Alberto Páez

Jairo augusto Cortez

UNIVERSIDAD COOPERATIVA DE COLOMBIA

SEDE BOGOTA

FACULTAD DE INGENIERIA

Programa INGENIERIA DE SISTEMAS

BOGOTA D.C

2018

Page 3: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Contenido

Introducción .................................................................................................. 4

Objetivos........................................................................................................ 5

Objetivo general......................................................................................... 5

Objetivos específicos del manual ............................................................ 5

Alcances y requerimientos .......................................................................... 6

Alcances ..................................................................................................... 6

Requerimientos.......................................................................................... 6

Planeación ..................................................................................................... 7

herramientas utilizadas y sus versiones ............................................... 11

Código fuente general del desarrollo de las aplicaciones ...................... 12

Page 4: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Introducción

En este proyecto se pretende agilizar el método de aprendizaje de los patrones

educativos colaborativos por medio de una aplicación móvil, que permite al

usuario observar con ejemplo en 3D el modelo del patrón para que su

aprendizaje sea de manera ágil y personal aprovechando los dispositivos

móviles que cada persona tiene uno. Este proyecto deriva de un proyecto

mayor llamado desarrollo de portafolios electrónicos para la evaluación del

aprendizaje por competencias en entornos virtuales. Además, se busca la

compresión a detalle de cómo se llevó a cabo el desarrollo de las aplicaciones

y con qué herramientas se implementó la realidad aumentada en el proyecto.

Page 5: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Objetivos

Objetivo general

Desarrollar aplicaciones para dispositivos móviles con tecnología Android en

realidad aumentada que permita a los usuarios el aprendizaje de los

patrones educativos colaborativos

Objetivos específicos del manual

• Conocer el planeamiento del desarrollo de las aplicaciones.

• Analizar y conocer la implementación de la realidad aumentada en el

desarrollo de una aplicación para sistema Android.

• Conocer los requerimientos específicos y limitaciones que tienen las

aplicaciones desarrolladas.

• Tener en cuenta las recomendaciones para tener un uso óptimo de cada

aplicación.

Page 6: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Alcances y requerimientos

Alcances

Las aplicaciones estarán al alcance de los usuarios que ingresen en la

plataforma Moodle de patrones educativos realizada por estudiantes de

la universidad cooperativa de Colombia.

Todas las personas que tengan un dispositivo móvil con sistema

Android desde la versión jelly vean (4.1) podrán usarla.

Requerimientos

Diseñar como se llevarán acbao los patrones educativos a la realidad

aumentada

Usar unity con la herramienta vuforia para realidad aumentada.

Desarrollar las aplicaciones para las siguientes versiones del Sistema

android

o Android

Jelly Bean 4.1- 4.3

KitKat 4.4 – 4.1w2

Lollipop 5.0–5.1.1

Marshmallow 6.0–6.1

Nougat 7.0 - 7.1.2

Oreo 8.0

El producto debe permanecer utilizable en cualquier momento que se

solicite

La información no debe ser manipulada por terceros

Los actores del programa son

o Jaime Paez – product Owner

o Jairo Cortez – Product owner

Page 7: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Planeación

El desarrollo del proyecto empezó teniendo claro como plantearíamos cada

patrón educativo-colaborativo en realidad aumentada. Después de tener eso

establecido seleccionamos las herramientas que usaríamos para realizar los

patrones en realidad aumentada.

Primero que todo tenemos que dirigirnos a la página de unity y descargarlo

(https://store.unity.com/es) y llevar acabo su respectiva instalación, después

de tener unity instalado nos dirigimos a la página de herramienta de desarrollo

vuforia (https://developer.vuforia.com/). La cual es un kit de desarrollo de

software de realidad aumentada para dispositivos móviles que permite la

creación de aplicaciones en realidad aumentada y realizamos el registro para

poder empezar el desarrollo.

Luego de esto en la página de vuforia creamos una llave de licencia por cada

aplicación que vamos a crear como se muestra a continuación.

imagen No.1

Page 8: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

imagen No.2

Como ya tenemos la licencia de vuforia por cada aplicación que

desarrollaremos, ahora nos dirigimos a establecer un marcador para cada una

de las aplicaciones que desarrollaremos y procedemos descargar el paquete

de instalación que nos genera vuforia para que la aplicación sincronice que

marcador usara para ser ejecutado (en la siguiente imagen indicaremos donde

se hace este proceso).

Page 9: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

imagen No.3

Procedemos con el desarrollo de cada aplicación creando un nuevo proyecto

en unity y después instalamos el kit de herramientas de vuforia (SDK) que se

puede descargar en su pagina (https://developer.vuforia.com/downloads/sdk)

y después instalaremos el paquete en cada aplicación que crearemos , el

marcador que hicimos anteriormente.

Page 10: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Además, tendremos que copiar el código llave que mostramso anteriormente

en la imagen No.2 y pegar dicho código en el recuadro correspondiente y

habilitar la apcion de realdiad virtual como se muestra en la imagen No.4.

Ahora empezamos a desarrollar la aplicación de realidad aumentada

insertando la figura en 3D que necesitamos, que podemos obtener en la tienda

de unity (https://assetstore.unity.com/categories/3d) o podemos crearla con

las herramientas que posee el sistema operativo Windows 10 que son el Paint

3D y el 3D builder, ya que las podemos exportar e insertarla en nuestro

desarrollo en unity.

Finalmente cuando ya hemos terminado todo este proceso y queremos

generar nuestro instalador (APK), y para eso necesitamos instalar Android

studio (https://developer.android.com/studio/) , después en unity vamos a la

opción de generar APK y escogemos desde que versión de Android se puede

ejecutar y habilitamos sus permisos para que el usuario lo instala y ejecute sin

problemas y por último la generamos y ya será usable. Como se muesta en

las siguientes imágenes.

Page 11: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

herramientas utilizadas y sus versiones

Unity 2018.2.6 (https://store.unity.com/es/download?ref=personal)

vuforia-sdk-android-7-2-23.zip

(https://developer.vuforia.com/downloads/sdk)

android studio 3.1.4 for Windows 64-bit

(https://developer.android.com/studio/)

paint 3D 1.1702.28017.0

3D builder 13.0.10349.0

Page 12: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Código fuente general del desarrollo de las aplicaciones

El código fuente que veremos acontinuacion es el código generar de cada una

de las seis aplicaciones, a razón de que solo insertamos figuras en 3D a las

aplicaciones por consiguiente este código nos muestra la configuraicon de

cámara que maneja unity para su ejecución y su manejo de figuras 3D, además

de estar implícito su configuraicon con vuforia.

Buildconfig.java

package com.vuforia.ar.pl; public final class BuildConfig { public static final String APPLICATION_ID = "com.vuforia.ar.pl"; public static final String BUILD_TYPE = "release"; public static final boolean DEBUG = false; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = "1.0"; } /* Location: * Qualified Name: com.vuforia.ar.pl.BuildConfig * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */

Camera1_Preview$1.java

package com.vuforia.ar.pl; import android.hardware.Camera; import android.hardware.Camera.AutoFocusCallback; import java.util.HashMap; class Camera1_Preview$1 implements Camera.AutoFocusCallback { Camera1_Preview$1(Camera1_Preview paramCamera1_Preview) {} public void onAutoFocus(boolean paramBoolean, Camera paramCamera) {

Page 13: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramCamera = Camera1_Preview.access$000(this$0).get(paramCamera); if (paramCamera == null) {} do { return; int i = ((Integer)paramCamera).intValue(); paramCamera = Camera1_Preview.access$100(this$0, i); } while (paramCamera == null); isAutoFocusing = false; } } /* Location: * Qualified Name: com.vuforia.ar.pl.Camera1_Preview.1 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */

Camera1_Preview$CameraCacheInfo.java

package com.vuforia.ar.pl; import android.graphics.SurfaceTexture; import android.hardware.Camera; public class Camera1_Preview$CameraCacheInfo { byte[][] buffer; int bufferFormatPL; int bufferHeight; int bufferSize; int bufferWidth; Camera camera; int[] caps; long deviceHandle; int deviceID; boolean isAutoFocusing; boolean isHalDriven; int overrideFormatAndroid; int overrideHeight; int overrideWidth; int requestFormatAndroid; int requestHeight;

Page 14: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

int requestWidth; int status; CameraSurface surface; SurfaceTexture surfaceTexture; public Camera1_Preview$CameraCacheInfo(Camera1_Preview paramCamera1_Preview) {} } /* Location: * Qualified Name: com.vuforia.ar.pl.Camera1_Preview.CameraCacheInfo * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */

Camera1_Preview.java

package com.vuforia.ar.pl; import android.app.Activity; import android.content.pm.PackageManager; import android.graphics.PixelFormat; import android.graphics.Rect; import android.graphics.SurfaceTexture; import android.hardware.Camera; import android.hardware.Camera.Area; import android.hardware.Camera.AutoFocusCallback; import android.hardware.Camera.CameraInfo; import android.hardware.Camera.Parameters; import android.hardware.Camera.PreviewCallback; import android.hardware.Camera.Size; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.Vector; import org.json.JSONException; import org.json.JSONObject; public class Camera1_Preview implements Camera.PreviewCallback {

Page 15: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private static final int AR_CAMERA_DIRECTION_BACK = 268443665; private static final int AR_CAMERA_DIRECTION_FRONT = 268443666; private static final int AR_CAMERA_DIRECTION_UNKNOWN = 268443664; private static final int AR_CAMERA_EXPOSUREMODE_AUTO = 805314560; private static final int AR_CAMERA_EXPOSUREMODE_CONTINUOUSAUTO = 805322752; private static final int AR_CAMERA_EXPOSUREMODE_LOCKED = 805310464; private static final int AR_CAMERA_FOCUSMODE_AUTO = 805306400; private static final int AR_CAMERA_FOCUSMODE_CONTINUOUSAUTO = 805306432; private static final int AR_CAMERA_FOCUSMODE_FIXED = 805306880; private static final int AR_CAMERA_FOCUSMODE_INFINITY = 805306624; private static final int AR_CAMERA_FOCUSMODE_MACRO = 805306496; private static final int AR_CAMERA_FOCUSMODE_NORMAL = 805306384; private static final int AR_CAMERA_IMAGE_FORMAT_ARGB32 = 268439813; private static final int AR_CAMERA_IMAGE_FORMAT_ARGB8888 = 268439813; private static final int AR_CAMERA_IMAGE_FORMAT_BGR24 = 268439822; private static final int AR_CAMERA_IMAGE_FORMAT_BGR888 = 268439822; private static final int AR_CAMERA_IMAGE_FORMAT_BGRA32 = 268439814; private static final int AR_CAMERA_IMAGE_FORMAT_BGRA8888 = 268439814; private static final int AR_CAMERA_IMAGE_FORMAT_LUM = 268439809; private static final int AR_CAMERA_IMAGE_FORMAT_NV12 = 268439815; private static final int AR_CAMERA_IMAGE_FORMAT_NV16 = 268439816; private static final int AR_CAMERA_IMAGE_FORMAT_NV21 = 268439817; private static final int AR_CAMERA_IMAGE_FORMAT_RGB24 = 268439811; private static final int AR_CAMERA_IMAGE_FORMAT_RGB565 = 268439810; private static final int AR_CAMERA_IMAGE_FORMAT_RGB888 = 268439811; private static final int AR_CAMERA_IMAGE_FORMAT_RGBA32 = 268439812; private static final int AR_CAMERA_IMAGE_FORMAT_RGBA4444 = 268439821; private static final int AR_CAMERA_IMAGE_FORMAT_RGBA5551 = 268439820;

Page 16: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private static final int AR_CAMERA_IMAGE_FORMAT_RGBA8888 = 268439812; private static final int AR_CAMERA_IMAGE_FORMAT_UNKNOWN = 268439808; private static final int AR_CAMERA_IMAGE_FORMAT_YV12 = 268439818; private static final int AR_CAMERA_IMAGE_FORMAT_YV16 = 268439819; private static final int AR_CAMERA_PARAMTYPE_BASE = 536870912; private static final int AR_CAMERA_PARAMTYPE_BRIGHTNESSRANGE = 537133056; private static final int AR_CAMERA_PARAMTYPE_BRIGHTNESSVALUE = 537001984; private static final int AR_CAMERA_PARAMTYPE_CONTRASTRANGE = 537919488; private static final int AR_CAMERA_PARAMTYPE_CONTRASTVALUE = 537395200; private static final int AR_CAMERA_PARAMTYPE_EXPOSUREMODE = 536870944; private static final int AR_CAMERA_PARAMTYPE_EXPOSURETIME = 536871168; private static final int AR_CAMERA_PARAMTYPE_EXPOSURETIMERANGE = 536871424; private static final int AR_CAMERA_PARAMTYPE_EXPOSUREVALUE = 536871936; private static final int AR_CAMERA_PARAMTYPE_EXPOSUREVALUERANGE = 536872960; private static final int AR_CAMERA_PARAMTYPE_FOCUSMODE = 536870914; private static final int AR_CAMERA_PARAMTYPE_FOCUSRANGE = 536870920; private static final int AR_CAMERA_PARAMTYPE_FOCUSREGION = 536870928; private static final int AR_CAMERA_PARAMTYPE_FOCUSVALUE = 536870916; private static final int AR_CAMERA_PARAMTYPE_ISO = 536870976; private static final int AR_CAMERA_PARAMTYPE_ISORANGE = 536871040; private static final int AR_CAMERA_PARAMTYPE_LENS_IS_ADJUSTING = 545259520; private static final int AR_CAMERA_PARAMTYPE_RECORDING_HINT = 541065216; private static final int AR_CAMERA_PARAMTYPE_ROTATION = 538968064; private static final int AR_CAMERA_PARAMTYPE_TORCHMODE = 536870913;

Page 17: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private static final int AR_CAMERA_PARAMTYPE_VIDEO_STABILIZATION = 553648128; private static final int AR_CAMERA_PARAMTYPE_WHITEBALANCEMODE = 536875008; private static final int AR_CAMERA_PARAMTYPE_WHITEBALANCERANGE = 536887296; private static final int AR_CAMERA_PARAMTYPE_WHITEBALANCEVALUE = 536879104; private static final int AR_CAMERA_PARAMTYPE_ZOOMRANGE = 536936448; private static final int AR_CAMERA_PARAMTYPE_ZOOMVALUE = 536903680; private static final int AR_CAMERA_PARAMVALUE_BASE = 805306368; private static final int AR_CAMERA_STATUS_CAPTURE_RUNNING = 268443651; private static final int AR_CAMERA_STATUS_OPENED = 268443650; private static final int AR_CAMERA_STATUS_UNINITIALIZED = 268443649; private static final int AR_CAMERA_STATUS_UNKNOWN = 268443648; private static final int AR_CAMERA_TORCHMODE_AUTO = 805306372; private static final int AR_CAMERA_TORCHMODE_CONTINUOUSAUTO = 805306376; private static final int AR_CAMERA_TORCHMODE_OFF = 805306369; private static final int AR_CAMERA_TORCHMODE_ON = 805306370; private static final int AR_CAMERA_TYPE_MONO = 268447761; private static final int AR_CAMERA_TYPE_STEREO = 268447762; private static final int AR_CAMERA_TYPE_UNKNOWN = 268447760; private static final int AR_CAMERA_WHITEBALANCEMODE_AUTO = 807403520; private static final int AR_CAMERA_WHITEBALANCEMODE_CONTINUOUSAUTO = 809500672; private static final int AR_CAMERA_WHITEBALANCEMODE_LOCKED = 806354944; private static final int CAMERA_CAPSINFO_VALUE_NUM_SUPPORTED_FRAMERATES = 4; private static final int CAMERA_CAPSINFO_VALUE_NUM_SUPPORTED_IMAGEFORMATS = 5; private static final int CAMERA_CAPSINFO_VALUE_NUM_SUPPORTED_IMAGESIZES = 3; private static final int CAMERA_CAPSINFO_VALUE_SUPPORTED_PARAMVALUES = 2; private static final int CAMERA_CAPSINFO_VALUE_SUPPORTED_QUERYABLE_PARAMS = 0; private static final int CAMERA_CAPSINFO_VALUE_SUPPORTED_SETTABLE_PARAMS = 1;

Page 18: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private static final int CAMERA_CAPTUREINFO_VALUE_FORMAT = 2; private static final int CAMERA_CAPTUREINFO_VALUE_FRAMERATE = 3; private static final int CAMERA_CAPTUREINFO_VALUE_HEIGHT = 1; private static final int CAMERA_CAPTUREINFO_VALUE_PREVIEWSURFACEENABLED = 4; private static final int CAMERA_CAPTUREINFO_VALUE_WIDTH = 0; private static final int[] CAMERA_IMAGE_FORMAT_CONVERSIONTABLE = { 16, 268439816, 17, 268439817, 4, 268439810, 842094169, 268439818 }; private static boolean CONVERT_FORMAT_TO_ANDROID = false; private static boolean CONVERT_FORMAT_TO_PL = true; private static final String FOCUS_MODE_NORMAL = "normal"; private static final String MODULENAME = "Camera1_Preview"; private static final int NUM_CAPTURE_BUFFERS = 2; private static final int NUM_CAPTURE_BUFFERS_TO_ADD = 2; private static final int NUM_MAX_CAMERAOPEN_RETRY = 10; private static final String SAMSUNG_PARAM_FAST_FPS_MODE = "fast-fps-mode"; private static final String SAMSUNG_PARAM_VRMODE = "vrmode"; private static final String SAMSUNG_PARAM_VRMODE_SUPPORTED = "vrmode-supported"; private static final int TIME_CAMERAOPEN_RETRY_DELAY_MS = 250; private static final int _NUM_CAMERA_CAPSINFO_VALUE_ = 6; private static final int _NUM_CAMERA_CAPTUREINFO_VALUE_ = 5; private Vector<CameraCacheInfo> cameraCacheInfo = null; private HashMap<Camera, Integer> cameraCacheInfoIndexCache = null; private SurfaceManager surfaceManager = null; private boolean checkPermission() { try { Activity localActivity = SystemTools.getActivityFromNative(); if (localActivity == null) { return false; } int i = localActivity.getPackageManager().checkPermission("android.permission.CAMERA", localActivity.getPackageName()); if (i == 0) { return true; } } catch (Exception localException) {} return false; }

Page 19: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private boolean checkSamsungHighFPS(CameraCacheInfo paramCameraCacheInfo) { Camera.Parameters localParameters = getCameraParameters(camera); if (localParameters == null) { SystemTools.setSystemErrorCode(6); return false; } if (("true".equalsIgnoreCase(localParameters.get("vrmode-supported"))) && (requestWidth > 0) && (requestHeight > 0) && (localParameters.get("fast-fps-mode") != null) && (localParameters.getInt("fast-fps-mode") != 0) && ((requestWidth != getPreviewSizewidth) || (requestHeight != getPreviewSizeheight))) { DebugLog.LOGW("Camera1_Preview", "Detected Samsung high fps camera driver bug."); DebugLog.LOGW("Camera1_Preview", "Preview size doesn't match request; width " + requestWidth + "!=" + getPreviewSizewidth + " or height " + requestHeight + "!=" + getPreviewSizeheight); setCameraPreviewFps(30, localParameters); localParameters.setPreviewSize(requestWidth, requestHeight); try { camera.setParameters(localParameters); localParameters = getCameraParameters(camera); if ((requestWidth != getPreviewSizewidth) || (requestHeight != getPreviewSizeheight)) { DebugLog.LOGE("Camera1_Preview", "Unable to workaround Samsung high fps camera driver bug."); DebugLog.LOGE("Camera1_Preview", "Preview size doesn't match request; width " + requestWidth + "!=" + getPreviewSizewidth + " or height " + requestHeight + "!=" + getPreviewSizeheight); return false; } } catch (Exception paramCameraCacheInfo) { SystemTools.setSystemErrorCode(6); return false; } } return true;

Page 20: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} private CameraCacheInfo getCameraCacheInfo(int paramInt) { if ((paramInt < 0) || (paramInt >= cameraCacheInfo.size())) { return null; } return (CameraCacheInfo)cameraCacheInfo.get(paramInt); } private int getCameraDeviceIndex(int paramInt1, int paramInt2, int paramInt3) { if ((paramInt2 == 268447760) || (SystemTools.checkMinimumApiLevel(9))) { paramInt2 = -1; int i; switch (paramInt3) { default: SystemTools.setSystemErrorCode(2); i = -1; return i; } for (paramInt2 = 0;; paramInt2 = 1) { int j = Camera.getNumberOfCameras(); paramInt3 = 0; for (;;) { if (paramInt3 >= j) { break label129; } Camera.CameraInfo localCameraInfo = new Camera.CameraInfo(); try { Camera.getCameraInfo(paramInt3, localCameraInfo); if ((paramInt2 < 0) || (paramInt2 == facing)) { i = paramInt3; if (paramInt1 < 0) { break; } i = paramInt3; if (paramInt1 == paramInt3) {

Page 21: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

break; } } } catch (Exception localException) { for (;;) {} } paramInt3 += 1; } } label129: SystemTools.setSystemErrorCode(6); return -1; } if (paramInt3 == 268443666) { SystemTools.setSystemErrorCode(2); return -1; } if (paramInt1 >= 1) { SystemTools.setSystemErrorCode(2); return -1; } return 0; } private Camera.Parameters getCameraParameters(Camera paramCamera) { try { paramCamera = paramCamera.getParameters(); return paramCamera; } catch (Exception paramCamera) {} return null; } private native void newFrameAvailable(long paramLong1, int paramInt1, int paramInt2, int paramInt3, int paramInt4, byte[] paramArrayOfByte, long paramLong2); private void setCameraCapsBit(CameraCacheInfo paramCameraCacheInfo, int paramInt1, int paramInt2, boolean paramBoolean)

Page 22: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ switch (paramInt1) { default: return; } for (int i = 805306368;; i = 536870912) { paramInt2 = (int)(Math.log((i ^ 0xFFFFFFFF) & paramInt2) / Math.log(2.0D)); if (!paramBoolean) { break; } paramCameraCacheInfo = caps; paramCameraCacheInfo[paramInt1] |= 1 << paramInt2; return; } paramCameraCacheInfo = caps; paramCameraCacheInfo[paramInt1] &= (1 << paramInt2 ^ 0xFFFFFFFF); } /* Error */ private boolean setCameraCaptureParams(CameraCacheInfo paramCameraCacheInfo, Camera.Parameters paramParameters, int[] paramArrayOfInt1, int[] paramArrayOfInt2) { // Byte code: // 0: aload_3 // 1: ifnonnull +8 -> 9 // 4: aload 4 // 6: ifnull +61 -> 67 // 9: aload 4 // 11: ifnull +62 -> 73 // 14: aload 4 // 16: iconst_0 // 17: iaload // 18: istore 5 // 20: aload_1 // 21: iload 5 // 23: putfield 410 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:overrideWidth I // 26: aload 4 // 28: ifnull +53 -> 81 // 31: aload 4

Page 23: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 33: iconst_1 // 34: iaload // 35: istore 5 // 37: aload_1 // 38: iload 5 // 40: putfield 413 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:overrideHeight I // 43: aload 4 // 45: ifnull +44 -> 89 // 48: aload 4 // 50: iconst_2 // 51: iaload // 52: istore 5 // 54: aload_1 // 55: aload_0 // 56: iload 5 // 58: getstatic 217 com/vuforia/ar/pl/Camera1_Preview:CONVERT_FORMAT_TO_ANDROID Z // 61: invokespecial 417 com/vuforia/ar/pl/Camera1_Preview:translateImageFormat (IZ)I // 64: putfield 420 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:overrideFormatAndroid I // 67: aload_3 // 68: ifnonnull +29 -> 97 // 71: iconst_1 // 72: ireturn // 73: aload_3 // 74: iconst_0 // 75: iaload // 76: istore 5 // 78: goto -58 -> 20 // 81: aload_3 // 82: iconst_1 // 83: iaload // 84: istore 5 // 86: goto -49 -> 37 // 89: aload_3 // 90: iconst_2 // 91: iaload // 92: istore 5 // 94: goto -40 -> 54 // 97: aload_1

Page 24: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 98: aload_3 // 99: iconst_0 // 100: iaload // 101: putfield 293 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:requestWidth I // 104: aload_1 // 105: aload_3 // 106: iconst_1 // 107: iaload // 108: putfield 296 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:requestHeight I // 111: aload_1 // 112: aload_0 // 113: aload_3 // 114: iconst_2 // 115: iaload // 116: getstatic 217 com/vuforia/ar/pl/Camera1_Preview:CONVERT_FORMAT_TO_ANDROID Z // 119: invokespecial 417 com/vuforia/ar/pl/Camera1_Preview:translateImageFormat (IZ)I // 122: putfield 423 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:requestFormatAndroid I // 125: aload_3 // 126: iconst_3 // 127: iaload // 128: istore 5 // 130: aload_1 // 131: getfield 293 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:requestWidth I // 134: ifle +22 -> 156 // 137: aload_1 // 138: getfield 296 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:requestHeight I // 141: ifle +15 -> 156 // 144: aload_2 // 145: aload_1 // 146: getfield 293 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:requestWidth I

Page 25: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 149: aload_1 // 150: getfield 296 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:requestHeight I // 153: invokevirtual 347 android/hardware/Camera$Parameters:setPreviewSize (II)V // 156: iload 5 // 158: ifle +27 -> 185 // 161: bipush 8 // 163: invokestatic 373 com/vuforia/ar/pl/SystemTools:checkMinimumApiLevel (I)Z // 166: ifeq +81 -> 247 // 169: aload_0 // 170: iload 5 // 172: aload_2 // 173: invokespecial 343 com/vuforia/ar/pl/Camera1_Preview:setCameraPreviewFps (ILandroid/hardware/Camera$Parameters;)Z // 176: ifne +9 -> 185 // 179: aload_2 // 180: iload 5 // 182: invokevirtual 426 android/hardware/Camera$Parameters:setPreviewFrameRate (I)V // 185: aload_1 // 186: getfield 423 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:requestFormatAndroid I // 189: ifeq +11 -> 200 // 192: aload_2 // 193: aload_1 // 194: getfield 423 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:requestFormatAndroid I // 197: invokevirtual 429 android/hardware/Camera$Parameters:setPreviewFormat (I)V // 200: aload_3 // 201: iconst_4 // 202: iaload // 203: ifle +56 -> 259 // 206: iconst_1 // 207: istore 5 // 209: iload 5 // 211: ifeq +34 -> 245 // 214: bipush 11

Page 26: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 216: invokestatic 373 com/vuforia/ar/pl/SystemTools:checkMinimumApiLevel (I)Z // 219: ifeq +49 -> 268 // 222: aload_1 // 223: new 431 android/graphics/SurfaceTexture // 226: dup // 227: iconst_m1 // 228: invokespecial 433 android/graphics/SurfaceTexture:<init> (I)V // 231: putfield 437 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:surfaceTexture Landroid/graphics/SurfaceTexture; // 234: aload_1 // 235: getfield 268 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:camera Landroid/hardware/Camera; // 238: aload_1 // 239: getfield 437 com/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo:surfaceTexture Landroid/graphics/SurfaceTexture; // 242: invokevirtual 441 android/hardware/Camera:setPreviewTexture (Landroid/graphics/SurfaceTexture;)V // 245: iconst_1 // 246: ireturn // 247: aload_2 // 248: iload 5 // 250: invokevirtual 426 android/hardware/Camera$Parameters:setPreviewFrameRate (I)V // 253: goto -68 -> 185 // 256: astore_1 // 257: iconst_0 // 258: ireturn // 259: iconst_0 // 260: istore 5 // 262: goto -53 -> 209 // 265: astore_1 // 266: iconst_0 // 267: ireturn // 268: aload_0 // 269: getfield 223 com/vuforia/ar/pl/Camera1_Preview:surfaceManager Lcom/vuforia/ar/pl/SurfaceManager; // 272: ifnull +16 -> 288

Page 27: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 275: aload_0 // 276: getfield 223 com/vuforia/ar/pl/Camera1_Preview:surfaceManager Lcom/vuforia/ar/pl/SurfaceManager; // 279: aload_1 // 280: invokevirtual 446 com/vuforia/ar/pl/SurfaceManager:addCameraSurface (Lcom/vuforia/ar/pl/Camera1_Preview$CameraCacheInfo;)Z // 283: ifne -38 -> 245 // 286: iconst_0 // 287: ireturn // 288: iconst_0 // 289: ireturn // 290: astore_1 // 291: goto -46 -> 245 // Local variable table: // start length slot name signature // 0 294 0 this Camera1_Preview // 0 294 1 paramCameraCacheInfo CameraCacheInfo // 0 294 2 paramParameters Camera.Parameters // 0 294 3 paramArrayOfInt1 int[] // 0 294 4 paramArrayOfInt2 int[] // 18 243 5 i int // Exception table: // from to target type // 130 156 256 java/lang/Exception // 161 185 256 java/lang/Exception // 185 200 256 java/lang/Exception // 247 253 256 java/lang/Exception // 222 234 265 java/lang/Exception // 234 245 290 java/lang/Exception } private boolean setCameraPreviewFps(int paramInt, Camera.Parameters paramParameters) { Object localObject2 = paramParameters.getSupportedPreviewFpsRange(); Object localObject1 = null; if (((paramInt == 60) || (paramInt == 120)) && ("true".equalsIgnoreCase(paramParameters.get("vrmode-supported")))) { localObject1 = new int[2]; paramParameters.set("vrmode", 1); paramParameters.setRecordingHint(true); paramParameters.set("focus-mode", "continuous-video");

Page 28: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (paramInt == 60) { paramParameters.set("fast-fps-mode", 1); localObject1[0] = 60000; localObject1[1] = 60000; } localObject2 = localObject1; if (paramInt == 120) { paramParameters.set("fast-fps-mode", 2); localObject1[0] = 120000; localObject1[1] = 120000; localObject2 = localObject1; } if (localObject2 != null) { paramParameters.setPreviewFpsRange(localObject2[0], localObject2[1]); return true; } } else { if (("true".equalsIgnoreCase(paramParameters.get("vrmode-supported"))) && (paramParameters.get("fast-fps-mode") != null) && (paramParameters.getInt("fast-fps-mode") != 0)) { paramParameters.set("vrmode", 0); paramParameters.set("fast-fps-mode", 0); } Iterator localIterator = ((List)localObject2).iterator(); for (;;) { localObject2 = localObject1; if (!localIterator.hasNext()) { break; } localObject2 = (int[])localIterator.next(); if ((localObject2[0] == paramInt * 1000) && (localObject2[1] - localObject2[0] < Integer.MAX_VALUE)) { localObject1 = localObject2; } } } return false;

Page 29: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} private boolean setCustomCameraParams(Camera.Parameters paramParameters, String paramString) { for (;;) { Object localObject; try { paramString = new JSONObject(paramString); localIterator = paramString.keys(); } catch (JSONException paramParameters) { try { Iterator localIterator; localObject = paramString.get(str); if (localObject.getClass() != String.class) { break label73; } paramParameters.set(str, (String)localObject); } catch (JSONException paramParameters) { return false; } paramParameters = paramParameters; return false; } if (!localIterator.hasNext()) { break label103; } String str = (String)localIterator.next(); label73: if (localObject.getClass() != Integer.class) { break; } paramParameters.set(str, ((Integer)localObject).intValue()); } return false; label103: return true; }

Page 30: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private boolean setupPreviewBuffer(CameraCacheInfo paramCameraCacheInfo) { Object localObject = getCameraParameters(camera); if (localObject == null) { return false; } int j; for (;;) { try { if (requestWidth == overrideWidth) { i = getPreviewSizewidth; bufferWidth = i; if (requestHeight != overrideHeight) { continue; } i = getPreviewSizeheight; bufferHeight = i; if (requestFormatAndroid != overrideFormatAndroid) { continue; } i = ((Camera.Parameters)localObject).getPreviewFormat(); bufferFormatPL = translateImageFormat(i, CONVERT_FORMAT_TO_PL); } } catch (Exception paramCameraCacheInfo) { return false; } try { localObject = new PixelFormat(); PixelFormat.getPixelFormatInfo(i, (PixelFormat)localObject); j = bitsPerPixel; i = j; } catch (Exception localException) { j = getBitsPerPixel(i); i = j;

Page 31: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (j != 0) { continue; } return false; } j = bufferWidth * bufferHeight * i / 8 + 4096; if (j > bufferSize) { break; } camera.setPreviewCallbackWithBuffer(this); return true; i = overrideWidth; continue; i = overrideHeight; continue; i = overrideFormatAndroid; } buffer = new byte[2][]; int i = 0; while (i < 2) { buffer[i] = new byte[j]; if (i < 2) { camera.addCallbackBuffer(buffer[i]); } i += 1; } bufferSize = j; camera.setPreviewCallbackWithBuffer(this); System.gc(); return true; } private int translateImageFormat(int paramInt, boolean paramBoolean) { int i = 0; while (i < CAMERA_IMAGE_FORMAT_CONVERSIONTABLE.length / 2) { int j; if (paramBoolean == CONVERT_FORMAT_TO_PL) { j = CAMERA_IMAGE_FORMAT_CONVERSIONTABLE[(i * 2)]; } while (paramInt == j) { if (paramBoolean == CONVERT_FORMAT_TO_PL) {

Page 32: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

return CAMERA_IMAGE_FORMAT_CONVERSIONTABLE[(i * 2 + 1)]; j = CAMERA_IMAGE_FORMAT_CONVERSIONTABLE[(i * 2 + 1)]; } else { return CAMERA_IMAGE_FORMAT_CONVERSIONTABLE[(i * 2)]; } } i += 1; } if (paramBoolean == CONVERT_FORMAT_TO_PL) { return 268439808; } return 0; } public boolean close(int paramInt) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return false; } if (isHalDriven) { DebugLog.LOGW("Camera1_Preview", "We shouldn't be here for HAL driven camera!"); return true; } cameraCacheInfoIndexCache.remove(camera); boolean bool = false; try { camera.release(); bool = true; } catch (Exception localException) { for (;;) {} } camera = null; buffer = ((byte[][])null); status = 268443649;

Page 33: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

System.gc(); return bool; } int getBitsPerPixel(int paramInt) { int i = 16; switch (paramInt) { default: i = 0; case 4: case 16: return i; case 17: return 12; } return 12; } public int[] getCameraCapabilities(int paramInt) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return null; } if (caps != null) { return caps; } Object localObject3 = getCameraParameters(camera); if (localObject3 == null) { SystemTools.setSystemErrorCode(6); return null; } Object localObject4 = ((Camera.Parameters)localObject3).getSupportedPreviewSizes(); Object localObject2 = ((Camera.Parameters)localObject3).getSupportedPreviewFrameRates(); Object localObject1 = ((Camera.Parameters)localObject3).getSupportedPreviewFormats();

Page 34: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

List localList1 = ((Camera.Parameters)localObject3).getSupportedFlashModes(); List localList2 = ((Camera.Parameters)localObject3).getSupportedFocusModes(); int k; label117: int j; if (localObject4 != null) { i = ((List)localObject4).size(); if (localObject2 == null) { break label758; } k = ((List)localObject2).size(); if (localObject1 == null) { break label764; } j = ((List)localObject1).size(); label130: caps = new int[i * 2 + 6 + k + j]; caps[0] = 536870912; if (localList1 == null) { break label775; } if ((!localList1.contains("torch")) && (!localList1.contains("on"))) { break label769; } bool = true; label191: setCameraCapsBit(localCameraCacheInfo, 0, 536870913, bool); setCameraCapsBit(localCameraCacheInfo, 0, 536870914, true); setCameraCapsBit(localCameraCacheInfo, 0, 536870916, SystemTools.checkMinimumApiLevel(8)); setCameraCapsBit(localCameraCacheInfo, 0, 536870928, SystemTools.checkMinimumApiLevel(14)); setCameraCapsBit(localCameraCacheInfo, 0, 536871936, SystemTools.checkMinimumApiLevel(8)); setCameraCapsBit(localCameraCacheInfo, 0, 536872960, SystemTools.checkMinimumApiLevel(8)); if ((!SystemTools.checkMinimumApiLevel(8)) || (!((Camera.Parameters)localObject3).isZoomSupported())) { break label781; } bool = true; label287:

Page 35: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

setCameraCapsBit(localCameraCacheInfo, 0, 536903680, bool); if ((!SystemTools.checkMinimumApiLevel(8)) || (!((Camera.Parameters)localObject3).isZoomSupported())) { break label787; } bool = true; label317: setCameraCapsBit(localCameraCacheInfo, 0, 536936448, bool); setCameraCapsBit(localCameraCacheInfo, 0, 553648128, SystemTools.checkMinimumApiLevel(15)); caps[1] = 536870912; if (localList1 == null) { break label799; } if ((!localList1.contains("torch")) && (!localList1.contains("on"))) { break label793; } bool = true; label385: setCameraCapsBit(localCameraCacheInfo, 1, 536870913, bool); setCameraCapsBit(localCameraCacheInfo, 1, 536870914, true); setCameraCapsBit(localCameraCacheInfo, 1, 536870928, SystemTools.checkMinimumApiLevel(14)); setCameraCapsBit(localCameraCacheInfo, 1, 536871936, SystemTools.checkMinimumApiLevel(8)); if ((!SystemTools.checkMinimumApiLevel(8)) || (!((Camera.Parameters)localObject3).isZoomSupported())) { break label805; } } label758: label764: label769: label775: label781: label787: label793: label799: label805: for (boolean bool = true;; bool = false) { setCameraCapsBit(localCameraCacheInfo, 1, 536903680, bool); setCameraCapsBit(localCameraCacheInfo, 1, 553648128, SystemTools.checkMinimumApiLevel(15)); caps[2] = 805306368;

Page 36: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if ((localList1 != null) && ((localList1.contains("torch")) || (localList1.contains("on")))) { setCameraCapsBit(localCameraCacheInfo, 2, 805306369, true); setCameraCapsBit(localCameraCacheInfo, 2, 805306370, true); } if (localList2 != null) { setCameraCapsBit(localCameraCacheInfo, 2, 805306384, true); setCameraCapsBit(localCameraCacheInfo, 2, 805306400, localList2.contains("auto")); setCameraCapsBit(localCameraCacheInfo, 2, 805306432, localList2.contains("continuous-video")); setCameraCapsBit(localCameraCacheInfo, 2, 805306496, localList2.contains("macro")); setCameraCapsBit(localCameraCacheInfo, 2, 805306624, localList2.contains("infinity")); setCameraCapsBit(localCameraCacheInfo, 2, 805306880, localList2.contains("fixed")); } caps[3] = i; caps[4] = k; caps[5] = j; int m = 6; paramInt = m; if (i <= 0) { break label811; } localObject3 = ((List)localObject4).listIterator(); i = m; for (;;) { paramInt = i; if (!((ListIterator)localObject3).hasNext()) { break; } localObject4 = (Camera.Size)((ListIterator)localObject3).next(); caps[i] = width; caps[(i + 1)] = height; i += 2; } i = 0; break; k = 0; break label117;

Page 37: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

j = 0; break label130; bool = false; break label191; bool = false; break label191; bool = false; break label287; bool = false; break label317; bool = false; break label385; bool = false; break label385; } label811: int i = paramInt; if (k > 0) { localObject2 = ((List)localObject2).listIterator(); for (;;) { i = paramInt; if (!((ListIterator)localObject2).hasNext()) { break; } i = ((Integer)((ListIterator)localObject2).next()).intValue(); caps[paramInt] = i; paramInt += 1; } } if (j > 0) { localObject1 = ((List)localObject1).listIterator(); while (((ListIterator)localObject1).hasNext()) { paramInt = ((Integer)((ListIterator)localObject1).next()).intValue(); caps[i] = translateImageFormat(paramInt, true); i += 1; } } return caps; } public int[] getCaptureInfo(int paramInt)

Page 38: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ int i = 0; CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return null; } Camera.Parameters localParameters = getCameraParameters(camera); if (localParameters == null) { SystemTools.setSystemErrorCode(6); return null; } for (;;) { try { int j = getPreviewSizewidth; int k = getPreviewSizeheight; int m = translateImageFormat(localParameters.getPreviewFormat(), CONVERT_FORMAT_TO_PL); int n = localParameters.getPreviewFrameRate(); if (surface == null) { paramInt = i; if (surfaceTexture == null) { return new int[] { j, k, m, n, paramInt }; } } } catch (Exception localException) { SystemTools.setSystemErrorCode(6); return null; } paramInt = 1; } } public int getDeviceID(int paramInt) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt);

Page 39: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return -1; } return deviceID; } public int getDirection(int paramInt) { if (!checkPermission()) { SystemTools.setSystemErrorCode(6); return -1; } if (SystemTools.checkMinimumApiLevel(9)) { Camera.CameraInfo localCameraInfo = new Camera.CameraInfo(); try { Camera.getCameraInfo(paramInt, localCameraInfo); switch (facing) { default: return 268443664; } } catch (Exception localException) { SystemTools.setSystemErrorCode(6); return -1; } return 268443665; return 268443666; } return 268443665; } String getFlattenedParameters(int paramInt) { Object localObject = getCameraCacheInfo(paramInt); if ((localObject == null) || (camera == null)) { SystemTools.setSystemErrorCode(4); return "";

Page 40: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} localObject = getCameraParameters(camera); if (localObject == null) { SystemTools.setSystemErrorCode(6); return ""; } return ((Camera.Parameters)localObject).flatten(); } public int getNumberOfCameras() { if (!checkPermission()) { SystemTools.setSystemErrorCode(6); return -1; } int i; if (SystemTools.checkMinimumApiLevel(9)) { try { i = Camera.getNumberOfCameras(); return i; } catch (Exception localException1) { SystemTools.setSystemErrorCode(6); return -1; } } for (;;) { try { boolean bool = SystemTools.getActivityFromNative().getPackageManager().hasSystemFeature("android.hardware.camera"); if (bool) { i = 1; return i; } } catch (Exception localException2) {

Page 41: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

SystemTools.setSystemErrorCode(6); return -1; } i = 0; } } public int getOrientation(int paramInt) { if (!checkPermission()) { SystemTools.setSystemErrorCode(6); return -1; } if (SystemTools.checkMinimumApiLevel(9)) { Camera.CameraInfo localCameraInfo = new Camera.CameraInfo(); try { Camera.getCameraInfo(paramInt, localCameraInfo); return orientation; } catch (Exception localException) { SystemTools.setSystemErrorCode(6); return -1; } } SystemTools.setSystemErrorCode(6); return -1; } int getStatus(int paramInt) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return 268443648; } return status; } Object getTypedCameraParameter(int paramInt1, int paramInt2)

Page 42: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ Object localObject1 = getCameraCacheInfo(paramInt1); if ((localObject1 == null) || (camera == null)) { SystemTools.setSystemErrorCode(4); return null; } Object localObject3 = getCameraParameters(camera); if (localObject3 == null) { SystemTools.setSystemErrorCode(6); return null; } switch (paramInt2) { default: return null; case 536870913: case 536870914: case 536870916: case 536870920: try { localObject1 = ((Camera.Parameters)localObject3).getFlashMode(); if ((((String)localObject1).equals("torch")) || (((String)localObject1).equals("on"))) { return Integer.valueOf(805306370); } if (((String)localObject1).equals("off")) { return Integer.valueOf(805306369); } SystemTools.setSystemErrorCode(6); return null; } catch (Exception localException) { SystemTools.setSystemErrorCode(6); return null; } localObject3 = ((Camera.Parameters)localObject3).getFocusMode(); if (((String)localObject3).equals("auto")) { if (!isAutoFocusing) { break label812; } }

Page 43: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

break; } label812: for (paramInt1 = 805306400;; paramInt1 = 805306384) { return Integer.valueOf(paramInt1); if (((String)localObject3).equals("continuous-video")) { return Integer.valueOf(805306432); } if (((String)localObject3).equals("infinity")) { return Integer.valueOf(805306624); } if (((String)localObject3).equals("macro")) { return Integer.valueOf(805306496); } if (((String)localObject3).equals("fixed")) { return Integer.valueOf(805306880); } SystemTools.setSystemErrorCode(6); return null; if (SystemTools.checkMinimumApiLevel(8)) { return Float.valueOf(((Camera.Parameters)localObject3).getFocalLength()); } SystemTools.setSystemErrorCode(6); return null; if (SystemTools.checkMinimumApiLevel(9)) { localObject1 = new float[3]; ((Camera.Parameters)localObject3).getFocusDistances((float[])localObject1); float f1 = localObject1[0]; float f2 = localObject1[2]; return new float[] { f1, f2 }; } SystemTools.setSystemErrorCode(6); return null; if ((SystemTools.checkMinimumApiLevel(14)) && (((Camera.Parameters)localObject3).getMaxNumFocusAreas() > 0)) { Object localObject2 = ((Camera.Parameters)localObject3).getFocusAreas(); if (((List)localObject2).size() > 0) { localObject2 = (Camera.Area)((List)localObject2).get(0);

Page 44: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

return new float[] { rect.left, rect.top, rect.right, rect.bottom, weight }; } } SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; if (SystemTools.checkMinimumApiLevel(8)) { return Float.valueOf(((Camera.Parameters)localObject3).getExposureCompensationStep() * ((Camera.Parameters)localObject3).getExposureCompensation()); } SystemTools.setSystemErrorCode(6); return null; if (SystemTools.checkMinimumApiLevel(8)) { return new float[] { ((Camera.Parameters)localObject3).getExposureCompensationStep() * ((Camera.Parameters)localObject3).getMinExposureCompensation(), ((Camera.Parameters)localObject3).getExposureCompensationStep() * ((Camera.Parameters)localObject3).getMaxExposureCompensation() }; } SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; if ((SystemTools.checkMinimumApiLevel(8)) && (((Camera.Parameters)localObject3).isZoomSupported())) { return Integer.valueOf(((Camera.Parameters)localObject3).getZoom()); } SystemTools.setSystemErrorCode(6); return null; if ((SystemTools.checkMinimumApiLevel(8)) && (((Camera.Parameters)localObject3).isZoomSupported())) { return new int[] { 0, ((Camera.Parameters)localObject3).getMaxZoom() }; } SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null;

Page 45: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; if (((Camera.Parameters)localObject3).getVideoStabilization()) { return Boolean.valueOf(true); } return Boolean.valueOf(false); } } String getUntypedCameraParameter(int paramInt, String paramString) { Object localObject = null; CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if ((localCameraCacheInfo == null) || (camera == null)) { SystemTools.setSystemErrorCode(4); paramString = (String)localObject; } do { return paramString; localObject = getCameraParameters(camera); if (localObject == null) { SystemTools.setSystemErrorCode(6); return null; } localObject = ((Camera.Parameters)localObject).get(paramString); paramString = (String)localObject; } while (localObject != null); SystemTools.setSystemErrorCode(6); return (String)localObject; } public boolean init() { cameraCacheInfo = new Vector(); cameraCacheInfoIndexCache = new HashMap(); return true; }

Page 46: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

public void onPreviewFrame(byte[] paramArrayOfByte, Camera paramCamera) { long l = System.nanoTime(); if (SystemTools.checkMinimumApiLevel(18)) {} Object localObject = cameraCacheInfoIndexCache.get(paramCamera); if (localObject == null) { if (!SystemTools.checkMinimumApiLevel(18)) {} } do { int i; do { return; i = ((Integer)localObject).intValue(); localObject = getCameraCacheInfo(i); if (localObject != null) { break; } } while (!SystemTools.checkMinimumApiLevel(18)); return; newFrameAvailable(deviceHandle, i, bufferWidth, bufferHeight, bufferFormatPL, paramArrayOfByte, l); paramCamera.addCallbackBuffer(paramArrayOfByte); } while (!SystemTools.checkMinimumApiLevel(18)); } public int open(long paramLong, int paramInt1, int paramInt2, int paramInt3, String paramString, int[] paramArrayOfInt1, int[] paramArrayOfInt2) { if (!checkPermission()) { SystemTools.setSystemErrorCode(6); return -1; } int i = getCameraDeviceIndex(paramInt1, paramInt2, paramInt3); if (i < 0) { return -1; } paramInt3 = -1; CameraCacheInfo localCameraCacheInfo = null; int j = cameraCacheInfo.size(); paramInt2 = 0;

Page 47: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramInt1 = paramInt3; if (paramInt2 < j) { localCameraCacheInfo = (CameraCacheInfo)cameraCacheInfo.get(paramInt2); if (deviceID == i) { paramInt1 = paramInt2; } } else { if (paramInt1 < 0) { localCameraCacheInfo = new CameraCacheInfo(); deviceID = i; deviceHandle = paramLong; camera = null; surface = null; buffer = ((byte[][])null); overrideWidth = 0; requestWidth = 0; bufferWidth = 0; overrideHeight = 0; requestHeight = 0; bufferHeight = 0; bufferFormatPL = 268439808; overrideFormatAndroid = 0; requestFormatAndroid = 0; caps = null; status = 268443649; isAutoFocusing = false; isHalDriven = false; } bufferSize = 0; paramInt2 = 0; paramInt3 = 10; } try { label228: if (!SystemTools.checkMinimumApiLevel(9)) { break label319; } camera = Camera.open(deviceID); label249:

Page 48: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Camera localCamera = camera; if (localCamera == null) { break label343; } paramInt2 = 1; } catch (Exception localException1) { for (;;) { continue; paramInt2 = 0; } } if ((paramInt2 == 0) && (paramInt3 > 0)) {} label319: label343: label600: label609: for (;;) { try {}catch (Exception localException2) { continue; if (((paramArrayOfInt1 == null) || (paramArrayOfInt1.length <= 0)) && ((paramArrayOfInt2 == null) || (paramArrayOfInt2.length <= 0))) { continue; } paramInt2 = 1; if ((paramString == null) || (paramString.length() <= 0)) { continue; } paramInt3 = 1; if ((paramInt2 == 0) && (paramInt3 == 0)) { continue; } Camera.Parameters localParameters = getCameraParameters(camera); if (localParameters != null) { continue; } SystemTools.setSystemErrorCode(6); return -1; paramInt2 = 0; continue; paramInt3 = 0;

Page 49: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

continue; if (paramInt2 == 0) { continue; } if ((paramArrayOfInt1 == null) || (paramArrayOfInt1.length == 5)) { continue; } SystemTools.setSystemErrorCode(2); return -1; if (setCameraCaptureParams(localCameraCacheInfo, localParameters, paramArrayOfInt1, paramArrayOfInt2)) { continue; } SystemTools.setSystemErrorCode(6); return -1; if ((paramInt3 == 0) || (setCustomCameraParams(localParameters, paramString))) { continue; } SystemTools.setSystemErrorCode(2); return -1; try { camera.setParameters(localParameters); if (!checkSamsungHighFPS(localCameraCacheInfo)) { return -1; } } catch (Exception paramString) { SystemTools.setSystemErrorCode(6); return -1; } status = 268443650; paramInt2 = paramInt1; if (paramInt1 >= 0) { continue; } cameraCacheInfo.add(localCameraCacheInfo); paramInt2 = cameraCacheInfo.size() - 1; cameraCacheInfoIndexCache.put(camera, Integer.valueOf(paramInt2)); return paramInt2; } try {

Page 50: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

wait(250L); if (paramInt2 != 0) { break label609; } if (paramInt3 > 0) { break label600; } if (camera != null) { continue; } SystemTools.setSystemErrorCode(6); return -1; } finally {} paramInt2 += 1; break; if (deviceID != 0) { break label249; } camera = Camera.open(); break label249; paramInt3 -= 1; break label228; } } public int registerHalCamera(int paramInt1, int paramInt2, int paramInt3, String paramString, int[] paramArrayOfInt1, int[] paramArrayOfInt2) { int i = -1; if (!checkPermission()) { SystemTools.setSystemErrorCode(6); paramInt2 = i; } int j; do { return paramInt2; j = getCameraDeviceIndex(paramInt1, paramInt2, paramInt3); paramInt2 = i; } while (j < 0); paramInt3 = -1; paramString = null; i = cameraCacheInfo.size();

Page 51: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramInt2 = 0; for (;;) { paramInt1 = paramInt3; if (paramInt2 < i) { paramString = (CameraCacheInfo)cameraCacheInfo.get(paramInt2); if ((deviceID == j) && (isHalDriven)) { paramInt1 = paramInt2; } } else { if (paramInt1 < 0) { paramString = new CameraCacheInfo(); deviceID = j; camera = null; surface = null; buffer = ((byte[][])null); overrideWidth = 0; requestWidth = 0; bufferWidth = 0; overrideHeight = 0; requestHeight = 0; bufferHeight = 0; bufferFormatPL = 268439808; overrideFormatAndroid = 0; requestFormatAndroid = 0; caps = null; status = 268443649; isAutoFocusing = false; isHalDriven = true; } bufferSize = 0; paramInt2 = paramInt1; if (paramInt1 >= 0) { break; } cameraCacheInfo.add(paramString); paramInt1 = cameraCacheInfo.size(); DebugLog.LOGD("Camera1_Preview", "New HAL camera cache info added to cache"); return paramInt1 - 1; }

Page 52: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramInt2 += 1; } } public boolean setBatchParameters(int paramInt, String paramString) { if (paramString == null) {} CameraCacheInfo localCameraCacheInfo; Camera.Parameters localParameters; do { return false; localCameraCacheInfo = getCameraCacheInfo(paramInt); if ((localCameraCacheInfo == null) || (camera == null)) { SystemTools.setSystemErrorCode(4); return false; } localParameters = getCameraParameters(camera); if (localParameters == null) { SystemTools.setSystemErrorCode(6); return false; } } while (!setCustomCameraParams(localParameters, paramString)); camera.setParameters(localParameters); return true; } public boolean setCaptureInfo(int paramInt, int[] paramArrayOfInt1, int[] paramArrayOfInt2) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); } for (;;) { return false; if (paramArrayOfInt1.length != 5) { SystemTools.setSystemErrorCode(2); return false; }

Page 53: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Camera.Parameters localParameters = getCameraParameters(camera); if (localParameters == null) { SystemTools.setSystemErrorCode(6); return false; } if (!setCameraCaptureParams(localCameraCacheInfo, localParameters, paramArrayOfInt1, paramArrayOfInt2)) { SystemTools.setSystemErrorCode(6); return false; } try { camera.setParameters(localParameters); if (checkSamsungHighFPS(localCameraCacheInfo)) { return true; } } catch (Exception paramArrayOfInt1) { SystemTools.setSystemErrorCode(6); } } return false; } public void setSurfaceManager(SurfaceManager paramSurfaceManager) { surfaceManager = paramSurfaceManager; } boolean setTypedCameraParameter(int paramInt1, int paramInt2, Object paramObject) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt1); if ((localCameraCacheInfo == null) || (camera == null)) { SystemTools.setSystemErrorCode(4); return false; } Camera.Parameters localParameters = getCameraParameters(camera); if (localParameters == null) {

Page 54: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

SystemTools.setSystemErrorCode(6); return false; } int i = 0; switch (paramInt2) { default: return false; case 536870976: case 541065216: case 536870913: case 536870914: case 536870916: case 536870920: case 536870928: case 536870944: case 536871936: for (;;) { Object localObject1; Object localObject2; try { localObject1 = Integer.toString(((Number)paramObject).intValue()); localObject2 = localParameters.get("iso-values"); paramObject = localObject1; if (localObject2 != null) { localObject2 = ((String)localObject2).split(","); paramInt1 = 0; paramObject = localObject1; if (paramInt1 < localObject2.length) { if (!localObject2[paramInt1].toLowerCase().contains(((String)localObject1).toLowerCase())) { continue; } paramObject = localObject2[paramInt1]; } } localParameters.set("iso", (String)paramObject); paramInt1 = i; } catch (Exception paramObject)

Page 55: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ SystemTools.setSystemErrorCode(6); return false; } try { camera.setParameters(localParameters); if (paramInt1 != 0) {} switch (paramInt2) { default: return true; } } catch (Exception paramObject) { SystemTools.setSystemErrorCode(6); return false; } paramInt1 += 1; continue; paramInt1 = ((Number)paramObject).intValue(); if (SystemTools.checkMinimumApiLevel(14)) { boolean bool; if (paramInt1 != 0) { bool = true; localParameters.setRecordingHint(bool); paramInt1 = i; } else { bool = false; } } else { if (paramInt1 == 0) { break label1397; } paramObject = "true"; localParameters.set("recording-hint", (String)paramObject); paramInt1 = i; continue;

Page 56: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

switch (((Number)paramObject).intValue()) { case 805306371: SystemTools.setSystemErrorCode(3); return false; case 805306370: if (localParameters.getSupportedFlashModes().contains("torch")) { localParameters.setFlashMode("torch"); paramInt1 = i; } else { localParameters.setFlashMode("on"); paramInt1 = i; } break; case 805306369: localParameters.setFlashMode("off"); paramInt1 = i; break; case 805306372: SystemTools.setSystemErrorCode(3); return false; camera.cancelAutoFocus(); switch (((Number)paramObject).intValue()) { case 805306384: SystemTools.setSystemErrorCode(3); return false; if (localParameters.getSupportedFocusModes().contains("normal")) { localParameters.setFocusMode("normal"); paramInt1 = i; } else { localParameters.setFocusMode("auto"); paramInt1 = 1; } break; case 805306400: localParameters.setFocusMode("auto"); paramInt1 = 1; break;

Page 57: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

case 805306432: if (localParameters.getSupportedFocusModes().contains("continuous-video")) { localParameters.setFocusMode("continuous-video"); paramInt1 = i; } else { SystemTools.setSystemErrorCode(6); return false; } break; case 805306496: localParameters.setFocusMode("macro"); paramInt1 = i; break; case 805306624: localParameters.setFocusMode("infinity"); paramInt1 = i; break; case 805306880: localParameters.setFocusMode("fixed"); paramInt1 = i; continue; SystemTools.setSystemErrorCode(6); return false; SystemTools.setSystemErrorCode(6); return false; if (SystemTools.checkMinimumApiLevel(14)) { paramObject = (float[])paramObject; if (paramObject.length == 5) { break label1410; } SystemTools.setSystemErrorCode(2); return false; SystemTools.setSystemErrorCode(2); return false; localObject1 = new Rect((int)(paramObject[0] * 2000.0D) - 1000, (int)(paramObject[1] * 2000.0D) - 1000, (int)(paramObject[2] * 2000.0D) - 1000, (int)(paramObject[3] * 2000.0D) - 1000); localObject2 = new ArrayList(); ((List)localObject2).add(new Camera.Area((Rect)localObject1, (int)(paramObject[4] * 1000.0D)));

Page 58: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramInt1 = i; if (localParameters.getMaxNumFocusAreas() > 0) { localParameters.setFocusAreas((List)localObject2); paramInt1 = i; } } else { SystemTools.setSystemErrorCode(6); return false; switch (((Number)paramObject).intValue()) { case 805310464: SystemTools.setSystemErrorCode(3); return false; paramInt1 = i; if (localParameters.isAutoExposureLockSupported()) { localParameters.setAutoExposureLock(true); paramInt1 = i; } break; case 805314560: case 805322752: paramInt1 = i; if (localParameters.isAutoExposureLockSupported()) { localParameters.setAutoExposureLock(false); paramInt1 = i; continue; if (!SystemTools.checkMinimumApiLevel(8)) { break label1085; } float f1 = ((Number)paramObject).floatValue(); float f2 = localParameters.getExposureCompensationStep(); if (f2 == 0.0F) { SystemTools.setSystemErrorCode(6); return false; } localParameters.setExposureCompensation(Math.round(f1 / f2)); paramInt1 = i; } break;

Page 59: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} } break; } break; } } } SystemTools.setSystemErrorCode(6); return false; case 536872960: SystemTools.setSystemErrorCode(6); return false; case 536875008: label423: label476: label620: label801: label807: label976: label1085: paramInt1 = ((Number)paramObject).intValue(); switch (paramInt1) { } break; } for (;;) { SystemTools.setSystemErrorCode(3); SystemTools.logSystemError("Cannot set unknown white balance mode (" + paramInt1 + ")"); return false; paramInt1 = i; if (!localParameters.isAutoWhiteBalanceLockSupported()) { break; } localParameters.setAutoWhiteBalanceLock(true); paramInt1 = i; break; paramInt1 = i; if (!localParameters.isAutoWhiteBalanceLockSupported()) { break; } localParameters.setAutoWhiteBalanceLock(false);

Page 60: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramInt1 = i; break; SystemTools.setSystemErrorCode(6); return false; SystemTools.setSystemErrorCode(6); return false; if ((SystemTools.checkMinimumApiLevel(8)) && (localParameters.isZoomSupported())) { localParameters.setZoom(((Number)paramObject).intValue()); paramInt1 = i; break; } SystemTools.setSystemErrorCode(6); return false; SystemTools.setSystemErrorCode(6); return false; SystemTools.setSystemErrorCode(6); return false; SystemTools.setSystemErrorCode(6); return false; SystemTools.setSystemErrorCode(6); return false; SystemTools.setSystemErrorCode(6); return false; SystemTools.setSystemErrorCode(6); return false; if (((Boolean)paramObject).booleanValue()) { localParameters.setVideoStabilization(true); paramInt1 = i; break; } localParameters.setVideoStabilization(false); paramInt1 = i; break; try { isAutoFocusing = true; camera.autoFocus(new Camera.AutoFocusCallback() { public void onAutoFocus(boolean paramAnonymousBoolean, Camera paramAnonymousCamera) {

Page 61: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramAnonymousCamera = cameraCacheInfoIndexCache.get(paramAnonymousCamera); if (paramAnonymousCamera == null) {} do { return; int i = ((Integer)paramAnonymousCamera).intValue(); paramAnonymousCamera = Camera1_Preview.this.getCameraCacheInfo(i); } while (paramAnonymousCamera == null); isAutoFocusing = false; } }); } catch (Exception paramObject) { SystemTools.setSystemErrorCode(6); return false; } label1397: paramObject = "false"; break label423; break label476; break label620; label1410: if ((paramObject[0] < 0.0F) || (paramObject[0] > 1.0F) || (paramObject[1] < 0.0F) || (paramObject[1] > 1.0F) || (paramObject[2] < 0.0F) || (paramObject[2] > 1.0F) || (paramObject[3] < 0.0F) || (paramObject[3] > 1.0F) || (paramObject[4] < 0.0F)) { break label801; } if (paramObject[4] <= 1.0F) { break label807; } break label801; break label976; } } boolean setUntypedCameraParameter(int paramInt, String paramString1, String paramString2) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if ((localCameraCacheInfo == null) || (camera == null))

Page 62: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ SystemTools.setSystemErrorCode(4); return false; } Camera.Parameters localParameters = getCameraParameters(camera); if (localParameters == null) { SystemTools.setSystemErrorCode(6); return false; } try { localParameters.set(paramString1, paramString2); camera.setParameters(localParameters); return true; } catch (Exception paramString1) { SystemTools.setSystemErrorCode(6); } return false; } public boolean start(int paramInt) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return false; } if (!setupPreviewBuffer(localCameraCacheInfo)) { SystemTools.setSystemErrorCode(6); return false; } try { camera.startPreview(); status = 268443651; return true; } catch (Exception localException) {

Page 63: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

SystemTools.setSystemErrorCode(6); } return false; } public boolean stop(int paramInt) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return false; } try { camera.stopPreview(); status = 268443650; return true; } catch (Exception localException) { SystemTools.setSystemErrorCode(6); } return false; } public class CameraCacheInfo { byte[][] buffer; int bufferFormatPL; int bufferHeight; int bufferSize; int bufferWidth; Camera camera; int[] caps; long deviceHandle; int deviceID; boolean isAutoFocusing; boolean isHalDriven; int overrideFormatAndroid; int overrideHeight; int overrideWidth; int requestFormatAndroid; int requestHeight;

Page 64: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

int requestWidth; int status; CameraSurface surface; SurfaceTexture surfaceTexture; public CameraCacheInfo() {} } } /* Location: * Qualified Name: com.vuforia.ar.pl.Camera1_Preview * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ Camera2_Preview$1.java package com.vuforia.ar.pl; import android.hardware.camera2.CameraDevice; import android.hardware.camera2.CameraDevice.StateCallback; import java.util.concurrent.Semaphore; class Camera2_Preview$1 extends CameraDevice.StateCallback { Camera2_Preview$1(Camera2_Preview paramCamera2_Preview) {} public void onDisconnected(CameraDevice paramCameraDevice) { paramCameraDevice.close(); Camera2_Preview.access$500(this$0).release(); } public void onError(CameraDevice paramCameraDevice, int paramInt) { paramCameraDevice.close(); Camera2_Preview.access$500(this$0).release(); } /* Error */ public void onOpened(CameraDevice paramCameraDevice) { // Byte code:

Page 65: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 0: aconst_null // 1: astore_2 // 2: aconst_null // 3: astore_3 // 4: aload_0 // 5: getfield 15 com/vuforia/ar/pl/Camera2_Preview$1:this$0 Lcom/vuforia/ar/pl/Camera2_Preview; // 8: invokestatic 44 com/vuforia/ar/pl/Camera2_Preview:access$400 (Lcom/vuforia/ar/pl/Camera2_Preview;)Ljava/util/Vector; // 11: invokevirtual 50 java/util/Vector:iterator ()Ljava/util/Iterator; // 14: astore 5 // 16: aload_3 // 17: astore_2 // 18: aload 5 // 20: invokeinterface 56 1 0 // 25: ifeq +80 -> 105 // 28: aload_3 // 29: astore_2 // 30: aload 5 // 32: invokeinterface 60 1 0 // 37: checkcast 62 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo // 40: astore 4 // 42: aload_3 // 43: astore_2 // 44: aload 4 // 46: getfield 66 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:deviceIDString Ljava/lang/String; // 49: aload_1 // 50: invokevirtual 70 android/hardware/camera2/CameraDevice:getId ()Ljava/lang/String; // 53: invokevirtual 76 java/lang/String:equals (Ljava/lang/Object;)Z // 56: ifeq -40 -> 16 // 59: aload 4 // 61: astore_3 // 62: aload_3 // 63: astore_2 // 64: aload_3 // 65: aload_1 // 66: putfield 80 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:device Landroid/hardware/camera2/CameraDevice; // 69: aload_3 // 70: astore_2

Page 66: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 71: aload_3 // 72: aload_1 // 73: iconst_1 // 74: invokevirtual 84 android/hardware/camera2/CameraDevice:createCaptureRequest (I)Landroid/hardware/camera2/CaptureRequest$Builder; // 77: putfield 88 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:builder Landroid/hardware/camera2/CaptureRequest$Builder; // 80: goto -64 -> 16 // 83: astore_1 // 84: aload_2 // 85: aconst_null // 86: putfield 88 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:builder Landroid/hardware/camera2/CaptureRequest$Builder; // 89: aload_2 // 90: aconst_null // 91: putfield 80 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:device Landroid/hardware/camera2/CameraDevice; // 94: aload_0 // 95: getfield 15 com/vuforia/ar/pl/Camera2_Preview$1:this$0 Lcom/vuforia/ar/pl/Camera2_Preview; // 98: invokestatic 30 com/vuforia/ar/pl/Camera2_Preview:access$500 (Lcom/vuforia/ar/pl/Camera2_Preview;)Ljava/util/concurrent/Semaphore; // 101: invokevirtual 35 java/util/concurrent/Semaphore:release ()V // 104: return // 105: aload_0 // 106: getfield 15 com/vuforia/ar/pl/Camera2_Preview$1:this$0 Lcom/vuforia/ar/pl/Camera2_Preview; // 109: invokestatic 30 com/vuforia/ar/pl/Camera2_Preview:access$500 (Lcom/vuforia/ar/pl/Camera2_Preview;)Ljava/util/concurrent/Semaphore; // 112: invokevirtual 35 java/util/concurrent/Semaphore:release ()V // 115: return // 116: astore_1 // 117: aload_0 // 118: getfield 15 com/vuforia/ar/pl/Camera2_Preview$1:this$0 Lcom/vuforia/ar/pl/Camera2_Preview; // 121: invokestatic 30 com/vuforia/ar/pl/Camera2_Preview:access$500 (Lcom/vuforia/ar/pl/Camera2_Preview;)Ljava/util/concurrent/Semaphore; // 124: invokevirtual 35 java/util/concurrent/Semaphore:release ()V

Page 67: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 127: aload_1 // 128: athrow // Local variable table: // start length slot name signature // 0 129 0 this 1 // 0 129 1 paramCameraDevice CameraDevice // 1 89 2 localObject1 Object // 3 69 3 localObject2 Object // 40 20 4 localCameraCacheInfo Camera2_Preview.CameraCacheInfo // 14 17 5 localIterator java.util.Iterator // Exception table: // from to target type // 4 16 83 android/hardware/camera2/CameraAccessException // 18 28 83 android/hardware/camera2/CameraAccessException // 30 42 83 android/hardware/camera2/CameraAccessException // 44 59 83 android/hardware/camera2/CameraAccessException // 64 69 83 android/hardware/camera2/CameraAccessException // 71 80 83 android/hardware/camera2/CameraAccessException // 4 16 116 finally // 18 28 116 finally // 30 42 116 finally // 44 59 116 finally // 64 69 116 finally // 71 80 116 finally // 84 94 116 finally } } /* Location: * Qualified Name: com.vuforia.ar.pl.Camera2_Preview.1 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ Camera2_Preview$2.java package com.vuforia.ar.pl;

Page 68: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

import android.hardware.camera2.CameraCaptureSession; import android.hardware.camera2.CameraCaptureSession.StateCallback; import android.hardware.camera2.CameraDevice; import android.hardware.camera2.CaptureRequest.Builder; import android.view.Surface; import java.util.Iterator; import java.util.List; import java.util.Vector; import java.util.concurrent.Semaphore; class Camera2_Preview$2 extends CameraCaptureSession.StateCallback { Camera2_Preview$2(Camera2_Preview paramCamera2_Preview) {} public void onConfigureFailed(CameraCaptureSession paramCameraCaptureSession) { paramCameraCaptureSession.close(); Camera2_Preview.access$500(this$0).release(); } public void onConfigured(CameraCaptureSession paramCameraCaptureSession) { Surface localSurface = null; Iterator localIterator = Camera2_Preview.access$100(this$0).iterator(); Object localObject; do { localObject = localSurface; if (!localIterator.hasNext()) { break; } localObject = (Camera2_Preview.CameraCacheInfo)localIterator.next(); } while (!deviceIDString.equals(paramCameraCaptureSession.getDevice().getId())); session = paramCameraCaptureSession; paramCameraCaptureSession = surfaces.iterator(); while (paramCameraCaptureSession.hasNext()) { localSurface = (Surface)paramCameraCaptureSession.next(); builder.addTarget(localSurface); }

Page 69: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Camera2_Preview.access$500(this$0).release(); } } /* Location: * Qualified Name: com.vuforia.ar.pl.Camera2_Preview.2 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ Camera2_Preview$AutofocusRunner.java package com.vuforia.ar.pl; import android.hardware.camera2.CameraAccessException; import android.hardware.camera2.CameraCaptureSession; import android.hardware.camera2.CameraCaptureSession.CaptureCallback; import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.CaptureRequest.Builder; import android.hardware.camera2.CaptureResult; import android.hardware.camera2.TotalCaptureResult; class Camera2_Preview$AutofocusRunner extends CameraCaptureSession.CaptureCallback { private Camera2_Preview.CameraCacheInfo mCCI; private CaptureRequest mCancelRequest; private CaptureRequest mFocusRequest; public Camera2_Preview$AutofocusRunner(Camera2_Preview paramCamera2_Preview, Camera2_Preview.CameraCacheInfo paramCameraCacheInfo) { mCCI = paramCameraCacheInfo; mCancelRequest = null; mFocusRequest = null; } public void onCaptureCompleted(CameraCaptureSession paramCameraCaptureSession, CaptureRequest paramCaptureRequest, TotalCaptureResult paramTotalCaptureResult) { super.onCaptureCompleted(paramCameraCaptureSession, paramCaptureRequest, paramTotalCaptureResult);

Page 70: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramCameraCaptureSession = (Integer)paramTotalCaptureResult.get(CaptureResult.CONTROL_AF_STATE); if ((paramCaptureRequest.equals(mCancelRequest)) && (paramCameraCaptureSession.intValue() == 0)) {} for (;;) { try { mCCI.session.capture(mFocusRequest, this, mCCI.handler); return; } catch (CameraAccessException paramCameraCaptureSession) {} if ((paramCaptureRequest.equals(mFocusRequest)) && ((paramCameraCaptureSession.intValue() == 4) || (paramCameraCaptureSession.intValue() == 5))) { mCCI.isAutoFocusing = false; return; } } } public boolean triggerAutofocus() throws CameraAccessException { if ((mCCI == null) || (mCCI.builder == null) || (mCCI.session == null)) {} Integer localInteger; do { return false; localInteger = (Integer)mCCI.builder.get(CaptureRequest.CONTROL_AF_MODE); } while ((CaptureRequest.CONTROL_AF_MODE == null) || (localInteger == null) || ((localInteger.intValue() != 1) && (localInteger.intValue() != 2))); mCCI.isAutoFocusing = true; mCCI.builder.set(CaptureRequest.CONTROL_AF_TRIGGER, Integer.valueOf(2)); mCancelRequest = mCCI.builder.build(); mCCI.builder.set(CaptureRequest.CONTROL_AF_TRIGGER, Integer.valueOf(0)); mCCI.builder.set(CaptureRequest.CONTROL_AF_TRIGGER, Integer.valueOf(1)); mFocusRequest = mCCI.builder.build();

Page 71: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

mCCI.builder.set(CaptureRequest.CONTROL_AF_TRIGGER, Integer.valueOf(0)); mCCI.session.capture(mCancelRequest, this, mCCI.handler); return true; } } /* Location: * Qualified Name: com.vuforia.ar.pl.Camera2_Preview.AutofocusRunner * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ Camera2_Preview$CameraCacheInfo.java

package com.vuforia.ar.pl; import android.hardware.camera2.CameraCaptureSession; import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CameraDevice; import android.hardware.camera2.CaptureRequest.Builder; import android.hardware.camera2.CaptureResult; import android.media.Image; import android.media.ImageReader; import android.os.Handler; import android.os.HandlerThread; import android.view.Surface; import java.util.List; import java.util.concurrent.Semaphore; public class Camera2_Preview$CameraCacheInfo { int bufferFormatPL; int bufferHeight; int bufferWidth; CaptureRequest.Builder builder; int[] caps; CameraCharacteristics characteristics; CameraDevice device; long deviceHandle; int deviceID; String deviceIDString; Handler handler; Semaphore imageSemaphore; Image[] images; boolean isAutoFocusing; CaptureResult lastResult;

Page 72: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

int overrideFormatAndroid; int overrideHeight; int overrideWidth; ImageReader reader; int requestFormatAndroid; int requestFramerate; int requestHeight; int requestWidth; CameraCaptureSession session; int status; List<Surface> surfaces; HandlerThread thread; public Camera2_Preview$CameraCacheInfo(Camera2_Preview paramCamera2_Preview) {} } /* Location: * Qualified Name: com.vuforia.ar.pl.Camera2_Preview.CameraCacheInfo * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ Camera2_Preview$FrameInfo.java

package com.vuforia.ar.pl; public class Camera2_Preview$FrameInfo { long exposureTime; int iso; long timestamp; public Camera2_Preview$FrameInfo(Camera2_Preview paramCamera2_Preview) {} } /* Location: * Qualified Name: com.vuforia.ar.pl.Camera2_Preview.FrameInfo * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */

Page 73: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Camera2_Preview$OnCameraDataAvailable.java

package com.vuforia.ar.pl; import android.hardware.camera2.CaptureResult; import android.media.Image; import android.media.Image.Plane; import android.media.ImageReader; import android.media.ImageReader.OnImageAvailableListener; import android.os.Trace; import java.nio.ByteBuffer; import java.util.HashMap; import java.util.Vector; import java.util.concurrent.Semaphore; class Camera2_Preview$OnCameraDataAvailable implements ImageReader.OnImageAvailableListener { private int DEBUG_FORMAT = 0; private int[] actualBufferSize = null; private int actualCaptureFormat = 268439808; private int currentTestBufferIndex = 0; private ByteBuffer[] testYUVBuffers = new ByteBuffer[2]; public Camera2_Preview$OnCameraDataAvailable(Camera2_Preview paramCamera2_Preview) {} private ByteBuffer convertNV21toPaddedYUV(ByteBuffer paramByteBuffer, Image.Plane paramPlane1, Image.Plane paramPlane2, Image.Plane paramPlane3, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7) { if (paramByteBuffer != null) { paramByteBuffer.rewind(); if (paramInt4 != 0) { break label69; } paramByteBuffer.put(paramPlane1.getBuffer()); } for (;;) { if (paramInt5 <= 0) { break label153;

Page 74: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} paramInt3 = 0; while (paramInt3 < actualBufferSize[0] * paramInt5) { paramByteBuffer.put((byte)0); paramInt3 += 1; } paramByteBuffer = ByteBuffer.allocateDirect(paramInt3); break; label69: int i = paramPlane1.getBuffer().limit(); while (paramPlane1.getBuffer().hasRemaining()) { paramPlane1.getBuffer().limit(paramPlane1.getBuffer().position() + paramInt2); paramByteBuffer.put(paramPlane1.getBuffer()); paramInt3 = 0; while (paramInt3 < paramInt4) { paramByteBuffer.put((byte)0); paramInt3 += 1; } paramPlane1.getBuffer().limit(i); } } label153: paramInt3 = 0; while (paramInt3 < paramInt1 / 2) { paramInt4 = 0; while (paramInt4 < paramInt2 / 2) { paramByteBuffer.put(paramPlane2.getBuffer().get()); if (paramPlane2.getBuffer().hasRemaining()) { paramPlane2.getBuffer().get(); } paramInt4 += 1; } paramInt4 = 0; while (paramInt4 < paramInt6) { paramByteBuffer.put((byte)0); paramInt4 += 1; } paramInt3 += 1;

Page 75: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} if (paramInt7 > 0) { paramInt3 = 0; while (paramInt3 < actualBufferSize[2] * paramInt7) { paramByteBuffer.put((byte)0); paramInt3 += 1; } } paramInt3 = 0; while (paramInt3 < paramInt1 / 2) { paramInt4 = 0; while (paramInt4 < paramInt2 / 2) { paramByteBuffer.put(paramPlane3.getBuffer().get()); if (paramPlane3.getBuffer().hasRemaining()) { paramPlane3.getBuffer().get(); } paramInt4 += 1; } paramInt4 = 0; while (paramInt4 < paramInt6) { paramByteBuffer.put((byte)0); paramInt4 += 1; } paramInt3 += 1; } if (paramInt7 > 0) { paramInt1 = 0; while (paramInt1 < actualBufferSize[2] * paramInt7) { paramByteBuffer.put((byte)0); paramInt1 += 1; } } paramByteBuffer.flip(); return paramByteBuffer; } private ByteBuffer convertNV21toYUV420Contigious(Image paramImage, ByteBuffer paramByteBuffer)

Page 76: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ Image.Plane localPlane1 = paramImage.getPlanes()[0]; Image.Plane localPlane2 = paramImage.getPlanes()[1]; Image.Plane localPlane3 = paramImage.getPlanes()[2]; int i1 = paramImage.getHeight(); int i2 = paramImage.getWidth(); int i = i1 * i2 * 12 / 8; int j = 0; int k = 0; int m = 0; int n = 0; if (actualBufferSize != null) { i = actualBufferSize[0] * actualBufferSize[1] + actualBufferSize[2] * 2 * actualBufferSize[3]; j = actualBufferSize[0] - i2; k = actualBufferSize[1] - i1; m = actualBufferSize[2] - i2 / 2; n = actualBufferSize[3] - i1 / 2; } return convertNV21toPaddedYUV(paramByteBuffer, localPlane1, localPlane3, localPlane2, i1, i2, i, j, k, m, n); } private ByteBuffer convertNV21toYV12Contigious(Image paramImage, ByteBuffer paramByteBuffer) { Image.Plane localPlane1 = paramImage.getPlanes()[0]; Image.Plane localPlane2 = paramImage.getPlanes()[1]; Image.Plane localPlane3 = paramImage.getPlanes()[2]; int i1 = paramImage.getHeight(); int i2 = paramImage.getWidth(); int i = i1 * i2 * 12 / 8; int j = 0; int k = 0; int m = 0; int n = 0; if (actualBufferSize != null) { i = actualBufferSize[0] * actualBufferSize[1] + actualBufferSize[2] * 2 * actualBufferSize[3]; j = actualBufferSize[0] - i2; k = actualBufferSize[1] - i1; m = actualBufferSize[2] - i2 / 2; n = actualBufferSize[3] - i1 / 2;

Page 77: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} return convertNV21toPaddedYUV(paramByteBuffer, localPlane1, localPlane2, localPlane3, i1, i2, i, j, k, m, n); } private int getImageFormat(Image paramImage) { if ((paramImage == null) || (paramImage.getPlanes().length != 3) || (paramImage.getFormat() != 35)) {} Image.Plane localPlane1; Image.Plane localPlane2; long[] arrayOfLong; do { Image.Plane localPlane3; do { return 268439808; localPlane1 = paramImage.getPlanes()[0]; localPlane2 = paramImage.getPlanes()[1]; localPlane3 = paramImage.getPlanes()[2]; } while ((localPlane1.getPixelStride() != 1) || (localPlane1.getRowStride() != paramImage.getWidth()) || (localPlane2.getPixelStride() != localPlane3.getPixelStride()) || (localPlane2.getRowStride() != localPlane3.getRowStride())); arrayOfLong = new long[3]; arrayOfLong[0] = Camera2_Preview.access$300(this$0, localPlane1.getBuffer()); arrayOfLong[1] = Camera2_Preview.access$300(this$0, localPlane2.getBuffer()); arrayOfLong[2] = Camera2_Preview.access$300(this$0, localPlane3.getBuffer()); } while ((arrayOfLong[0] == 0L) || (arrayOfLong[1] == 0L) || (arrayOfLong[2] == 0L)); if (localPlane2.getPixelStride() == 2) { if (arrayOfLong[1] + 1L == arrayOfLong[2]) { return 268439815; } if (arrayOfLong[2] + 1L == arrayOfLong[1]) { return 268439817; } } if (localPlane2.getPixelStride() == 1) {

Page 78: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (arrayOfLong[1] < arrayOfLong[2]) { if (arrayOfLong[1] + paramImage.getHeight() / 2 * (paramImage.getWidth() / 2) != arrayOfLong[2]) { actualBufferSize = new int[4]; actualBufferSize[0] = localPlane1.getRowStride(); actualBufferSize[1] = ((int)((arrayOfLong[1] - arrayOfLong[0]) / localPlane1.getRowStride())); actualBufferSize[2] = localPlane2.getRowStride(); actualBufferSize[3] = ((int)((arrayOfLong[2] - arrayOfLong[1]) / localPlane2.getRowStride())); } return 268439818; } if (arrayOfLong[2] + paramImage.getHeight() / 2 * (paramImage.getWidth() / 2) != arrayOfLong[1]) { actualBufferSize = new int[4]; actualBufferSize[0] = localPlane1.getRowStride(); actualBufferSize[1] = ((int)((arrayOfLong[2] - arrayOfLong[0]) / localPlane1.getRowStride())); actualBufferSize[2] = localPlane2.getRowStride(); actualBufferSize[3] = ((int)((arrayOfLong[1] - arrayOfLong[2]) / localPlane2.getRowStride())); } return 268439828; } DebugLog.LOGE("Camera2_Preview", "Unable to detect a supported image format, Unknown Image Format"); return 268439808; } public void onImageAvailable(ImageReader paramImageReader) { Trace.beginSection("onImageAvailable (java)"); Integer localInteger = (Integer)Camera2_Preview.access$000(this$0).get(paramImageReader); if (localInteger == null) { DebugLog.LOGE("Camera2_Preview", "Unable to find reader in the index cache!"); Trace.endSection(); return; }

Page 79: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Camera2_Preview.CameraCacheInfo localCameraCacheInfo = (Camera2_Preview.CameraCacheInfo)Camera2_Preview.access$100(this$0).get(localInteger.intValue()); if (localCameraCacheInfo == null) { DebugLog.LOGE("Camera2_Preview", "Unable to find CCI in list!"); Trace.endSection(); return; } if (!imageSemaphore.tryAcquire()) { DebugLog.LOGE("Camera2_Preview", "Unable to aquire image semaphore, need to free some buffers!!"); Trace.endSection(); return; } Camera2_Preview.FrameInfo localFrameInfo; if (paramImageReader.getMaxImages() > 0) { paramImageReader = paramImageReader.acquireLatestImage(); if (paramImageReader != null) { localFrameInfo = new Camera2_Preview.FrameInfo(this$0); timestamp = paramImageReader.getTimestamp(); Object localObject = lastResult; if (localObject != null) { Long localLong = (Long)((CaptureResult)localObject).get(CaptureResult.SENSOR_EXPOSURE_TIME); if (localLong != null) { exposureTime = localLong.longValue(); timestamp += localLong.longValue(); } localObject = (Integer)((CaptureResult)localObject).get(CaptureResult.SENSOR_SENSITIVITY); if (localObject != null) { iso = ((Integer)localObject).intValue(); } } if (actualCaptureFormat == 268439808) { actualCaptureFormat = getImageFormat(paramImageReader); }

Page 80: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (DEBUG_FORMAT != 268439818) { break label327; } testYUVBuffers[currentTestBufferIndex] = convertNV21toYV12Contigious(paramImageReader, testYUVBuffers[currentTestBufferIndex]); paramImageReader.close(); Camera2_Preview.access$200(this$0, deviceHandle, localInteger.intValue(), bufferWidth, bufferHeight, actualBufferSize, 268439818, testYUVBuffers[currentTestBufferIndex], localFrameInfo); currentTestBufferIndex = ((currentTestBufferIndex + 1) % 2); } } for (;;) { imageSemaphore.release(); Trace.endSection(); return; label327: if (DEBUG_FORMAT == 268439828) { testYUVBuffers[currentTestBufferIndex] = convertNV21toYUV420Contigious(paramImageReader, testYUVBuffers[currentTestBufferIndex]); paramImageReader.close(); Camera2_Preview.access$200(this$0, deviceHandle, localInteger.intValue(), bufferWidth, bufferHeight, actualBufferSize, 268439828, testYUVBuffers[currentTestBufferIndex], localFrameInfo); currentTestBufferIndex = ((currentTestBufferIndex + 1) % 2); } else { Camera2_Preview.access$200(this$0, deviceHandle, localInteger.intValue(), bufferWidth, bufferHeight, actualBufferSize, actualCaptureFormat, paramImageReader.getPlanes()[0].getBuffer(), localFrameInfo); paramImageReader.close(); } } } } /* Location: * Qualified Name: com.vuforia.ar.pl.Camera2_Preview.OnCameraDataAvailable

Page 81: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

* Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ Camera2_Preview$OnFrameCapturedCallback.java package com.vuforia.ar.pl; import android.hardware.camera2.CameraCaptureSession; import android.hardware.camera2.CameraCaptureSession.CaptureCallback; import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.TotalCaptureResult; class Camera2_Preview$OnFrameCapturedCallback extends CameraCaptureSession.CaptureCallback { Camera2_Preview.CameraCacheInfo mCCI; public Camera2_Preview$OnFrameCapturedCallback(Camera2_Preview paramCamera2_Preview, Camera2_Preview.CameraCacheInfo paramCameraCacheInfo) { mCCI = paramCameraCacheInfo; } public void onCaptureCompleted(CameraCaptureSession paramCameraCaptureSession, CaptureRequest paramCaptureRequest, TotalCaptureResult paramTotalCaptureResult) { if (mCCI != null) { mCCI.lastResult = paramTotalCaptureResult;

Page 82: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} } } /* Location: * Qualified Name: com.vuforia.ar.pl.Camera2_Preview.OnFrameCapturedCallback * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ Camera2_Preview.java package com.vuforia.ar.pl; import android.annotation.TargetApi; import android.app.Activity; import android.content.Context; import android.content.pm.PackageManager; import android.graphics.Rect; import android.hardware.camera2.CameraAccessException; import android.hardware.camera2.CameraCaptureSession; import android.hardware.camera2.CameraCaptureSession.CaptureCallback; import android.hardware.camera2.CameraCaptureSession.StateCallback; import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CameraCharacteristics.Key; import android.hardware.camera2.CameraDevice; import android.hardware.camera2.CameraDevice.StateCallback; import android.hardware.camera2.CameraManager; import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.CaptureRequest.Builder; import android.hardware.camera2.CaptureRequest.Key; import android.hardware.camera2.CaptureResult; import android.hardware.camera2.TotalCaptureResult;

Page 83: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

import android.hardware.camera2.params.MeteringRectangle; import android.hardware.camera2.params.StreamConfigurationMap; import android.media.Image; import android.media.Image.Plane; import android.media.ImageReader; import android.media.ImageReader.OnImageAvailableListener; import android.os.Handler; import android.os.HandlerThread; import android.os.Trace; import android.util.Pair; import android.util.Range; import android.util.Rational; import android.util.Size; import android.view.Surface; import java.nio.ByteBuffer; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Vector; import java.util.concurrent.Semaphore; @TargetApi(21) public class Camera2_Preview { private static final int AR_CAMERA_DIRECTION_BACK = 268443665; private static final int AR_CAMERA_DIRECTION_FRONT = 268443666; private static final int AR_CAMERA_DIRECTION_UNKNOWN = 268443664; private static final int AR_CAMERA_EXPOSUREMODE_AUTO = 805314560; private static final int AR_CAMERA_EXPOSUREMODE_CONTINUOUSAUTO = 805322752; private static final int AR_CAMERA_EXPOSUREMODE_LOCKED = 805310464; private static final int AR_CAMERA_EXPOSUREMODE_MANUAL = 805339136; private static final int AR_CAMERA_EXPOSUREMODE_SHUTTER_PRIORITY = 805371904; private static final int AR_CAMERA_FOCUSMODE_AUTO = 805306400; private static final int AR_CAMERA_FOCUSMODE_CONTINUOUSAUTO = 805306432; private static final int AR_CAMERA_FOCUSMODE_FIXED = 805306880; private static final int AR_CAMERA_FOCUSMODE_INFINITY = 805306624; private static final int AR_CAMERA_FOCUSMODE_MACRO = 805306496;

Page 84: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private static final int AR_CAMERA_FOCUSMODE_NORMAL = 805306384; private static final int AR_CAMERA_IMAGE_FORMAT_ARGB32 = 268439813; private static final int AR_CAMERA_IMAGE_FORMAT_ARGB8888 = 268439813; private static final int AR_CAMERA_IMAGE_FORMAT_BGR24 = 268439822; private static final int AR_CAMERA_IMAGE_FORMAT_BGR888 = 268439822; private static final int AR_CAMERA_IMAGE_FORMAT_BGRA32 = 268439814; private static final int AR_CAMERA_IMAGE_FORMAT_BGRA8888 = 268439814; private static final int AR_CAMERA_IMAGE_FORMAT_LUM = 268439809; private static final int AR_CAMERA_IMAGE_FORMAT_NV12 = 268439815; private static final int AR_CAMERA_IMAGE_FORMAT_NV16 = 268439816; private static final int AR_CAMERA_IMAGE_FORMAT_NV21 = 268439817; private static final int AR_CAMERA_IMAGE_FORMAT_RGB24 = 268439811; private static final int AR_CAMERA_IMAGE_FORMAT_RGB565 = 268439810; private static final int AR_CAMERA_IMAGE_FORMAT_RGB888 = 268439811; private static final int AR_CAMERA_IMAGE_FORMAT_RGBA32 = 268439812; private static final int AR_CAMERA_IMAGE_FORMAT_RGBA4444 = 268439821; private static final int AR_CAMERA_IMAGE_FORMAT_RGBA5551 = 268439820; private static final int AR_CAMERA_IMAGE_FORMAT_RGBA8888 = 268439812; private static final int AR_CAMERA_IMAGE_FORMAT_UNKNOWN = 268439808; private static final int AR_CAMERA_IMAGE_FORMAT_YUV420P = 268439828; private static final int AR_CAMERA_IMAGE_FORMAT_YV12 = 268439818; private static final int AR_CAMERA_IMAGE_FORMAT_YV16 = 268439819; private static final int AR_CAMERA_PARAMTYPE_BASE = 536870912; private static final int AR_CAMERA_PARAMTYPE_BRIGHTNESSRANGE = 537133056; private static final int AR_CAMERA_PARAMTYPE_BRIGHTNESSVALUE = 537001984; private static final int AR_CAMERA_PARAMTYPE_CONTRASTRANGE = 537919488;

Page 85: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private static final int AR_CAMERA_PARAMTYPE_CONTRASTVALUE = 537395200; private static final int AR_CAMERA_PARAMTYPE_EXPOSUREMODE = 536870944; private static final int AR_CAMERA_PARAMTYPE_EXPOSURETIME = 536871168; private static final int AR_CAMERA_PARAMTYPE_EXPOSURETIMERANGE = 536871424; private static final int AR_CAMERA_PARAMTYPE_EXPOSUREVALUE = 536871936; private static final int AR_CAMERA_PARAMTYPE_EXPOSUREVALUERANGE = 536872960; private static final int AR_CAMERA_PARAMTYPE_FOCUSMODE = 536870914; private static final int AR_CAMERA_PARAMTYPE_FOCUSRANGE = 536870920; private static final int AR_CAMERA_PARAMTYPE_FOCUSREGION = 536870928; private static final int AR_CAMERA_PARAMTYPE_FOCUSVALUE = 536870916; private static final int AR_CAMERA_PARAMTYPE_ISO = 536870976; private static final int AR_CAMERA_PARAMTYPE_ISORANGE = 536871040; private static final int AR_CAMERA_PARAMTYPE_LENS_IS_ADJUSTING = 545259520; private static final int AR_CAMERA_PARAMTYPE_RECORDING_HINT = 541065216; private static final int AR_CAMERA_PARAMTYPE_ROTATION = 538968064; private static final int AR_CAMERA_PARAMTYPE_TORCHMODE = 536870913; private static final int AR_CAMERA_PARAMTYPE_VIDEO_STABILIZATION = 553648128; private static final int AR_CAMERA_PARAMTYPE_WHITEBALANCEMODE = 536875008; private static final int AR_CAMERA_PARAMTYPE_WHITEBALANCERANGE = 536887296; private static final int AR_CAMERA_PARAMTYPE_WHITEBALANCEVALUE = 536879104; private static final int AR_CAMERA_PARAMTYPE_ZOOMRANGE = 536936448; private static final int AR_CAMERA_PARAMTYPE_ZOOMVALUE = 536903680; private static final int AR_CAMERA_PARAMVALUE_BASE = 805306368;

Page 86: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private static final int AR_CAMERA_STATUS_CAPTURE_RUNNING = 268443651; private static final int AR_CAMERA_STATUS_OPENED = 268443650; private static final int AR_CAMERA_STATUS_UNINITIALIZED = 268443649; private static final int AR_CAMERA_STATUS_UNKNOWN = 268443648; private static final int AR_CAMERA_TORCHMODE_AUTO = 805306372; private static final int AR_CAMERA_TORCHMODE_CONTINUOUSAUTO = 805306376; private static final int AR_CAMERA_TORCHMODE_OFF = 805306369; private static final int AR_CAMERA_TORCHMODE_ON = 805306370; private static final int AR_CAMERA_TYPE_MONO = 268447761; private static final int AR_CAMERA_TYPE_STEREO = 268447762; private static final int AR_CAMERA_TYPE_UNKNOWN = 268447760; private static final int AR_CAMERA_WHITEBALANCEMODE_AUTO = 807403520; private static final int AR_CAMERA_WHITEBALANCEMODE_CONTINUOUSAUTO = 809500672; private static final int AR_CAMERA_WHITEBALANCEMODE_LOCKED = 806354944; private static final int CAMERA_CAPSINFO_VALUE_NUM_SUPPORTED_FRAMERATES = 4; private static final int CAMERA_CAPSINFO_VALUE_NUM_SUPPORTED_IMAGEFORMATS = 5; private static final int CAMERA_CAPSINFO_VALUE_NUM_SUPPORTED_IMAGESIZES = 3; private static final int CAMERA_CAPSINFO_VALUE_SUPPORTED_PARAMVALUES = 2; private static final int CAMERA_CAPSINFO_VALUE_SUPPORTED_QUERYABLE_PARAMS = 0; private static final int CAMERA_CAPSINFO_VALUE_SUPPORTED_SETTABLE_PARAMS = 1; private static final int CAMERA_CAPTUREINFO_VALUE_FORMAT = 2; private static final int CAMERA_CAPTUREINFO_VALUE_FRAMERATE = 3; private static final int CAMERA_CAPTUREINFO_VALUE_HEIGHT = 1; private static final int CAMERA_CAPTUREINFO_VALUE_PREVIEWSURFACEENABLED = 4; private static final int CAMERA_CAPTUREINFO_VALUE_WIDTH = 0; private static final int[] CAMERA_IMAGE_FORMAT_CONVERSIONTABLE = { 35, 268439817 }; private static boolean CONVERT_FORMAT_TO_ANDROID = false; private static boolean CONVERT_FORMAT_TO_PL = true; private static final Range<Integer> EMPTY_RANGE = new Range(Integer.valueOf(0), Integer.valueOf(0)); private static final String FOCUS_MODE_NORMAL = "normal";

Page 87: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private static final int MAX_HIGHEST_FPS_ALLOWED = 300; private static final int MAX_LOWEST_FPS_ALLOWED = 150; private static final String MODULENAME = "Camera2_Preview"; private static final int NUM_CAPTURE_BUFFERS = 2; private static final int NUM_MAX_CAMERAOPEN_RETRY = 10; private static final int TIME_CAMERAOPEN_RETRY_DELAY_MS = 250; private static final int _NUM_CAMERA_CAPSINFO_VALUE_ = 6; private static final int _NUM_CAMERA_CAPTUREINFO_VALUE_ = 5; private HashMap<ImageReader, Integer> mCameraCacheInfoIndexCache = null; private Vector<CameraCacheInfo> mCameraCacheInfos = null; private Vector<CameraCacheInfo> mCameraCacheInfosInProgress = null; private CameraManager mCameraManager; private Context mContext; private int mIsPermissionGranted = -1; private Semaphore mOpenCloseSemaphore = new Semaphore(1); private boolean checkCameraManager() { if (mCameraManager != null) { return true; } Object localObject = SystemTools.getActivityFromNative(); if (localObject == null) { return false; } localObject = ((Activity)localObject).getApplication(); if (localObject == null) { return false; } mCameraManager = ((CameraManager)((Context)localObject).getSystemService("camera")); return mCameraManager != null; } private boolean checkPermission() { if (mIsPermissionGranted == 0) {} for (;;) { return true; try { Activity localActivity = SystemTools.getActivityFromNative();

Page 88: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

mIsPermissionGranted = localActivity.getPackageManager().checkPermission("android.permission.CAMERA", localActivity.getPackageName()); int i = mIsPermissionGranted; if (i == 0) {} } catch (Exception localException) { for (;;) {} } } return false; } private native long getBufferAddress(ByteBuffer paramByteBuffer); private CameraCacheInfo getCameraCacheInfo(int paramInt) { if ((paramInt < 0) || (paramInt >= mCameraCacheInfos.size())) { return null; } return (CameraCacheInfo)mCameraCacheInfos.get(paramInt); } private int getCameraDeviceIndex(int paramInt1, int paramInt2, int paramInt3) { if (paramInt2 != 268447760) {} paramInt2 = -1; int i; switch (paramInt3) { default: SystemTools.setSystemErrorCode(2); i = -1; } for (;;) { return i; paramInt2 = 1; try { for (;;) { String[] arrayOfString = mCameraManager.getCameraIdList();

Page 89: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramInt3 = 0; for (;;) { if (paramInt3 >= arrayOfString.length) { break label134; } CameraCharacteristics localCameraCharacteristics = mCameraManager.getCameraCharacteristics(arrayOfString[paramInt3]); if (paramInt2 >= 0) { i = ((Integer)localCameraCharacteristics.get(CameraCharacteristics.LENS_FACING)).intValue(); if (paramInt2 != i) {} } else { i = paramInt3; if (paramInt1 < 0) { break; } i = paramInt3; if (paramInt1 == paramInt3) { break; } } paramInt3 += 1; } paramInt2 = 0; } label134: return -1; } catch (CameraAccessException localCameraAccessException) { SystemTools.setSystemErrorCode(6); } } } private List<Integer> getSupportedPreviewFrameRates(CameraCharacteristics paramCameraCharacteristics) {

Page 90: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramCameraCharacteristics = (Range[])paramCameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES); int i = Integer.MAX_VALUE; int j = Integer.MIN_VALUE; int m = paramCameraCharacteristics.length; int k = 0; while (k < m) { localLinkedList = paramCameraCharacteristics[k]; i = Math.min(i, ((Integer)localLinkedList.getLower()).intValue()); j = Math.max(j, ((Integer)localLinkedList.getUpper()).intValue()); k += 1; } LinkedList localLinkedList = new LinkedList(); if ((i < 0) || (i >= 150) || (j < 0) || (j >= 300)) { DebugLog.LOGW("Camera2_Preview", String.format("Detected odd fps values from Camera2 API: low=%d, high=%d. Using saner defaults instead.", new Object[] { Integer.valueOf(i), Integer.valueOf(j) })); localLinkedList.add(Integer.valueOf(30)); return localLinkedList; } label156: if (i <= j) { m = paramCameraCharacteristics.length; k = 0; } for (;;) { if (k < m) { if (paramCameraCharacteristics[k].contains(Integer.valueOf(i))) { localLinkedList.add(Integer.valueOf(i)); } } else { i += 1; break label156; break; } k += 1; }

Page 91: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} private <T> CaptureRequest.Key<T> mapStringToKey(String paramString, CameraCharacteristics paramCameraCharacteristics, T paramT) { paramCameraCharacteristics = paramCameraCharacteristics.getAvailableCaptureRequestKeys().iterator(); while (paramCameraCharacteristics.hasNext()) { paramT = (CaptureRequest.Key)paramCameraCharacteristics.next(); if (paramT.getName().equals(paramString)) { return paramT; } } return null; } private native void newFrameAvailable(long paramLong, int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfInt, int paramInt4, ByteBuffer paramByteBuffer, Object paramObject); private void setCameraCapsBit(CameraCacheInfo paramCameraCacheInfo, int paramInt1, int paramInt2, boolean paramBoolean) { switch (paramInt1) { default: return; } for (int i = 805306368;; i = 536870912) { paramInt2 = (int)(Math.log((i ^ 0xFFFFFFFF) & paramInt2) / Math.log(2.0D)); if (!paramBoolean) { break; } paramCameraCacheInfo = caps; paramCameraCacheInfo[paramInt1] |= 1 << paramInt2; return; } paramCameraCacheInfo = caps; paramCameraCacheInfo[paramInt1] &= (1 << paramInt2 ^ 0xFFFFFFFF); }

Page 92: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private boolean setCameraCaptureParams(CameraCacheInfo paramCameraCacheInfo, int[] paramArrayOfInt1, int[] paramArrayOfInt2) { if ((paramArrayOfInt1 != null) || (paramArrayOfInt2 != null)) { if (paramArrayOfInt2 == null) { break label66; } i = paramArrayOfInt2[0]; overrideWidth = i; if (paramArrayOfInt2 == null) { break label74; } i = paramArrayOfInt2[1]; label32: overrideHeight = i; if (paramArrayOfInt2 == null) { break label82; } } label66: label74: label82: for (int i = paramArrayOfInt2[2];; i = paramArrayOfInt1[2]) { overrideFormatAndroid = translateImageFormat(i, CONVERT_FORMAT_TO_ANDROID); if (paramArrayOfInt1 != null) { break label90; } return true; i = paramArrayOfInt1[0]; break; i = paramArrayOfInt1[1]; break label32; } label90: if ((paramCameraCacheInfo == null) || (builder == null) || (characteristics == null)) { DebugLog.LOGE("Camera2_Preview", "CamCacheInfo not properly initialized in setCaptureParams"); return false; } requestWidth = paramArrayOfInt1[0];

Page 93: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

requestHeight = paramArrayOfInt1[1]; requestFormatAndroid = translateImageFormat(paramArrayOfInt1[2], CONVERT_FORMAT_TO_ANDROID); requestFramerate = paramArrayOfInt1[3]; paramArrayOfInt2 = ((StreamConfigurationMap)characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP)).getOutputSizes(requestFormatAndroid); if (paramArrayOfInt2 == null) { DebugLog.LOGD("Camera2_Preview", String.format("setCameraCaptureParams: format not supported. : %d", new Object[] { Integer.valueOf(paramArrayOfInt1[2]) })); return false; } boolean bool = false; int j = paramArrayOfInt2.length; i = 0; for (;;) { if (i < j) { bool = paramArrayOfInt2[i].equals(new Size(requestWidth, requestHeight)); if (!bool) {} } else { if (bool) { break; } DebugLog.LOGD("Camera2_Preview", String.format("setCameraCaptureParams: size not supported. : %d, %d", new Object[] { Integer.valueOf(requestWidth), Integer.valueOf(requestHeight) })); return false; } i += 1; } Range[] arrayOfRange = (Range[])characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES); paramArrayOfInt1 = null; j = Integer.MAX_VALUE; int n = arrayOfRange.length; i = 0;

Page 94: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

for (;;) { paramArrayOfInt2 = paramArrayOfInt1; Range localRange; if (i < n) { localRange = arrayOfRange[i]; if ((((Integer)localRange.getLower()).intValue() >= 150) || (((Integer)localRange.getUpper()).intValue() >= 300)) { DebugLog.LOGW("Camera2_Preview", String.format("Detected odd fps values from Camera2 API: low=%d, high=%d. Using first fps range as default instead of searching for perfect fit.", new Object[] { localRange.getLower(), localRange.getUpper() })); paramArrayOfInt2 = arrayOfRange[0]; } } else { if (paramArrayOfInt2 != null) { break; } DebugLog.LOGD("Camera2_Preview", String.format("setCameraCaptureParams: fps range not supported.", new Object[0])); return false; } paramArrayOfInt2 = paramArrayOfInt1; int k = j; if (localRange.contains(Integer.valueOf(requestFramerate))) { int m = ((Integer)localRange.getUpper()).intValue() - ((Integer)localRange.getLower()).intValue(); paramArrayOfInt2 = paramArrayOfInt1; k = j; if (m < j) { paramArrayOfInt2 = localRange; k = m; } } i += 1; paramArrayOfInt1 = paramArrayOfInt2; j = k; }

Page 95: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

builder.set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, paramArrayOfInt2); return true; } /* Error */ private boolean setCustomCameraParams(CameraCacheInfo paramCameraCacheInfo, String paramString) { // Byte code: // 0: aload_1 // 1: ifnull +17 -> 18 // 4: aload_1 // 5: getfield 486 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:builder Landroid/hardware/camera2/CaptureRequest$Builder; // 8: ifnull +10 -> 18 // 11: aload_1 // 12: getfield 490 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:characteristics Landroid/hardware/camera2/CameraCharacteristics; // 15: ifnonnull +5 -> 20 // 18: iconst_0 // 19: ireturn // 20: new 551 org/json/JSONObject // 23: dup // 24: aload_2 // 25: invokespecial 554 org/json/JSONObject:<init> (Ljava/lang/String;)V // 28: astore_2 // 29: aload_2 // 30: invokevirtual 557 org/json/JSONObject:keys ()Ljava/util/Iterator; // 33: astore_3 // 34: aload_3 // 35: invokeinterface 443 1 0 // 40: ifeq +89 -> 129 // 43: aload_3 // 44: invokeinterface 447 1 0 // 49: checkcast 406 java/lang/String // 52: astore 4 // 54: aload_2 // 55: aload 4 // 57: invokevirtual 559 org/json/JSONObject:get (Ljava/lang/String;)Ljava/lang/Object; // 60: astore 5

Page 96: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 62: aload 5 // 64: invokevirtual 563 java/lang/Object:getClass ()Ljava/lang/Class; // 67: astore 6 // 69: aload 6 // 71: ldc_w 406 // 74: if_acmpeq +10 -> 84 // 77: aload 6 // 79: ldc -12 // 81: if_acmpne -63 -> 18 // 84: aload_0 // 85: aload 4 // 87: aload_1 // 88: getfield 490 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:characteristics Landroid/hardware/camera2/CameraCharacteristics; // 91: aload 5 // 93: invokespecial 565 com/vuforia/ar/pl/Camera2_Preview:mapStringToKey (Ljava/lang/String;Landroid/hardware/camera2/CameraCharacteristics;Ljava/lang/Object;)Landroid/hardware/camera2/CaptureRequest$Key; // 96: ifnull -78 -> 18 // 99: aload_1 // 100: getfield 486 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:builder Landroid/hardware/camera2/CaptureRequest$Builder; // 103: aload_0 // 104: aload 4 // 106: aload_1 // 107: getfield 490 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:characteristics Landroid/hardware/camera2/CameraCharacteristics; // 110: aload 5 // 112: invokespecial 565 com/vuforia/ar/pl/Camera2_Preview:mapStringToKey (Ljava/lang/String;Landroid/hardware/camera2/CameraCharacteristics;Ljava/lang/Object;)Landroid/hardware/camera2/CaptureRequest$Key; // 115: aload 5 // 117: invokevirtual 545 android/hardware/camera2/CaptureRequest$Builder:set (Landroid/hardware/camera2/CaptureRequest$Key;Ljava/lang/Object;)V // 120: goto -86 -> 34 // 123: astore_1 // 124: iconst_0 // 125: ireturn

Page 97: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 126: astore_1 // 127: iconst_0 // 128: ireturn // 129: iconst_1 // 130: ireturn // Local variable table: // start length slot name signature // 0 131 0 this Camera2_Preview // 0 131 1 paramCameraCacheInfo CameraCacheInfo // 0 131 2 paramString String // 33 11 3 localIterator Iterator // 52 53 4 str String // 60 56 5 localObject Object // 67 11 6 localClass Class // Exception table: // from to target type // 20 29 123 org/json/JSONException // 54 62 126 org/json/JSONException } private boolean setupPreviewBuffer(CameraCacheInfo paramCameraCacheInfo) { reader = ImageReader.newInstance(requestWidth, requestHeight, requestFormatAndroid, 2); imageSemaphore = new Semaphore(2); images = new Image[2]; if (requestWidth == overrideWidth) { i = reader.getWidth(); bufferWidth = i; if (requestHeight != overrideHeight) { break label192; } i = reader.getHeight(); label83: bufferHeight = i; if (requestFormatAndroid != overrideFormatAndroid) { break label200; } } label192: label200: for (int i = reader.getImageFormat();; i = overrideFormatAndroid) {

Page 98: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

bufferFormatPL = translateImageFormat(i, CONVERT_FORMAT_TO_PL); reader.setOnImageAvailableListener(new OnCameraDataAvailable(), handler); if (surfaces == null) { surfaces = new LinkedList(); } surfaces.clear(); surfaces.add(reader.getSurface()); return true; i = overrideWidth; break; i = overrideHeight; break label83; } } private int translateImageFormat(int paramInt, boolean paramBoolean) { int i = 0; while (i < CAMERA_IMAGE_FORMAT_CONVERSIONTABLE.length / 2) { int j; if (paramBoolean == CONVERT_FORMAT_TO_PL) { j = CAMERA_IMAGE_FORMAT_CONVERSIONTABLE[(i * 2)]; } while (paramInt == j) { if (paramBoolean == CONVERT_FORMAT_TO_PL) { return CAMERA_IMAGE_FORMAT_CONVERSIONTABLE[(i * 2 + 1)]; j = CAMERA_IMAGE_FORMAT_CONVERSIONTABLE[(i * 2 + 1)]; } else { return CAMERA_IMAGE_FORMAT_CONVERSIONTABLE[(i * 2)]; } } i += 1; } if (paramBoolean == CONVERT_FORMAT_TO_PL) { return 268439808; } return 0; }

Page 99: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

public boolean close(int paramInt) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return false; } mCameraCacheInfoIndexCache.remove(reader); boolean bool = false; try { session.close(); device.close(); reader.close(); bool = true; } catch (Exception localException) { for (;;) {} } session = null; reader = null; images = null; status = 268443649; System.gc(); return bool; } int getBitsPerPixel(int paramInt) { int i = 16; switch (paramInt) { default: i = 0; case 4: case 16: return i; case 17: return 12; } return 12; }

Page 100: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

public int[] getCameraCapabilities(int paramInt) { if (!checkCameraManager()) { SystemTools.setSystemErrorCode(6); return null; } CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return null; } if (caps != null) { return caps; } Size[] arrayOfSize; List localList; int[] arrayOfInt1; int[] arrayOfInt2; LinkedList localLinkedList; int j; int k; int m; for (;;) { try { Object localObject1 = mCameraManager.getCameraIdList()[deviceID]; localObject1 = (StreamConfigurationMap)mCameraManager.getCameraCharacteristics((String)localObject1).get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP); arrayOfSize = ((StreamConfigurationMap)localObject1).getOutputSizes(35); localList = getSupportedPreviewFrameRates(characteristics); arrayOfInt1 = (int[])characteristics.get(CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES); Arrays.sort(arrayOfInt1); arrayOfInt2 = (int[])characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES);

Page 101: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Arrays.sort(arrayOfInt2); localLinkedList = new LinkedList(); localLinkedList.add(Integer.valueOf(35)); if (arrayOfSize != null) { i = arrayOfSize.length; if (localList == null) { break label307; } j = localList.size(); if (localLinkedList == null) { break label313; } k = localLinkedList.size(); localObject1 = (float[])characteristics.get(CameraCharacteristics.LENS_INFO_AVAILABLE_FOCAL_LENGTHS); if ((localObject1 == null) || (localObject1.length <= 0)) { break label319; } bool1 = true; if (!bool1) { break; } m = localObject1.length; paramInt = 0; if (paramInt >= m) { break; } float f = localObject1[paramInt]; DebugLog.LOGD("Camera2_Preview", "Supported Focal Length is " + f + "mm"); paramInt += 1; continue; } i = 0; } catch (CameraAccessException localCameraAccessException) { SystemTools.setSystemErrorCode(6); return null; } continue; label307: j = 0;

Page 102: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

continue; label313: k = 0; continue; label319: bool1 = false; } Object localObject3 = (Boolean)characteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE); Object localObject2 = localObject3; if (localObject3 == null) { localObject2 = Boolean.valueOf(false); } localObject3 = (Integer)characteristics.get(CameraCharacteristics.CONTROL_MAX_REGIONS_AF); boolean bool3; boolean bool2; label423: boolean bool4; label458: boolean bool5; label493: boolean bool6; label552: boolean bool7; if ((localObject3 != null) && (((Integer)localObject3).intValue() > 0)) { bool3 = true; localObject3 = (Range)characteristics.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE); if ((localObject3 == null) || (EMPTY_RANGE.equals(localObject3))) { break label1288; } bool2 = true; localObject3 = (Range)characteristics.get(CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE); if ((localObject3 == null) || (EMPTY_RANGE.equals(localObject3))) { break label1294; } bool4 = true;

Page 103: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Object localObject4 = (Range)characteristics.get(CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE); if ((localObject3 == null) || (EMPTY_RANGE.equals(localObject4))) { break label1300; } bool5 = true; localObject3 = (int[])characteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES); localObject4 = (int[])characteristics.get(CameraCharacteristics.LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION); if (((localObject3 == null) || (localObject3.length <= 1)) && ((localObject4 == null) || (localObject4.length <= 1))) { break label1306; } bool6 = true; caps = new int[i * 2 + 6 + j + k]; caps[0] = 536870912; setCameraCapsBit(localCameraCacheInfo, 0, 536870913, ((Boolean)localObject2).booleanValue()); if (arrayOfInt1.length <= 0) { break label1312; } bool7 = true; label603: setCameraCapsBit(localCameraCacheInfo, 0, 536870914, bool7); setCameraCapsBit(localCameraCacheInfo, 0, 536870916, bool1); setCameraCapsBit(localCameraCacheInfo, 0, 536870928, bool3); if (arrayOfInt2.length <= 0) { break label1318; } bool7 = true; label645: setCameraCapsBit(localCameraCacheInfo, 0, 536870944, bool7); setCameraCapsBit(localCameraCacheInfo, 0, 536871936, bool2); setCameraCapsBit(localCameraCacheInfo, 0, 536872960, bool2); setCameraCapsBit(localCameraCacheInfo, 0, 536870976, bool4); setCameraCapsBit(localCameraCacheInfo, 0, 536871040, bool4); setCameraCapsBit(localCameraCacheInfo, 0, 536871168, bool5); setCameraCapsBit(localCameraCacheInfo, 0, 536871424, bool5); setCameraCapsBit(localCameraCacheInfo, 0, 536903680, bool1); setCameraCapsBit(localCameraCacheInfo, 0, 536936448, bool1); setCameraCapsBit(localCameraCacheInfo, 0, 553648128, bool6);

Page 104: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

caps[1] = 536870912; setCameraCapsBit(localCameraCacheInfo, 1, 536870913, ((Boolean)localObject2).booleanValue()); if (arrayOfInt1.length <= 0) { break label1324; } bool7 = true; label787: setCameraCapsBit(localCameraCacheInfo, 1, 536870914, bool7); setCameraCapsBit(localCameraCacheInfo, 1, 536870928, bool3); if (arrayOfInt2.length <= 0) { break label1330; } bool3 = true; label818: setCameraCapsBit(localCameraCacheInfo, 1, 536870944, bool3); setCameraCapsBit(localCameraCacheInfo, 1, 536871936, bool2); setCameraCapsBit(localCameraCacheInfo, 1, 536870976, bool4); setCameraCapsBit(localCameraCacheInfo, 1, 536871168, bool5); setCameraCapsBit(localCameraCacheInfo, 1, 536903680, bool1); setCameraCapsBit(localCameraCacheInfo, 1, 553648128, bool6); caps[2] = 805306368; if (((Boolean)localObject2).booleanValue()) { setCameraCapsBit(localCameraCacheInfo, 2, 805306369, true); setCameraCapsBit(localCameraCacheInfo, 2, 805306370, true); } if (arrayOfInt1 != null) { if (Arrays.binarySearch(arrayOfInt1, 1) == -1) { break label1336; } bool1 = true; label939: setCameraCapsBit(localCameraCacheInfo, 2, 805306384, bool1); if (Arrays.binarySearch(arrayOfInt1, 1) == -1) { break label1342; } bool1 = true; label963: setCameraCapsBit(localCameraCacheInfo, 2, 805306400, bool1); if (Arrays.binarySearch(arrayOfInt1, 3) == -1) { break label1348; } bool1 = true;

Page 105: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

label987: setCameraCapsBit(localCameraCacheInfo, 2, 805306432, bool1); if (Arrays.binarySearch(arrayOfInt1, 2) == -1) { break label1354; } bool1 = true; label1011: setCameraCapsBit(localCameraCacheInfo, 2, 805306496, bool1); if ((Arrays.binarySearch(arrayOfInt1, 0) == -1) || (CaptureRequest.LENS_FOCUS_DISTANCE == null)) { break label1360; } bool1 = true; label1041: setCameraCapsBit(localCameraCacheInfo, 2, 805306624, bool1); if (Arrays.binarySearch(arrayOfInt1, 0) == -1) { break label1366; } bool1 = true; label1065: setCameraCapsBit(localCameraCacheInfo, 2, 805306880, bool1); } if (arrayOfInt2 != null) { if (Arrays.binarySearch(arrayOfInt2, 0) == -1) { break label1372; } bool1 = true; label1094: setCameraCapsBit(localCameraCacheInfo, 2, 805310464, bool1); if (Arrays.binarySearch(arrayOfInt2, 0) == -1) { break label1378; } bool1 = true; label1118: setCameraCapsBit(localCameraCacheInfo, 2, 805339136, bool1); if (Arrays.binarySearch(arrayOfInt2, 1) == -1) { break label1384; } bool1 = true; label1142: setCameraCapsBit(localCameraCacheInfo, 2, 805314560, bool1); if (Arrays.binarySearch(arrayOfInt2, 1) == -1) { break label1390; }

Page 106: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} } label1288: label1294: label1300: label1306: label1312: label1318: label1324: label1330: label1336: label1342: label1348: label1354: label1360: label1366: label1372: label1378: label1384: label1390: for (boolean bool1 = true;; bool1 = false) { setCameraCapsBit(localCameraCacheInfo, 2, 805322752, bool1); caps[3] = i; caps[4] = j; caps[5] = k; m = 6; paramInt = m; if (i <= 0) { break label1396; } int n = arrayOfSize.length; paramInt = 0; i = m; m = paramInt; for (;;) { paramInt = i; if (m >= n) { break; } localObject2 = arrayOfSize[m]; caps[i] = ((Size)localObject2).getWidth(); caps[(i + 1)] = ((Size)localObject2).getHeight(); i += 2;

Page 107: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

m += 1; } bool3 = false; break; bool2 = false; break label423; bool4 = false; break label458; bool5 = false; break label493; bool6 = false; break label552; bool7 = false; break label603; bool7 = false; break label645; bool7 = false; break label787; bool3 = false; break label818; bool1 = false; break label939; bool1 = false; break label963; bool1 = false; break label987; bool1 = false; break label1011; bool1 = false; break label1041; bool1 = false; break label1065; bool1 = false; break label1094; bool1 = false; break label1118; bool1 = false; break label1142; } label1396: int i = paramInt; if (j > 0) { localObject2 = localList.iterator(); for (;;)

Page 108: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ i = paramInt; if (!((Iterator)localObject2).hasNext()) { break; } localObject3 = (Integer)((Iterator)localObject2).next(); caps[paramInt] = ((Integer)localObject3).intValue(); paramInt += 1; } } if (k > 0) { localObject2 = localLinkedList.iterator(); while (((Iterator)localObject2).hasNext()) { localObject3 = (Integer)((Iterator)localObject2).next(); caps[i] = translateImageFormat(((Integer)localObject3).intValue(), true); i += 1; } } return caps; } public int[] getCaptureInfo(int paramInt) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return null; } for (;;) { int[] arrayOfInt; try { arrayOfInt = new int[5]; if (reader != null) { arrayOfInt[0] = reader.getWidth(); arrayOfInt[1] = reader.getHeight(); arrayOfInt[2] = translateImageFormat(reader.getImageFormat(), CONVERT_FORMAT_TO_PL); if (builder == null) {

Page 109: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

break label141; } arrayOfInt[3] = ((Integer)((Range)builder.get(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE)).getUpper()).intValue(); arrayOfInt[4] = 1; return arrayOfInt; } } catch (Exception localException) { SystemTools.setSystemErrorCode(6); return null; } arrayOfInt[0] = requestWidth; arrayOfInt[1] = requestHeight; arrayOfInt[2] = translateImageFormat(requestFormatAndroid, CONVERT_FORMAT_TO_PL); continue; label141: arrayOfInt[3] = requestFramerate; } } public int getDeviceID(int paramInt) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return -1; } return deviceID; } public int getDirection(int paramInt) { if (!checkPermission()) { SystemTools.setSystemErrorCode(6); return -1; } if (!checkCameraManager()) {

Page 110: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

SystemTools.setSystemErrorCode(6); return -1; } if (SystemTools.checkMinimumApiLevel(21)) { try { String[] arrayOfString = mCameraManager.getCameraIdList(); if (paramInt < arrayOfString.length) { paramInt = ((Integer)mCameraManager.getCameraCharacteristics(arrayOfString[paramInt]).get(CameraCharacteristics.LENS_FACING)).intValue(); switch (paramInt) { default: return 268443664; case 1: return 268443665; } return 268443666; } } catch (Exception localException) { SystemTools.setSystemErrorCode(6); return -1; } } return 268443665; } String getNamedParameter(int paramInt1, int paramInt2) { Object localObject2 = getCameraCacheInfo(paramInt1); if ((localObject2 == null) || (builder == null) || (characteristics == null)) { SystemTools.setSystemErrorCode(4); } Object localObject1; do { do { return null; localObject1 = characteristics.getAvailableCaptureRequestKeys(); localObject2 = characteristics.getKeys();

Page 111: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (paramInt2 >= ((List)localObject1).size()) { break; } localObject1 = (CaptureRequest.Key)((List)localObject1).get(paramInt2); } while (localObject1 == null); return ((CaptureRequest.Key)localObject1).getName(); if (paramInt2 - ((List)localObject1).size() >= ((List)localObject2).size()) { break; } localObject1 = (CameraCharacteristics.Key)((List)localObject2).get(paramInt2 - ((List)localObject1).size()); } while (localObject1 == null); return ((CameraCharacteristics.Key)localObject1).getName(); SystemTools.setSystemErrorCode(6); return null; } int getNamedParameterCount(int paramInt) { Object localObject = getCameraCacheInfo(paramInt); if ((localObject == null) || (builder == null) || (characteristics == null)) { SystemTools.setSystemErrorCode(4); return -1; } List localList = characteristics.getAvailableCaptureRequestKeys(); localObject = characteristics.getKeys(); return localList.size() + ((List)localObject).size(); } public int getNumberOfCameras() { if (!checkPermission()) { SystemTools.setSystemErrorCode(6); return -1; } if (!checkCameraManager()) { SystemTools.setSystemErrorCode(6); return -1; } if (SystemTools.checkMinimumApiLevel(21)) { try

Page 112: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ int i = mCameraManager.getCameraIdList().length; return i; } catch (Exception localException) {} } SystemTools.setSystemErrorCode(6); return -1; } public int getOrientation(int paramInt) { if (!checkPermission()) { SystemTools.setSystemErrorCode(6); return -1; } if (!checkCameraManager()) { SystemTools.setSystemErrorCode(6); return -1; } if (SystemTools.checkMinimumApiLevel(21)) { try { String[] arrayOfString = mCameraManager.getCameraIdList(); if (paramInt < arrayOfString.length) { paramInt = ((Integer)mCameraManager.getCameraCharacteristics(arrayOfString[paramInt]).get(CameraCharacteristics.SENSOR_ORIENTATION)).intValue(); return paramInt; } } catch (Exception localException) {} } SystemTools.setSystemErrorCode(6); return -1; } int getStatus(int paramInt) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null)

Page 113: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ SystemTools.setSystemErrorCode(4); return 268443648; } return status; } Object getTypedCameraParameter(int paramInt1, int paramInt2) { Object localObject1 = getCameraCacheInfo(paramInt1); if ((localObject1 == null) || (characteristics == null)) { SystemTools.setSystemErrorCode(4); localObject1 = null; return localObject1; } Object localObject2 = lastResult; switch (paramInt2) { default: return null; case 536870913: if (localObject2 != null) { break; } } try { SystemTools.setSystemErrorCode(6); return null; } catch (Exception localException) { Object localObject3; SystemTools.setSystemErrorCode(6); return null; } localObject1 = (Integer)((CaptureResult)localObject2).get(CaptureResult.FLASH_MODE); if ((localObject1 == null) || (CaptureResult.FLASH_MODE == null)) { SystemTools.setSystemErrorCode(6); return null; } if (((Integer)localObject1).equals(Integer.valueOf(2))) {

Page 114: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

return Integer.valueOf(805306370); } if (((Integer)localObject1).equals(Integer.valueOf(0))) { return Integer.valueOf(805306369); } SystemTools.setSystemErrorCode(6); return null; if (localObject2 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject3 = (Integer)((CaptureResult)localObject2).get(CaptureResult.CONTROL_AF_MODE); if ((localObject3 == null) || (CaptureResult.CONTROL_AF_MODE == null)) { SystemTools.setSystemErrorCode(6); return null; } if (((Integer)localObject3).equals(Integer.valueOf(1))) { if (!isAutoFocusing) { break label1605; } } label1605: for (paramInt1 = 805306400;; paramInt1 = 805306384) { return Integer.valueOf(paramInt1); if (((Integer)localObject3).equals(Integer.valueOf(3))) { return Integer.valueOf(805306432); } if (((Integer)localObject3).equals(Integer.valueOf(0))) { localObject1 = (Float)((CaptureResult)localObject2).get(CaptureResult.LENS_FOCUS_DISTANCE); if ((localObject1 == null) || (CaptureResult.LENS_FOCUS_DISTANCE == null) || (!((Float)localObject1).equals(Float.valueOf(0.0F)))) { return Integer.valueOf(805306880); } return Integer.valueOf(805306624); } if (((Integer)localObject3).equals(Integer.valueOf(2))) { return Integer.valueOf(805306496);

Page 115: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} SystemTools.setSystemErrorCode(6); return null; if (localObject2 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject1 = (Float)((CaptureResult)localObject2).get(CaptureResult.LENS_FOCAL_LENGTH); if ((localObject1 != null) && (CaptureResult.LENS_FOCAL_LENGTH != null)) { break; } SystemTools.setSystemErrorCode(6); return null; if (localObject2 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject1 = (Pair)((CaptureResult)localObject2).get(CaptureResult.LENS_FOCUS_RANGE); if ((localObject1 != null) && (CaptureResult.LENS_FOCUS_RANGE != null)) { return new float[] { ((Float)first).floatValue(), ((Float)second).floatValue() }; } SystemTools.setSystemErrorCode(6); return null; if (localObject2 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject3 = (Integer)characteristics.get(CameraCharacteristics.CONTROL_MAX_REGIONS_AF); if ((localObject3 != null) && (CameraCharacteristics.CONTROL_MAX_REGIONS_AF != null) && (((Integer)localObject3).intValue() > 0) && (CaptureResult.CONTROL_AF_REGIONS != null)) {

Page 116: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

localObject2 = (MeteringRectangle[])((CaptureResult)localObject2).get(CaptureResult.CONTROL_AF_REGIONS); if ((localObject2 == null) || (localObject2.length == 0)) { break label1611; } localObject1 = (Rect)characteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE); if (localObject1 == null) { SystemTools.setSystemErrorCode(6); return Boolean.valueOf(false); } localObject3 = localObject2[0].getRect(); return new float[] { left / (((Rect)localObject1).width() - 1), top / (((Rect)localObject1).height() - 1), right / (((Rect)localObject1).width() - 1), bottom / (((Rect)localObject1).height() - 1), (localObject2[0].getMeteringWeight() + 0) / 1000 }; } SystemTools.setSystemErrorCode(6); return null; if (localObject2 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject1 = (Integer)((CaptureResult)localObject2).get(CaptureResult.CONTROL_AE_MODE); if ((localObject1 == null) || (CaptureResult.CONTROL_AE_MODE == null)) { SystemTools.setSystemErrorCode(6); return null; } if (((Integer)localObject1).equals(Integer.valueOf(0))) { return Integer.valueOf(805339136); } if (((Integer)localObject1).equals(Integer.valueOf(1))) { return Integer.valueOf(805322752); } SystemTools.setSystemErrorCode(6); return null; if (localObject2 == null)

Page 117: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ SystemTools.setSystemErrorCode(6); return null; } localObject1 = (Integer)((CaptureResult)localObject2).get(CaptureResult.SENSOR_SENSITIVITY); if ((localObject1 != null) && (CaptureResult.SENSOR_SENSITIVITY != null)) { return Float.valueOf(((Integer)localObject1).floatValue()); } SystemTools.setSystemErrorCode(6); return null; localObject1 = (Range)characteristics.get(CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE); if ((localObject1 == null) || (CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE == null)) { SystemTools.setSystemErrorCode(6); return null; } return new float[] { ((Integer)((Range)localObject1).getLower()).floatValue(), ((Integer)((Range)localObject1).getUpper()).floatValue() }; if (localObject2 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject1 = (Long)((CaptureResult)localObject2).get(CaptureResult.SENSOR_EXPOSURE_TIME); if ((localObject1 != null) && (CaptureResult.SENSOR_EXPOSURE_TIME != null)) { return Float.valueOf((float)(((Long)localObject1).doubleValue() / 1.0E9D)); } SystemTools.setSystemErrorCode(6); return null; localObject1 = (Range)characteristics.get(CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE);

Page 118: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if ((localObject1 == null) || (CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE == null)) { SystemTools.setSystemErrorCode(6); return null; } return new float[] { (float)(((Long)((Range)localObject1).getLower()).doubleValue() / 1.0E9D), (float)(((Long)((Range)localObject1).getUpper()).doubleValue() / 1.0E9D) }; if (localObject2 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject2 = (Integer)((CaptureResult)localObject2).get(CaptureResult.CONTROL_AE_EXPOSURE_COMPENSATION); localObject1 = (Rational)characteristics.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP); if ((localObject2 != null) && (CaptureResult.CONTROL_AE_EXPOSURE_COMPENSATION != null) && (localObject1 != null) && (CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP != null)) { return Float.valueOf(((Rational)localObject1).floatValue() * ((Integer)localObject2).intValue()); } SystemTools.setSystemErrorCode(6); return null; localObject2 = (Range)characteristics.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE); localObject1 = (Rational)characteristics.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP); if ((localObject2 == null) || (CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE == null) || (localObject1 == null) || (CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP == null)) { SystemTools.setSystemErrorCode(6); return null; } float f1 = ((Rational)localObject1).floatValue();

Page 119: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

float f2 = ((Integer)((Range)localObject2).getLower()).intValue(); float f3 = ((Rational)localObject1).floatValue(); return new float[] { f2 * f1, ((Integer)((Range)localObject2).getUpper()).intValue() * f3 }; SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; if (localObject2 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject1 = (Float)((CaptureResult)localObject2).get(CaptureResult.LENS_FOCAL_LENGTH); if ((localObject1 != null) && (CaptureResult.LENS_FOCAL_LENGTH != null)) { break; } SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; SystemTools.setSystemErrorCode(6); return null; if (localObject2 == null) { SystemTools.setSystemErrorCode(6); return null; } paramInt2 = 0; localObject1 = (Integer)((CaptureResult)localObject2).get(CaptureResult.CONTROL_VIDEO_STABILIZATION_MODE); paramInt1 = paramInt2;

Page 120: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (localObject1 != null) { paramInt1 = paramInt2; if (CaptureResult.CONTROL_VIDEO_STABILIZATION_MODE != null) { paramInt1 = 1; if (((Integer)localObject1).equals(Integer.valueOf(1))) { return Boolean.valueOf(true); } } } localObject1 = (Integer)((CaptureResult)localObject2).get(CaptureResult.LENS_OPTICAL_STABILIZATION_MODE); paramInt2 = paramInt1; if (localObject1 != null) { paramInt2 = paramInt1; if (CaptureResult.LENS_OPTICAL_STABILIZATION_MODE != null) { paramInt2 = 1; if (((Integer)localObject1).equals(Integer.valueOf(1))) { return Boolean.valueOf(true); } } } if (paramInt2 == 0) { SystemTools.setSystemErrorCode(6); return null; } return Boolean.valueOf(false); } label1611: return null; } Object getUntypedCameraParameter(int paramInt, String paramString) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if ((localCameraCacheInfo == null) || (builder == null) || (characteristics == null) || (paramString == null)) { SystemTools.setSystemErrorCode(4);

Page 121: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

return null; } List localList = null; Object localObject2 = characteristics.getAvailableCaptureRequestKeys(); paramInt = 0; for (;;) { localObject1 = localList; if (paramInt >= ((List)localObject2).size()) { break label107; } localObject1 = (CaptureRequest.Key)((List)localObject2).get(paramInt); if (((CaptureRequest.Key)localObject1).getName().equals(paramString)) { break; } paramInt += 1; } Object localObject1 = builder.get((CaptureRequest.Key)localObject1); label107: localList = characteristics.getKeys(); paramInt = 0; for (;;) { if (paramInt >= localList.size()) { break label357; } localObject2 = (CameraCharacteristics.Key)localList.get(paramInt); if (((CameraCharacteristics.Key)localObject2).getName().equals(paramString)) { break; } paramInt += 1; } label357: for (paramString = characteristics.get((CameraCharacteristics.Key)localObject2);; paramString = (String)localObject1) { if (paramString == null) { SystemTools.setSystemErrorCode(6); return null; }

Page 122: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (((paramString instanceof Long)) || ((paramString instanceof Float)) || ((paramString instanceof Boolean)) || ((paramString instanceof String))) { return paramString; } if ((paramString instanceof Integer)) { return new Long(((Integer)paramString).longValue()); } if ((paramString instanceof Byte)) { return new Long(((Byte)paramString).longValue()); } if ((paramString instanceof Range)) { localObject1 = ((Range)paramString).getLower(); paramString = ((Range)paramString).getUpper(); if ((localObject1 instanceof Integer)) { return new long[] { ((Integer)localObject1).longValue(), ((Integer)paramString).longValue() }; } if ((localObject1 instanceof Long)) { return new long[] { ((Long)localObject1).longValue(), ((Long)paramString).longValue() }; } SystemTools.setSystemErrorCode(6); return null; } SystemTools.setSystemErrorCode(6); return null; } } int getUntypedCameraParameterType(int paramInt, String paramString) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if ((localCameraCacheInfo == null) || (builder == null) || (characteristics == null) || (paramString == null)) { SystemTools.setSystemErrorCode(4); return -1; } List localList = null; int j = 0; Object localObject2 = characteristics.getAvailableCaptureRequestKeys(); int i = 0; for (;;)

Page 123: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ paramInt = j; localObject1 = localList; if (i >= ((List)localObject2).size()) { break label120; } localObject1 = (CaptureRequest.Key)((List)localObject2).get(i); if (((CaptureRequest.Key)localObject1).getName().equals(paramString)) { break; } i += 1; } Object localObject1 = builder.get((CaptureRequest.Key)localObject1); paramInt = 1; label120: localList = characteristics.getKeys(); i = 0; while (i < localList.size()) { localObject2 = (CameraCharacteristics.Key)localList.get(i); if (!((CameraCharacteristics.Key)localObject2).getName().equals(paramString)) { i += 1; } else { paramString = characteristics.get((CameraCharacteristics.Key)localObject2); paramInt = 1; } } for (;;) { if (paramInt == 0) { SystemTools.setSystemErrorCode(6); return -1; } if (paramString == null) { return -1; } if ((paramString instanceof Integer)) { return 1; }

Page 124: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if ((paramString instanceof Byte)) { return 1; } if ((paramString instanceof Long)) { return 1; } if ((paramString instanceof Float)) { return 2; } if ((paramString instanceof Boolean)) { return 3; } if ((paramString instanceof String)) { return 0; } if ((paramString instanceof Range)) { paramString = ((Range)paramString).getLower(); if ((paramString instanceof Integer)) { return 4; } if ((paramString instanceof Long)) { return 4; } } return -1; paramString = (String)localObject1; } } public boolean init() { mCameraCacheInfos = new Vector(); mCameraCacheInfosInProgress = new Vector(); mCameraCacheInfoIndexCache = new HashMap(); return true; } public int open(long paramLong, int paramInt1, int paramInt2, int paramInt3, String paramString, int[] paramArrayOfInt1, int[] paramArrayOfInt2) { DebugLog.LOGI("Camera2_Preview", String.format("open called with handle: %x, %d, type: %d, direction: %d", new Object[] { Long.valueOf(paramLong), Integer.valueOf(paramInt1), Integer.valueOf(paramInt2), Integer.valueOf(paramInt3) }));

Page 125: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (!checkPermission()) { SystemTools.setSystemErrorCode(6); paramInt2 = -1; return paramInt2; } if (!checkCameraManager()) { SystemTools.setSystemErrorCode(6); return -1; } paramInt3 = getCameraDeviceIndex(paramInt1, paramInt2, paramInt3); if (paramInt3 < 0) { return -1; } DebugLog.LOGD("Camera2_Preview", "Camera device index" + paramInt3); paramInt2 = -1; CameraCacheInfo localCameraCacheInfo = null; int i = mCameraCacheInfos.size(); paramInt1 = 0; label138: if (paramInt1 < i) { localCameraCacheInfo = (CameraCacheInfo)mCameraCacheInfos.get(paramInt1); if (deviceID != paramInt3) {} } for (;;) { if (paramInt1 < 0) {} label505: label536: label568: label593: label667: label673: label765: label774: for (;;) { try { localCameraCacheInfo = new CameraCacheInfo(); }

Page 126: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

catch (CameraAccessException paramString) { CaptureRequest.Builder localBuilder; SystemTools.setSystemErrorCode(6); return -1; } for (;;) { try { deviceID = paramInt3; deviceHandle = paramLong; deviceIDString = mCameraManager.getCameraIdList()[deviceID]; characteristics = mCameraManager.getCameraCharacteristics(deviceIDString); device = null; session = null; builder = null; surfaces = null; reader = null; images = null; imageSemaphore = null; thread = new HandlerThread(deviceIDString + "_camera_thread"); thread.start(); handler = new Handler(thread.getLooper()); overrideWidth = 0; requestWidth = 0; bufferWidth = 0; overrideHeight = 0; requestHeight = 0; bufferHeight = 0; bufferFormatPL = 268439808; overrideFormatAndroid = 0; requestFormatAndroid = 0; caps = null; status = 268443649; isAutoFocusing = false; paramInt2 = 0; paramInt3 = 10; } catch (CameraAccessException paramString) { break label568; paramInt3 -= 1; break;

Page 127: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

break label536; } try { mOpenCloseSemaphore.acquire(); mCameraCacheInfosInProgress.add(localCameraCacheInfo); mCameraManager.openCamera(deviceIDString, new CameraDevice.StateCallback() { public void onDisconnected(CameraDevice paramAnonymousCameraDevice) { paramAnonymousCameraDevice.close(); mOpenCloseSemaphore.release(); } public void onError(CameraDevice paramAnonymousCameraDevice, int paramAnonymousInt) { paramAnonymousCameraDevice.close(); mOpenCloseSemaphore.release(); } /* Error */ public void onOpened(CameraDevice paramAnonymousCameraDevice) { // Byte code: // 0: aconst_null // 1: astore_2 // 2: aconst_null // 3: astore_3 // 4: aload_0 // 5: getfield 15 com/vuforia/ar/pl/Camera2_Preview$1:this$0 Lcom/vuforia/ar/pl/Camera2_Preview; // 8: invokestatic 44 com/vuforia/ar/pl/Camera2_Preview:access$400 (Lcom/vuforia/ar/pl/Camera2_Preview;)Ljava/util/Vector; // 11: invokevirtual 50 java/util/Vector:iterator ()Ljava/util/Iterator; // 14: astore 5 // 16: aload_3 // 17: astore_2 // 18: aload 5 // 20: invokeinterface 56 1 0

Page 128: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 25: ifeq +80 -> 105 // 28: aload_3 // 29: astore_2 // 30: aload 5 // 32: invokeinterface 60 1 0 // 37: checkcast 62 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo // 40: astore 4 // 42: aload_3 // 43: astore_2 // 44: aload 4 // 46: getfield 66 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:deviceIDString Ljava/lang/String; // 49: aload_1 // 50: invokevirtual 70 android/hardware/camera2/CameraDevice:getId ()Ljava/lang/String; // 53: invokevirtual 76 java/lang/String:equals (Ljava/lang/Object;)Z // 56: ifeq -40 -> 16 // 59: aload 4 // 61: astore_3 // 62: aload_3 // 63: astore_2 // 64: aload_3 // 65: aload_1 // 66: putfield 80 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:device Landroid/hardware/camera2/CameraDevice; // 69: aload_3 // 70: astore_2 // 71: aload_3 // 72: aload_1 // 73: iconst_1 // 74: invokevirtual 84 android/hardware/camera2/CameraDevice:createCaptureRequest (I)Landroid/hardware/camera2/CaptureRequest$Builder; // 77: putfield 88 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:builder Landroid/hardware/camera2/CaptureRequest$Builder; // 80: goto -64 -> 16 // 83: astore_1 // 84: aload_2 // 85: aconst_null

Page 129: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 86: putfield 88 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:builder Landroid/hardware/camera2/CaptureRequest$Builder; // 89: aload_2 // 90: aconst_null // 91: putfield 80 com/vuforia/ar/pl/Camera2_Preview$CameraCacheInfo:device Landroid/hardware/camera2/CameraDevice; // 94: aload_0 // 95: getfield 15 com/vuforia/ar/pl/Camera2_Preview$1:this$0 Lcom/vuforia/ar/pl/Camera2_Preview; // 98: invokestatic 30 com/vuforia/ar/pl/Camera2_Preview:access$500 (Lcom/vuforia/ar/pl/Camera2_Preview;)Ljava/util/concurrent/Semaphore; // 101: invokevirtual 35 java/util/concurrent/Semaphore:release ()V // 104: return // 105: aload_0 // 106: getfield 15 com/vuforia/ar/pl/Camera2_Preview$1:this$0 Lcom/vuforia/ar/pl/Camera2_Preview; // 109: invokestatic 30 com/vuforia/ar/pl/Camera2_Preview:access$500 (Lcom/vuforia/ar/pl/Camera2_Preview;)Ljava/util/concurrent/Semaphore; // 112: invokevirtual 35 java/util/concurrent/Semaphore:release ()V // 115: return // 116: astore_1 // 117: aload_0 // 118: getfield 15 com/vuforia/ar/pl/Camera2_Preview$1:this$0 Lcom/vuforia/ar/pl/Camera2_Preview; // 121: invokestatic 30 com/vuforia/ar/pl/Camera2_Preview:access$500 (Lcom/vuforia/ar/pl/Camera2_Preview;)Ljava/util/concurrent/Semaphore; // 124: invokevirtual 35 java/util/concurrent/Semaphore:release ()V // 127: aload_1 // 128: athrow // Local variable table: // start length slot name signature

Page 130: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

// 0 129 0 this 1 // 0 129 1 paramAnonymousCameraDevice CameraDevice // 1 89 2 localObject1 Object // 3 69 3 localObject2 Object // 40 20 4 localCameraCacheInfo Camera2_Preview.CameraCacheInfo // 14 17 5 localIterator Iterator // Exception table: // from to target type // 4 16 83 android/hardware/camera2/CameraAccessException // 18 28 83 android/hardware/camera2/CameraAccessException // 30 42 83 android/hardware/camera2/CameraAccessException // 44 59 83 android/hardware/camera2/CameraAccessException // 64 69 83 android/hardware/camera2/CameraAccessException // 71 80 83 android/hardware/camera2/CameraAccessException // 4 16 116 finally // 18 28 116 finally // 30 42 116 finally // 44 59 116 finally // 64 69 116 finally // 71 80 116 finally // 84 94 116 finally } }, handler); mOpenCloseSemaphore.acquire(); mCameraCacheInfosInProgress.remove(localCameraCacheInfo); mOpenCloseSemaphore.release(); if (device == null) { continue; } localBuilder = builder; if (localBuilder == null) { continue; } paramInt2 = 1; } catch (Exception localException2) {

Page 131: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

break label505; } } if ((paramInt2 == 0) && (paramInt3 > 0)) {} try {}catch (Exception localException1) { continue; if (((paramArrayOfInt1 == null) || (paramArrayOfInt1.length <= 0)) && ((paramArrayOfInt2 == null) || (paramArrayOfInt2.length <= 0))) { break label667; } paramInt2 = 1; if ((paramString == null) || (paramString.length() <= 0)) { break label673; } paramInt3 = 1; for (;;) { if ((paramInt2 != 0) || (paramInt3 != 0)) { if (paramInt2 != 0) { if ((paramArrayOfInt1 != null) && (paramArrayOfInt1.length != 5)) { SystemTools.setSystemErrorCode(2); return -1; paramInt2 = 0; break; paramInt3 = 0; continue; } if (!setCameraCaptureParams(localCameraCacheInfo, paramArrayOfInt1, paramArrayOfInt2)) { SystemTools.setSystemErrorCode(6); return -1; } } if ((paramInt3 != 0) && (!setCustomCameraParams(localCameraCacheInfo, paramString))) { SystemTools.setSystemErrorCode(2); return -1; } }

Page 132: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} status = 268443650; paramInt2 = paramInt1; } try { wait(250L); if (paramInt2 != 0) { break label774; } if (paramInt3 > 0) { break label765; } if ((device != null) && (builder != null)) { break label593; } SystemTools.setSystemErrorCode(6); return -1; } finally {} paramInt1 += 1; break label138; paramInt2 = 0; continue; if (paramInt1 >= 0) { break; } mCameraCacheInfos.add(localCameraCacheInfo); return mCameraCacheInfos.size() - 1; } paramInt1 = paramInt2; } } public boolean setBatchParameters(int paramInt, String paramString) { if (paramString == null) {} CameraCacheInfo localCameraCacheInfo; do { return false; localCameraCacheInfo = getCameraCacheInfo(paramInt); if ((localCameraCacheInfo == null) || (builder == null)) { SystemTools.setSystemErrorCode(4);

Page 133: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

return false; } } while (!setCustomCameraParams(localCameraCacheInfo, paramString)); return true; } public boolean setCaptureInfo(int paramInt, int[] paramArrayOfInt1, int[] paramArrayOfInt2) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return false; } if (paramArrayOfInt1.length != 5) { SystemTools.setSystemErrorCode(2); return false; } if (!setCameraCaptureParams(localCameraCacheInfo, paramArrayOfInt1, paramArrayOfInt2)) { SystemTools.setSystemErrorCode(6); return false; } return true; } boolean setTypedCameraParameter(int paramInt1, int paramInt2, Object paramObject) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt1); if ((localCameraCacheInfo == null) || (builder == null) || (characteristics == null)) { SystemTools.setSystemErrorCode(4); return false; } int k = 0; label364: label420: label580:

Page 134: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

label873: label879: label1122: int i; switch (paramInt2) { default: return false; case 541065216: case 536870913: case 536870914: case 536870916: case 536870920: case 536870928: case 536870944: case 536870976: case 536871040: case 536871168: case 536871424: case 536871936: case 536872960: case 536875008: case 536879104: case 536887296: case 536903680: do { for (;;) { try { if (CaptureRequest.CONTROL_CAPTURE_INTENT == null) { SystemTools.setSystemErrorCode(6); return false; } paramInt1 = ((Number)paramObject).intValue(); paramObject = builder; localObject = CaptureRequest.CONTROL_CAPTURE_INTENT; if (paramInt1 != 0) { paramInt1 = 3; ((CaptureRequest.Builder)paramObject).set((CaptureRequest.Key)localObject, Integer.valueOf(paramInt1));

Page 135: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramInt1 = k; if (session == null) {} } } catch (Exception paramObject) { SystemTools.setSystemErrorCode(6); return false; } try { session.setRepeatingRequest(builder.build(), new OnFrameCapturedCallback(localCameraCacheInfo), handler); if (paramInt1 != 0) {} switch (paramInt2) { default: return true; } } catch (CameraAccessException paramObject) { float f; int m; int n; SystemTools.setSystemErrorCode(6); return false; } paramInt1 = 1; continue; if (CaptureRequest.FLASH_MODE == null) { SystemTools.setSystemErrorCode(6); return false; } switch (((Number)paramObject).intValue()) { case 805306371: SystemTools.setSystemErrorCode(3); return false; case 805306370: builder.set(CaptureRequest.FLASH_MODE, Integer.valueOf(2)); paramInt1 = k; break; case 805306369:

Page 136: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

builder.set(CaptureRequest.FLASH_MODE, Integer.valueOf(0)); paramInt1 = k; break; case 805306372: SystemTools.setSystemErrorCode(3); return false; if (CaptureRequest.CONTROL_AF_MODE == null) { SystemTools.setSystemErrorCode(6); return false; } localObject = (int[])characteristics.get(CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES); Arrays.sort((int[])localObject); switch (((Number)paramObject).intValue()) { case 805306384: SystemTools.setSystemErrorCode(3); return false; case 805306400: if (Arrays.binarySearch((int[])localObject, 1) == -1) { SystemTools.setSystemErrorCode(6); return false; } builder.set(CaptureRequest.CONTROL_AF_MODE, Integer.valueOf(1)); paramInt1 = 1; break; case 805306432: if (Arrays.binarySearch((int[])localObject, 3) == -1) { SystemTools.setSystemErrorCode(6); return false; } builder.set(CaptureRequest.CONTROL_AF_MODE, Integer.valueOf(3)); paramInt1 = k; break; case 805306496: if (Arrays.binarySearch((int[])localObject, 2) == -1) { SystemTools.setSystemErrorCode(6); return false;

Page 137: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} builder.set(CaptureRequest.CONTROL_AF_MODE, Integer.valueOf(2)); paramInt1 = 1; break; case 805306624: if (CaptureRequest.LENS_FOCUS_DISTANCE == null) { SystemTools.setSystemErrorCode(6); return false; } if (Arrays.binarySearch((int[])localObject, 0) == -1) { SystemTools.setSystemErrorCode(6); return false; } builder.set(CaptureRequest.CONTROL_AF_MODE, Integer.valueOf(0)); builder.set(CaptureRequest.LENS_FOCUS_DISTANCE, Float.valueOf(0.0F)); paramInt1 = k; break; case 805306880: if (Arrays.binarySearch((int[])localObject, 0) == -1) { SystemTools.setSystemErrorCode(6); return false; } builder.set(CaptureRequest.CONTROL_AF_MODE, Integer.valueOf(0)); paramInt1 = k; continue; if (CaptureRequest.LENS_FOCUS_DISTANCE == null) { SystemTools.setSystemErrorCode(6); return false; } f = ((Number)paramObject).floatValue(); builder.set(CaptureRequest.LENS_FOCUS_DISTANCE, Float.valueOf(f)); paramInt1 = k; continue; SystemTools.setSystemErrorCode(6); return false; paramObject = (float[])paramObject;

Page 138: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (paramObject.length == 5) { break label2226; } SystemTools.setSystemErrorCode(2); return false; SystemTools.setSystemErrorCode(2); return false; localObject = (Integer)characteristics.get(CameraCharacteristics.CONTROL_MAX_REGIONS_AF); if ((CaptureRequest.CONTROL_AF_REGIONS == null) || (localObject == null) || (((Integer)localObject).intValue() == 0)) { SystemTools.setSystemErrorCode(6); return false; } localObject = (Rect)characteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE); if (localObject == null) { SystemTools.setSystemErrorCode(6); return false; } paramObject = new MeteringRectangle(new Rect(Math.min((int)(paramObject[0] * ((Rect)localObject).width()), ((Rect)localObject).width() - 1), Math.min((int)(paramObject[1] * ((Rect)localObject).height()), ((Rect)localObject).height() - 1), Math.min((int)(paramObject[2] * ((Rect)localObject).width()), ((Rect)localObject).width() - 1), Math.min((int)(paramObject[3] * ((Rect)localObject).height()), ((Rect)localObject).height() - 1)), (int)(paramObject[4] * 1000.0F + 0.0F)); builder.set(CaptureRequest.CONTROL_AF_REGIONS, new MeteringRectangle[] { paramObject }); paramInt1 = 1; continue; paramInt1 = ((Number)paramObject).intValue(); paramObject = (int[])characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES); if ((paramObject != null) && (CaptureRequest.CONTROL_AE_MODE != null)) { break label2309; } SystemTools.setSystemErrorCode(6);

Page 139: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

return false; SystemTools.setSystemErrorCode(3); return false; paramInt1 = 0; j = paramObject.length; i = 0; break label2355; if (paramInt1 == 0) { SystemTools.setSystemErrorCode(6); return false; } builder.set(CaptureRequest.CONTROL_AE_MODE, Integer.valueOf(0)); paramInt1 = k; continue; paramInt1 = 0; j = paramObject.length; i = 0; break label2392; if (paramInt1 == 0) { SystemTools.setSystemErrorCode(6); return false; } builder.set(CaptureRequest.CONTROL_AE_MODE, Integer.valueOf(1)); paramInt1 = k; continue; localObject = (Range)characteristics.get(CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE); if ((localObject == null) || (CaptureRequest.SENSOR_SENSITIVITY == null)) { SystemTools.setSystemErrorCode(6); return false; } paramInt1 = ((Number)paramObject).intValue(); if (((Range)localObject).contains(Integer.valueOf(paramInt1))) { builder.set(CaptureRequest.SENSOR_SENSITIVITY, Integer.valueOf(paramInt1)); paramInt1 = k; }

Page 140: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

else { SystemTools.setSystemErrorCode(6); return false; SystemTools.setSystemErrorCode(6); return false; localObject = (Range)characteristics.get(CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE); if ((localObject == null) || (CaptureRequest.SENSOR_EXPOSURE_TIME == null)) { SystemTools.setSystemErrorCode(6); return false; } paramObject = Long.valueOf(Math.round(((Number)paramObject).floatValue() * 1.0E9D)); if (((Range)localObject).contains((Comparable)paramObject)) { builder.set(CaptureRequest.SENSOR_EXPOSURE_TIME, paramObject); paramInt1 = k; } else { SystemTools.setSystemErrorCode(6); return false; SystemTools.setSystemErrorCode(6); return false; f = ((Number)paramObject).floatValue(); paramObject = (Range)characteristics.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE); localObject = (Rational)characteristics.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP); if ((EMPTY_RANGE.equals(paramObject)) || (CaptureRequest.CONTROL_AE_EXPOSURE_COMPENSATION == null) || (localObject == null) || (CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP == null)) { SystemTools.setSystemErrorCode(6); return false; } paramInt1 = Math.round(f / ((Rational)localObject).floatValue());

Page 141: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (((Range)paramObject).contains(Integer.valueOf(paramInt1))) { builder.set(CaptureRequest.CONTROL_AE_EXPOSURE_COMPENSATION, Integer.valueOf(paramInt1)); paramInt1 = k; } else { SystemTools.setSystemErrorCode(6); return false; SystemTools.setSystemErrorCode(6); return false; switch (((Number)paramObject).intValue()) { case 806354944: SystemTools.setSystemErrorCode(3); return false; if (CaptureRequest.CONTROL_AWB_LOCK == null) { SystemTools.setSystemErrorCode(6); return false; } builder.set(CaptureRequest.CONTROL_AWB_LOCK, Boolean.valueOf(true)); paramInt1 = k; break; case 807403520: case 809500672: if ((CaptureRequest.CONTROL_AWB_LOCK != null) && (((Boolean)builder.get(CaptureRequest.CONTROL_AWB_LOCK)).booleanValue())) { builder.set(CaptureRequest.CONTROL_AWB_LOCK, Boolean.valueOf(false)); } paramInt1 = k; if (CaptureRequest.CONTROL_AWB_MODE != null) { builder.set(CaptureRequest.CONTROL_AWB_MODE, Integer.valueOf(1)); paramInt1 = k; } break; } }

Page 142: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} } break; } break; } } SystemTools.setSystemErrorCode(6); return false; SystemTools.setSystemErrorCode(6); return false; m = ((Number)paramObject).intValue(); paramObject = (float[])characteristics.get(CameraCharacteristics.LENS_INFO_AVAILABLE_FOCAL_LENGTHS); if ((paramObject == null) || (CaptureRequest.LENS_FOCAL_LENGTH == null)) { SystemTools.setSystemErrorCode(6); return false; } j = 0; n = paramObject.length; paramInt1 = 0; i = j; if (paramInt1 < n) { f = paramObject[paramInt1]; if (Math.abs(f - m) >= 0.01F) { break label2433; } i = 1; builder.set(CaptureRequest.LENS_FOCAL_LENGTH, Float.valueOf(f)); } paramInt1 = k; } while (i != 0); SystemTools.setSystemErrorCode(2); return false; case 536936448: SystemTools.setSystemErrorCode(6); return false; case 537001984: SystemTools.setSystemErrorCode(6); return false; case 537133056:

Page 143: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

SystemTools.setSystemErrorCode(6); return false; case 537395200: SystemTools.setSystemErrorCode(6); return false; case 537919488: SystemTools.setSystemErrorCode(6); return false; case 538968064: label1572: label1747: SystemTools.setSystemErrorCode(6); return false; } Object localObject = (int[])characteristics.get(CameraCharacteristics.LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION); if ((localObject != null) && (localObject.length > 1) && (CaptureRequest.LENS_OPTICAL_STABILIZATION_MODE != null)) { i = 1; label1890: localObject = (int[])characteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES); if ((localObject == null) || (localObject.length <= 1) || (CaptureRequest.CONTROL_VIDEO_STABILIZATION_MODE == null)) { break label2446; } } label2226: label2309: label2355: label2383: label2392: label2421: label2433: label2446: for (int j = 1;; j = 0) { if ((i == 0) && (j == 0)) { SystemTools.setSystemErrorCode(6); return false; }

Page 144: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

boolean bool = ((Boolean)paramObject).booleanValue(); if (i != 0) { builder.set(CaptureRequest.LENS_OPTICAL_STABILIZATION_MODE, Integer.valueOf(0)); } if (j != 0) { builder.set(CaptureRequest.CONTROL_VIDEO_STABILIZATION_MODE, Integer.valueOf(0)); } paramInt1 = k; if (!bool) { break; } if (i != 0) { builder.set(CaptureRequest.LENS_OPTICAL_STABILIZATION_MODE, Integer.valueOf(1)); paramInt1 = k; break; } paramInt1 = k; if (j == 0) { break; } builder.set(CaptureRequest.CONTROL_VIDEO_STABILIZATION_MODE, Integer.valueOf(1)); paramInt1 = k; break; try { paramObject = (Integer)characteristics.get(CameraCharacteristics.CONTROL_MAX_REGIONS_AF); if ((paramObject != null) && (CameraCharacteristics.CONTROL_MAX_REGIONS_AF != null) && (((Integer)paramObject).intValue() > 0) && (CaptureRequest.CONTROL_AF_REGIONS != null)) { paramObject = (MeteringRectangle[])builder.get(CaptureRequest.CONTROL_AF_REGIONS); if ((paramObject != null) && (paramObject.length > 0)) {

Page 145: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

localObject = new MeteringRectangle[paramObject.length]; i = paramObject.length; paramInt2 = 0; paramInt1 = 0; while (paramInt2 < i) { localObject[paramInt1] = new MeteringRectangle(paramObject[paramInt2].getRect(), 0); paramInt2 += 1; paramInt1 += 1; } builder.set(CaptureRequest.CONTROL_AF_REGIONS, localObject); } } if (new AutofocusRunner(localCameraCacheInfo).triggerAutofocus()) { break label364; } SystemTools.setSystemErrorCode(6); return false; } catch (Exception paramObject) { SystemTools.setSystemErrorCode(6); return false; } break label420; break label580; if ((paramObject[0] < 0.0F) || (paramObject[0] > 1.0F) || (paramObject[1] < 0.0F) || (paramObject[1] > 1.0F) || (paramObject[2] < 0.0F) || (paramObject[2] > 1.0F) || (paramObject[3] < 0.0F) || (paramObject[3] > 1.0F) || (paramObject[4] < 0.0F)) { break label873; } if (paramObject[4] <= 1.0F) { break label879; } break label873; switch (paramInt1) { } break label1122; while (i < j) { if (paramObject[i] == 0) {} for (paramInt1 = 1;; paramInt1 = 0)

Page 146: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ if (paramInt1 == 0) { break label2383; } break; } i += 1; } while (i < j) { if (paramObject[i] == 1) {} for (paramInt1 = 1;; paramInt1 = 0) { if (paramInt1 == 0) { break label2421; } break; } i += 1; } break label1572; paramInt1 += 1; break label1747; i = 0; break label1890; } } boolean setUntypedCameraParameter(int paramInt, String paramString, Object paramObject) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if ((localCameraCacheInfo == null) || (builder == null) || (characteristics == null) || (paramString == null) || (paramObject == null)) { SystemTools.setSystemErrorCode(4); return false; } Object localObject = characteristics.getAvailableCaptureRequestKeys(); paramInt = 0; while (paramInt < ((List)localObject).size()) { CaptureRequest.Key localKey = (CaptureRequest.Key)((List)localObject).get(paramInt);

Page 147: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (!localKey.getName().equals(paramString)) { paramInt += 1; } else { localObject = builder.get(localKey); if ((!(localObject instanceof Integer)) && (!(localObject instanceof Float)) && (!(localObject instanceof Boolean)) && (!(localObject instanceof Byte)) && (!(localObject instanceof Long))) { return false; } paramString = (String)paramObject; if ((localObject instanceof Byte)) { paramString = (String)paramObject; if ((paramObject instanceof Long)) { paramString = new Byte(((Long)paramObject).byteValue()); } } paramObject = paramString; if ((localObject instanceof Integer)) { paramObject = paramString; if ((paramString instanceof Long)) { paramObject = new Integer(((Long)paramString).intValue()); } } if (!localObject.getClass().equals(paramObject.getClass())) { return false; } try { builder.set(localKey, paramObject); if (session != null) { session.setRepeatingRequest(builder.build(), new OnFrameCapturedCallback(localCameraCacheInfo), handler); } return true; } catch (Exception paramString) { SystemTools.setSystemErrorCode(6); return false; }

Page 148: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} } SystemTools.setSystemErrorCode(6); return false; } public boolean start(int paramInt) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) { SystemTools.setSystemErrorCode(4); return false; } if (!setupPreviewBuffer(localCameraCacheInfo)) { SystemTools.setSystemErrorCode(6); return false; } try { if (session == null) { mOpenCloseSemaphore.acquire(); device.createCaptureSession(surfaces, new CameraCaptureSession.StateCallback() { public void onConfigureFailed(CameraCaptureSession paramAnonymousCameraCaptureSession) { paramAnonymousCameraCaptureSession.close(); mOpenCloseSemaphore.release(); } public void onConfigured(CameraCaptureSession paramAnonymousCameraCaptureSession) { Surface localSurface = null; Iterator localIterator = mCameraCacheInfos.iterator(); Object localObject; do { localObject = localSurface; if (!localIterator.hasNext()) {

Page 149: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

break; } localObject = (Camera2_Preview.CameraCacheInfo)localIterator.next(); } while (!deviceIDString.equals(paramAnonymousCameraCaptureSession.getDevice().getId())); session = paramAnonymousCameraCaptureSession; paramAnonymousCameraCaptureSession = surfaces.iterator(); while (paramAnonymousCameraCaptureSession.hasNext()) { localSurface = (Surface)paramAnonymousCameraCaptureSession.next(); builder.addTarget(localSurface); } mOpenCloseSemaphore.release(); } }, handler); mOpenCloseSemaphore.acquire(); mOpenCloseSemaphore.release(); if (session == null) { SystemTools.setSystemErrorCode(6); return false; } } } catch (Exception localException) { SystemTools.setSystemErrorCode(6); return false; } session.setRepeatingRequest(builder.build(), new OnFrameCapturedCallback(localException), handler); status = 268443651; mCameraCacheInfoIndexCache.put(reader, Integer.valueOf(paramInt)); return true; } public boolean stop(int paramInt) { CameraCacheInfo localCameraCacheInfo = getCameraCacheInfo(paramInt); if (localCameraCacheInfo == null) {

Page 150: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

SystemTools.setSystemErrorCode(4); return false; } try { session.abortCaptures(); status = 268443650; return true; } catch (Exception localException) { SystemTools.setSystemErrorCode(6); } return false; } private class AutofocusRunner extends CameraCaptureSession.CaptureCallback { private Camera2_Preview.CameraCacheInfo mCCI; private CaptureRequest mCancelRequest; private CaptureRequest mFocusRequest; public AutofocusRunner(Camera2_Preview.CameraCacheInfo paramCameraCacheInfo) { mCCI = paramCameraCacheInfo; mCancelRequest = null; mFocusRequest = null; } public void onCaptureCompleted(CameraCaptureSession paramCameraCaptureSession, CaptureRequest paramCaptureRequest, TotalCaptureResult paramTotalCaptureResult) { super.onCaptureCompleted(paramCameraCaptureSession, paramCaptureRequest, paramTotalCaptureResult); paramCameraCaptureSession = (Integer)paramTotalCaptureResult.get(CaptureResult.CONTROL_AF_STATE); if ((paramCaptureRequest.equals(mCancelRequest)) && (paramCameraCaptureSession.intValue() == 0)) {} for (;;) { try

Page 151: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ mCCI.session.capture(mFocusRequest, this, mCCI.handler); return; } catch (CameraAccessException paramCameraCaptureSession) {} if ((paramCaptureRequest.equals(mFocusRequest)) && ((paramCameraCaptureSession.intValue() == 4) || (paramCameraCaptureSession.intValue() == 5))) { mCCI.isAutoFocusing = false; return; } } } public boolean triggerAutofocus() throws CameraAccessException { if ((mCCI == null) || (mCCI.builder == null) || (mCCI.session == null)) {} Integer localInteger; do { return false; localInteger = (Integer)mCCI.builder.get(CaptureRequest.CONTROL_AF_MODE); } while ((CaptureRequest.CONTROL_AF_MODE == null) || (localInteger == null) || ((localInteger.intValue() != 1) && (localInteger.intValue() != 2))); mCCI.isAutoFocusing = true; mCCI.builder.set(CaptureRequest.CONTROL_AF_TRIGGER, Integer.valueOf(2)); mCancelRequest = mCCI.builder.build(); mCCI.builder.set(CaptureRequest.CONTROL_AF_TRIGGER, Integer.valueOf(0)); mCCI.builder.set(CaptureRequest.CONTROL_AF_TRIGGER, Integer.valueOf(1)); mFocusRequest = mCCI.builder.build(); mCCI.builder.set(CaptureRequest.CONTROL_AF_TRIGGER, Integer.valueOf(0)); mCCI.session.capture(mCancelRequest, this, mCCI.handler); return true; } } public class CameraCacheInfo {

Page 152: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

int bufferFormatPL; int bufferHeight; int bufferWidth; CaptureRequest.Builder builder; int[] caps; CameraCharacteristics characteristics; CameraDevice device; long deviceHandle; int deviceID; String deviceIDString; Handler handler; Semaphore imageSemaphore; Image[] images; boolean isAutoFocusing; CaptureResult lastResult; int overrideFormatAndroid; int overrideHeight; int overrideWidth; ImageReader reader; int requestFormatAndroid; int requestFramerate; int requestHeight; int requestWidth; CameraCaptureSession session; int status; List<Surface> surfaces; HandlerThread thread; public CameraCacheInfo() {} } public class FrameInfo { long exposureTime; int iso; long timestamp; public FrameInfo() {} } private class OnCameraDataAvailable implements ImageReader.OnImageAvailableListener { private int DEBUG_FORMAT = 0; private int[] actualBufferSize = null;

Page 153: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private int actualCaptureFormat = 268439808; private int currentTestBufferIndex = 0; private ByteBuffer[] testYUVBuffers = new ByteBuffer[2]; public OnCameraDataAvailable() {} private ByteBuffer convertNV21toPaddedYUV(ByteBuffer paramByteBuffer, Image.Plane paramPlane1, Image.Plane paramPlane2, Image.Plane paramPlane3, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7) { if (paramByteBuffer != null) { paramByteBuffer.rewind(); if (paramInt4 != 0) { break label69; } paramByteBuffer.put(paramPlane1.getBuffer()); } for (;;) { if (paramInt5 <= 0) { break label153; } paramInt3 = 0; while (paramInt3 < actualBufferSize[0] * paramInt5) { paramByteBuffer.put((byte)0); paramInt3 += 1; } paramByteBuffer = ByteBuffer.allocateDirect(paramInt3); break; label69: int i = paramPlane1.getBuffer().limit(); while (paramPlane1.getBuffer().hasRemaining()) { paramPlane1.getBuffer().limit(paramPlane1.getBuffer().position() + paramInt2); paramByteBuffer.put(paramPlane1.getBuffer()); paramInt3 = 0; while (paramInt3 < paramInt4) { paramByteBuffer.put((byte)0); paramInt3 += 1; }

Page 154: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramPlane1.getBuffer().limit(i); } } label153: paramInt3 = 0; while (paramInt3 < paramInt1 / 2) { paramInt4 = 0; while (paramInt4 < paramInt2 / 2) { paramByteBuffer.put(paramPlane2.getBuffer().get()); if (paramPlane2.getBuffer().hasRemaining()) { paramPlane2.getBuffer().get(); } paramInt4 += 1; } paramInt4 = 0; while (paramInt4 < paramInt6) { paramByteBuffer.put((byte)0); paramInt4 += 1; } paramInt3 += 1; } if (paramInt7 > 0) { paramInt3 = 0; while (paramInt3 < actualBufferSize[2] * paramInt7) { paramByteBuffer.put((byte)0); paramInt3 += 1; } } paramInt3 = 0; while (paramInt3 < paramInt1 / 2) { paramInt4 = 0; while (paramInt4 < paramInt2 / 2) { paramByteBuffer.put(paramPlane3.getBuffer().get()); if (paramPlane3.getBuffer().hasRemaining()) { paramPlane3.getBuffer().get(); } paramInt4 += 1; }

Page 155: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramInt4 = 0; while (paramInt4 < paramInt6) { paramByteBuffer.put((byte)0); paramInt4 += 1; } paramInt3 += 1; } if (paramInt7 > 0) { paramInt1 = 0; while (paramInt1 < actualBufferSize[2] * paramInt7) { paramByteBuffer.put((byte)0); paramInt1 += 1; } } paramByteBuffer.flip(); return paramByteBuffer; } private ByteBuffer convertNV21toYUV420Contigious(Image paramImage, ByteBuffer paramByteBuffer) { Image.Plane localPlane1 = paramImage.getPlanes()[0]; Image.Plane localPlane2 = paramImage.getPlanes()[1]; Image.Plane localPlane3 = paramImage.getPlanes()[2]; int i1 = paramImage.getHeight(); int i2 = paramImage.getWidth(); int i = i1 * i2 * 12 / 8; int j = 0; int k = 0; int m = 0; int n = 0; if (actualBufferSize != null) { i = actualBufferSize[0] * actualBufferSize[1] + actualBufferSize[2] * 2 * actualBufferSize[3]; j = actualBufferSize[0] - i2; k = actualBufferSize[1] - i1; m = actualBufferSize[2] - i2 / 2; n = actualBufferSize[3] - i1 / 2; } return convertNV21toPaddedYUV(paramByteBuffer, localPlane1, localPlane3, localPlane2, i1, i2, i, j, k, m, n);

Page 156: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} private ByteBuffer convertNV21toYV12Contigious(Image paramImage, ByteBuffer paramByteBuffer) { Image.Plane localPlane1 = paramImage.getPlanes()[0]; Image.Plane localPlane2 = paramImage.getPlanes()[1]; Image.Plane localPlane3 = paramImage.getPlanes()[2]; int i1 = paramImage.getHeight(); int i2 = paramImage.getWidth(); int i = i1 * i2 * 12 / 8; int j = 0; int k = 0; int m = 0; int n = 0; if (actualBufferSize != null) { i = actualBufferSize[0] * actualBufferSize[1] + actualBufferSize[2] * 2 * actualBufferSize[3]; j = actualBufferSize[0] - i2; k = actualBufferSize[1] - i1; m = actualBufferSize[2] - i2 / 2; n = actualBufferSize[3] - i1 / 2; } return convertNV21toPaddedYUV(paramByteBuffer, localPlane1, localPlane2, localPlane3, i1, i2, i, j, k, m, n); } private int getImageFormat(Image paramImage) { if ((paramImage == null) || (paramImage.getPlanes().length != 3) || (paramImage.getFormat() != 35)) {} Image.Plane localPlane1; Image.Plane localPlane2; long[] arrayOfLong; do { Image.Plane localPlane3; do { return 268439808; localPlane1 = paramImage.getPlanes()[0]; localPlane2 = paramImage.getPlanes()[1]; localPlane3 = paramImage.getPlanes()[2];

Page 157: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} while ((localPlane1.getPixelStride() != 1) || (localPlane1.getRowStride() != paramImage.getWidth()) || (localPlane2.getPixelStride() != localPlane3.getPixelStride()) || (localPlane2.getRowStride() != localPlane3.getRowStride())); arrayOfLong = new long[3]; arrayOfLong[0] = Camera2_Preview.this.getBufferAddress(localPlane1.getBuffer()); arrayOfLong[1] = Camera2_Preview.this.getBufferAddress(localPlane2.getBuffer()); arrayOfLong[2] = Camera2_Preview.this.getBufferAddress(localPlane3.getBuffer()); } while ((arrayOfLong[0] == 0L) || (arrayOfLong[1] == 0L) || (arrayOfLong[2] == 0L)); if (localPlane2.getPixelStride() == 2) { if (arrayOfLong[1] + 1L == arrayOfLong[2]) { return 268439815; } if (arrayOfLong[2] + 1L == arrayOfLong[1]) { return 268439817; } } if (localPlane2.getPixelStride() == 1) { if (arrayOfLong[1] < arrayOfLong[2]) { if (arrayOfLong[1] + paramImage.getHeight() / 2 * (paramImage.getWidth() / 2) != arrayOfLong[2]) { actualBufferSize = new int[4]; actualBufferSize[0] = localPlane1.getRowStride(); actualBufferSize[1] = ((int)((arrayOfLong[1] - arrayOfLong[0]) / localPlane1.getRowStride())); actualBufferSize[2] = localPlane2.getRowStride(); actualBufferSize[3] = ((int)((arrayOfLong[2] - arrayOfLong[1]) / localPlane2.getRowStride())); } return 268439818; } if (arrayOfLong[2] + paramImage.getHeight() / 2 * (paramImage.getWidth() / 2) != arrayOfLong[1]) { actualBufferSize = new int[4]; actualBufferSize[0] = localPlane1.getRowStride();

Page 158: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

actualBufferSize[1] = ((int)((arrayOfLong[2] - arrayOfLong[0]) / localPlane1.getRowStride())); actualBufferSize[2] = localPlane2.getRowStride(); actualBufferSize[3] = ((int)((arrayOfLong[1] - arrayOfLong[2]) / localPlane2.getRowStride())); } return 268439828; } DebugLog.LOGE("Camera2_Preview", "Unable to detect a supported image format, Unknown Image Format"); return 268439808; } public void onImageAvailable(ImageReader paramImageReader) { Trace.beginSection("onImageAvailable (java)"); Integer localInteger = (Integer)mCameraCacheInfoIndexCache.get(paramImageReader); if (localInteger == null) { DebugLog.LOGE("Camera2_Preview", "Unable to find reader in the index cache!"); Trace.endSection(); return; } Camera2_Preview.CameraCacheInfo localCameraCacheInfo = (Camera2_Preview.CameraCacheInfo)mCameraCacheInfos.get(localInteger.intValue()); if (localCameraCacheInfo == null) { DebugLog.LOGE("Camera2_Preview", "Unable to find CCI in list!"); Trace.endSection(); return; } if (!imageSemaphore.tryAcquire()) { DebugLog.LOGE("Camera2_Preview", "Unable to aquire image semaphore, need to free some buffers!!"); Trace.endSection(); return; } Camera2_Preview.FrameInfo localFrameInfo; if (paramImageReader.getMaxImages() > 0) { paramImageReader = paramImageReader.acquireLatestImage();

Page 159: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (paramImageReader != null) { localFrameInfo = new Camera2_Preview.FrameInfo(Camera2_Preview.this); timestamp = paramImageReader.getTimestamp(); Object localObject = lastResult; if (localObject != null) { Long localLong = (Long)((CaptureResult)localObject).get(CaptureResult.SENSOR_EXPOSURE_TIME); if (localLong != null) { exposureTime = localLong.longValue(); timestamp += localLong.longValue(); } localObject = (Integer)((CaptureResult)localObject).get(CaptureResult.SENSOR_SENSITIVITY); if (localObject != null) { iso = ((Integer)localObject).intValue(); } } if (actualCaptureFormat == 268439808) { actualCaptureFormat = getImageFormat(paramImageReader); } if (DEBUG_FORMAT != 268439818) { break label327; } testYUVBuffers[currentTestBufferIndex] = convertNV21toYV12Contigious(paramImageReader, testYUVBuffers[currentTestBufferIndex]); paramImageReader.close(); Camera2_Preview.this.newFrameAvailable(deviceHandle, localInteger.intValue(), bufferWidth, bufferHeight, actualBufferSize, 268439818, testYUVBuffers[currentTestBufferIndex], localFrameInfo); currentTestBufferIndex = ((currentTestBufferIndex + 1) % 2); } } for (;;) { imageSemaphore.release(); Trace.endSection(); return; label327:

Page 160: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (DEBUG_FORMAT == 268439828) { testYUVBuffers[currentTestBufferIndex] = convertNV21toYUV420Contigious(paramImageReader, testYUVBuffers[currentTestBufferIndex]); paramImageReader.close(); Camera2_Preview.this.newFrameAvailable(deviceHandle, localInteger.intValue(), bufferWidth, bufferHeight, actualBufferSize, 268439828, testYUVBuffers[currentTestBufferIndex], localFrameInfo); currentTestBufferIndex = ((currentTestBufferIndex + 1) % 2); } else { Camera2_Preview.this.newFrameAvailable(deviceHandle, localInteger.intValue(), bufferWidth, bufferHeight, actualBufferSize, actualCaptureFormat, paramImageReader.getPlanes()[0].getBuffer(), localFrameInfo); paramImageReader.close(); } } } } private class OnFrameCapturedCallback extends CameraCaptureSession.CaptureCallback { Camera2_Preview.CameraCacheInfo mCCI; public OnFrameCapturedCallback(Camera2_Preview.CameraCacheInfo paramCameraCacheInfo) { mCCI = paramCameraCacheInfo; } public void onCaptureCompleted(CameraCaptureSession paramCameraCaptureSession, CaptureRequest paramCaptureRequest, TotalCaptureResult paramTotalCaptureResult) { if (mCCI != null) { mCCI.lastResult = paramTotalCaptureResult; } } } }

Page 161: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

/* Location: * Qualified Name: com.vuforia.ar.pl.Camera2_Preview * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ CameraSurface.java package com.vuforia.ar.pl; import android.content.Context; import android.hardware.Camera; import android.view.SurfaceHolder; import android.view.SurfaceHolder.Callback; import android.view.SurfaceView; import java.io.IOException; class CameraSurface extends SurfaceView implements SurfaceHolder.Callback { private static final String MODULENAME = "CameraSurface"; Camera camera = null; SurfaceHolder surfaceHolder = getHolder(); public CameraSurface(Context paramContext) { super(paramContext); surfaceHolder.addCallback(this); surfaceHolder.setType(3); } public void setCamera(Camera paramCamera) { camera = paramCamera;

Page 162: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} public void surfaceChanged(SurfaceHolder paramSurfaceHolder, int paramInt1, int paramInt2, int paramInt3) {} public void surfaceCreated(SurfaceHolder paramSurfaceHolder) { try { if (camera != null) { camera.setPreviewDisplay(paramSurfaceHolder); } return; } catch (IOException paramSurfaceHolder) { camera = null; } } public void surfaceDestroyed(SurfaceHolder paramSurfaceHolder) { camera = null; } } /* Location: * Qualified Name: com.vuforia.ar.pl.CameraSurface * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ DebugLog.java package com.vuforia.ar.pl; import android.util.Log; public class DebugLog { private static final String LOGTAG = "AR"; public static final void LOGD(String paramString1, String paramString2) { String str = paramString2;

Page 163: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (paramString1.length() > 0) { str = paramString1 + ": " + paramString2; } Log.d("AR", str); } public static final void LOGE(String paramString1, String paramString2) { String str = paramString2; if (paramString1.length() > 0) { str = paramString1 + ": " + paramString2; } Log.e("AR", str); } public static final void LOGI(String paramString1, String paramString2) { String str = paramString2; if (paramString1.length() > 0) { str = paramString1 + ": " + paramString2; } Log.i("AR", str); } public static final void LOGW(String paramString1, String paramString2) { String str = paramString2; if (paramString1.length() > 0) { str = paramString1 + ": " + paramString2; } Log.w("AR", str); } } /* Location: * Qualified Name: com.vuforia.ar.pl.DebugLog * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ DrawOverlayView.java package com.vuforia.ar.pl; import android.app.Activity;

Page 164: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.util.DisplayMetrics; import android.view.Display; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import java.nio.ByteBuffer; public class DrawOverlayView extends View { private static final String MODULENAME = "DrawOverlayView"; private Drawable drawable = null; private double mLeft; private float[] mScale; private int[] mSize; private double mTop; private DisplayMetrics metrics; private Bitmap overlayBitmap; public DrawOverlayView(Context paramContext) { super(paramContext); } public DrawOverlayView(Context paramContext, byte[] paramArrayOfByte, int paramInt1, int paramInt2, float[] paramArrayOfFloat, int[] paramArrayOfInt) { super(paramContext); mLeft = paramInt1; mTop = paramInt2; mScale = paramArrayOfFloat; mSize = paramArrayOfInt; paramContext = new byte[paramArrayOfByte.length * 4]; paramInt1 = 0; while (paramInt1 < mSize[0] * mSize[1]) { paramContext[(paramInt1 * 4)] = paramArrayOfByte[paramInt1]; paramContext[(paramInt1 * 4 + 1)] = paramArrayOfByte[paramInt1];

Page 165: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramContext[(paramInt1 * 4 + 2)] = paramArrayOfByte[paramInt1]; paramContext[(paramInt1 * 4 + 3)] = -1; paramInt1 += 1; } overlayBitmap = Bitmap.createBitmap(mSize[0], mSize[1], Bitmap.Config.ARGB_8888); overlayBitmap.copyPixelsFromBuffer(ByteBuffer.wrap(paramContext)); drawable = new BitmapDrawable(overlayBitmap); metrics = new DisplayMetrics(); ((Activity)getContext()).getWindowManager().getDefaultDisplay().getMetrics(metrics); } public void addOverlay(Activity paramActivity) { ((ViewGroup)paramActivity.getWindow().getDecorView()).addView(this); setVisibility(0); } protected void onDraw(Canvas paramCanvas) { if (overlayBitmap == null) { super.dispatchDraw(paramCanvas); return; } double d = metrics.heightPixels - drawable.getIntrinsicHeight() * mScale[1]; if (d < mTop) { mTop = d; } int i = (int)(mLeft + drawable.getIntrinsicWidth() * metrics.density * mScale[0]); int j = (int)(mTop + drawable.getIntrinsicHeight() * metrics.density * mScale[1]); drawable.setBounds((int)mLeft, (int)mTop, i, j); drawable.setAlpha(100); drawable.draw(paramCanvas); super.dispatchDraw(paramCanvas); } public void removeOverlay(Activity paramActivity, View paramView) { try {

Page 166: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

((ViewGroup)paramActivity.getWindow().getDecorView()).removeView(paramView); return; } catch (Exception paramActivity) {} } } /* Location: * Qualified Name: com.vuforia.ar.pl.DrawOverlayView * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ EpsonBT200Controller$1.java

package com.vuforia.ar.pl; import android.app.Activity; import android.view.Window; import android.view.WindowManager.LayoutParams; class EpsonBT200Controller$1 implements Runnable { EpsonBT200Controller$1(EpsonBT200Controller paramEpsonBT200Controller, Activity paramActivity) {} public void run() { Window localWindow = val$activity.getWindow(); WindowManager.LayoutParams localLayoutParams = localWindow.getAttributes(); flags |= 0x80000000; localWindow.setAttributes(localLayoutParams); } } /* Location: * Qualified Name: com.vuforia.ar.pl.EpsonBT200Controller.1 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */

Page 167: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

EpsonBT200Controller.java package com.vuforia.ar.pl; import android.app.Activity; import android.view.Display; import android.view.Window; import android.view.WindowManager; import android.view.WindowManager.LayoutParams; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class EpsonBT200Controller { private static final String MODULENAME = "EpsonBT200Controller"; private boolean stereoEnabled = false; public EpsonBT200Controller() { final Activity localActivity = SystemTools.getActivityFromNative(); if (localActivity == null) { return; } localActivity.runOnUiThread(new Runnable() { public void run() { Window localWindow = localActivity.getWindow(); WindowManager.LayoutParams localLayoutParams = localWindow.getAttributes(); flags |= 0x80000000; localWindow.setAttributes(localLayoutParams); } }); } public boolean getStereo() { return stereoEnabled; } public boolean setStereo(boolean paramBoolean) { int i = 0; if (paramBoolean) {

Page 168: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

i = 1; } boolean bool1; try { Object localObject = SystemTools.getActivityFromNative(); if (localObject == null) { return false; } localObject = ((WindowManager)((Activity)localObject).getSystemService("window")).getDefaultDisplay(); boolean bool2 = ((Boolean)Display.class.getDeclaredMethod("setDisplayMode", new Class[] { Integer.TYPE }).invoke(localObject, new Object[] { Integer.valueOf(i) })).booleanValue(); bool1 = bool2; if (bool2) { stereoEnabled = paramBoolean; return bool2; } } catch (NoSuchMethodException localNoSuchMethodException) { return false; } catch (IllegalAccessException localIllegalAccessException) { return false; } catch (InvocationTargetException localInvocationTargetException) { bool1 = false; } return bool1; } } /* Location: * Qualified Name: com.vuforia.ar.pl.EpsonBT200Controller * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */

Page 169: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

FileTools.java package com.vuforia.ar.pl; import android.app.Activity; import android.content.res.AssetManager; import android.os.Environment; import java.io.File; public class FileTools { private static final int FILE_PATHTYPEINDEX_ABSOLUTE = -1; private static final int FILE_PATHTYPEINDEX_ANDROID_ASSETS = 0; private static final int FILE_PATHTYPEINDEX_ANDROID_DATALOCAL = 4; private static final int FILE_PATHTYPEINDEX_ANDROID_MEDIASTORAGE = 3; private static final int FILE_PATHTYPEINDEX_ANDROID_PRIVATEAPPCACHE = 2; private static final int FILE_PATHTYPEINDEX_ANDROID_PRIVATEAPPSTORAGE = 1; private static final String MODULENAME = "FileTools"; public static String getAbsolutePath(int paramInt, String paramString) { Object localObject1; switch (paramInt) { default: SystemTools.setSystemErrorCode(6); return null; case 1: localObject1 = SystemTools.getActivityFromNative(); if (localObject1 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject1 = ((Activity)localObject1).getFilesDir(); if (localObject1 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject1 = ((File)localObject1).getAbsolutePath();

Page 170: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} for (;;) { Object localObject2 = localObject1; if (localObject1 != null) { localObject2 = localObject1; if (paramString != null) { localObject2 = localObject1; if (((String)localObject1).length() > 0) { localObject2 = localObject1; if (((String)localObject1).charAt(((String)localObject1).length() - 1) != '/') { localObject2 = (String)localObject1 + "/"; } } localObject2 = (String)localObject2 + paramString; } } return (String)localObject2; localObject1 = SystemTools.getActivityFromNative(); if (localObject1 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject1 = ((Activity)localObject1).getCacheDir(); if (localObject1 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject1 = ((File)localObject1).getAbsolutePath(); continue; localObject1 = Environment.getExternalStorageDirectory(); if (localObject1 == null) { SystemTools.setSystemErrorCode(6); return null; } localObject1 = ((File)localObject1).getAbsolutePath(); } }

Page 171: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

public static AssetManager get_assetmanager() { Activity localActivity = SystemTools.getActivityFromNative(); if (localActivity == null) { SystemTools.setSystemErrorCode(6); return null; } return localActivity.getAssets(); } public static boolean mediastorage_isAvailable() { String str = Environment.getExternalStorageState(); return ("mounted".equals(str)) || ("mounted_ro".equals(str)); } } /* Location: * Qualified Name: com.vuforia.ar.pl.FileTools * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ ImageTools.java

package com.vuforia.ar.pl; import android.graphics.Bitmap; import android.graphics.Bitmap.CompressFormat; import android.graphics.Bitmap.Config; import android.graphics.Rect; import android.graphics.YuvImage; import java.io.ByteArrayOutputStream; import java.io.OutputStream; public class ImageTools { private static final int CAMERA_IMAGE_FORMAT_LUM = 268439809; private static final int CAMERA_IMAGE_FORMAT_NV12 = 268439815; private static final int CAMERA_IMAGE_FORMAT_NV21 = 268439817; private static final int CAMERA_IMAGE_FORMAT_RGB565 = 268439810; private static final String MODULENAME = "ImageTools";

Page 172: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

public static byte[] encodeImage(byte[] paramArrayOfByte, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5) { if (paramArrayOfByte == null) { return null; } Object localObject; if (paramInt3 == 268439817) { paramArrayOfByte = new YuvImage(paramArrayOfByte, 17, paramInt1, paramInt2, null); localObject = new ByteArrayOutputStream(); if (paramArrayOfByte.compressToJpeg(new Rect(0, 0, paramInt1, paramInt2), paramInt5, (OutputStream)localObject)) { return ((ByteArrayOutputStream)localObject).toByteArray(); } return null; } if (paramInt3 == 268439809) { paramInt4 = paramInt1 * paramInt2; localObject = new int[paramInt4]; paramInt3 = 0; while (paramInt3 < paramInt4) { localObject[paramInt3] = (paramArrayOfByte[paramInt3] << 24 | 0xFFFFFF); paramInt3 += 1; } paramArrayOfByte = Bitmap.createBitmap((int[])localObject, 0, paramInt1, paramInt1, paramInt2, Bitmap.Config.ARGB_8888); localObject = new ByteArrayOutputStream(); if (paramArrayOfByte.compress(Bitmap.CompressFormat.JPEG, paramInt5, (OutputStream)localObject)) { return ((ByteArrayOutputStream)localObject).toByteArray(); } return null; } return null; } } /* Location: * Qualified Name: com.vuforia.ar.pl.ImageTools * Java Class Version: 6 (50.0)

Page 173: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

* JD-Core Version: 0.7.1 */ ODGR7Controller$1.java

package com.vuforia.ar.pl; import android.app.Activity; class ODGR7Controller$1 implements Runnable { ODGR7Controller$1(ODGR7Controller paramODGR7Controller, Activity paramActivity, boolean paramBoolean) {} public void run() { ODGR7Controller.access$000(this$0, val$activity, val$enable); } } /* Location: * Qualified Name: com.vuforia.ar.pl.ODGR7Controller.1 * Java Class Version: 6 (50.0) ODGR7Controller.java package com.vuforia.ar.pl; import android.app.Activity; import android.util.DisplayMetrics; import android.view.Surface; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.ViewGroup; import android.view.Window; import com.osterhoutgroup.api.ext.ExtendDisplay; public class ODGR7Controller { private static final String MODULENAME = "ODGR7Controller"; private boolean stereoEnabled = false; private void configureSurfaceViews(ViewGroup paramViewGroup, boolean paramBoolean) {

Page 174: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

int j = paramViewGroup.getChildCount(); int i = 0; if (i < j) { Object localObject = paramViewGroup.getChildAt(i); if ((localObject instanceof SurfaceView)) { localObject = (SurfaceView)localObject; if (((SurfaceView)localObject).getHolder().getSurface().isValid()) { ExtendDisplay.extendSurface((SurfaceView)localObject, paramBoolean); } } for (;;) { i += 1; break; if ((localObject instanceof ViewGroup)) { configureSurfaceViews((ViewGroup)localObject, paramBoolean); } } } } private void doSetStereo(Activity paramActivity, boolean paramBoolean) { Window localWindow = paramActivity.getWindow(); if (localWindow == null) { return; } logMetrics("Before extendWindow", paramActivity, localWindow); ExtendDisplay.extendWindow(localWindow, paramBoolean); logMetrics("After extendWindow", paramActivity, localWindow); setStereoSurfaces(localWindow, paramBoolean); stereoEnabled = paramBoolean; } private void logMetrics(String paramString, Activity paramActivity, Window paramWindow) { paramString = new DisplayMetrics(); ExtendDisplay.getDisplayMetrics(paramActivity, paramWindow, paramString); int i = widthPixels; i = heightPixels;

Page 175: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} private void setStereoSurfaces(Window paramWindow, boolean paramBoolean) { configureSurfaceViews((ViewGroup)paramWindow.getDecorView(), paramBoolean); } public boolean getStereo() { return stereoEnabled; } public boolean setStereo(final boolean paramBoolean) { final Activity localActivity = SystemTools.getActivityFromNative(); if (localActivity == null) { return false; } localActivity.runOnUiThread(new Runnable() { public void run() { ODGR7Controller.this.doSetStereo(localActivity, paramBoolean); } }); return true; } } /* Location: * Qualified Name: com.vuforia.ar.pl.ODGR7Controller * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ RenderManager$1.java

package com.vuforia.ar.pl; import android.app.Activity; class RenderManager$1 implements Runnable

Page 176: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ RenderManager$1(RenderManager paramRenderManager, DrawOverlayView paramDrawOverlayView, Activity paramActivity) {} public void run() { val$wm.addOverlay(val$activity); } } /* Location: * Qualified Name: com.vuforia.ar.pl.RenderManager.1 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 RenderManager$2.java

package com.vuforia.ar.pl; import android.app.Activity; import android.view.View; class RenderManager$2 implements Runnable { RenderManager$2(RenderManager paramRenderManager, Activity paramActivity, View paramView) {} public void run() { new DrawOverlayView(val$activity).removeOverlay(val$activity, val$view); } } /* Location: * Qualified Name: com.vuforia.ar.pl.RenderManager.2 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 RenderManager$FixedFrameRateRunner.java package com.vuforia.ar.pl; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.atomic.AtomicBoolean;

Page 177: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

final class RenderManager$FixedFrameRateRunner implements Runnable { private RenderManager$FixedFrameRateRunner(RenderManager paramRenderManager) {} public void run() { if ((!this$0.renderRequestServiced.getAndSet(false)) && (this$0.surfaceManager != null)) { this$0.surfaceManager.requestRender(); if ((!this$0.synchronousMode) && (!this$0.renderRequestWatcherTask.isCancelled())) { this$0.renderRequestWatcherTask.cancel(false); } } } } /* Location: * Qualified Name: com.vuforia.ar.pl.RenderManager.FixedFrameRateRunner * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ RenderManager$RenderRequestWatcher.java

package com.vuforia.ar.pl; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; final class RenderManager$RenderRequestWatcher implements Runnable { private RenderManager$RenderRequestWatcher(RenderManager paramRenderManager) {} public void run() { if ((this$0.renderRequested.compareAndSet(true, false)) && (this$0.surfaceManager != null))

Page 178: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ this$0.surfaceManager.requestRender(); this$0.renderRequestServiced.set(true); if (this$0.fixedFrameRateRunnerTask == null) { this$0.fixedFrameRateRunnerTask = this$0.timer.scheduleAtFixedRate(new RenderManager.FixedFrameRateRunner(this$0, null), 0L, this$0.delayMS, TimeUnit.MILLISECONDS); } } } } /* Location: * Qualified Name: com.vuforia.ar.pl.RenderManager.RenderRequestWatcher * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ RenderManager.java package com.vuforia.ar.pl; import android.app.Activity; import android.view.View; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; public class RenderManager { private static final int AR_RENDERING_MODE_CONTINUOUS = 2; private static final int AR_RENDERING_MODE_DISABLED = 1; private static final int AR_RENDERING_MODE_UNKNOWN = 0; private static final int AR_RENDERING_MODE_WHENDIRTY = 3; private static final String MODULENAME = "RenderManager"; private static int viewId = 0; long delayMS = 0L; ScheduledFuture<?> fixedFrameRateRunnerTask; long maxMS = 0L; long minMS = 0L; int renderMode; AtomicBoolean renderRequestServiced;

Page 179: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

ScheduledFuture<?> renderRequestWatcherTask; AtomicBoolean renderRequested; SurfaceManager surfaceManager; boolean synchronousMode; ScheduledThreadPoolExecutor timer; public RenderManager(SurfaceManager paramSurfaceManager) { surfaceManager = paramSurfaceManager; renderMode = 2; timer = new ScheduledThreadPoolExecutor(1); synchronousMode = false; renderRequestServiced = new AtomicBoolean(false); renderRequested = new AtomicBoolean(false); } public View addOverlay(final byte[] paramArrayOfByte, int paramInt1, int paramInt2, float[] paramArrayOfFloat, int[] paramArrayOfInt) { final Activity localActivity = SystemTools.getActivityFromNative(); if (localActivity == null) { DebugLog.LOGE("RenderManager", "drawOverlay could not get access to an activity"); return null; } paramArrayOfByte = new DrawOverlayView(localActivity, paramArrayOfByte, paramInt1, paramInt2, paramArrayOfFloat, paramArrayOfInt); localActivity.runOnUiThread(new Runnable() { public void run() { paramArrayOfByte.addOverlay(localActivity); } }); return paramArrayOfByte; } public boolean canSetRenderMode() { boolean bool = surfaceManager.retrieveGLSurfaceView(); if (!bool) { DebugLog.LOGD("RenderManager", "Could not retrieve a valid GLSurfaceView in view hierarchy, therefore cannot set any render mode");

Page 180: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} return bool; } public int getRenderMode() { return renderMode; } public boolean removeOverlay(final View paramView) { final Activity localActivity = SystemTools.getActivityFromNative(); if (localActivity == null) {} while (paramView == null) { return false; } localActivity.runOnUiThread(new Runnable() { public void run() { new DrawOverlayView(localActivity).removeOverlay(localActivity, paramView); } }); return true; } public boolean requestRender() { renderRequested.set(true); return true; } public boolean setRenderFpsLimits(boolean paramBoolean, int paramInt1, int paramInt2) { long l2 = 1L; synchronousMode = paramBoolean; if ((paramInt1 == 0) || (paramInt2 == 0)) { SystemTools.setSystemErrorCode(2); return false; } if (paramInt1 > 1000) {

Page 181: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

l1 = 1L; minMS = l1; if (paramInt2 <= 1000) { break label109; } l1 = l2; label49: maxMS = l1; if (renderMode == 3) { if (!synchronousMode) { break label120; } } } label109: label120: for (long l1 = minMS;; l1 = maxMS) { if (l1 != delayMS) { delayMS = l1; startTimer(); } return true; l1 = 1000L / paramInt1; break; l1 = 1000L / paramInt2; break label49; } } public boolean setRenderMode(int paramInt) { if (surfaceManager == null) { SystemTools.setSystemErrorCode(6); return false; } surfaceManager.retrieveGLSurfaceView(); boolean bool2; boolean bool1; switch (paramInt) { default: SystemTools.setSystemErrorCode(2);

Page 182: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

return false; case 2: bool2 = surfaceManager.setEnableRenderWhenDirty(false); bool1 = bool2; if (bool2) { shutdownTimer(); bool1 = bool2; } if (!bool1) { SystemTools.setSystemErrorCode(6); } break; } for (;;) { return bool1; bool2 = surfaceManager.setEnableRenderWhenDirty(true); bool1 = bool2; if (!bool2) { break; } if (paramInt == 1) { shutdownTimer(); bool1 = bool2; break; } if (paramInt == renderMode) { bool1 = bool2; if (!timer.isShutdown()) { break; } } if (synchronousMode) {} for (long l = minMS;; l = maxMS) { bool1 = bool2; if (l == 0L) { break; } delayMS = l; startTimer(); bool1 = bool2;

Page 183: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

break; } renderMode = paramInt; } } void shutdownTimer() { if (!timer.isShutdown()) { timer.shutdown(); } } void startTimer() { if (timer.isShutdown()) { timer = new ScheduledThreadPoolExecutor(1); } if ((fixedFrameRateRunnerTask != null) && (!fixedFrameRateRunnerTask.isCancelled())) { fixedFrameRateRunnerTask.cancel(true); } if ((renderRequestWatcherTask != null) && (!renderRequestWatcherTask.isCancelled())) { renderRequestWatcherTask.cancel(true); } fixedFrameRateRunnerTask = null; renderRequestWatcherTask = null; if (delayMS < 4L) {} for (long l = 1L;; l = delayMS / 4L) { renderRequestWatcherTask = timer.scheduleWithFixedDelay(new RenderRequestWatcher(null), 0L, l, TimeUnit.MILLISECONDS); return; } } private final class FixedFrameRateRunner implements Runnable { private FixedFrameRateRunner() {} public void run() {

Page 184: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if ((!renderRequestServiced.getAndSet(false)) && (surfaceManager != null)) { surfaceManager.requestRender(); if ((!synchronousMode) && (!renderRequestWatcherTask.isCancelled())) { renderRequestWatcherTask.cancel(false); } } } } private final class RenderRequestWatcher implements Runnable { private RenderRequestWatcher() {} public void run() { if ((renderRequested.compareAndSet(true, false)) && (surfaceManager != null)) { surfaceManager.requestRender(); renderRequestServiced.set(true); if (fixedFrameRateRunnerTask == null) { fixedFrameRateRunnerTask = timer.scheduleAtFixedRate(new RenderManager.FixedFrameRateRunner(RenderManager.this, null), 0L, delayMS, TimeUnit.MILLISECONDS); } } } } } /* Location: * Qualified Name: com.vuforia.ar.pl.RenderManager * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ SensorController$SensorCacheInfo.java package com.vuforia.ar.pl; import android.hardware.Sensor;

Page 185: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

public class SensorController$SensorCacheInfo { int cacheIndex; boolean isDefaultSensor; int plSensorType; int requestedAbstractUpdateRate; Sensor sensor; float[] valuesForForcedSensorEvent; public SensorController$SensorCacheInfo(SensorController paramSensorController) {} } /* Location: * Qualified Name: com.vuforia.ar.pl.SensorController.SensorCacheInfo * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ SensorController.java package com.vuforia.ar.pl; import android.app.Activity; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Handler; import android.os.HandlerThread; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Vector; public class SensorController extends HandlerThread implements SensorEventListener { private static final int AR_SENSOR_CONFIDENCE_HIGH = 4; private static final int AR_SENSOR_CONFIDENCE_LOW = 2; private static final int AR_SENSOR_CONFIDENCE_MEDIUM = 3; private static final int AR_SENSOR_CONFIDENCE_UNKNOWN = 0;

Page 186: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private static final int AR_SENSOR_CONFIDENCE_UNRELIABLE = 1; private static int AR_SENSOR_INDEX_DONTCARE = -1; private static final int AR_SENSOR_PARAMTYPE_ACCURACY = 1879048200; private static final int AR_SENSOR_PARAMTYPE_BASE = 1879048192; private static final int AR_SENSOR_PARAMTYPE_DATARANGE_MAX = 1879048194; private static final int AR_SENSOR_PARAMTYPE_DATARANGE_MIN = 1879048193; private static final int AR_SENSOR_PARAMTYPE_RESOLUTION = 1879048196; private static final int AR_SENSOR_PARAMTYPE_SENSITIVITY = 1879048208; private static final int AR_SENSOR_PARAMTYPE_UPDATEINTERVAL = 1879048224; private static final int AR_SENSOR_PARAMTYPE_UPDATEINTERVAL_ABSTRACT = 1879048256; private static final int AR_SENSOR_PARAMTYPE_UPDATEINTERVAL_MIN = 1879048320; private static final int AR_SENSOR_PARAMTYPE_UPDATERATE_MIN = 1879048448; private static final int AR_SENSOR_STATUS_IDLE = 1342242818; private static final int AR_SENSOR_STATUS_RUNNING = 1342242819; private static final int AR_SENSOR_STATUS_UNINITIALIZED = 1342242817; private static final int AR_SENSOR_STATUS_UNKNOWN = 1342242816; private static final int AR_SENSOR_TYPE_ACCELEROMETER = 1342177282; private static final int AR_SENSOR_TYPE_AMBIENT_LIGHT = 1342177286; private static final int AR_SENSOR_TYPE_DEVICE_ROTATION = 1342177288; private static final int AR_SENSOR_TYPE_GYROSCOPE = 1342177281; private static final int AR_SENSOR_TYPE_MAGNETOMETER = 1342177283; private static final int AR_SENSOR_TYPE_PROXIMITY = 1342177285; private static final int AR_SENSOR_TYPE_STEP_DETECTOR = 1342177287; private static final int AR_SENSOR_TYPE_UNKNOWN = 1342177280; private static final int AR_SENSOR_UPDATEINTERVAL_HIGHESTRATE = 4; private static final int AR_SENSOR_UPDATEINTERVAL_HIGHRATE = 3; private static final int AR_SENSOR_UPDATEINTERVAL_LOWRATE = 1;

Page 187: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private static final int AR_SENSOR_UPDATEINTERVAL_MEDIUMRATE = 2; private static final int AR_SENSOR_UPDATEINTERVAL_UNKNOWN = 0; private static boolean CONVERT_FORMAT_TO_ANDROID = false; private static boolean CONVERT_FORMAT_TO_PL = false; private static final String MODULENAME = "SensorController"; private static final int SENSORINFO_VALUE_ANDROIDSENSORTYPE = 1; private static final int SENSORINFO_VALUE_ISDEFAULT = 2; private static final int SENSORINFO_VALUE_PLSENSORTYPE = 0; private static final int[] SENSOR_TYPE_CONVERSIONTABLE = { 4, 1342177281, 1, 1342177282, 2, 1342177283, 8, 1342177285, 5, 1342177286, 18, 1342177287, 11, 1342177288 }; private static final int _NUM_SENSORINFO_VALUE_ = 3; private Vector<SensorCacheInfo> sensorCacheInfo = null; private Handler sensorEventHandler; private HashMap<Sensor, Integer> sensorIndexMap = null; private SensorManager sensorManager; static { CONVERT_FORMAT_TO_PL = true; CONVERT_FORMAT_TO_ANDROID = false; } public SensorController() { super("SensorController"); } private SensorCacheInfo getSensorCacheInfo(int paramInt) { if ((paramInt < 0) || (paramInt >= sensorCacheInfo.size())) { return null; } return (SensorCacheInfo)sensorCacheInfo.get(paramInt); } private native void newDataAvailable(int paramInt1, long paramLong, int paramInt2, float[] paramArrayOfFloat); private int translateSensorType(int paramInt, boolean paramBoolean) { int i = 0; while (i < SENSOR_TYPE_CONVERSIONTABLE.length / 2) {

Page 188: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

int j; if (paramBoolean == CONVERT_FORMAT_TO_PL) { j = SENSOR_TYPE_CONVERSIONTABLE[(i * 2)]; } while (paramInt == j) { if (paramBoolean == CONVERT_FORMAT_TO_PL) { return SENSOR_TYPE_CONVERSIONTABLE[(i * 2 + 1)]; j = SENSOR_TYPE_CONVERSIONTABLE[(i * 2 + 1)]; } else { return SENSOR_TYPE_CONVERSIONTABLE[(i * 2)]; } } i += 1; } if (paramBoolean == CONVERT_FORMAT_TO_PL) { return 1342177280; } return 0; } private int translateSensorUpdateIntervalToAndroid(int paramInt) { switch (paramInt) { default: return -1; case 1: return 3; case 2: return 2; case 3: return 1; } return 0; } boolean close(int paramInt) { SensorCacheInfo localSensorCacheInfo = getSensorCacheInfo(paramInt); if (localSensorCacheInfo == null) { SystemTools.setSystemErrorCode(4);

Page 189: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

SystemTools.logSystemError("Sensor handle is invalid"); return false; } boolean bool = false; try { sensorManager.unregisterListener(this, sensor); bool = true; System.gc(); } catch (Exception localException) { for (;;) { SystemTools.setSystemErrorCode(6); SystemTools.logSystemError("Failed to unregister sensor event listerer"); } } return bool; } public int getAllSupportedSensors() { Object localObject = SystemTools.getActivityFromNative(); if (localObject == null) { SystemTools.logSystemError("No valid activity set in native!"); return -1; } localObject = ((Activity)localObject).getApplication(); if (localObject == null) { return -1; } sensorManager = ((SensorManager)((Context)localObject).getSystemService("sensor")); if (sensorManager == null) { SystemTools.setSystemErrorCode(6); SystemTools.logSystemError("Failed to retrieve Context's Sensor Service"); return -1; } if (sensorCacheInfo.size() > 0) { return sensorCacheInfo.size();

Page 190: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} localObject = sensorManager.getSensorList(-1).iterator(); while (((Iterator)localObject).hasNext()) { Sensor localSensor = (Sensor)((Iterator)localObject).next(); int i = localSensor.getType(); boolean bool = localSensor.equals(sensorManager.getDefaultSensor(i)); i = translateSensorType(i, CONVERT_FORMAT_TO_PL); if (i != 1342177280) { SensorCacheInfo localSensorCacheInfo = new SensorCacheInfo(); sensor = localSensor; plSensorType = i; isDefaultSensor = bool; cacheIndex = sensorCacheInfo.size(); requestedAbstractUpdateRate = 0; sensorCacheInfo.add(localSensorCacheInfo); sensorIndexMap.put(sensor, Integer.valueOf(cacheIndex)); } } return sensorCacheInfo.size(); } int[] getSensorInfoValues(int paramInt) { int i = 1; SensorCacheInfo localSensorCacheInfo = getSensorCacheInfo(paramInt); if (localSensorCacheInfo == null) { return null; } int j = plSensorType; int k = sensor.getType(); if (isDefaultSensor) {} for (paramInt = i;; paramInt = 0) { return new int[] { j, k, paramInt }; } } String getSensorName(int paramInt) { SensorCacheInfo localSensorCacheInfo = getSensorCacheInfo(paramInt); if (localSensorCacheInfo == null) { return null; } return sensor.getName();

Page 191: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} Object getTypedSensorParameter(int paramInt1, int paramInt2) { SensorCacheInfo localSensorCacheInfo = getSensorCacheInfo(paramInt1); if (localSensorCacheInfo == null) { SystemTools.setSystemErrorCode(4); SystemTools.logSystemError("Sensor handle is invalid"); return null; } StringBuilder localStringBuilder; switch (paramInt2) { default: try { SystemTools.setSystemErrorCode(3); SystemTools.logSystemError("Unknown sensor parameter"); return null; } catch (Exception localException) { SystemTools.setSystemErrorCode(6); SystemTools.logSystemError("Failed to get sensor parameter: " + localException.toString()); return null; } case 1879048193: case 1879048200: case 1879048208: case 1879048224: SystemTools.setSystemErrorCode(3); localStringBuilder = new StringBuilder().append("Querying sensor parameter ").append(paramInt2).append(" is not supported for sensor type ").append(plSensorType); if (paramInt2 != 1879048224) {} break; } for (String str = " when using the Java-based sensor API";; str = "") { SystemTools.logSystemError(str); return null; return Float.valueOf(sensor.getMaximumRange());

Page 192: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

return Float.valueOf(sensor.getResolution()); if (SystemTools.checkMinimumApiLevel(9)) { return Integer.valueOf(sensor.getMinDelay()); } SystemTools.setSystemErrorCode(3); SystemTools.logSystemError("Unknown sensor parameter"); return null; paramInt1 = requestedAbstractUpdateRate; return Integer.valueOf(paramInt1); } } public boolean init() { sensorManager = null; sensorCacheInfo = new Vector(); sensorIndexMap = new HashMap(); return true; } public void onAccuracyChanged(Sensor paramSensor, int paramInt) {} public void onSensorChanged(SensorEvent paramSensorEvent) { Object localObject = sensorIndexMap.get(sensor); if (localObject == null) {} do { return; localObject = getSensorCacheInfo(((Integer)localObject).intValue()); } while (localObject == null); int i = 0; switch (accuracy) { } for (;;) { newDataAvailable(cacheIndex, timestamp, i, values); return; i = 1; continue; i = 2; continue; i = 3; continue;

Page 193: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

i = 4; } } boolean open(int paramInt1, int paramInt2) { Object localObject2 = null; if (paramInt2 == AR_SENSOR_INDEX_DONTCARE) { paramInt2 = 0; localObject1 = localObject2; if (paramInt2 < sensorCacheInfo.size()) { localObject1 = (SensorCacheInfo)sensorCacheInfo.get(paramInt2); if ((plSensorType != paramInt1) || (!isDefaultSensor)) { break label69; } } } for (;;) { if (localObject1 != null) { break label91; } SystemTools.setSystemErrorCode(2); SystemTools.logSystemError("No sensor matching the requested sensor device info has been found"); return false; label69: paramInt2 += 1; break; localObject1 = (SensorCacheInfo)sensorCacheInfo.get(paramInt2); } label91: if (sensorEventHandler == null) {} StringBuilder localStringBuilder; try { start(); sensorEventHandler = new Handler(getLooper()); return true; } catch (Exception localException) { SystemTools.setSystemErrorCode(6);

Page 194: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

localStringBuilder = new StringBuilder().append("Failed to "); if (!isAlive()) {} } for (Object localObject1 = "retrieve a handler for the sensor event handler thread";; localObject1 = "start Java handler thread for sensor events") { SystemTools.logSystemError((String)localObject1 + ": " + localException.toString()); return false; } } boolean setTypedSensorParameter(int paramInt1, int paramInt2, Object paramObject) { Object localObject = getSensorCacheInfo(paramInt1); if (localObject == null) { SystemTools.setSystemErrorCode(4); SystemTools.logSystemError("Sensor handle is invalid"); return false; } switch (paramInt2) { default: try { SystemTools.setSystemErrorCode(3); SystemTools.logSystemError("Unknown sensor parameter"); return false; } catch (Exception paramObject) { SystemTools.setSystemErrorCode(6); SystemTools.logSystemError("Failed to get sensor parameter: " + ((Exception)paramObject).toString()); return false; } case 1879048193: case 1879048194: case 1879048196: case 1879048200: case 1879048208: case 1879048224: case 1879048320:

Page 195: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

SystemTools.setSystemErrorCode(3); localObject = new StringBuilder().append("Sensor parameter ").append(paramInt2).append(" cannot be set for sensor type ").append(plSensorType); if (paramInt2 != 1879048224) {} break; } for (paramObject = " when using the Java-based sensor API";; paramObject = "") { SystemTools.logSystemError((String)paramObject); return false; paramInt1 = ((Number)paramObject).intValue(); if ((paramInt1 < 1) || (paramInt1 > 4)) { SystemTools.setSystemErrorCode(2); SystemTools.logSystemError("Invalid abstract sensor update interval (" + paramInt1 + ")"); return false; } requestedAbstractUpdateRate = paramInt1; return true; } } boolean start(int paramInt) { SensorCacheInfo localSensorCacheInfo = getSensorCacheInfo(paramInt); boolean bool2; if (localSensorCacheInfo == null) { SystemTools.setSystemErrorCode(4); SystemTools.logSystemError("Sensor handle is invalid"); bool2 = false; return bool2; } paramInt = translateSensorUpdateIntervalToAndroid(requestedAbstractUpdateRate); if (paramInt < 0) { paramInt = 1; } for (;;) { boolean bool1 = false; try

Page 196: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ bool2 = sensorManager.registerListener(this, sensor, paramInt, sensorEventHandler); bool1 = bool2; } catch (Exception localException) { for (;;) {} } bool2 = bool1; if (bool1) { break; } SystemTools.setSystemErrorCode(6); SystemTools.logSystemError("Failed to start sensor, could not register sensor event listerer"); return bool1; } } boolean stop(int paramInt) { SensorCacheInfo localSensorCacheInfo = getSensorCacheInfo(paramInt); if (localSensorCacheInfo == null) { SystemTools.setSystemErrorCode(4); SystemTools.logSystemError("Sensor handle is invalid"); return false; } try { sensorManager.unregisterListener(this, sensor); return true; } catch (Exception localException) { SystemTools.setSystemErrorCode(6); SystemTools.logSystemError("Failed to stop sensor, could not unregister sensor event listerer"); } return false; } public class SensorCacheInfo {

Page 197: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

int cacheIndex; boolean isDefaultSensor; int plSensorType; int requestedAbstractUpdateRate; Sensor sensor; float[] valuesForForcedSensorEvent; public SensorCacheInfo() {} } } /* Location: * Qualified Name: com.vuforia.ar.pl.SensorController * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ SurfaceManager$1.java

package com.vuforia.ar.pl; import android.view.ViewGroup; import android.widget.FrameLayout.LayoutParams; import java.util.concurrent.locks.Lock; class SurfaceManager$1 implements Runnable { SurfaceManager$1(SurfaceManager paramSurfaceManager) {} public void run() { this$0.addSurfaceLock.lock(); this$0.retrieveGLSurfaceView(); try { SurfaceManager.access$000(this$0, this$0.cciForSurface); ((ViewGroup)this$0.cameraSurfaceParentView).addView(this$0.cciForSurface.surface, this$0.glSurfaceViewChildPosition + 1, new FrameLayout.LayoutParams(-1, -1)); this$0.cciForSurface.surface.setVisibility(0); this$0.addSurfaceLock.unlock(); return; }

Page 198: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

catch (Exception localException) { localException = localException; this$0.addSurfaceLock.unlock(); return; } finally { localObject = finally; this$0.addSurfaceLock.unlock(); throw ((Throwable)localObject); } } } /* Location: * Qualified Name: com.vuforia.ar.pl.SurfaceManager.1 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ SurfaceManager.java

package com.vuforia.ar.pl; import android.app.Activity; import android.opengl.GLSurfaceView; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.widget.FrameLayout.LayoutParams; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public class SurfaceManager { private static final String MODULENAME = "SurfaceManager"; Lock addSurfaceLock = new ReentrantLock(); View cameraSurfaceParentView = null; Camera1_Preview.CameraCacheInfo cciForSurface; GLSurfaceView glSurfaceView = null; int glSurfaceViewChildPosition = 0; boolean renderWhenDirtyEnabled = false; Lock viewLock = new ReentrantLock();

Page 199: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

private boolean applyRenderWhenDirty() { int i = 0; if (glSurfaceView != null) { GLSurfaceView localGLSurfaceView = glSurfaceView; if (renderWhenDirtyEnabled) {} for (;;) { localGLSurfaceView.setRenderMode(i); return true; i = 1; } } return false; } private GLSurfaceView searchForGLSurfaceView(View paramView) { localObject = null; glSurfaceViewChildPosition = 0; try { ViewGroup localViewGroup = (ViewGroup)paramView; int j = localViewGroup.getChildCount(); int i = 0; paramView = (View)localObject; for (;;) { localObject = paramView; if (i >= j) { break; } localObject = localViewGroup.getChildAt(i); if ((localObject instanceof GLSurfaceView)) { localObject = (GLSurfaceView)localObject; glSurfaceViewChildPosition = i; break; } if ((localObject instanceof ViewGroup)) { paramView = searchForGLSurfaceView((View)localObject); localObject = paramView; if (paramView != null) {

Page 200: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

break; } } i += 1; } return (GLSurfaceView)localObject; } catch (Exception paramView) { return null; } } private void setupCameraSurface(Camera1_Preview.CameraCacheInfo paramCameraCacheInfo) { if (surface == null) { Activity localActivity = SystemTools.getActivityFromNative(); if (localActivity != null) { surface = new CameraSurface(localActivity); } } for (;;) { surface.setCamera(camera); return; if ((surface.getParent() != null) && (ViewGroup.class.isInstance(surface.getParent()))) { ((ViewGroup)surface.getParent()).removeView(surface); } } } public boolean addCameraSurface(Camera1_Preview.CameraCacheInfo paramCameraCacheInfo) { Activity localActivity = SystemTools.getActivityFromNative(); if (localActivity == null) {} do { return false; cciForSurface = paramCameraCacheInfo; int i = 0; viewLock.lock();

Page 201: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

try { localActivity.runOnUiThread(new Runnable() { public void run() { addSurfaceLock.lock(); retrieveGLSurfaceView(); try { SurfaceManager.this.setupCameraSurface(cciForSurface); ((ViewGroup)cameraSurfaceParentView).addView(cciForSurface.surface, glSurfaceViewChildPosition + 1, new FrameLayout.LayoutParams(-1, -1)); cciForSurface.surface.setVisibility(0); addSurfaceLock.unlock(); return; } catch (Exception localException) { localException = localException; addSurfaceLock.unlock(); return; } finally { localObject = finally; addSurfaceLock.unlock(); throw ((Throwable)localObject); } } }); viewLock.unlock(); } catch (Exception paramCameraCacheInfo) { for (;;) { paramCameraCacheInfo = paramCameraCacheInfo; i = 1; viewLock.unlock(); } } finally {

Page 202: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramCameraCacheInfo = finally; viewLock.unlock(); throw paramCameraCacheInfo; } } while (i != 0); return true; } public void requestRender() { if (glSurfaceView != null) { glSurfaceView.requestRender(); } } public boolean retrieveGLSurfaceView() { for (;;) { try { Object localObject = SystemTools.getActivityFromNative(); if (localObject == null) { return false; } localObject = ((Activity)localObject).getWindow().getDecorView(); glSurfaceView = searchForGLSurfaceView((View)localObject); if (glSurfaceView == null) { cameraSurfaceParentView = ((View)localObject); if (glSurfaceView != null) { bool = true; return bool; } } else { cameraSurfaceParentView = ((View)glSurfaceView.getParent()); continue; } boolean bool = false; } catch (Exception localException) {

Page 203: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

return false; } } } public boolean setEnableRenderWhenDirty(boolean paramBoolean) { renderWhenDirtyEnabled = paramBoolean; return applyRenderWhenDirty(); } } /* Location: * Qualified Name: com.vuforia.ar.pl.SurfaceManager * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ SystemTools$1.java package com.vuforia.ar.pl; import android.app.Activity; import java.lang.reflect.Method; final class SystemTools$1 implements Runnable { SystemTools$1(boolean paramBoolean, Activity paramActivity, int paramInt) {} public void run() { if (val$enableLifecycleEvents) {} try { Method localMethod = val$activity.getClass().getDeclaredMethod("onPause", new Class[0]); localMethod.setAccessible(true); localMethod.invoke(val$activity, new Object[0]); localMethod = val$activity.getClass().getDeclaredMethod("onDestroy", new Class[0]); localMethod.setAccessible(true); localMethod.invoke(val$activity, new Object[0]); }

Page 204: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

catch (Exception localException) { try { do { Thread.sleep(1000L); System.exit(val$errorCode); return; localException = localException; SystemTools.logSystemError("Error attempting to call onPause and onDestroy, will proceed with exiting"); } while ((localException == null) || (localException.getCause() == null)); SystemTools.logSystemError(localException.getCause().toString()); StackTraceElement[] arrayOfStackTraceElement = localException.getStackTrace(); int j = arrayOfStackTraceElement.length; int i = 0; while (i < j) { SystemTools.logSystemError(arrayOfStackTraceElement[i].toString()); i += 1; } } catch (InterruptedException localInterruptedException) { for (;;) {} } } } } /* Location: * Qualified Name: com.vuforia.ar.pl.SystemTools.1 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */ SystemTools.java

package com.vuforia.ar.pl; import android.app.Activity; import android.content.pm.ApplicationInfo; import android.content.res.Configuration; import android.content.res.Resources;

Page 205: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

import android.graphics.Point; import android.os.Build.VERSION; import android.util.DisplayMetrics; import android.view.Display; import android.view.WindowManager; import java.lang.reflect.Method; public class SystemTools { public static final int AR_DEVICE_ORIENTATION_0 = 268455954; public static final int AR_DEVICE_ORIENTATION_180 = 268455955; public static final int AR_DEVICE_ORIENTATION_270 = 268455957; public static final int AR_DEVICE_ORIENTATION_90 = 268455956; public static final int AR_DEVICE_ORIENTATION_UNKNOWN = 268455952; public static final int AR_ERROR_INVALID_ENUM = 3; public static final int AR_ERROR_INVALID_HANDLE = 4; public static final int AR_ERROR_INVALID_OPERATION = 5; public static final int AR_ERROR_INVALID_VALUE = 2; public static final int AR_ERROR_NONE = 0; public static final int AR_ERROR_OPERATION_CANCELED = 7; public static final int AR_ERROR_OPERATION_FAILED = 6; public static final int AR_ERROR_OPERATION_TIMEOUT = 8; public static final int AR_ERROR_UNKNOWN = 1; public static final int AR_RENDERING_TEXTURE_ROTATION_AUTO = 268455953; public static final int AR_RENDERING_TEXTURE_ROTATION_LANDSCAPE_LEFT = 268455956; public static final int AR_RENDERING_TEXTURE_ROTATION_LANDSCAPE_RIGHT = 268455957; public static final int AR_RENDERING_TEXTURE_ROTATION_PORTRAIT = 268455954; public static final int AR_RENDERING_TEXTURE_ROTATION_PORTRAIT_UPSIDEDOWN = 268455955; public static final int AR_VIDEOTEXTURE_ROTATION_UNKNOWN = 268455952; private static final String MODULENAME = "SystemTools"; public static boolean checkMinimumApiLevel(int paramInt) { return Build.VERSION.SDK_INT >= paramInt; }

Page 206: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

public static native Activity getActivityFromNative(); public static int getActivityOrientation(Activity paramActivity) { if (paramActivity == null) { return 268455952; } Configuration localConfiguration = paramActivity.getResources().getConfiguration(); paramActivity = ((WindowManager)paramActivity.getSystemService("window")).getDefaultDisplay(); if (checkMinimumApiLevel(8)) {} for (int i = paramActivity.getRotation();; i = paramActivity.getOrientation()) { switch (orientation) { default: return 268455952; case 1: case 3: if ((i != 0) && (i != 3)) { break label95; } return 268455954; } } label95: return 268455955; if ((i == 0) || (i == 1)) { return 268455956; } return 268455957; } public static int[] getActivitySize(Activity paramActivity) { if (paramActivity == null) {} int i; int j; do { return null; DisplayMetrics localDisplayMetrics = new DisplayMetrics();

Page 207: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramActivity.getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics); i = widthPixels; j = heightPixels; } while ((i <= 0) || (j <= 0)); return new int[] { i, j }; } public static int getDeviceOrientation(Activity paramActivity) { int j = 268455952; if (paramActivity == null) { return 268455952; } paramActivity.getResources().getConfiguration(); paramActivity = ((WindowManager)paramActivity.getSystemService("window")).getDefaultDisplay(); int i; if (checkMinimumApiLevel(8)) { i = paramActivity.getRotation(); if (i != 0) { break label63; } j = 268455954; } label63: do { return j; i = paramActivity.getOrientation(); break; if (i == 1) { return 268455956; } if (i == 2) { return 268455955; } } while (i != 3); return 268455957; } public static float[] getDisplayDpi(Activity paramActivity)

Page 208: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

{ if (paramActivity == null) { return null; } DisplayMetrics localDisplayMetrics = new DisplayMetrics(); if (checkMinimumApiLevel(17)) { paramActivity.getWindowManager().getDefaultDisplay().getRealMetrics(localDisplayMetrics); } for (;;) { float f1 = xdpi; float f2 = ydpi; if ((f1 <= 0.0F) || (f2 <= 0.0F)) { break; } return new float[] { f1, f2 }; paramActivity.getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics); } } public static int[] getDisplaySize(Activity paramActivity) { if (paramActivity == null) { return null; } Point localPoint = new Point(); try { paramActivity.getWindowManager().getDefaultDisplay().getRealSize(localPoint); if ((x > 0) && (y > 0)) { paramActivity = new int[2]; if (y <= x) { break label82; } paramActivity[0] = y; paramActivity[1] = x; return paramActivity; }

Page 209: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

} catch (NoSuchMethodError paramActivity) { DebugLog.LOGE("SystemTools", "Display.getRealSize is not supported on this platform"); } return null; label82: paramActivity[0] = x; paramActivity[1] = y; return paramActivity; } public static String getNativeLibraryPath(Activity paramActivity) { Object localObject; if (paramActivity == null) { localObject = null; } for (;;) { return (String)localObject; localObject = null; try { ApplicationInfo localApplicationInfo = paramActivity.getApplicationInfo(); if (localApplicationInfo != null) { if (checkMinimumApiLevel(9)) { paramActivity = nativeLibraryDir; localObject = paramActivity; if (paramActivity != null) { localObject = paramActivity; if (paramActivity.length() > 0) { localObject = paramActivity; if (paramActivity.charAt(paramActivity.length() - 1) != '/') { return paramActivity + '/'; } } } } else {

Page 210: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

paramActivity = "/data/data/" + paramActivity.getPackageName() + "/lib/"; return paramActivity; } } } catch (Exception paramActivity) {} } return null; } public static native void logSystemError(String paramString); public static Method retrieveClassMethod(Class<?> paramClass, String paramString, Class<?>... paramVarArgs) { Object localObject = null; try { paramClass = paramClass.getMethod(paramString, paramVarArgs); if (paramClass != null) {} return paramClass; } catch (Exception paramClass) { for (;;) { paramClass = (Class<?>)localObject; } } } public static void sendKillSignal() { sendKillSignal(0, true); } public static void sendKillSignal(int paramInt) { sendKillSignal(paramInt, true); } public static void sendKillSignal(final int paramInt, boolean paramBoolean) { final Activity localActivity = getActivityFromNative();

Page 211: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

if (localActivity == null) { return; } localActivity.runOnUiThread(new Runnable() { public void run() { if (val$enableLifecycleEvents) {} try { Method localMethod = localActivity.getClass().getDeclaredMethod("onPause", new Class[0]); localMethod.setAccessible(true); localMethod.invoke(localActivity, new Object[0]); localMethod = localActivity.getClass().getDeclaredMethod("onDestroy", new Class[0]); localMethod.setAccessible(true); localMethod.invoke(localActivity, new Object[0]); } catch (Exception localException) { try { do { Thread.sleep(1000L); System.exit(paramInt); return; localException = localException; SystemTools.logSystemError("Error attempting to call onPause and onDestroy, will proceed with exiting"); } while ((localException == null) || (localException.getCause() == null)); SystemTools.logSystemError(localException.getCause().toString()); StackTraceElement[] arrayOfStackTraceElement = localException.getStackTrace(); int j = arrayOfStackTraceElement.length; int i = 0; while (i < j) { SystemTools.logSystemError(arrayOfStackTraceElement[i].toString()); i += 1; } }

Page 212: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

catch (InterruptedException localInterruptedException) { for (;;) {} } } } }); } public static void sendKillSignal(boolean paramBoolean) { sendKillSignal(0, paramBoolean); } public static native void setSystemErrorCode(int paramInt); } /* Location: * Qualified Name: com.vuforia.ar.pl.SystemTools * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */

Page 213: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

COMUNICACIONES FTP TCP/IP WEB WIFI

Finalizado el desarrollo de las aplicaciones y teniendo listos sus

respectivos APK procedemos a alojarlos en la nube de datos llamada

mega, y primero que todo nos registramos en dicha nube para llevar

acabo la subida de los APK a la nube para que el usuario pueda

desccargar cada uno de los APK sin problemas. cabe aclarar que cada

APK esta comprimido con el programa Win Rar y para descomprimirlo

necesitamosel programa mencionado que el usuairo puede descargar

en este link (https://www.winrar.es/descargas). Por ende, acontinuaicon

verán los enlaces de descarga con sus respectivas contraseñas.

Patrón lluvia de ideas

Enlace: https://mega.nz/#!SQNDnYCZ

Contraseña:

!UAaD2tBE2UybxHjvLN3wzyQIBZD2VIKPWj2ncVH_gI8

Patrón resolviendo problemas en pareja/estándar alto

Enlace: https://mega.nz/#!aY8WWILI

Contraseña: !w6y9Migo-

m3z9KFmpY0qRhAOVJK3t2fwJAiEKlgv5f4

Patrón pensando en pareja

Enlace: https://mega.nz/#!Kd9myCRT

Contraseña:

!X_q6iZqpkciMjbk0Ef1sCJQpcqmwvSe43ozYqPeXvoY

Patrón simulación

Enlace: https://mega.nz/#!GFcFSRLY

Contraseña:

!K4CVKkIuXHAlfO7tVQdQYsWNYqRC6WR1MuKL03JfrSI

Page 214: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Patrón pirámide

Enlace: https://mega.nz/#!vMVgXTID

Contraseña:

!o5y0lxOz6UwMlpm9pXKdptnegkTtGhYfOUSlKYl2Xgw

Patrón rompecabezas

Enlace: https://mega.nz/#!qdshSLjB

Contraseña:

!_9ukjcEKZhlR69kT0NOBIzzfWjTpztimuNVBBx3Zt48

CONCLUSIONES Y RECOMENDACIONES

Entender claramente como fue desarrollado el proyecto

implementando realidad aumentada y ender los puntos clave que

se deben tener en cuenta en dicho desarrollo.

Enclarecer que herramientas como Paint 3D y 3D builder son muy

necesarias para este tipo de aplicaciones.

Establecer un precedente de como llevar acabo aplicaciones

móviles de realidad aumentada para dispositivos Android.

Las aplicaciones fueron desarrolladas para dispositivos móviles con

sistema Android por ende no pueden ser usados por dispositivos

con sistemas IOS.

El desarrollo fue enfocado para que solo usuarios con la versión 4.1

de Android (jelly bean) en adelante pueden instalar la aplicación,

por consiguiente, el usuario que desee ejecutar la aplicación en una

versión más antigua que la mencionada, no lo podrá llevar acabo.

Page 215: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

Tener la aplicación de lectura con su respectivo marcador, los

marcadores se hicieron para que cada aplicación lea solo el

correspondiente.

Un punto clave a mencionar es que las aplicaciones se

desarrollaron de forma individual por tal motivo cuando llevamos

acabo la instalación de un APK sobrescribe la aplicación que

tengamos (eso si ya se había instalado una de estas aplicaciones).

si el usuario ya no necesita tener la aplicaicon en su dispositivo, se

debe dirigir al apartado de opciones y adminsitrador de aplicaciones

seleccionar la aplicaicon respectiva y escoger la ipcion de desistalar

aplicación.

Page 216: APLICACIONES DE REALIDAD AUMENTADA PARA EL …

BIBLIOGRAFÍA Y WEBGRAFIA

(Hernández-Leo et al., 2006) . patrones educativos colaborativos

“http://www.gsic.uva.es/~daviniahl/clfp/tps-es/”

©2018 Realidad Aumentada | Innovae. Definición realidad

aumentada.

“http://realidadaumentada.info/tecnologia/”

Universidad de Valladolid (2014-2018). Estrategias especificas para patrones educativos. “https://es.slideshare.net/METIS-project/he-u-a20140918patternsdocumentationes”

Guillermo Perezbolde (2017-2018). “Lo que necesitas para hacer realidad aumentada” https://www.merca20.com/quieres-hacer-realidad-aumentada-aqui-esta-todo-lo-que-necesitas/

politécnico gran colombiano (2015-2018), el valor dela realidad aumentada en la educación virtual “http://polivirtual.co/realidad-aumentada-y-educacion-virtual/”

Bernabé Soto Beltrán(2010-2018) Realidad aumentada es educación aumentada “http://www.americalearningmedia.com/edicion-010/116-analisis/833-realidad-aumentada-es-educacion-aumentada”

2018 Unity Technologies. Publication 2018.1-X , manual vuforia https://docs.unity3d.com/es/2018.1/Manual/vuforia-sdk-overview.html

2018 Unity Technologies, manual unity “https://unity3d.com/es/learn”