[libbluray-devel] Notify BD-J when UO is denied (masked)

hpi1 git at videolan.org
Sun Apr 19 15:02:31 CEST 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Apr 17 21:22:30 2015 +0300| [9084ba6397ca88753f75c9c67c115cfb3b395430] | committer: hpi1

Notify BD-J when UO is denied (masked)

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

 src/libbluray/bdj/bdj.c                                           |    1 +
 src/libbluray/bdj/bdj.h                                           |    1 +
 src/libbluray/bdj/java/org/videolan/Libbluray.java                |    2 ++
 src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java  |    4 ++++
 .../bdj/java/org/videolan/media/content/playlist/Handler.java     |    4 ++++
 .../videolan/media/content/playlist/UOMaskTableControlImpl.java   |    1 -
 src/libbluray/bdnav/uo_mask_table.h                               |    5 +++++
 src/libbluray/bluray.c                                            |    4 ++++
 8 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index 4e03cef..3465c69 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -630,6 +630,7 @@ int bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param)
         "RATE",
         "AUDIO_STREAM",
         "SECONDARY_STREAM",
+        "UO_MASKED",
     };
 
     JNIEnv* env;
diff --git a/src/libbluray/bdj/bdj.h b/src/libbluray/bdj/bdj.h
index 60fe180..45fbfc5 100644
--- a/src/libbluray/bdj/bdj.h
+++ b/src/libbluray/bdj/bdj.h
@@ -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 {
diff --git a/src/libbluray/bdj/java/org/videolan/Libbluray.java b/src/libbluray/bdj/java/org/videolan/Libbluray.java
index add4acb..b2b2cb1 100644
--- a/src/libbluray/bdj/java/org/videolan/Libbluray.java
+++ b/src/libbluray/bdj/java/org/videolan/Libbluray.java
@@ -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;
diff --git a/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java b/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
index 10d6a98..3d43579 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
@@ -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;
diff --git a/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java b/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
index d898e9f..7046b77 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
@@ -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);
     }
diff --git a/src/libbluray/bdj/java/org/videolan/media/content/playlist/UOMaskTableControlImpl.java b/src/libbluray/bdj/java/org/videolan/media/content/playlist/UOMaskTableControlImpl.java
index ec33b19..d63f1bc 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/playlist/UOMaskTableControlImpl.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/playlist/UOMaskTableControlImpl.java
@@ -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));
     }
 
diff --git a/src/libbluray/bdnav/uo_mask_table.h b/src/libbluray/bdnav/uo_mask_table.h
index af0eca6..7d15606 100644
--- a/src/libbluray/bdnav/uo_mask_table.h
+++ b/src/libbluray/bdnav/uo_mask_table.h
@@ -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;
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index d60ad55..13efcde 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -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;
         }
     }



More information about the libbluray-devel mailing list