Code example for SurfaceView

Methods: getHolder

0
        mHolder.addCallback(this);
 
    } 
 
    public void onPreviewFrame(byte[] data, Camera camera) {
        if (mFiltered.getHolder().getSurface().isValid()) {
            processFrame(data, mFiltered.getHolder().getSurface());
            /* 
 
            Canvas canvas = mFiltered.getHolder().lockCanvas(); 
 
            if (canvas != null) { 
                //canvas.drawBitmap(filteredData, 0, 640, 0, 0, 640, 360, false, null); 
                //canvas.drawBitmap(data, 0, 640, 0, 0, 640, 360, false, null); 
                //mFiltered.getHolder().unlockCanvasAndPost(canvas); 
 
            } else { 
                Log.d(TAG, "canvas was null"); 
            } 
            */ 
        }