Skip to content

Commit 0bd0f9f

Browse files
committed
stuffs to be done in pause and resume
Signed-off-by: Umair Khan <[email protected]>
1 parent f248fe0 commit 0bd0f9f

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,6 @@ public void onPause() {
6868
if (mCamera != null) {
6969
mCamera.release();
7070
}
71-
72-
glView.queueEvent(new Runnable() {
73-
@Override
74-
public void run() {
75-
if (mSurfaceTexture != null) {
76-
mSurfaceTexture.release();
77-
mSurfaceTexture = null;
78-
}
79-
if (mFullScreen != null) {
80-
mFullScreen.release(false); // assume the GLSurfaceView EGL context is about
81-
mFullScreen = null; // to be destroyed
82-
}
83-
}
84-
});
8571
}
8672

8773
@Override
@@ -90,9 +76,6 @@ public void onResume() {
9076
glView.queueEvent(new Runnable() {
9177
@Override
9278
public void run() {
93-
createSurfaceTexture();
94-
prepareFrameBuffers();
95-
9679
//If camera is not null, the activity was started already and we're coming back from a pause.
9780
if (mCamera != null) {
9881
log("Starting Camera in resume");

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,29 @@ public void run() {
187187

188188
public void pause() {
189189
onPause();
190+
glView.queueEvent(new Runnable() {
191+
@Override
192+
public void run() {
193+
if (mSurfaceTexture != null) {
194+
mSurfaceTexture.release();
195+
mSurfaceTexture = null;
196+
}
197+
if (mFullScreen != null) {
198+
mFullScreen.release(false); // assume the GLSurfaceView EGL context is about
199+
mFullScreen = null; // to be destroyed
200+
}
201+
}
202+
});
190203
}
191204

192205
public void resume() {
206+
glView.queueEvent(new Runnable() {
207+
@Override
208+
public void run() {
209+
createSurfaceTexture();
210+
prepareFrameBuffers();
211+
}
212+
});
193213
onResume();
194214
}
195215

0 commit comments

Comments
 (0)