surfaceView.getHeight() will return the surfaceView's height, not the video's height.
I can get the VideoFrame in onFrame(VideoFrame frame), but the frame's height is the height of source's video, not the ended height showed in the surfaceView.
For example, as above image, the surfaceView's height is 1280, the frame's height is 1080, the ended height showed in the surfaceView is 405. Now, i don't know how to get the 405.
I setted the scalingType: surfaceView.setScalingType(ScalingType.SCALE_ASPECT_BALANCED);
I try these, all didn't work. `Display display = this.getDisplay(); SurfaceHolder sh = this.getHolder(); Rect rect = sh.getSurfaceFrame(); this.getLocalVisibleRect(rect); //rect = this.getClipBounds(); this.getGlobalVisibleRect(rect); this.getWindowVisibleDisplayFrame(rect); int h3 = getResources().getDisplayMetrics().heightPixels; this.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); this.post(new Runnable() { @Override public void run() { int MeasuredHeight = ZoomSurfaceViewRenderer.this.getMeasuredHeight(); int MeasuredWidth = ZoomSurfaceViewRenderer.this.getMeasuredWidth();
int w1 = ZoomSurfaceViewRenderer.this.getWidth();
int h1 = ZoomSurfaceViewRenderer.this.getHeight();
int x = h1;
}
});
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams)this.getLayoutParams();
int h2 = layoutParams.height;
int w2 = layoutParams.width;
Matrix matrix = this.getMatrix();
int MeasuredHeight = this.getMeasuredHeight();
int MeasuredWidth = this.getMeasuredWidth();
int PaddingTop = this.getPaddingTop();
float PivotY = this.getPivotY();
float ScaleY = this.getScaleY();
float TranslationX = this.getTranslationX();
float TranslationY = this.getTranslationY();
float TranslationZ = this.getTranslationZ();
int w = ZoomSurfaceViewRenderer.this.getWidth();
int h = ZoomSurfaceViewRenderer.this.getHeight();`