Code example for PixelFormat

Methods: getPixelFormatInfo

0
         
        mCamera.setParameters(parameters);
//        Log.v("Java", String.format("PREVIEW FRAMERATE %d\n",parameters.getPreviewFrameRate())); 
         
        //2.2 hack 
        PixelFormat p = new PixelFormat();
		PixelFormat.getPixelFormatInfo(parameters.getPreviewFormat(),p);
		Log.v("Java", String.format("FORMATO DE PIXEL = %d, BYTES PER PIXEL = %d, BITS PER PIXEL = %d\n", parameters.getPreviewFormat(), p.bytesPerPixel, p.bitsPerPixel));
		int bufSize = (w*h*p.bitsPerPixel)/8;
		 //Must call this before calling addCallbackBuffer to get all the 
        // reflection variables setup 
        initForACB(); 
        byte[] buffer = new byte[bufSize];
        addCallbackBuffer_Android2p2(buffer);   
        buffer = new byte[bufSize];
        addCallbackBuffer_Android2p2(buffer);
        setPreviewCallbackWithBuffer(); 
          
        //2.0 correto 
//        mCamera.setPreviewCallback(this);