mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 13:10:12 +08:00
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:
parent
f8720ec60e
commit
076941bb07
@ -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() {
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user