Commit 9084ba63 authored by Petri Hintukainen's avatar Petri Hintukainen

Notify BD-J when UO is denied (masked)

parent 87cb0495
......@@ -630,6 +630,7 @@ int bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param)
"RATE",
"AUDIO_STREAM",
"SECONDARY_STREAM",
"UO_MASKED",
};
JNIEnv* env;
......
......@@ -41,6 +41,7 @@ typedef enum {
BDJ_EVENT_RATE,
BDJ_EVENT_AUDIO_STREAM,
BDJ_EVENT_SECONDARY_STREAM,
BDJ_EVENT_UO_MASKED,
} BDJ_EVENT;
typedef struct {
......
......@@ -487,6 +487,7 @@ public class Libbluray {
case BDJ_EVENT_SECONDARY_STREAM:
case BDJ_EVENT_END_OF_PLAYLIST:
case BDJ_EVENT_PTS:
case BDJ_EVENT_UO_MASKED:
PlayerManager.getInstance().onEvent(event, param);
break;
case BDJ_EVENT_RATE:
......@@ -560,6 +561,7 @@ public class Libbluray {
public static final int BDJ_EVENT_RATE = 13;
public static final int BDJ_EVENT_AUDIO_STREAM = 14;
public static final int BDJ_EVENT_SECONDARY_STREAM = 15;
public static final int BDJ_EVENT_UO_MASKED = 16;
/* TODO: use org/bluray/system/RegisterAccess instead */
public static final int PSR_IG_STREAM_ID = 0;
......
......@@ -381,6 +381,7 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
protected void doAngleChanged(int angle) {};
protected void doSubtitleChanged(int param) {};
protected void doAudioStreamChanged(int param) {};
protected void doUOMasked(int position) {};
protected void doSecondaryStreamChanged(int param) {};
/*
......@@ -648,6 +649,9 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
case Libbluray.BDJ_EVENT_SECONDARY_STREAM:
player.doSecondaryStreamChanged(param2);
break;
case Libbluray.BDJ_EVENT_UO_MASKED:
player.doUOMasked(param2);
break;
default:
System.err.println("Unknown ACTION_STATUS: id " + param + ", value " + param2);
break;
......
......@@ -247,6 +247,10 @@ public class Handler extends BDHandler {
}
}
protected void doUOMasked(int position) {
((UOMaskTableControlImpl)controls[16]).onUOMasked(position);
}
protected void doAngleChanged(int param) {
((AngleControlImpl)controls[0]).onAngleChange(param);
}
......
......@@ -60,7 +60,6 @@ public class UOMaskTableControlImpl implements UOMaskTableControl {
}
protected void onUOMasked(int position) {
// TODO: this method is not called
listeners.putCallback(new UOMaskedEvent(this, position));
}
......
......@@ -22,6 +22,11 @@
#include <stdint.h>
enum {
UO_MASK_MENU_CALL_INDEX = 0,
UO_MASK_TITLE_SEARCH_INDEX = 1,
};
typedef struct bd_uo_mask_table_s
{
unsigned int menu_call : 1;
......
......@@ -3122,6 +3122,7 @@ static int _try_play_title(BLURAY *bd, unsigned title)
if (bd->st0.uo_mask.title_search) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "title search masked by stream\n");
_bdj_event(bd, BDJ_EVENT_UO_MASKED, UO_MASK_TITLE_SEARCH_INDEX);
return 0;
}
......@@ -3136,6 +3137,7 @@ static int _try_play_title(BLURAY *bd, unsigned title)
if (bd->title_type == title_bdj) {
if (bd->bdj_uo_mask.title_search) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "title search masked by BD-J\n");
_bdj_event(bd, BDJ_EVENT_UO_MASKED, UO_MASK_TITLE_SEARCH_INDEX);
return 0;
}
}
......@@ -3166,6 +3168,7 @@ static int _try_menu_call(BLURAY *bd, int64_t pts)
if (bd->st0.uo_mask.menu_call) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "menu call masked by stream\n");
_bdj_event(bd, BDJ_EVENT_UO_MASKED, UO_MASK_MENU_CALL_INDEX);
return 0;
}
......@@ -3184,6 +3187,7 @@ static int _try_menu_call(BLURAY *bd, int64_t pts)
if (bd->title_type == title_bdj) {
if (bd->bdj_uo_mask.menu_call) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "menu call masked by BD-J\n");
_bdj_event(bd, BDJ_EVENT_UO_MASKED, UO_MASK_MENU_CALL_INDEX);
return 0;
}
}
......
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