[libbluray-devel] [Git][videolan/libbluray][master] 2 commits: BD-J: Log unimplemented background plane operations.

Petri Hintukainen gitlab at videolan.org
Thu Feb 4 19:27:47 UTC 2021



Petri Hintukainen pushed to branch master at VideoLAN / libbluray


Commits:
ee52e81c by hpi1 at 2021-02-03T12:14:03+02:00
BD-J: Log unimplemented background plane operations.

- - - - -
79429a52 by hpi1 at 2021-02-04T21:25:19+02:00
Add player setting for JAVA_HOME.

- - - - -


6 changed files:

- src/libbluray/bdj/bdj.c
- src/libbluray/bdj/bdj.h
- src/libbluray/bdj/java/org/havi/ui/HBackgroundDevice.java
- src/libbluray/bdj/java/org/havi/ui/HStillImageBackgroundConfiguration.java
- src/libbluray/bluray.c
- src/libbluray/bluray.h


Changes:

=====================================
src/libbluray/bdj/bdj.c
=====================================
@@ -369,7 +369,7 @@ static void *_load_jli_macos()
 }
 #endif
 
-static void *_load_jvm(const char **p_java_home)
+static void *_load_jvm(const char **p_java_home, const char *app_java_home)
 {
 #ifdef HAVE_BDJ_J2ME
 # ifdef _WIN32
@@ -431,6 +431,13 @@ static void *_load_jvm(const char **p_java_home)
     unsigned    path_ind;
     void       *handle = NULL;
 
+    /* Application provided JAVA_HOME overrides everything else */
+    if (app_java_home) {
+        BD_DEBUG(DBG_BDJ, "Using application-provided JAVA_HOME '%s'\n", app_java_home);
+        *p_java_home = app_java_home;
+        return _jvm_dlopen_a(app_java_home, jvm_dir, num_jvm_dir, jvm_lib);
+    }
+
     /* JAVA_HOME set, use it */
     java_home = getenv("JAVA_HOME");
     if (java_home) {
@@ -508,6 +515,7 @@ void bdj_config_cleanup(BDJ_CONFIG *p)
 {
     X_FREE(p->cache_root);
     X_FREE(p->persistent_root);
+    X_FREE(p->java_home);
     X_FREE(p->classpath[0]);
     X_FREE(p->classpath[1]);
 }
@@ -763,7 +771,7 @@ static int _bdj_init(JNIEnv *env, struct bluray *bd, const char *disc_root, cons
 int bdj_jvm_available(BDJ_CONFIG *storage)
 {
     const char *java_home;
-    void* jvm_lib = _load_jvm(&java_home);
+    void* jvm_lib = _load_jvm(&java_home, storage->java_home);
     if (!jvm_lib) {
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "BD-J check: Failed to load JVM library\n");
         return BDJ_CHECK_NO_JVM;
@@ -1014,7 +1022,7 @@ BDJAVA* bdj_open(const char *path, struct bluray *bd,
 
     // first load the jvm using dlopen
     const char *java_home = NULL;
-    void* jvm_lib = _load_jvm(&java_home);
+    void* jvm_lib = _load_jvm(&java_home, cfg->java_home);
 
     if (!jvm_lib) {
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "Wasn't able to load JVM\n");


=====================================
src/libbluray/bdj/bdj.h
=====================================
@@ -67,6 +67,7 @@ typedef struct {
     char *persistent_root;   /* BD-J Xlet persistent storage */
     char *cache_root;        /* BD-J binding unit data area */
 
+    char *java_home;         /* JAVA_HOME override from application */
     char *classpath[2];      /* BD-J implementation class path (location of libbluray.jar) */
 
     uint8_t no_persistent_storage; /* disable persistent storage (remove files at close) */


=====================================
src/libbluray/bdj/java/org/havi/ui/HBackgroundDevice.java
=====================================
@@ -80,6 +80,7 @@ public class HBackgroundDevice extends HScreenDevice {
     public boolean setBackgroundConfiguration(HBackgroundConfiguration hbc)
             throws SecurityException, HPermissionDeniedException,
             HConfigurationException {
+        org.videolan.Logger.unimplemented("HBackgroundDevide", "setBackgroundConfiguration()");
         this.hbc = hbc;
         return true;
     }


=====================================
src/libbluray/bdj/java/org/havi/ui/HStillImageBackgroundConfiguration.java
=====================================
@@ -39,6 +39,7 @@ public class HStillImageBackgroundConfiguration extends
     public void displayImage(HBackgroundImage image, HScreenRectangle r)
             throws IOException, HPermissionDeniedException,
             HConfigurationException {
+        org.videolan.Logger.unimplemented("HStillImageBackgroundConfiguration", "displayImage()");
         this.image = image;
         this.rect = r;
     }


=====================================
src/libbluray/bluray.c
=====================================
@@ -2960,6 +2960,14 @@ int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *s)
             BD_DEBUG(DBG_BDJ, "Persistent root dir set to %s\n", bd->bdj_config.persistent_root);
             return 1;
 
+        case BLURAY_PLAYER_JAVA_HOME:
+            bd_mutex_lock(&bd->mutex);
+            X_FREE(bd->bdj_config.java_home);
+            bd->bdj_config.java_home = s ? str_dup(s) : NULL;
+            bd_mutex_unlock(&bd->mutex);
+            BD_DEBUG(DBG_BDJ, "Java home set to %s\n", bd->bdj_config.java_home ? bd->bdj_config.java_home : "<auto>");
+            return 1;
+
         default:
             return 0;
     }


=====================================
src/libbluray/bluray.h
=====================================
@@ -693,6 +693,7 @@ typedef enum {
 
     BLURAY_PLAYER_PERSISTENT_ROOT            = 0x200, /* Root path to the BD_J persistent storage location. String. */
     BLURAY_PLAYER_CACHE_ROOT                 = 0x201, /* Root path to the BD_J cache storage location. String. */
+    BLURAY_PLAYER_JAVA_HOME                  = 0x202, /* Location of JRE. String. Default: NULL (autodetect). */
 } bd_player_setting;
 
 /**



View it on GitLab: https://code.videolan.org/videolan/libbluray/-/compare/9f1cc143efb6f3af71770a6d33f88f501ae619ad...79429a524a1f339f4c2e6c90bb14939ab767ab00

-- 
View it on GitLab: https://code.videolan.org/videolan/libbluray/-/compare/9f1cc143efb6f3af71770a6d33f88f501ae619ad...79429a524a1f339f4c2e6c90bb14939ab767ab00
You're receiving this email because of your account on code.videolan.org.




More information about the libbluray-devel mailing list