[libbluray-devel] [Git][videolan/libbluray][master] BD-J: report the requested stereoscopic mode in the video configuration
Petri Hintukainen (@hpi)
gitlab at videolan.org
Sat Nov 21 13:13:39 UTC 2026
Petri Hintukainen pushed to branch master at VideoLAN / libbluray
Commits:
0baaf4be by Adrian Betschart at 2026-11-21T13:09:25+00:00
BD-J: report the requested stereoscopic mode in the video configuration
When running as a profile 5 (3D) player, an Xlet can request a
stereoscopic video mode by setting the HVideoConfigTemplateS3D.S3D
preference (with an S3DProperty object) in a template, getting the
matching configuration with HVideoDevice.getBestConfiguration() and
applying it with setVideoConfiguration().
getBestConfiguration() ignored the S3D preference and returned one of
the default configurations, whose template never has the S3D preference
set. getCurrentConfiguration().getConfigTemplate().getPreferenceObject(S3D)
always returned null after the configuration was set.
Disney 3D discs (disneyFramework / Deluxe TitleBoundXlet: Aladdin (2019)
3D, Zootopia (2016) 3D) set S3DProperty.TWO_PLANES (and TWOD_OUTPUT when
leaving a title), then poll the current configuration every 100 ms and
give up after 5 seconds. Every pop-up menu open and close, and every
title change, took 5 seconds; the title change also hit the Xlet STOP
timeout.
Return a configuration whose template carries the requested S3D
preference (REQUIRED) in addition to the platform preferences of the
matching default configuration. These configurations are created on
demand, once per default configuration and S3D object, so the same
request returns the same configuration.
Only templates of a profile 5 player (HVideoConfigTemplateS3D) are
affected.
- - - - -
1 changed file:
- src/libbluray/bdj/java/org/havi/ui/HVideoDevice.java
Changes:
=====================================
src/libbluray/bdj/java/org/havi/ui/HVideoDevice.java
=====================================
@@ -20,6 +20,8 @@
package org.havi.ui;
+import java.util.ArrayList;
+
import org.blurayx.s3d.ui.HVideoConfigTemplateS3D;
import org.blurayx.uhd.ui.HVideoConfigurationTemplateUHD;
@@ -42,6 +44,7 @@ public class HVideoDevice extends HScreenDevice {
hvcArray[i] = new HVideoConfiguration(hvct);
}
hvc = hvcArray[0];
+ s3dArray = new ArrayList[length];
}
public HVideoConfiguration[] getConfigurations() {
@@ -58,17 +61,57 @@ public class HVideoDevice extends HScreenDevice {
for (int i = 0; i < hvcArray.length; i++)
if (hvct.match(hvcArray[i]) > score)
hvc = hvcArray[i];
- return hvc;
+ return getS3DConfiguration(hvc, hvct);
}
public HVideoConfiguration getBestConfiguration(HVideoConfigTemplate hvcta[]) {
int score = -1;
HVideoConfiguration hvc = null;
+ HVideoConfigTemplate hvct = null;
for (int i = 0; i < hvcArray.length; i++)
for (int j = 0; j < hvcta.length; j++)
- if (hvcta[j].match(hvcArray[i]) > score)
+ if (hvcta[j].match(hvcArray[i]) > score) {
hvc = hvcArray[i];
- return hvc;
+ hvct = hvcta[j];
+ }
+ return getS3DConfiguration(hvc, hvct);
+ }
+
+ /*
+ * Profile 5: if the template asks for a stereoscopic mode (HVideoConfigTemplateS3D.S3D),
+ * return a configuration whose template reports that mode.
+ * Applications set the configuration and then wait until
+ * getCurrentConfiguration().getConfigTemplate().getPreferenceObject(S3D) reports it.
+ */
+ private synchronized HVideoConfiguration getS3DConfiguration(HVideoConfiguration hvc, HVideoConfigTemplate hvct) {
+ if (hvc == null || !(hvct instanceof HVideoConfigTemplateS3D) ||
+ !(hvc.getConfigTemplate() instanceof HVideoConfigTemplateS3D))
+ return hvc;
+
+ Object s3d = hvct.getPreferenceObject(HVideoConfigTemplateS3D.S3D);
+ int priority = hvct.getPreferencePriority(HVideoConfigTemplateS3D.S3D);
+ if (s3d == null ||
+ (priority != HScreenConfigTemplate.REQUIRED && priority != HScreenConfigTemplate.PREFERRED))
+ return hvc;
+
+ int index;
+ for (index = 0; hvcArray[index] != hvc; index++)
+ ;
+ if (s3dArray[index] == null)
+ s3dArray[index] = new ArrayList();
+
+ for (int i = 0; i < s3dArray[index].size(); i++) {
+ HVideoConfiguration s3dHvc = (HVideoConfiguration)s3dArray[index].get(i);
+ if (s3d.equals(s3dHvc.getConfigTemplate().getPreferenceObject(HVideoConfigTemplateS3D.S3D)))
+ return s3dHvc;
+ }
+
+ HVideoConfigTemplateS3D s3dHvct = new HVideoConfigTemplateS3D();
+ HScreenConfigTemplate.initDefaultConfigTemplate(s3dHvct, index);
+ s3dHvct.setPreference(HVideoConfigTemplateS3D.S3D, s3d, HScreenConfigTemplate.REQUIRED);
+ HVideoConfiguration s3dHvc = new HVideoConfiguration(s3dHvct);
+ s3dArray[index].add(s3dHvc);
+ return s3dHvc;
}
public HVideoConfiguration getCurrentConfiguration() {
@@ -93,5 +136,6 @@ public class HVideoDevice extends HScreenDevice {
public static final HVideoConfiguration NOT_CONTRIBUTING = null;
private HVideoConfiguration[] hvcArray;
+ private ArrayList[] s3dArray;
private HVideoConfiguration hvc;
}
View it on GitLab: https://code.videolan.org/videolan/libbluray/-/commit/0baaf4bed2391a8812182bfa67a88143f02ddc34
--
View it on GitLab: https://code.videolan.org/videolan/libbluray/-/commit/0baaf4bed2391a8812182bfa67a88143f02ddc34
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the libbluray-devel
mailing list