[libbluray-devel] Export graphics controller status
hpi1
git at videolan.org
Mon Dec 19 09:39:55 CET 2011
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Dec 19 10:18:53 2011 +0200| [8b66e542003b415d376ec278f19ba8dd2f2d1b8d] | committer: hpi1
Export graphics controller status
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=8b66e542003b415d376ec278f19ba8dd2f2d1b8d
---
src/libbluray/bluray.c | 2 +-
src/libbluray/decoders/graphics_controller.c | 12 ++++++++++++
src/libbluray/decoders/graphics_controller.h | 8 ++++++++
3 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index d88e4a2..3a8856e 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -551,7 +551,7 @@ static int _run_gc(BLURAY *bd, gc_ctrl_e msg, uint32_t param)
int result = -1;
if (bd && bd->graphics_controller && bd->hdmv_vm) {
- GC_NAV_CMDS cmds = {-1, NULL, -1};
+ GC_NAV_CMDS cmds = {-1, NULL, -1, 0};
result = gc_run(bd->graphics_controller, msg, param, &cmds);
diff --git a/src/libbluray/decoders/graphics_controller.c b/src/libbluray/decoders/graphics_controller.c
index 3ae9c80..5e7b01a 100644
--- a/src/libbluray/decoders/graphics_controller.c
+++ b/src/libbluray/decoders/graphics_controller.c
@@ -397,8 +397,10 @@ static void _close_osd(GRAPHICS_CONTROLLER *gc, int plane)
if (plane == BD_OVERLAY_IG) {
gc->ig_open = 0;
+ gc->ig_drawn = 0;
} else {
gc->pg_open = 0;
+ gc->pg_drawn = 0;
}
}
@@ -1160,6 +1162,7 @@ int gc_run(GRAPHICS_CONTROLLER *gc, gc_ctrl_e ctrl, uint32_t param, GC_NAV_CMDS
cmds->num_nav_cmds = 0;
cmds->nav_cmds = NULL;
cmds->sound_id_ref = -1;
+ cmds->status = GC_STATUS_NONE;
}
if (!gc) {
@@ -1246,6 +1249,15 @@ int gc_run(GRAPHICS_CONTROLLER *gc, gc_ctrl_e ctrl, uint32_t param, GC_NAV_CMDS
break;
}
+ if (cmds) {
+ if (gc->igs->ics->interactive_composition.ui_model == IG_UI_MODEL_POPUP) {
+ cmds->status |= GC_STATUS_POPUP;
+ }
+ if (gc->ig_drawn) {
+ cmds->status |= GC_STATUS_MENU_OPEN;
+ }
+ }
+
bd_mutex_unlock(&gc->mutex);
return result;
diff --git a/src/libbluray/decoders/graphics_controller.h b/src/libbluray/decoders/graphics_controller.h
index f8fee74..0dac37b 100644
--- a/src/libbluray/decoders/graphics_controller.h
+++ b/src/libbluray/decoders/graphics_controller.h
@@ -58,6 +58,11 @@ typedef enum {
} gc_ctrl_e;
+
+#define GC_STATUS_NONE 0
+#define GC_STATUS_POPUP 1 /* popup menu loaded */
+#define GC_STATUS_MENU_OPEN 2 /* menu open */
+
typedef struct {
/* HDMV navigation command sequence */
int num_nav_cmds;
@@ -65,6 +70,9 @@ typedef struct {
/* Sound idx */
int sound_id_ref;
+
+ /* graphics status (none, menu, popup) */
+ uint32_t status; /* bit mask */
} GC_NAV_CMDS;
/*
More information about the libbluray-devel
mailing list