Skip to content

Commit e324198

Browse files
committed
*le revert
Signed-off-by: Umair Khan <[email protected]>
1 parent 6ae36a3 commit e324198

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

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

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ public void run() {
8989
mCameraHandler = new CameraHandler(Capture.this);
9090
}
9191
});
92+
93+
glView.queueEvent(new Runnable() {
94+
@Override
95+
public void run() {
96+
mFullScreen = new FullFrameRect(
97+
new Texture2dProgram(Texture2dProgram.ProgramType.TEXTURE_EXT));
98+
mTextureId = mFullScreen.createTextureObject();
99+
100+
mSurfaceTexture = new SurfaceTexture(mTextureId);
101+
mSurfaceTexture.setOnFrameAvailableListener(Capture.this);
102+
// mCameraHandler.sendMessage(mCameraHandler.obtainMessage(CameraHandler.MSG_START_CAMERA, null));
103+
startCameraImpl(0);
104+
System.out.println("sent starting message to UI thread");
105+
prepareFrameBuffers();
106+
}
107+
});
92108
}
93109

94110
public void setCamera(String camera) {
@@ -117,37 +133,18 @@ public void pause() {
117133
if (mCamera != null) {
118134
mCamera.release();
119135
}
136+
/*
120137
if (mFullScreen != null) {
121138
mFullScreen.release(false); // assume the GLSurfaceView EGL context is about
122139
mFullScreen = null; // to be destroyed
123-
}
124-
if (mSurfaceTexture != null) {
125-
mSurfaceTexture.release();
126-
mSurfaceTexture = null;
127-
}
140+
}*/
128141
}
129142

130143
public void resume() {
131144
log("resume called");
132145
if (selectedCamera != -1) {
133146
startCameraImpl(selectedCamera);
134147
}
135-
136-
glView.queueEvent(new Runnable() {
137-
@Override
138-
public void run() {
139-
mFullScreen = new FullFrameRect(
140-
new Texture2dProgram(Texture2dProgram.ProgramType.TEXTURE_EXT));
141-
mTextureId = mFullScreen.createTextureObject();
142-
143-
mSurfaceTexture = new SurfaceTexture(mTextureId);
144-
mSurfaceTexture.setOnFrameAvailableListener(Capture.this);
145-
// mCameraHandler.sendMessage(mCameraHandler.obtainMessage(CameraHandler.MSG_START_CAMERA, null));
146-
startCameraImpl(0);
147-
System.out.println("sent starting message to UI thread");
148-
prepareFrameBuffers();
149-
}
150-
});
151148
}
152149

153150
@Override

0 commit comments

Comments
 (0)