[libbluray-devel] Added events for pop-up menu availability and IG menu status

hpi1 git at videolan.org
Mon Dec 19 09:39:56 CET 2011


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Dec 19 10:28:20 2011 +0200| [6d88105783fa3a83963178d31f624717334ca9e0] | committer: hpi1

Added events for pop-up menu availability and IG menu status

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

 ChangeLog              |    1 +
 src/libbluray/bluray.c |   22 ++++++++++++++++++++++
 src/libbluray/bluray.h |    7 +++++++
 3 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 094e2da..0a2a144 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 ????-??-??:
+ - Added events for pop-up menu availability and IG menu status
  - Fixed resuming to interactive title
  - Use user filesystem handler with libaacs
  - Fixes to HDMV menu rendering
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 2b1f40c..506b98d 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -143,6 +143,7 @@ struct bluray {
     /* graphics */
     GRAPHICS_CONTROLLER *graphics_controller;
     SOUND_DATA          *sound_effects;
+    uint32_t             gc_status;
 };
 
 #define DL_CALL(lib,func,param,...)             \
@@ -559,9 +560,30 @@ static int _run_gc(BLURAY *bd, gc_ctrl_e msg, uint32_t param)
             hdmv_vm_set_object(bd->hdmv_vm, cmds.num_nav_cmds, cmds.nav_cmds);
             bd->hdmv_suspended = !hdmv_vm_running(bd->hdmv_vm);
         }
+
+        if (cmds.status != bd->gc_status) {
+            uint32_t changed_flags = cmds.status ^ bd->gc_status;
+            bd->gc_status = cmds.status;
+            if (changed_flags & GC_STATUS_MENU_OPEN) {
+                _queue_event(bd, (BD_EVENT){BD_EVENT_MENU, !!(bd->gc_status & GC_STATUS_MENU_OPEN)});
+            }
+            if (changed_flags & GC_STATUS_POPUP) {
+                _queue_event(bd, (BD_EVENT){BD_EVENT_POPUP, !!(bd->gc_status & GC_STATUS_POPUP)});
+            }
+        }
+
         if (cmds.sound_id_ref >= 0 && cmds.sound_id_ref < 0xff) {
             _queue_event(bd, (BD_EVENT){BD_EVENT_SOUND_EFFECT, cmds.sound_id_ref});
         }
+
+    } else {
+        if (bd->gc_status & GC_STATUS_MENU_OPEN) {
+            _queue_event(bd, (BD_EVENT){BD_EVENT_MENU, 0});
+        }
+        if (bd->gc_status & GC_STATUS_POPUP) {
+            _queue_event(bd, (BD_EVENT){BD_EVENT_POPUP, 0});
+        }
+        bd->gc_status = GC_STATUS_NONE;
     }
 
     return result;
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 2900bbc..f639565 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -513,7 +513,14 @@ typedef enum {
     /* Still playback for n seconds (reached end of still mode play item) */
     BD_EVENT_STILL_TIME,             /* 0 = infinite ; 1...300 = seconds */
 
+    /* Play sound effect */
     BD_EVENT_SOUND_EFFECT,           /* effect ID */
+
+    /* Pop-Up menu available */
+    BD_EVENT_POPUP,                  /* 0 - no, 1 - yes */
+
+    /* Interactive menu visible */
+    BD_EVENT_MENU,                   /* 0 - no, 1 - yes */
 } bd_event_e;
 
 typedef struct {



More information about the libbluray-devel mailing list