[libbluray-devel] Pass BD-J key interest table to application

hpi1 git at videolan.org
Sun Apr 19 16:16:46 CEST 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Apr 19 15:47:31 2015 +0300| [8ba4b1e9f9c2d4250e0b2b1b43c8c5ad921bcdc4] | committer: hpi1

Pass BD-J key interest table to application

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

 src/libbluray/bdj/java/org/videolan/BDJLoader.java |    1 +
 src/libbluray/bdj/java/org/videolan/Libbluray.java |    5 +++++
 src/libbluray/bdj/native/org_videolan_Libbluray.c  |   13 +++++++++++++
 src/libbluray/bdj/native/org_videolan_Libbluray.h  |   10 +++++++++-
 src/libbluray/bluray.c                             |    8 ++++++++
 src/libbluray/bluray.h                             |   18 +++++++++++++++++-
 src/libbluray/bluray_internal.h                    |    3 ++-
 7 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/BDJLoader.java b/src/libbluray/bdj/java/org/videolan/BDJLoader.java
index 89fe20c..22bd37a 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJLoader.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJLoader.java
@@ -178,6 +178,7 @@ public class BDJLoader {
             gui.setVisible(true);
 
             Libbluray.setUOMask(terminfo.getMenuCallMask(), terminfo.getTitleSearchMask());
+            Libbluray.setKeyInterest(bdjo.getKeyInterestTable());
 
             // initialize appProxys
             for (int i = 0; i < appTable.length; i++) {
diff --git a/src/libbluray/bdj/java/org/videolan/Libbluray.java b/src/libbluray/bdj/java/org/videolan/Libbluray.java
index b2b2cb1..fcac9d7 100644
--- a/src/libbluray/bdj/java/org/videolan/Libbluray.java
+++ b/src/libbluray/bdj/java/org/videolan/Libbluray.java
@@ -247,6 +247,10 @@ public class Libbluray {
         setUOMaskN(nativePointer, menuCallMask, titleSearchMask);
     }
 
+    protected static void setKeyInterest(int mask) {
+        setKeyInterestN(nativePointer, mask);
+    }
+
     protected static int setVirtualPackage(String vpPath, boolean initBackupRegs) {
         return setVirtualPackageN(nativePointer, vpPath, initBackupRegs);
     }
@@ -612,6 +616,7 @@ public class Libbluray {
     private static native int selectAngleN(long np, int angle);
     private static native long getUOMaskN(long np);
     private static native void setUOMaskN(long np, boolean menuCallMask, boolean titleSearchMask);
+    private static native void setKeyInterestN(long np, int mask);
     private static native long tellTimeN(long np);
     private static native int selectRateN(long np, float rate, int reason);
     private static native int writeGPRN(long np, int num, int value);
diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c
index c4a8ba0..05d4a76 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -220,6 +220,14 @@ JNIEXPORT void JNICALL Java_org_videolan_Libbluray_setUOMaskN(JNIEnv * env,
     bd_set_bdj_uo_mask(bd, ((!!menuCallMask) * BDJ_MENU_CALL_MASK) | ((!!titleSearchMask) * BDJ_TITLE_SEARCH_MASK));
 }
 
+JNIEXPORT void JNICALL Java_org_videolan_Libbluray_setKeyInterestN(JNIEnv * env,
+        jclass cls, jlong np, jint mask) {
+    BLURAY* bd = (BLURAY*)(intptr_t)np;
+
+    BD_DEBUG(DBG_JNI, "setKeyInterestN(0x%x)\n", (int)mask);
+    bd_set_bdj_kit(bd, mask);
+}
+
 JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_setVirtualPackageN(JNIEnv * env,
         jclass cls, jlong np, jstring vpPath, jboolean psr_init_backup) {
     BLURAY* bd = (BLURAY*)(intptr_t)np;
@@ -615,6 +623,11 @@ Java_org_videolan_Libbluray_methods[] =
         VC(Java_org_videolan_Libbluray_setUOMaskN),
     },
     {
+        CC("setKeyInterestN"),
+        CC("(JI)V"),
+        VC(Java_org_videolan_Libbluray_setKeyInterestN),
+    },
+    {
         CC("getTitleInfosN"),
         CC("(J)[Lorg/videolan/TitleInfo;"),
         VC(Java_org_videolan_Libbluray_getTitleInfosN),
diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.h b/src/libbluray/bdj/native/org_videolan_Libbluray.h
index 7c7d3d0..466359e 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.h
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.h
@@ -110,7 +110,7 @@ JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_getUOMaskN
 
 /*
  * Class:     org_videolan_Libbluray
- * Method:    getUOMask
+ * Method:    setUOMask
  * Signature: (JZZ)V
  */
 JNIEXPORT void JNICALL Java_org_videolan_Libbluray_setUOMaskN
@@ -118,6 +118,14 @@ JNIEXPORT void JNICALL Java_org_videolan_Libbluray_setUOMaskN
 
 /*
  * Class:     org_videolan_Libbluray
+ * Method:    setKeyInterestN
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL Java_org_videolan_Libbluray_setKeyInterestN
+(JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_videolan_Libbluray
  * Method:    getTitleInfosN
  * Signature: (J)[Lorg/videolan/TitleInfo;
  */
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index f3f03f3..d71b6ec 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -1086,6 +1086,13 @@ uint64_t bd_get_uo_mask(BLURAY *bd)
 #endif
 
 #ifdef USING_BDJAVA
+void bd_set_bdj_kit(BLURAY *bd, int mask)
+{
+    _queue_event(bd, BD_EVENT_KEY_INTEREST_TABLE, mask);
+}
+#endif
+
+#ifdef USING_BDJAVA
 void bd_select_rate(BLURAY *bd, float rate, int reason)
 {
     if (reason == BDJ_PLAYBACK_STOP) {
@@ -1298,6 +1305,7 @@ static void _stop_bdj(BLURAY *bd)
     if (bd->bdjava != NULL) {
         bdj_process_event(bd->bdjava, BDJ_EVENT_STOP, 0);
         _queue_event(bd, BD_EVENT_STILL, 0);
+        _queue_event(bd, BD_EVENT_KEY_INTEREST_TABLE, 0);
     }
 }
 #else
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 3b71b8e..1705ef9 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -727,7 +727,10 @@ typedef enum {
     /* 3D */
     BD_EVENT_STEREOSCOPIC_STATUS    = 27,  /* 0 - 2D, 1 - 3D */
 
-    /*BD_EVENT_LAST = 31, */
+    /* BD-J key interest table changed */
+    BD_EVENT_KEY_INTEREST_TABLE     = 32,  /* bitmask, BLURAY_KIT_* */
+
+    /*BD_EVENT_LAST = 32, */
 
 } bd_event_e;
 
@@ -748,6 +751,19 @@ typedef struct {
 #define BLURAY_TITLE_FIRST_PLAY  0xffff
 #define BLURAY_TITLE_TOP_MENU    0
 
+/* BD_EVENT_KEY_INTEREST flags */
+#define BLURAY_KIT_PLAY          0x1
+#define BLURAY_KIT_STOP          0x2
+#define BLURAY_KIT_FFW           0x4
+#define BLURAY_KIT_REW           0x8
+#define BLURAY_KIT_TRACK_NEXT    0x10
+#define BLURAY_KIT_TRACK_PREV    0x20
+#define BLURAY_KIT_PAUSE         0x40
+#define BLURAY_KIT_STILL_OFF     0x80
+#define BLURAY_KIT_SEC_AUDIO     0x100
+#define BLURAY_KIT_SEC_VIDEO     0x200
+#define BLURAY_KIT_PG_TEXTST     0x400
+
 /**
  *
  *  Get event from libbluray event queue.
diff --git a/src/libbluray/bluray_internal.h b/src/libbluray/bluray_internal.h
index ea74b48..1d712f4 100644
--- a/src/libbluray/bluray_internal.h
+++ b/src/libbluray/bluray_internal.h
@@ -38,7 +38,7 @@ BD_PRIVATE struct bd_disc *bd_get_disc(struct bluray *bd);
 BD_PRIVATE int      bd_set_virtual_package(struct bluray *bd, const char *vp_path, int psr_init_backup);
 
 /*
- * UO mask
+ * UO mask, KIT
  */
 
 #define BDJ_MENU_CALL_MASK     0x01
@@ -46,6 +46,7 @@ BD_PRIVATE int      bd_set_virtual_package(struct bluray *bd, const char *vp_pat
 
 BD_PRIVATE uint64_t bd_get_uo_mask(struct bluray *bd);
 BD_PRIVATE void     bd_set_bdj_uo_mask(struct bluray *bd, unsigned mask);
+BD_PRIVATE void     bd_set_bdj_kit(struct bluray *bd, int mask);
 
 /*
  * title selection



More information about the libbluray-devel mailing list