[vlc-commits] [Git][videolan/vlc][master] 2 commits: bluray: add a custom JAVA_HOME setting for BD-J

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Oct 7 06:20:35 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
a5a1049e by Masstock at 2024-10-07T06:06:23+00:00
bluray: add a custom JAVA_HOME setting for BD-J

Add an option to request a specific JAVA_HOME location for BD-J applications.
This require libbluray 1.3.0.

- - - - -
befb2d0a by Masstock at 2024-10-07T06:06:23+00:00
bluray: add a enable/disable persistent storage setting for BD-J

Add an option to enable/disable BD-J persistent storage.
This require libbluray 1.0.0.

- - - - -


1 changed file:

- modules/access/bluray.c


Changes:

=====================================
modules/access/bluray.c
=====================================
@@ -142,6 +142,16 @@ static const char * bluray_event_debug_strings[] =
 #define BD_REGION_LONGTEXT  N_("Blu-Ray player region code. "\
                                 "Some discs can be played only with a correct region code.")
 
+#define BD_BDJ_SETTINGS_TEXT        N_("BD-J")
+#define BD_BDJ_JAVA_HOME_TEXT       N_("JAVA_HOME")
+#define BD_BDJ_JAVA_HOME_LONGTEXT   N_(\
+    "JRE (Java Runtime Environment) location used to execute BD-J content. "\
+    "If undefined, use automatic detection.")
+#define BD_BDJ_PERS_STOR_TEXT       N_("Persistent storage")
+#define BD_BDJ_PERS_STOR_LONGTEXT   N_(\
+    "Enable/disable BD-J persistent storage. "\
+    "If disabled, persistent files created by the BD-J application are deleted at close.")
+
 static const char *const ppsz_region_code[] = {
     "A", "B", "C" };
 static const char *const ppsz_region_code_text[] = {
@@ -153,6 +163,12 @@ static const char *const ppsz_region_code_text[] = {
 #if BLURAY_VERSION >= BLURAY_VERSION_CODE(0,8,0)
 # define BLURAY_DEMUX
 #endif
+#if BLURAY_VERSION >= BLURAY_VERSION_CODE(1,0,0)
+# define BLURAY_ENABLE_PERSISTENT_STORAGE // Enable/Disable persistent storage
+#endif
+#if BLURAY_VERSION >= BLURAY_VERSION_CODE(1,3,0)
+# define BLURAY_SET_JAVA_HOME // Capable to set custom JAVA_HOME
+#endif
 
 #ifndef BD_STREAM_TYPE_VIDEO_HEVC
 # define BD_STREAM_TYPE_VIDEO_HEVC 0x24
@@ -175,6 +191,16 @@ vlc_module_begin ()
     add_string("bluray-region", ppsz_region_code[REGION_DEFAULT], BD_REGION_TEXT, BD_REGION_LONGTEXT)
         change_string_list(ppsz_region_code, ppsz_region_code_text)
 
+#if defined(BLURAY_SET_JAVA_HOME) || defined(BLURAY_ENABLE_PERSISTENT_STORAGE)
+    set_section(BD_BDJ_SETTINGS_TEXT, NULL)
+#  ifdef BLURAY_SET_JAVA_HOME
+    add_directory("bluray-java-home", NULL, BD_BDJ_JAVA_HOME_TEXT, BD_BDJ_JAVA_HOME_LONGTEXT)
+#  endif
+#  ifdef BLURAY_ENABLE_PERSISTENT_STORAGE
+    add_bool("bluray-persistent-storage", true, BD_BDJ_PERS_STOR_TEXT, BD_BDJ_PERS_STOR_LONGTEXT)
+#  endif
+#endif
+
     add_shortcut("bluray", "file")
 
     set_callbacks(blurayOpen, blurayClose)
@@ -830,7 +856,22 @@ static int blurayOpen(vlc_object_t *object)
         /* If we're passed a block device, try to convert it to the mount point. */
         FindMountPoint(&p_sys->psz_bd_path);
 
-        p_sys->bluray = bd_open(p_sys->psz_bd_path, NULL);
+        /* Set opening settings */
+        p_sys->bluray = bd_init();
+#ifdef BLURAY_SET_JAVA_HOME
+        char *psz_java_home = var_InheritString(p_demux, "bluray-java-home");
+        bd_set_player_setting_str(p_sys->bluray, BLURAY_PLAYER_JAVA_HOME, psz_java_home);
+        free(psz_java_home);
+#endif
+#ifdef BLURAY_ENABLE_PERSISTENT_STORAGE
+        bool b_persistent_storage = var_InheritBool(p_demux, "bluray-persistent-storage");
+        bd_set_player_setting(p_sys->bluray, BLURAY_PLAYER_SETTING_PERSISTENT_STORAGE, b_persistent_storage);
+#endif
+
+        if (!bd_open_disc(p_sys->bluray, p_sys->psz_bd_path, NULL)) {
+            bd_close(p_sys->bluray);
+            p_sys->bluray = NULL;
+        }
     }
     if (!p_sys->bluray) {
         goto error;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dbc3f839d87d84c7eda665d1d12b2e6a9b1d0383...befb2d0aa69378e75d4b9f09464ad07dd998ed3f

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dbc3f839d87d84c7eda665d1d12b2e6a9b1d0383...befb2d0aa69378e75d4b9f09464ad07dd998ed3f
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list