00001 /* 00002 * This file is part of libbluray 00003 * Copyright (C) 2010 hpi1 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library. If not, see 00017 * <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #if !defined(_MOBJ_PARSE_H_) 00021 #define _MOBJ_PARSE_H_ 00022 00023 #include <util/attributes.h> 00024 00025 #include <stdint.h> 00026 00027 typedef struct { 00028 uint8_t op_cnt : 3; /* operand count */ 00029 uint8_t grp : 2; /* command group */ 00030 uint8_t sub_grp : 3; /* command sub-group */ 00031 00032 uint8_t imm_op1 : 1; /* I-flag for operand 1 */ 00033 uint8_t imm_op2 : 1; /* I-flag for operand 2 */ 00034 uint8_t reserved1 : 2; 00035 uint8_t branch_opt : 4; /* branch option */ 00036 00037 uint8_t reserved2 : 4; 00038 uint8_t cmp_opt : 4; /* compare option */ 00039 00040 uint8_t reserved3 : 3; 00041 uint8_t set_opt : 5; /* set option */ 00042 } HDMV_INSN; 00043 00044 typedef struct bd_mobj_cmd_s { 00045 HDMV_INSN insn; 00046 uint32_t dst; 00047 uint32_t src; 00048 } MOBJ_CMD; 00049 00050 typedef struct { 00051 uint8_t resume_intention_flag : 1; 00052 uint8_t menu_call_mask : 1; 00053 uint8_t title_search_mask : 1; 00054 00055 uint16_t num_cmds; 00056 MOBJ_CMD *cmds; 00057 } MOBJ_OBJECT; 00058 00059 typedef struct { 00060 uint16_t num_objects; 00061 MOBJ_OBJECT objects[]; 00062 } MOBJ_OBJECTS; 00063 00064 00065 BD_PRIVATE MOBJ_OBJECTS* mobj_parse(const char *path); /* parse MovieObject.bdmv */ 00066 BD_PRIVATE void mobj_parse_cmd(uint8_t *buf, MOBJ_CMD *cmd); 00067 BD_PRIVATE void mobj_free(MOBJ_OBJECTS **index); 00068 00069 BD_PRIVATE int mobj_sprint_cmd(char *buf, MOBJ_CMD *cmd); /* print MOBJ_CMD to string. buf is expected to be 256 bytes. */ 00070 00071 #endif // _MOBJ_PARSE_H_
1.6.3