@Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		if (mVARM.getAspectRatio() > 0 && mAspectRatioMode == ASPECT_RATIO_PREVIEW) {
			mVARM.measure(widthMeasureSpec, heightMeasureSpec);
			setMeasuredDimension(mVARM.getMeasuredWidth(), mVARM.getMeasuredHeight());
		} else {
			super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		}
	}
The surface view will fill completely fill its parent.
src/net/majorkernelpanic/streaming/gl/SurfaceView.java