提交 f5089100 编写于 作者: R Roman Donchenko 提交者: OpenCV Buildbot

Merge pull request #1073 from asmorkalov:android_cvjavaframe

...@@ -38,7 +38,7 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb ...@@ -38,7 +38,7 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb
private boolean mStopThread; private boolean mStopThread;
protected Camera mCamera; protected Camera mCamera;
protected JavaCameraFrame mCameraFrame; protected JavaCameraFrame[] mCameraFrame;
private SurfaceTexture mSurfaceTexture; private SurfaceTexture mSurfaceTexture;
public static class JavaCameraSizeAccessor implements ListItemAccessor { public static class JavaCameraSizeAccessor implements ListItemAccessor {
...@@ -180,7 +180,9 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb ...@@ -180,7 +180,9 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb
AllocateCache(); AllocateCache();
mCameraFrame = new JavaCameraFrame(mFrameChain[mChainIdx], mFrameWidth, mFrameHeight); mCameraFrame = new JavaCameraFrame[2];
mCameraFrame[0] = new JavaCameraFrame(mFrameChain[0], mFrameWidth, mFrameHeight);
mCameraFrame[1] = new JavaCameraFrame(mFrameChain[1], mFrameWidth, mFrameHeight);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mSurfaceTexture = new SurfaceTexture(MAGIC_TEXTURE_ID); mSurfaceTexture = new SurfaceTexture(MAGIC_TEXTURE_ID);
...@@ -216,8 +218,10 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb ...@@ -216,8 +218,10 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb
mFrameChain[0].release(); mFrameChain[0].release();
mFrameChain[1].release(); mFrameChain[1].release();
} }
if (mCameraFrame != null) if (mCameraFrame != null) {
mCameraFrame.release(); mCameraFrame[0].release();
mCameraFrame[1].release();
}
} }
} }
...@@ -318,7 +322,7 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb ...@@ -318,7 +322,7 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb
if (!mStopThread) { if (!mStopThread) {
if (!mFrameChain[mChainIdx].empty()) if (!mFrameChain[mChainIdx].empty())
deliverAndDrawFrame(mCameraFrame); deliverAndDrawFrame(mCameraFrame[mChainIdx]);
mChainIdx = 1 - mChainIdx; mChainIdx = 1 - mChainIdx;
} }
} while (!mStopThread); } while (!mStopThread);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册