[libbluray-devel] Decode mainpath embedded IG streams
hpi1
git at videolan.org
Mon Nov 21 08:50:49 CET 2011
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Nov 21 09:48:38 2011 +0200| [1cad66208bcd7d1289ba99bbed22ab4370546605] | committer: hpi1
Decode mainpath embedded IG streams
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=1cad66208bcd7d1289ba99bbed22ab4370546605
---
src/libbluray/bluray.c | 47 +++++++++++++++++++++++++++++------------------
1 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 3947480..166c5f7 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -522,6 +522,28 @@ static int64_t _seek_stream(BLURAY *bd, BD_STREAM *st,
}
/*
+ * Graphics controller interface
+ */
+
+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};
+
+ result = gc_run(bd->graphics_controller, msg, param, &cmds);
+
+ if (cmds.num_nav_cmds > 0) {
+ hdmv_vm_set_object(bd->hdmv_vm, cmds.num_nav_cmds, cmds.nav_cmds);
+ bd->hdmv_suspended = !hdmv_vm_running(bd->hdmv_vm);
+ }
+ }
+
+ return result;
+}
+
+/*
* libaacs and libbdplus open / close
*/
@@ -1190,6 +1212,13 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len)
if (_read_block(bd, st, bd->int_buf) > 0) {
+ if (bd->ig_pid > 0) {
+ if (gc_decode_ts(bd->graphics_controller, bd->ig_pid, bd->int_buf, 1, -1) > 0) {
+ /* initialize menus */
+ _run_gc(bd, GC_CTRL_INIT_MENU, 0);
+ }
+ }
+
st->int_buf_off = st->clip_pos % 6144;
} else {
@@ -2051,24 +2080,6 @@ int bd_menu_call(BLURAY *bd, int64_t pts)
return _play_title(bd, BLURAY_TITLE_TOP_MENU);
}
-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};
-
- result = gc_run(bd->graphics_controller, msg, param, &cmds);
-
- if (cmds.num_nav_cmds > 0) {
- hdmv_vm_set_object(bd->hdmv_vm, cmds.num_nav_cmds, cmds.nav_cmds);
- bd->hdmv_suspended = !hdmv_vm_running(bd->hdmv_vm);
- }
- }
-
- return result;
-}
-
static void _process_hdmv_vm_event(BLURAY *bd, HDMV_EVENT *hev)
{
BD_DEBUG(DBG_BLURAY, "HDMV event: %d %d\n", hev->event, hev->param);
More information about the libbluray-devel
mailing list