From: Alexander Smorkalov Date: Fri, 8 Feb 2013 05:43:21 +0000 (+0400) Subject: 15-puzzle app reverted to usage of old CvCameraViewListener implementation; X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1314^2~1537^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=076941bb079865d58fa009c53c7c3b838b73668a;p=platform%2Fupstream%2Fopencv.git 15-puzzle app reverted to usage of old CvCameraViewListener implementation; super.onPause() call moved to begining of onPause method according Google recomandations. --- diff --git a/modules/java/generator/src/java/android+JavaCameraView.java b/modules/java/generator/src/java/android+JavaCameraView.java index 508a650..b545c24 100644 --- a/modules/java/generator/src/java/android+JavaCameraView.java +++ b/modules/java/generator/src/java/android+JavaCameraView.java @@ -263,7 +263,7 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb mWidth = width; mHeight = height; mYuvFrameData = Yuv420sp; - mRgba = new Mat(mHeight, mWidth, CvType.CV_8UC4); + mRgba = new Mat(); } public void release() { diff --git a/samples/android/15-puzzle/src/org/opencv/samples/puzzle15/Puzzle15Activity.java b/samples/android/15-puzzle/src/org/opencv/samples/puzzle15/Puzzle15Activity.java index 15c8b8f..466400d 100644 --- a/samples/android/15-puzzle/src/org/opencv/samples/puzzle15/Puzzle15Activity.java +++ b/samples/android/15-puzzle/src/org/opencv/samples/puzzle15/Puzzle15Activity.java @@ -1,12 +1,11 @@ package org.opencv.samples.puzzle15; import org.opencv.android.BaseLoaderCallback; -import org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame; import org.opencv.android.LoaderCallbackInterface; import org.opencv.android.OpenCVLoader; import org.opencv.core.Mat; import org.opencv.android.CameraBridgeViewBase; -import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener2; +import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener; import android.os.Bundle; import android.app.Activity; @@ -17,7 +16,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.WindowManager; -public class Puzzle15Activity extends Activity implements CvCameraViewListener2, View.OnTouchListener { +public class Puzzle15Activity extends Activity implements CvCameraViewListener, View.OnTouchListener { private static final String TAG = "Sample::Puzzle15::Activity"; @@ -64,9 +63,9 @@ public class Puzzle15Activity extends Activity implements CvCameraViewListener2, @Override public void onPause() { + super.onPause(); if (mOpenCvCameraView != null) mOpenCvCameraView.disableView(); - super.onPause(); } @Override @@ -127,7 +126,7 @@ public class Puzzle15Activity extends Activity implements CvCameraViewListener2, return false; } - public Mat onCameraFrame(CvCameraViewFrame inputFrame) { - return mPuzzle15.puzzleFrame(inputFrame.rgba()); + public Mat onCameraFrame(Mat inputFrame) { + return mPuzzle15.puzzleFrame(inputFrame); } } diff --git a/samples/android/color-blob-detection/src/org/opencv/samples/colorblobdetect/ColorBlobDetectionActivity.java b/samples/android/color-blob-detection/src/org/opencv/samples/colorblobdetect/ColorBlobDetectionActivity.java index f6be4b9..e6e1c03 100644 --- a/samples/android/color-blob-detection/src/org/opencv/samples/colorblobdetect/ColorBlobDetectionActivity.java +++ b/samples/android/color-blob-detection/src/org/opencv/samples/colorblobdetect/ColorBlobDetectionActivity.java @@ -79,9 +79,9 @@ public class ColorBlobDetectionActivity extends Activity implements OnTouchListe @Override public void onPause() { + super.onPause(); if (mOpenCvCameraView != null) mOpenCvCameraView.disableView(); - super.onPause(); } @Override diff --git a/samples/android/face-detection/src/org/opencv/samples/facedetect/FdActivity.java b/samples/android/face-detection/src/org/opencv/samples/facedetect/FdActivity.java index a9dfab0..2372773 100644 --- a/samples/android/face-detection/src/org/opencv/samples/facedetect/FdActivity.java +++ b/samples/android/face-detection/src/org/opencv/samples/facedetect/FdActivity.java @@ -130,9 +130,9 @@ public class FdActivity extends Activity implements CvCameraViewListener2 { @Override public void onPause() { + super.onPause(); if (mOpenCvCameraView != null) mOpenCvCameraView.disableView(); - super.onPause(); } @Override diff --git a/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsActivity.java b/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsActivity.java index 52f77db..f055697 100644 --- a/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsActivity.java +++ b/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsActivity.java @@ -112,9 +112,9 @@ public class ImageManipulationsActivity extends Activity implements CvCameraView @Override public void onPause() { + super.onPause(); if (mOpenCvCameraView != null) mOpenCvCameraView.disableView(); - super.onPause(); } @Override diff --git a/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1Java.java b/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1Java.java index 1a1f06f..1fbac34 100644 --- a/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1Java.java +++ b/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1Java.java @@ -67,9 +67,9 @@ public class Sample1Java extends Activity implements CvCameraViewListener2 { @Override public void onPause() { + super.onPause(); if (mOpenCvCameraView != null) mOpenCvCameraView.disableView(); - super.onPause(); } @Override diff --git a/samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2NativeCamera.java b/samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2NativeCamera.java index 45c3b37..3a19ffd 100644 --- a/samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2NativeCamera.java +++ b/samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2NativeCamera.java @@ -73,9 +73,9 @@ public class Sample2NativeCamera extends Activity implements CvCameraViewListene @Override public void onPause() { + super.onPause(); if (mOpenCvCameraView != null) mOpenCvCameraView.disableView(); - super.onPause(); } @Override diff --git a/samples/android/tutorial-3-native/src/org/opencv/samples/tutorial3/Sample3Native.java b/samples/android/tutorial-3-native/src/org/opencv/samples/tutorial3/Sample3Native.java index ded920f..71990fa 100644 --- a/samples/android/tutorial-3-native/src/org/opencv/samples/tutorial3/Sample3Native.java +++ b/samples/android/tutorial-3-native/src/org/opencv/samples/tutorial3/Sample3Native.java @@ -62,9 +62,9 @@ public class Sample3Native extends Activity implements CvCameraViewListener2 { @Override public void onPause() { + super.onPause(); if (mOpenCvCameraView != null) mOpenCvCameraView.disableView(); - super.onPause(); } @Override diff --git a/samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4Mixed.java b/samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4Mixed.java index ddae246..97a563b 100644 --- a/samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4Mixed.java +++ b/samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4Mixed.java @@ -88,9 +88,9 @@ public class Sample4Mixed extends Activity implements CvCameraViewListener2 { @Override public void onPause() { + super.onPause(); if (mOpenCvCameraView != null) mOpenCvCameraView.disableView(); - super.onPause(); } @Override diff --git a/samples/android/tutorial-5-cameracontrol/src/org/opencv/samples/tutorial5/Sample5CameraControl.java b/samples/android/tutorial-5-cameracontrol/src/org/opencv/samples/tutorial5/Sample5CameraControl.java index 7eba7a3..f19580b 100644 --- a/samples/android/tutorial-5-cameracontrol/src/org/opencv/samples/tutorial5/Sample5CameraControl.java +++ b/samples/android/tutorial-5-cameracontrol/src/org/opencv/samples/tutorial5/Sample5CameraControl.java @@ -79,9 +79,9 @@ public class Sample5CameraControl extends Activity implements CvCameraViewListen @Override public void onPause() { + super.onPause(); if (mOpenCvCameraView != null) mOpenCvCameraView.disableView(); - super.onPause(); } @Override