libbluray | branch: master | hpi1 <[email protected]> | Wed Aug 29 15:19:33 2012 +0300| [d8dc303d2aa7b584cbf59ced3a76f1e0f75a0369] | committer: hpi1
Implement part of 3D HDMV instructions > http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=d8dc303d2aa7b584cbf59ced3a76f1e0f75a0369 --- src/libbluray/hdmv/hdmv_vm.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/libbluray/hdmv/hdmv_vm.c b/src/libbluray/hdmv/hdmv_vm.c index 715ed3a..9f88942 100644 --- a/src/libbluray/hdmv/hdmv_vm.c +++ b/src/libbluray/hdmv/hdmv_vm.c @@ -651,6 +651,18 @@ static void _set_sec_stream(HDMV_VM *p, uint32_t dst, uint32_t src) bd_psr_unlock(p->regs); } +static void _set_stream_ss(HDMV_VM *p, uint32_t dst, uint32_t src) +{ + BD_DEBUG(DBG_HDMV, "_set_stream_ss(0x%x, 0x%x)\n", dst, src); + + if (!(bd_psr_read(p->regs, PSR_3D_STATUS) & 1)) { + BD_DEBUG(DBG_HDMV, "_set_stream_ss ignored (PSR22 indicates 2D mode)\n"); + return; + } + + BD_DEBUG(DBG_HDMV, "_set_stream_ss(0x%x, 0x%x) unimplemented\n", dst, src); +} + /* * SET/SYSTEM navigation control */ @@ -712,6 +724,33 @@ static void _popup_off(HDMV_VM *p) } /* + * SET/SYSTEM 3D mode + */ + +static void _set_output_mode(HDMV_VM *p, uint32_t dst) +{ + if ((bd_psr_read(p->regs, PSR_PROFILE_VERSION) & 0x130240) != 0x130240) { + BD_DEBUG(DBG_HDMV, "_set_output_mode ignored (not running as profile 5 player)\n"); + return; + } + + bd_psr_lock(p->regs); + + uint32_t psr22 = bd_psr_read(p->regs, PSR_3D_STATUS); + + /* update output mode (bit 0). PSR22 bits 1 and 2 are subtitle alignment (_set_stream_ss()) */ + if (dst & 1) { + psr22 |= 1; + } else { + psr22 &= ~1; + } + + bd_psr_write(p->regs, PSR_3D_STATUS, psr22); + + bd_psr_unlock(p->regs); +} + +/* * navigation timer */ @@ -978,6 +1017,8 @@ static int _hdmv_step(HDMV_VM *p) case INSN_POPUP_OFF: _popup_off (p); break; case INSN_STILL_ON: _set_still_mode (p, 1); break; case INSN_STILL_OFF: _set_still_mode (p, 0); break; + case INSN_SET_OUTPUT_MODE: _set_output_mode(p, dst); break; + case INSN_SET_STREAM_SS: _set_stream_ss (p, dst, src); break; default: BD_DEBUG(DBG_HDMV|DBG_CRIT, "[unknown SETSYSTEM option in opcode 0x%08x] ", *(uint32_t*)insn); break; _______________________________________________ libbluray-devel mailing list [email protected] http://mailman.videolan.org/listinfo/libbluray-devel
