Skip to content

Commit d81f388

Browse files
committed
make Capture.list() static
It comes with the downside that now it I have to remove the check if device has a camera or not Signed-off-by: Umair Khan <[email protected]>
1 parent d6a2953 commit d81f388

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/in/omerjerk/processing/video/android/Capture.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ public static void log(String log) {
5151

5252
// private Texture customTexture;
5353
private PGraphicsOpenGL pg;
54-
private IntBuffer pixelBuffer;
5554

5655
private PGraphicsOpenGL destpg;
57-
PGL pgl;
5856

5957
private CameraHandler mCameraHandler;
6058

@@ -75,8 +73,6 @@ public Capture(final PApplet applet, int width, int height) {
7573
height = 1280;
7674
}
7775
init(width, height, ARGB);
78-
pixelBuffer = IntBuffer.allocate(width * height);
79-
pixelBuffer.position(0);
8076

8177
applet.registerMethod("pause", this);
8278
applet.registerMethod("resume", this);
@@ -166,9 +162,9 @@ public void surfaceDestroyed(SurfaceHolder holder) {
166162
// TODO: Release Camera resources
167163
}
168164

169-
public String[] list() {
170-
if (applet.getPackageManager().hasSystemFeature(
171-
PackageManager.FEATURE_CAMERA)) {
165+
public static String[] list() {
166+
// if (applet.getPackageManager().hasSystemFeature(
167+
// PackageManager.FEATURE_CAMERA)) {
172168
int nOfCameras = Camera.getNumberOfCameras();
173169
for (int i = 0; i < nOfCameras; ++i) {
174170
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
@@ -183,8 +179,8 @@ public String[] list() {
183179
String[] array = new String[nOfCameras];
184180
camerasList.toArray(array);
185181
return array;
186-
}
187-
return null;
182+
// }
183+
// return null;
188184
}
189185

190186
private void startPreview(SurfaceHolder mHolder) {
@@ -353,7 +349,7 @@ public void prepareFrameBuffers() {
353349
GlUtil.checkGlError("glFramebufferTexture2D");
354350

355351
/*
356-
//No sure if this is required in opengl 2. Ignoring as of now.
352+
//No sure if this is required in opengl es 2. Ignoring as of now.
357353
IntBuffer drawBuffers = IntBuffer.allocate(1);
358354
drawBuffers.put(0, GLES20.GL_COLOR_ATTACHMENT0);
359355
GLES30.glDrawBuffers(1, drawBuffers);

0 commit comments

Comments
 (0)