diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/camera/panorama/Mosaic.java | 21 | ||||
| -rw-r--r-- | src/com/android/camera/panorama/MosaicFrameProcessor.java | 2 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/com/android/camera/panorama/Mosaic.java b/src/com/android/camera/panorama/Mosaic.java index 9ad2c64..5064cec 100644 --- a/src/com/android/camera/panorama/Mosaic.java +++ b/src/com/android/camera/panorama/Mosaic.java @@ -88,6 +88,9 @@ public class Mosaic { public static final int MOSAIC_RET_OK = 1; public static final int MOSAIC_RET_ERROR = -1; public static final int MOSAIC_RET_CANCELLED = -2; + public static final int MOSAIC_RET_LOW_TEXTURE = -3; + public static final int MOSAIC_RET_FEW_INLIERS = 2; + static { System.loadLibrary("jni_mosaic"); @@ -113,10 +116,11 @@ public class Mosaic { * image to t is computed and returned. * * @param pixels source image of NV21 format. - * @return Float array of length 10; first 9 entries correspond to the 3x3 - * transformation matrix between the first frame and the passed frame, - * and the last entry is the number of the passed frame, - * where the counting starts from 1. + * @return Float array of length 11; first 9 entries correspond to the 3x3 + * transformation matrix between the first frame and the passed frame; + * the 10th entry is the number of the passed frame, where the counting + * starts from 1; and the 11th entry is the returning code, whose value + * is one of those MOSAIC_RET_* returning flags defined above. */ public native float[] setSourceImage(byte[] pixels); @@ -127,10 +131,11 @@ public class Mosaic { * using glReadPixels directly from GPU memory (where it is accessed by * an associated SurfaceTexture). * - * @return Float array of length 10; first 9 entries correspond to the 3x3 - * transformation matrix between the first frame and the passed frame, - * and the last entry is the number of the passed frame, - * where the counting starts from 1. + * @return Float array of length 11; first 9 entries correspond to the 3x3 + * transformation matrix between the first frame and the passed frame; + * the 10th entry is the number of the passed frame, where the counting + * starts from 1; and the 11th entry is the returning code, whose value + * is one of those MOSAIC_RET_* returning flags defined above. */ public native float[] setSourceImageFromGPU(); diff --git a/src/com/android/camera/panorama/MosaicFrameProcessor.java b/src/com/android/camera/panorama/MosaicFrameProcessor.java index 54fc7b8..7660f5e 100644 --- a/src/com/android/camera/panorama/MosaicFrameProcessor.java +++ b/src/com/android/camera/panorama/MosaicFrameProcessor.java @@ -26,6 +26,7 @@ public class MosaicFrameProcessor { private static final String TAG = "MosaicFrameProcessor"; private static final int NUM_FRAMES_IN_BUFFER = 2; private static final int MAX_NUMBER_OF_FRAMES = 100; + private static final int MOSAIC_RET_CODE_INDEX = 10; private static final int FRAME_COUNT_INDEX = 9; private static final int X_COORD_INDEX = 2; private static final int Y_COORD_INDEX = 5; @@ -184,6 +185,7 @@ public class MosaicFrameProcessor { public void calculateTranslationRate(long now) { float[] frameData = mMosaicer.setSourceImageFromGPU(); + int ret_code = (int) frameData[MOSAIC_RET_CODE_INDEX]; mTotalFrameCount = (int) frameData[FRAME_COUNT_INDEX]; float translationCurrX = frameData[X_COORD_INDEX]; float translationCurrY = frameData[Y_COORD_INDEX]; |
