[Android] IVLCVout: tell libvlcjni where we want the video to be in the window

Steve Lhomme git at videolan.org
Thu Mar 12 13:37:48 UTC 2026


vlc-android | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Dec  3 16:27:49 2025 +0100| [251bbc8b4ea5b4dd5859242dd608c2bf3a5faad5] | committer: Steve Lhomme

IVLCVout: tell libvlcjni where we want the video to be in the window

And position the video according to the core placement.

Requires changes in VLC to have the placement sent to libvlcjni [^1].
In this version:
- visibleWidth is the Width of the video in window
- visibleHeight is Height of the video in window
- sarNum is X Position of the video in window
- sarDen is Y Position of the video in window

The x,y positioning is not currently handled as it's always centered in the core
as in the SurfaceView layout.

[^1]: https://code.videolan.org/videolan/libvlcjni/-/merge_requests/192

> https://code.videolan.org/videolan/vlc-android/commit/251bbc8b4ea5b4dd5859242dd608c2bf3a5faad5
---

 .../src/org/videolan/vlc/gui/video/PopupManager.kt         | 14 ++++++++++++++
 buildsystem/compile.sh                                     |  4 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/PopupManager.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/PopupManager.kt
index 5984bbbbf3..58810a1762 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/PopupManager.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/PopupManager.kt
@@ -57,6 +57,7 @@ import org.videolan.vlc.PlaybackService
 import org.videolan.vlc.R
 import org.videolan.vlc.gui.helpers.MISC_CHANNEL_ID
 import org.videolan.vlc.gui.view.PopupLayout
+import org.videolan.vlc.isVLC4
 import org.videolan.vlc.util.getPendingIntent
 import kotlin.math.absoluteValue
 import kotlin.math.floor
@@ -169,6 +170,18 @@ class PopupManager(private val service: PlaybackService) : PlaybackService.Callb
         val displayW = view.width
         val displayH = view.height
 
+        if (isVLC4())
+        {
+            if (width == 0 || height == 0) {
+                view.setViewSize(displayW, displayH)
+                vlcVout?.setWindowSize(displayW, displayH)
+                return
+            }
+
+            view.setViewSize(visibleWidth, visibleHeight)
+        }
+        else
+        {
         // sanity check
         if (displayW * displayH == 0) {
             Log.e(TAG, "Invalid surface size")
@@ -200,6 +213,7 @@ class PopupManager(private val service: PlaybackService) : PlaybackService.Callb
             dw = dh * ar
 
         view.setViewSize(floor(dw).toInt(), floor(dh).toInt())
+        }
     }
 
     override fun update() {}
diff --git a/buildsystem/compile.sh b/buildsystem/compile.sh
index 74e74da698..20fe046098 100755
--- a/buildsystem/compile.sh
+++ b/buildsystem/compile.sh
@@ -280,10 +280,10 @@ fi
 
 
 if [ "$FORCE_VLC_4" = 1 ]; then
-    LIBVLCJNI_TESTED_HASH=ce3b7bec0738ae4d2a9721388b789bd23a733c2a
+    LIBVLCJNI_TESTED_HASH=da9a05e49b63780977b4a993e4f2705f7b1290f8
     LIBVLCJNI_BRANCH="master"
 else
-    LIBVLCJNI_TESTED_HASH=7dea540bd34e56bb6510fb06ea4abdbebd2f1a0a
+    LIBVLCJNI_TESTED_HASH=7cd0c151da4162aa3052fb6949ddab1436d8fafb
     LIBVLCJNI_BRANCH="libvlcjni-3.x"
 fi
 LIBVLCJNI_REPOSITORY=https://code.videolan.org/videolan/libvlcjni.git



More information about the Android mailing list