Aded setPreviewDisplay call to java camera samples

This commit is contained in:
Andrey Kamaev 2011-07-21 09:57:46 +00:00
parent 0d7a37c1e7
commit 8782914fc8
4 changed files with 24 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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