mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
Aded setPreviewDisplay call to java camera samples
This commit is contained in:
parent
0d7a37c1e7
commit
8782914fc8
@ -1,5 +1,6 @@
|
||||
package org.opencv.samples.tutorial0;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import android.content.Context;
|
||||
@ -58,6 +59,11 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde
|
||||
|
||||
params.setPreviewSize(getFrameWidth(), getFrameHeight());
|
||||
mCamera.setParameters(params);
|
||||
try {
|
||||
mCamera.setPreviewDisplay(null);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "mCamera.setPreviewDisplay fails: " + e);
|
||||
}
|
||||
mCamera.startPreview();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.opencv.samples.tutorial1;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import android.content.Context;
|
||||
@ -58,6 +59,11 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde
|
||||
|
||||
params.setPreviewSize(getFrameWidth(), getFrameHeight());
|
||||
mCamera.setParameters(params);
|
||||
try {
|
||||
mCamera.setPreviewDisplay(null);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "mCamera.setPreviewDisplay fails: " + e);
|
||||
}
|
||||
mCamera.startPreview();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.opencv.samples.tutorial3;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import android.content.Context;
|
||||
@ -58,6 +59,11 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde
|
||||
|
||||
params.setPreviewSize(getFrameWidth(), getFrameHeight());
|
||||
mCamera.setParameters(params);
|
||||
try {
|
||||
mCamera.setPreviewDisplay(null);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "mCamera.setPreviewDisplay fails: " + e);
|
||||
}
|
||||
mCamera.startPreview();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.opencv.samples.tutorial4;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import android.content.Context;
|
||||
@ -58,6 +59,11 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde
|
||||
|
||||
params.setPreviewSize(getFrameWidth(), getFrameHeight());
|
||||
mCamera.setParameters(params);
|
||||
try {
|
||||
mCamera.setPreviewDisplay(null);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "mCamera.setPreviewDisplay fails: " + e);
|
||||
}
|
||||
mCamera.startPreview();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user