Merge remote-tracking branch 'origin/2.4' into merge-2.4

Conflicts:
	modules/contrib/src/basicretinafilter.hpp
	modules/contrib/src/magnoretinafilter.hpp
	modules/contrib/src/parvoretinafilter.hpp
	modules/contrib/src/retinacolor.hpp
	modules/gpu/include/opencv2/gpu/gpu.hpp
	modules/highgui/src/cap_tyzx.cpp
	modules/ocl/perf/perf_filters.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/opencl/haarobjectdetect.cl
	modules/ocl/test/test_filters.cpp
	modules/ocl/test/test_objdetect.cpp
This commit is contained in:
Roman Donchenko
2014-03-03 13:45:22 +04:00
17 changed files with 41 additions and 26 deletions

View File

@@ -22,6 +22,7 @@ public class NativeCameraView extends CameraBridgeViewBase {
private Thread mThread;
protected VideoCapture mCamera;
protected NativeCameraFrame mFrame;
public NativeCameraView(Context context, int cameraId) {
super(context, cameraId);
@@ -97,6 +98,8 @@ public class NativeCameraView extends CameraBridgeViewBase {
if (mCamera.isOpened() == false)
return false;
mFrame = new NativeCameraFrame(mCamera);
java.util.List<Size> sizes = mCamera.getSupportedPreviewSizes();
/* Select the size that fits surface considering maximum size allowed */
@@ -127,9 +130,8 @@ public class NativeCameraView extends CameraBridgeViewBase {
private void releaseCamera() {
synchronized (this) {
if (mCamera != null) {
mCamera.release();
}
if (mFrame != null) mFrame.release();
if (mCamera != null) mCamera.release();
}
}
@@ -153,6 +155,11 @@ public class NativeCameraView extends CameraBridgeViewBase {
mRgba = new Mat();
}
public void release() {
if (mGray != null) mGray.release();
if (mRgba != null) mRgba.release();
}
private VideoCapture mCapture;
private Mat mRgba;
private Mat mGray;
@@ -167,7 +174,7 @@ public class NativeCameraView extends CameraBridgeViewBase {
break;
}
deliverAndDrawFrame(new NativeCameraFrame(mCamera));
deliverAndDrawFrame(mFrame);
} while (!mStopThread);
}