Skip to content
Snippets Groups Projects
Commit 3a2b18bb authored by Geoffrey Métais's avatar Geoffrey Métais Committed by Geoffrey Métais
Browse files

Set dimensions according to surface size

Do not get window size as reference, and do not change surface parent
size anymore
parent 698def5a
No related branches found
No related tags found
1 merge request!311Set dimensions according to surface size
Pipeline #11003 passed with stage
in 26 minutes and 30 seconds
......@@ -13,7 +13,8 @@
android:layout_height="match_parent"
android:inflatedId="@+id/surface_video"
android:layout="@layout/surface_view"
android:id="@+id/surface_stub" />
android:id="@+id/surface_stub"
android:layout_gravity="center"/>
<ViewStub
android:layout_width="1dp"
......@@ -27,5 +28,6 @@
android:layout_height="match_parent"
android:layout="@layout/texture_view"
android:inflatedId="@+id/texture_video"
android:id="@+id/texture_stub" />
android:id="@+id/texture_stub"
android:layout_gravity="center" />
</FrameLayout>
......@@ -195,8 +195,8 @@ class VideoHelper implements IVLCVout.OnNewVideoLayoutListener {
// get screen size
if (activity != null) {
sw = activity.getWindow().getDecorView().getWidth();
sh = activity.getWindow().getDecorView().getHeight();
sw = mVideoSurfaceFrame.getWidth();
sh = mVideoSurfaceFrame.getHeight();
} else if (mDisplayManager != null && mDisplayManager.getPresentation() != null && mDisplayManager.getPresentation().getWindow() != null) {
sw = mDisplayManager.getPresentation().getWindow().getDecorView().getWidth();
sh = mDisplayManager.getPresentation().getWindow().getDecorView().getHeight();
......@@ -296,12 +296,6 @@ class VideoHelper implements IVLCVout.OnNewVideoLayoutListener {
mVideoSurface.setLayoutParams(lp);
if (mSubtitlesSurface != null) mSubtitlesSurface.setLayoutParams(lp);
// set frame size (crop if necessary)
lp = mVideoSurfaceFrame.getLayoutParams();
lp.width = (int) Math.floor(dw);
lp.height = (int) Math.floor(dh);
mVideoSurfaceFrame.setLayoutParams(lp);
mVideoSurface.invalidate();
if (mSubtitlesSurface != null) mSubtitlesSurface.invalidate();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment