question: @ TargetApi ( Build . VERSION_CODES . HONEYCOMB ) public void snapshot ( int cameraId ) { final int encWidth = 768 ; final int encHeight = 432 ; if ( enable . containsKey ( cameraId ) && ! enable . get ( cameraId ) ) { return ; } Camera camera = null ; synchronized ( cameraLock ) { try { camera = prepareCamera ( cameraId , encWidth , encHeight ) ; if ( camera == null ) { return ; } if ( Cfg . DEBUG ) { Check . log ( TAG + " (snapshot), cameraId: " + cameraId ) ; } if ( this . surface == null ) { int [ ] surfaceparams = new int [ 1 ] ; GLES20 . glGenTextures ( 1 , surfaceparams , 0 ) ; GLES20 . glBindTexture ( GLES20 . GL_TEXTURE_2D , surfaceparams [ 0 ] ) ; GLES20 . glTexParameteri ( GLES20 . GL_TEXTURE_2D , GLES20 . GL_TEXTURE_WRAP_S , GLES20 . GL_CLAMP_TO_EDGE ) ; GLES20 . glTexParameteri ( GLES20 . GL_TEXTURE_2D , GLES20 . GL_TEXTURE_WRAP_T , GLES20 . GL_CLAMP_TO_EDGE ) ; this . surface = new SurfaceTexture ( surfaceparams [ 0 ] ) ; } camera . setPreviewTexture ( surface ) ; camera . startPreview ( ) ; camera . setOneShotPreviewCallback ( previewCallback ) ; cameraLock . wait ( ) ; } catch ( Exception e ) { if ( Cfg . DEBUG ) { Check . log ( TAG + " (snapshot) ERROR: " + e ) ; } } } }
target:  Wraps encodeCameraToMpeg().  This is necessary because SurfaceTexture will try to use the looper in the current thread if one exists, and the CTS tests create one on the test thread. <p/> The wrapper propagates exceptions thrown by the worker thread back to the caller. <p/> / Tests encoding of AVC video from Camera input.  The output is saved as an MP4 file.