[libbluray-devel] Store disc index and root path in BDJAVA

hpi1 git at videolan.org
Wed Sep 12 22:03:46 CEST 2012


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Sep 12 22:13:39 2012 +0300| [e6c13cd09e98491baed37f6c3049545d5a6adbce] | committer: hpi1

Store disc index and root path in BDJAVA

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=e6c13cd09e98491baed37f6c3049545d5a6adbce
---

 src/libbluray/bdj/bdj.c         |    5 ++++-
 src/libbluray/bdj/bdj.h         |    3 ++-
 src/libbluray/bdj/bdj_private.h |    8 ++++++--
 src/libbluray/bluray.c          |    2 +-
 4 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index a236947..66f64cb 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -39,7 +39,8 @@ int start_xlet(JNIEnv* env, const char* path, jobject bdjo, BDJAVA* bdjava);
 void* load_jvm();
 
 BDJAVA* bdj_open(const char *path, const char *start,
-                 struct bluray *bd, struct bd_registers_s *registers)
+                 struct bluray *bd, struct bd_registers_s *registers,
+                 struct indx_root_s *index)
 {
     // first load the jvm using dlopen
     void* jvm_lib = load_jvm();
@@ -52,6 +53,8 @@ BDJAVA* bdj_open(const char *path, const char *start,
     BDJAVA* bdjava = malloc(sizeof(BDJAVA));
     bdjava->bd = bd;
     bdjava->reg = registers;
+    bdjava->index = index;
+    bdjava->path = path;
 
     JavaVMInitArgs args;
 
diff --git a/src/libbluray/bdj/bdj.h b/src/libbluray/bdj/bdj.h
index 7b3e839..4f14cd2 100644
--- a/src/libbluray/bdj/bdj.h
+++ b/src/libbluray/bdj/bdj.h
@@ -26,9 +26,10 @@ typedef struct bdjava_s BDJAVA;
 
 struct bluray;
 struct bd_registers_s;
+struct indx_root_s;
 
 BDJAVA* bdj_open(const char *path, const char *start,
-                 struct bluray *bd, struct bd_registers_s *registers);
+                 struct bluray *bd, struct bd_registers_s *registers, struct indx_root_s *index);
 void bdj_close(BDJAVA *bdjava);
 
 void bdj_send_event(BDJAVA *bdjava, int type, int keyCode);
diff --git a/src/libbluray/bdj/bdj_private.h b/src/libbluray/bdj/bdj_private.h
index b948a07..042acc5 100644
--- a/src/libbluray/bdj/bdj_private.h
+++ b/src/libbluray/bdj/bdj_private.h
@@ -3,15 +3,19 @@
 
 #include "libbluray/register.h"
 #include "libbluray/bluray.h"
+#include "libbluray/bdnav/index_parse.h"
 #include <jni.h>
 
 struct bdjava_s {
-    BD_REGISTERS* reg;
-    BLURAY* bd;
+    BLURAY       *bd;
+    BD_REGISTERS *reg;
+    INDX_ROOT    *index;
 
     // JNI
     JavaVM* jvm;
     JNIEnv* env;
+
+    const char *path;
 };
 
 #endif
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 7237c54..c53f620 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -1938,7 +1938,7 @@ int bd_start_bdj(BLURAY *bd, const char *start_object)
 {
 #ifdef USING_BDJAVA
     if (bd->bdjava == NULL) {
-        bd->bdjava = bdj_open(bd->device_path, start_object, bd, bd->regs);
+        bd->bdjava = bdj_open(bd->device_path, start_object, bd, bd->regs, bd->index);
         return !!bd->bdjava;
     } else {
         BD_DEBUG(DBG_BLURAY | DBG_CRIT, "BD-J is already running (%p)\n", bd);



More information about the libbluray-devel mailing list