00001 /* 00002 * This file is part of libbluray 00003 * Copyright (C) 2009-2010 John Stebbins 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(_MPLS_PARSE_H_) 00021 #define _MPLS_PARSE_H_ 00022 00023 #include "uo_mask_table.h" 00024 00025 #include <util/attributes.h> 00026 00027 #include <stdint.h> 00028 00029 #ifdef __cplusplus 00030 extern "C" { 00031 #endif 00032 00033 #define BD_MARK_ENTRY 0x01 00034 #define BD_MARK_LINK 0x02 00035 00036 typedef struct 00037 { 00038 uint8_t stream_type; 00039 uint8_t coding_type; 00040 uint16_t pid; 00041 uint8_t subpath_id; 00042 uint8_t subclip_id; 00043 uint8_t format; 00044 uint8_t rate; 00045 uint8_t char_code; 00046 uint8_t lang[4]; 00047 // Secondary audio specific fields 00048 uint8_t sa_num_primary_audio_ref; 00049 uint8_t *sa_primary_audio_ref; 00050 // Secondary video specific fields 00051 uint8_t sv_num_secondary_audio_ref; 00052 uint8_t sv_num_pip_pg_ref; 00053 uint8_t *sv_secondary_audio_ref; 00054 uint8_t *sv_pip_pg_ref; 00055 } MPLS_STREAM; 00056 00057 typedef struct 00058 { 00059 uint8_t num_video; 00060 uint8_t num_audio; 00061 uint8_t num_pg; 00062 uint8_t num_ig; 00063 uint8_t num_secondary_audio; 00064 uint8_t num_secondary_video; 00065 uint8_t num_pip_pg; 00066 MPLS_STREAM *video; 00067 MPLS_STREAM *audio; 00068 MPLS_STREAM *pg; 00069 MPLS_STREAM *ig; 00070 MPLS_STREAM *secondary_audio; 00071 MPLS_STREAM *secondary_video; 00072 } MPLS_STN; 00073 00074 typedef struct 00075 { 00076 char clip_id[6]; 00077 char codec_id[5]; 00078 uint8_t stc_id; 00079 } MPLS_CLIP; 00080 00081 typedef struct 00082 { 00083 uint8_t is_multi_angle; 00084 uint8_t connection_condition; 00085 uint32_t in_time; 00086 uint32_t out_time; 00087 BD_UO_MASK uo_mask; 00088 uint8_t random_access_flag; 00089 uint8_t still_mode; 00090 uint16_t still_time; 00091 uint8_t angle_count; 00092 uint8_t is_different_audio; 00093 uint8_t is_seamless_angle; 00094 MPLS_CLIP *clip; 00095 MPLS_STN stn; 00096 } MPLS_PI; 00097 00098 typedef struct 00099 { 00100 uint8_t mark_id; 00101 uint8_t mark_type; 00102 uint16_t play_item_ref; 00103 uint32_t time; 00104 uint16_t entry_es_pid; 00105 uint32_t duration; 00106 } MPLS_PLM; 00107 00108 typedef struct 00109 { 00110 uint8_t playback_type; 00111 uint16_t playback_count; 00112 BD_UO_MASK uo_mask; 00113 uint8_t random_access_flag; 00114 uint8_t audio_mix_flag; 00115 uint8_t lossless_bypass_flag; 00116 } MPLS_AI; 00117 00118 typedef struct 00119 { 00120 uint8_t connection_condition; 00121 uint8_t is_multi_clip; 00122 uint32_t in_time; 00123 uint32_t out_time; 00124 uint16_t sync_play_item_id; 00125 uint32_t sync_pts; 00126 uint8_t clip_count; 00127 MPLS_CLIP *clip; 00128 } MPLS_SUB_PI; 00129 00130 typedef struct 00131 { 00132 uint8_t type; 00133 uint8_t is_repeat; 00134 uint8_t sub_playitem_count; 00135 MPLS_SUB_PI *sub_play_item; 00136 } MPLS_SUB; 00137 00138 typedef struct 00139 { 00140 uint32_t type_indicator; 00141 uint32_t type_indicator2; 00142 uint32_t list_pos; 00143 uint32_t mark_pos; 00144 uint32_t ext_pos; 00145 MPLS_AI app_info; 00146 uint16_t list_count; 00147 uint16_t sub_count; 00148 uint16_t mark_count; 00149 MPLS_PI *play_item; 00150 MPLS_SUB *sub_path; 00151 MPLS_PLM *play_mark; 00152 } MPLS_PL; 00153 00154 00155 BD_PRIVATE MPLS_PL* mpls_parse(char *path, int verbose); 00156 BD_PRIVATE void mpls_free(MPLS_PL *pl); 00157 00158 BD_PRIVATE int mpls_parse_uo(uint8_t *buf, BD_UO_MASK *uo); 00159 00160 #ifdef __cplusplus 00161 }; 00162 #endif 00163 00164 #endif // _MPLS_PARSE_H_
1.6.3