This commit is contained in:
wangcongtao
2020-02-10 16:06:55 +08:00
parent f0b0b336e9
commit 2e7dcd5806
72 changed files with 13 additions and 2 deletions

View File

@@ -39,6 +39,8 @@ public class JSurfaceView extends SurfaceView implements Runnable, SurfaceHolder
*/
private int[] mFrames;
private Thread mThread;
// 使用 BitmapFactory.Option.inBitmap 属性复用 bitmap 对象
private Bitmap mContainerBitmap = null;
@@ -78,12 +80,19 @@ public class JSurfaceView extends SurfaceView implements Runnable, SurfaceHolder
if ( bRunning ) {
return;
}
ThreadPoolService.execute( this );
bRunning = true;
mThread = new Thread( this );
mThread.start();
}
public void stop() {
bRunning = false;
try {
mThread.interrupt();
mThread = null;
} catch ( Exception e ) {
e.printStackTrace();
}
}
@Override