Aded setPreviewDisplay call to java camera samples

pull/13383/head
Andrey Kamaev 14 years ago
parent 0d7a37c1e7
commit 8782914fc8
  1. 6
      samples/android/tutorial-0-androidcamera/src/org/opencv/samples/tutorial0/SampleViewBase.java
  2. 6
      samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/SampleViewBase.java
  3. 6
      samples/android/tutorial-3-native/src/org/opencv/samples/tutorial3/SampleViewBase.java
  4. 6
      samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/SampleViewBase.java

@ -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…
Cancel
Save