@Override
			public void onPreviewFrame(byte[] data, Camera camera) {
				i++;
				now = System.nanoTime()/1000;
				if (i>3) {
					t += now - oldnow;
					count++;
				}
				if (i>20) {
					mQuality.framerate = (int) (1000000/(t/count)+1);
					lock.release();
				}
				oldnow = now;
			}
Computes the average frame rate at which the preview callback is called.
We will then use this average frame rate with the MediaCodec.  
Blocks the thread in which this function is called.
src/net/majorkernelpanic/streaming/video/VideoStream.java