[libbluray-devel] Notify app when UO mask changes

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


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Apr 19 16:09:14 2015 +0300| [1e6974a33bee9f5c5123bc42dd299c80c222692d] | committer: hpi1

Notify app when UO mask changes

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

 src/libbluray/bluray.c |   12 ++++++++++--
 src/libbluray/bluray.h |    9 ++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index cc1894f..c074127 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -527,13 +527,21 @@ static void _init_textst_timer(BLURAY *bd)
  * UO mask
  */
 
+static uint32_t _compressed_mask(BD_UO_MASK mask)
+{
+    return mask.menu_call | (mask.title_search << 1);
+}
+
 static void _update_uo_mask(BLURAY *bd)
 {
+    BD_UO_MASK old_mask = bd->uo_mask;
     BD_UO_MASK new_mask;
 
     new_mask = bd_uo_mask_combine(bd->title_uo_mask, bd->st0.uo_mask);
-
-    bd->uo_mask = new_mask;
+    if (_compressed_mask(old_mask) != _compressed_mask(new_mask)) {
+        bd->uo_mask = new_mask;
+        _queue_event(bd, BD_EVENT_UO_MASK_CHANGED, _compressed_mask(new_mask));
+    }
 }
 
 #ifdef USING_BDJAVA
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 1705ef9..6ade74b 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -730,7 +730,10 @@ typedef enum {
     /* BD-J key interest table changed */
     BD_EVENT_KEY_INTEREST_TABLE     = 32,  /* bitmask, BLURAY_KIT_* */
 
-    /*BD_EVENT_LAST = 32, */
+    /* UO mask changed */
+    BD_EVENT_UO_MASK_CHANGED        = 33,  /* bitmask, BLURAY_UO_* */
+
+    /*BD_EVENT_LAST = 33, */
 
 } bd_event_e;
 
@@ -764,6 +767,10 @@ typedef struct {
 #define BLURAY_KIT_SEC_VIDEO     0x200
 #define BLURAY_KIT_PG_TEXTST     0x400
 
+/* BD_EVENT_UO_MASK flags */
+#define BLURAY_UO_MENU_CALL      0x1
+#define BLURAY_UO_TITLE_SEARCH   0x2
+
 /**
  *
  *  Get event from libbluray event queue.



More information about the libbluray-devel mailing list