Code example for Camera.Parameters

Methods: setJpegQuality

0
 
	private void setCameraCompressionParametersBasedOnSize(Parameters parameters, Size maxSize) {
		if (maxSize.width == MAX_5MP_WIDTH)
			parameters.setJpegQuality(50);
		else if (maxSize.width == MAX_8MP_WIDTH)
			parameters.setJpegQuality(30);
		else 
			// probably 3MP 
			parameters.setJpegQuality(80);
	} 
 
	@Override 
	public void surfaceDestroyed(SurfaceHolder holder) {
		try { 
			if (camera != null) {
				camera.stopPreview();
				camera.release();
				camera = null;
			} 
		} catch (Exception ex) {