Code example for YuvImage

Methods: compressToJpeg, getHeight, getWidth

0
    			 
    			ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
    			ByteArrayOutputStream byteStream2 = new ByteArrayOutputStream();
    			Camera.Parameters parameters = mCamera.getParameters(); 
                Size size = parameters.getPreviewSize(); 
                YuvImage image = new YuvImage(currentFrame, parameters.getPreviewFormat(), size.width, size.height, null); 
    			 
                Matrix mat = new Matrix();
	        	mat.postRotate(((AndroidRobotActivity) c).getRotationDegree());
	        	 
    			image.compressToJpeg(new Rect(0, 0, image.getWidth(), image.getHeight()), 70, byteStream);
    	         
    			/*Bitmap bMap = BitmapFactory.decodeByteArray(byteStream.toByteArray(), 0, byteStream.toByteArray().length); 
	        	Bitmap bMapRotate = Bitmap.createBitmap(bMap, 0, 0, bMap.getWidth(), bMap.getHeight(), mat, true); 
    			bMapRotate.compress(Bitmap.CompressFormat.JPEG, 100, byteStream2);*/ 
	        	 
	        	//long test2 = System.currentTimeMillis(); 
	        	 
    			//return test2 - test; 
    			return byteStream.toByteArray();
			} catch (Exception e) {