@@ -89,6 +89,22 @@ public void run() {
89
89
mCameraHandler = new CameraHandler (Capture .this );
90
90
}
91
91
});
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
+ });
92
108
}
93
109
94
110
public void setCamera (String camera ) {
@@ -117,37 +133,18 @@ public void pause() {
117
133
if (mCamera != null ) {
118
134
mCamera .release ();
119
135
}
136
+ /*
120
137
if (mFullScreen != null) {
121
138
mFullScreen.release(false); // assume the GLSurfaceView EGL context is about
122
139
mFullScreen = null; // to be destroyed
123
- }
124
- if (mSurfaceTexture != null ) {
125
- mSurfaceTexture .release ();
126
- mSurfaceTexture = null ;
127
- }
140
+ }*/
128
141
}
129
142
130
143
public void resume () {
131
144
log ("resume called" );
132
145
if (selectedCamera != -1 ) {
133
146
startCameraImpl (selectedCamera );
134
147
}
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
- });
151
148
}
152
149
153
150
@ Override
0 commit comments