Commit 8ba4b1e9 authored by Petri Hintukainen's avatar Petri Hintukainen

Pass BD-J key interest table to application

parent ac34de56
......@@ -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++) {
......
......@@ -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);
......
......@@ -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;
......@@ -614,6 +622,11 @@ Java_org_videolan_Libbluray_methods[] =
CC("(JZZ)V"),
VC(Java_org_videolan_Libbluray_setUOMaskN),
},
{
CC("setKeyInterestN"),
CC("(JI)V"),
VC(Java_org_videolan_Libbluray_setKeyInterestN),
},
{
CC("getTitleInfosN"),
CC("(J)[Lorg/videolan/TitleInfo;"),
......
......@@ -110,12 +110,20 @@ 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
(JNIEnv *, jclass, jlong, jboolean, jboolean);
/*
* 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
......
......@@ -1085,6 +1085,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)
{
......@@ -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
......
......@@ -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.
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment