void OpenCamera(int orientation, int currDevice) { #if UNITY_ANDROID if (device == currDevice && AppStarted) { return; } this.androidCameraActivity.Call("closeCamera"); ImWidth = 320; ImHeight = 240; this.androidCameraActivity.Call("GrabFromCamera", ImWidth, ImHeight, currDevice); AppStarted = true; #else VisageTrackerNative._openCamera(orientation, currDevice); #endif }
// if width and height are -1, values will be set internally void OpenCamera(int orientation, int currDevice, int width, int height, int mirrored) { #if UNITY_ANDROID if (device == currDevice && AppStarted) { return; } //camera needs to be opened on main thread this.androidCameraActivity.Call("runOnUiThread", new AndroidJavaRunnable(() => { this.androidCameraActivity.Call("closeCamera"); this.androidCameraActivity.Call("GrabFromCamera", width, height, currDevice); })); AppStarted = true; #else VisageTrackerNative._openCamera(orientation, currDevice, width, height, mirrored); #endif }
// if width and height are -1, values will be set internally void OpenCamera(int orientation, int currDevice, int width, int height, int mirrored) { VisageTrackerNative._openCamera(orientation, currDevice, width, height, mirrored); }