15-puzzle app reverted to usage of old CvCameraViewListener implementation;

super.onPause() call moved to begining of onPause method according Google recomandations.
This commit is contained in:
Alexander Smorkalov 2013-02-08 09:43:21 +04:00
parent f8720ec60e
commit 076941bb07
10 changed files with 14 additions and 15 deletions

View File

@ -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() {

View File

@ -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);
}
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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