[libbluray-devel] Store BD-J uo mask in bluray.c

hpi1 git at videolan.org
Mon Nov 17 11:41:22 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Nov 17 11:36:43 2014 +0200| [72d1c7fc0cb41834d67f6bdb4025a3ab62c8c22b] | committer: hpi1

Store BD-J uo mask in bluray.c

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

 src/libbluray/bdj/bdj.c                           |    9 ---------
 src/libbluray/bdj/bdj.h                           |    5 -----
 src/libbluray/bdj/bdj_private.h                   |    2 --
 src/libbluray/bdj/native/org_videolan_Libbluray.c |    2 +-
 src/libbluray/bluray.c                            |   14 ++++++++++++--
 src/libbluray/bluray_internal.h                   |    6 ++++++
 6 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index 6b23add..73a8e0d 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -630,12 +630,3 @@ int bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param)
 
     return result;
 }
-
-int bdj_get_uo_mask(BDJAVA *bdjava)
-{
-    if (!bdjava) {
-        return 0;
-    }
-
-    return bdjava->uo_mask;
-}
diff --git a/src/libbluray/bdj/bdj.h b/src/libbluray/bdj/bdj.h
index 7226932..bc3c147 100644
--- a/src/libbluray/bdj/bdj.h
+++ b/src/libbluray/bdj/bdj.h
@@ -47,10 +47,6 @@ typedef struct {
     char *cache_root;
 } BDJ_STORAGE;
 
-/* bdj_get_uo_mask() */
-#define BDJ_MENU_CALL_MASK     0x01
-#define BDJ_TITLE_SEARCH_MASK  0x02
-
 typedef struct bdjava_s BDJAVA;
 
 struct bluray;
@@ -59,7 +55,6 @@ BD_PRIVATE BDJAVA* bdj_open(const char *path, struct bluray *bd,
                             const char *bdj_disc_id, BDJ_STORAGE *storage);
 BD_PRIVATE void bdj_close(BDJAVA *bdjava);
 BD_PRIVATE int  bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param);
-BD_PRIVATE int  bdj_get_uo_mask(BDJAVA *bdjava);
 
 BD_PRIVATE int  bdj_jvm_available(void); /* 0: no. 1: only jvm. 2: jvm + libbluray.jar. */
 
diff --git a/src/libbluray/bdj/bdj_private.h b/src/libbluray/bdj/bdj_private.h
index c48095b..bc4a161 100644
--- a/src/libbluray/bdj/bdj_private.h
+++ b/src/libbluray/bdj/bdj_private.h
@@ -34,8 +34,6 @@ struct bdjava_s {
 
     // JNI
     JavaVM* jvm;
-
-    unsigned uo_mask; /* UO masks from bdjo */
 };
 
 #endif
diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c
index c0ca8e5..04bc587 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -205,7 +205,7 @@ JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_getUOMaskN(JNIEnv * env,
 JNIEXPORT void JNICALL Java_org_videolan_Libbluray_setUOMaskN(JNIEnv * env,
         jclass cls, jlong np, jboolean menuCallMask, jboolean titleSearchMask) {
     BDJAVA* bdj = (BDJAVA*)(intptr_t)np;
-    bdj->uo_mask = ((!!menuCallMask) * BDJ_MENU_CALL_MASK) | ((!!titleSearchMask) * BDJ_TITLE_SEARCH_MASK);
+    bd_set_bdj_uo_mask(bdj->bd, ((!!menuCallMask) * BDJ_MENU_CALL_MASK) | ((!!titleSearchMask) * BDJ_TITLE_SEARCH_MASK));
 }
 
 JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_getTitlesN(JNIEnv * env,
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 62bf8a1..b19e7c8 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -184,6 +184,7 @@ struct bluray {
     bd_argb_overlay_proc_f argb_overlay_proc;
     BD_ARGB_BUFFER      *argb_buffer;
     BD_MUTEX             argb_buffer_mutex;
+    BD_UO_MASK           bdj_uo_mask;
 #endif
 };
 
@@ -1114,6 +1115,14 @@ static void _fill_disc_info(BLURAY *bd)
  */
 
 #ifdef USING_BDJAVA
+void bd_set_bdj_uo_mask(BLURAY *bd, unsigned mask)
+{
+    bd->bdj_uo_mask.title_search = !!(mask & BDJ_TITLE_SEARCH_MASK);
+    bd->bdj_uo_mask.menu_call    = !!(mask & BDJ_MENU_CALL_MASK);
+}
+#endif
+
+#ifdef USING_BDJAVA
 uint64_t bd_get_uo_mask(BLURAY *bd)
 {
     /* internal function. Used by BD-J. */
@@ -2959,6 +2968,7 @@ static int _play_bdj(BLURAY *bd, unsigned title)
     int result;
 
     bd->title_type = title_bdj;
+    memset(&bd->bdj_uo_mask, 0, sizeof(BD_UO_MASK));
 
     result = _start_bdj(bd, title);
     if (result <= 0) {
@@ -3132,7 +3142,7 @@ static int _try_play_title(BLURAY *bd, unsigned title)
 
 #ifdef USING_BDJAVA
     if (bd->title_type == title_bdj) {
-        if (bdj_get_uo_mask(bd->bdjava) & BDJ_TITLE_SEARCH_MASK) {
+        if (bd->bdj_uo_mask.title_search) {
             BD_DEBUG(DBG_BLURAY | DBG_CRIT, "title search masked by BD-J\n");
             return 0;
         }
@@ -3180,7 +3190,7 @@ static int _try_menu_call(BLURAY *bd, int64_t pts)
 
 #ifdef USING_BDJAVA
     if (bd->title_type == title_bdj) {
-        if (bdj_get_uo_mask(bd->bdjava) & BDJ_MENU_CALL_MASK) {
+        if (bd->bdj_uo_mask.menu_call) {
             BD_DEBUG(DBG_BLURAY | DBG_CRIT, "menu call masked by BD-J\n");
             return 0;
         }
diff --git a/src/libbluray/bluray_internal.h b/src/libbluray/bluray_internal.h
index d69650b..c3cbda7 100644
--- a/src/libbluray/bluray_internal.h
+++ b/src/libbluray/bluray_internal.h
@@ -28,7 +28,13 @@
 
 BD_PRIVATE const uint8_t *bd_get_aacs_data(BLURAY *bd, int type);
 
+/* bd_set_bdj_uo_mask() */
+#define BDJ_MENU_CALL_MASK     0x01
+#define BDJ_TITLE_SEARCH_MASK  0x02
+
 BD_PRIVATE uint64_t bd_get_uo_mask(BLURAY *bd);
+BD_PRIVATE void     bd_set_bdj_uo_mask(struct bluray *bd, unsigned mask);
+
 BD_PRIVATE int bd_play_title_internal(BLURAY *bd, unsigned title);
 
 BD_PRIVATE uint32_t bd_reg_read(BLURAY *bd, int psr, int reg);



More information about the libbluray-devel mailing list