35 #include "bdnav/clpi_data.h"
38 #define TITLES_FILTER_DUP_TITLE 0x01
39 #define TITLES_FILTER_DUP_CLIP 0x02
41 #define TITLES_RELEVANT \
42 (TITLES_FILTER_DUP_TITLE | TITLES_FILTER_DUP_CLIP)
45 typedef struct bluray BLURAY;
52 #define BD_AACS_CORRUPTED_DISC -1
53 #define BD_AACS_NO_CONFIG -2
54 #define BD_AACS_NO_PK -3
55 #define BD_AACS_NO_CERT -4
56 #define BD_AACS_CERT_REVOKED -5
57 #define BD_AACS_MMC_FAILED -6
71 uint8_t bluray_detected;
74 const char *disc_name;
75 const char *udf_volume_id;
79 uint8_t no_menu_support;
80 uint8_t first_play_supported;
81 uint8_t top_menu_supported;
88 uint32_t num_hdmv_titles;
89 uint32_t num_bdj_titles;
90 uint32_t num_unsupported_titles;
94 uint8_t bdj_supported;
95 uint8_t libjvm_detected;
102 uint8_t video_format;
104 uint8_t content_exist_3D;
105 uint8_t initial_output_mode_preference;
106 uint8_t provider_data[32];
109 uint8_t aacs_detected;
110 uint8_t libaacs_detected;
111 uint8_t aacs_handled;
117 uint8_t bdplus_detected;
118 uint8_t libbdplus_detected;
119 uint8_t bdplus_handled;
122 uint32_t bdplus_date;
125 uint8_t initial_dynamic_range_type;
134 BLURAY_STREAM_TYPE_VIDEO_MPEG1 = 0x01,
135 BLURAY_STREAM_TYPE_VIDEO_MPEG2 = 0x02,
136 BLURAY_STREAM_TYPE_AUDIO_MPEG1 = 0x03,
137 BLURAY_STREAM_TYPE_AUDIO_MPEG2 = 0x04,
138 BLURAY_STREAM_TYPE_AUDIO_LPCM = 0x80,
139 BLURAY_STREAM_TYPE_AUDIO_AC3 = 0x81,
140 BLURAY_STREAM_TYPE_AUDIO_DTS = 0x82,
141 BLURAY_STREAM_TYPE_AUDIO_TRUHD = 0x83,
142 BLURAY_STREAM_TYPE_AUDIO_AC3PLUS = 0x84,
143 BLURAY_STREAM_TYPE_AUDIO_DTSHD = 0x85,
144 BLURAY_STREAM_TYPE_AUDIO_DTSHD_MASTER = 0x86,
145 BLURAY_STREAM_TYPE_VIDEO_VC1 = 0xea,
146 BLURAY_STREAM_TYPE_VIDEO_H264 = 0x1b,
147 BLURAY_STREAM_TYPE_VIDEO_HEVC = 0x24,
148 BLURAY_STREAM_TYPE_SUB_PG = 0x90,
149 BLURAY_STREAM_TYPE_SUB_IG = 0x91,
150 BLURAY_STREAM_TYPE_SUB_TEXT = 0x92,
151 BLURAY_STREAM_TYPE_AUDIO_AC3PLUS_SECONDARY = 0xa1,
152 BLURAY_STREAM_TYPE_AUDIO_DTSHD_SECONDARY = 0xa2
156 BLURAY_VIDEO_FORMAT_480I = 1,
157 BLURAY_VIDEO_FORMAT_576I = 2,
158 BLURAY_VIDEO_FORMAT_480P = 3,
159 BLURAY_VIDEO_FORMAT_1080I = 4,
160 BLURAY_VIDEO_FORMAT_720P = 5,
161 BLURAY_VIDEO_FORMAT_1080P = 6,
162 BLURAY_VIDEO_FORMAT_576P = 7,
163 BLURAY_VIDEO_FORMAT_2160P = 8,
167 BLURAY_VIDEO_RATE_24000_1001 = 1,
168 BLURAY_VIDEO_RATE_24 = 2,
169 BLURAY_VIDEO_RATE_25 = 3,
170 BLURAY_VIDEO_RATE_30000_1001 = 4,
171 BLURAY_VIDEO_RATE_50 = 6,
172 BLURAY_VIDEO_RATE_60000_1001 = 7
176 BLURAY_ASPECT_RATIO_4_3 = 2,
177 BLURAY_ASPECT_RATIO_16_9 = 3
181 BLURAY_AUDIO_FORMAT_MONO = 1,
182 BLURAY_AUDIO_FORMAT_STEREO = 3,
183 BLURAY_AUDIO_FORMAT_MULTI_CHAN = 6,
184 BLURAY_AUDIO_FORMAT_COMBO = 12
189 BLURAY_AUDIO_RATE_48 = 1,
190 BLURAY_AUDIO_RATE_96 = 4,
191 BLURAY_AUDIO_RATE_192 = 5,
192 BLURAY_AUDIO_RATE_192_COMBO = 12,
194 BLURAY_AUDIO_RATE_96_COMBO = 14
199 BLURAY_TEXT_CHAR_CODE_UTF8 = 0x01,
200 BLURAY_TEXT_CHAR_CODE_UTF16BE = 0x02,
201 BLURAY_TEXT_CHAR_CODE_SHIFT_JIS = 0x03,
202 BLURAY_TEXT_CHAR_CODE_EUC_KR = 0x04,
203 BLURAY_TEXT_CHAR_CODE_GB18030_20001 = 0x05,
204 BLURAY_TEXT_CHAR_CODE_CN_GB = 0x06,
205 BLURAY_TEXT_CHAR_CODE_BIG5 = 0x07
209 BLURAY_STILL_NONE = 0x00,
210 BLURAY_STILL_TIME = 0x01,
211 BLURAY_STILL_INFINITE = 0x02,
215 BLURAY_MARK_ENTRY = 0x01,
216 BLURAY_MARK_LINK = 0x02,
220 BLURAY_DYNAMIC_RANGE_SDR = 0,
221 BLURAY_DYNAMIC_RANGE_HDR10 = 1,
222 BLURAY_DYNAMIC_RANGE_DOLBY_VISION = 2
223 } bd_dynamic_range_type_e;
241 uint8_t video_stream_count;
242 uint8_t audio_stream_count;
243 uint8_t pg_stream_count;
244 uint8_t ig_stream_count;
245 uint8_t sec_audio_stream_count;
246 uint8_t sec_video_stream_count;
283 uint32_t chapter_count;
289 uint8_t mvc_base_view_r_flag;
297 uint8_t num_channels;
299 const int16_t *samples;
322 BLURAY *
bd_open(
const char *device_path,
const char *keyfile_path);
341 int bd_open_disc(BLURAY *bd,
const char *device_path,
const char *keyfile_path);
352 void *read_blocks_handle,
353 int (*read_blocks)(
void *handle,
void *buf,
int lba,
int num_blocks));
366 int bd_open_files(BLURAY *bd,
368 struct bd_dir_s *(*open_dir)(
void *handle,
const char *rel_path),
369 struct bd_file_s *(*open_file)(
void *handle,
const char *rel_path));
401 const struct meta_dl *bd_get_meta(BLURAY *bd);
436 uint32_t
bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length);
515 int bd_read(BLURAY *bd,
unsigned char *buf,
int len);
612 #define BLURAY_AUDIO_STREAM 0
613 #define BLURAY_PG_TEXTST_STREAM 1
615 void bd_select_stream(BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag);
685 BLURAY_PLAYER_SETTING_AUDIO_LANG = 16,
686 BLURAY_PLAYER_SETTING_PG_LANG = 17,
687 BLURAY_PLAYER_SETTING_MENU_LANG = 18,
688 BLURAY_PLAYER_SETTING_COUNTRY_CODE = 19,
689 BLURAY_PLAYER_SETTING_REGION_CODE = 20,
690 BLURAY_PLAYER_SETTING_OUTPUT_PREFER = 21,
691 BLURAY_PLAYER_SETTING_PARENTAL = 13,
692 BLURAY_PLAYER_SETTING_AUDIO_CAP = 15,
693 BLURAY_PLAYER_SETTING_VIDEO_CAP = 29,
694 BLURAY_PLAYER_SETTING_DISPLAY_CAP = 23,
695 BLURAY_PLAYER_SETTING_3D_CAP = 24,
696 BLURAY_PLAYER_SETTING_UHD_CAP = 25,
697 BLURAY_PLAYER_SETTING_UHD_DISPLAY_CAP = 26,
698 BLURAY_PLAYER_SETTING_HDR_PREFERENCE = 27,
699 BLURAY_PLAYER_SETTING_SDR_CONV_PREFER = 28,
700 BLURAY_PLAYER_SETTING_TEXT_CAP = 30,
701 BLURAY_PLAYER_SETTING_PLAYER_PROFILE = 31,
703 BLURAY_PLAYER_SETTING_DECODE_PG = 0x100,
704 BLURAY_PLAYER_SETTING_PERSISTENT_STORAGE = 0x101,
706 BLURAY_PLAYER_PERSISTENT_ROOT = 0x200,
707 BLURAY_PLAYER_CACHE_ROOT = 0x201,
708 BLURAY_PLAYER_JAVA_HOME = 0x202,
724 int bd_set_player_setting_str(BLURAY *bd, uint32_t idx,
const char *value);
740 BD_EVENT_READ_ERROR = 2,
741 BD_EVENT_ENCRYPTED = 3,
749 BD_EVENT_PLAYLIST = 6,
750 BD_EVENT_PLAYITEM = 7,
751 BD_EVENT_CHAPTER = 8,
752 BD_EVENT_PLAYMARK = 9,
753 BD_EVENT_END_OF_TITLE = 10,
759 BD_EVENT_AUDIO_STREAM = 11,
760 BD_EVENT_IG_STREAM = 12,
761 BD_EVENT_PG_TEXTST_STREAM = 13,
762 BD_EVENT_PIP_PG_TEXTST_STREAM = 14,
763 BD_EVENT_SECONDARY_AUDIO_STREAM = 15,
764 BD_EVENT_SECONDARY_VIDEO_STREAM = 16,
766 BD_EVENT_PG_TEXTST = 17,
767 BD_EVENT_PIP_PG_TEXTST = 18,
768 BD_EVENT_SECONDARY_AUDIO = 19,
769 BD_EVENT_SECONDARY_VIDEO = 20,
770 BD_EVENT_SECONDARY_VIDEO_SIZE = 21,
777 BD_EVENT_PLAYLIST_STOP = 22,
780 BD_EVENT_DISCONTINUITY = 23,
790 BD_EVENT_STILL_TIME = 26,
793 BD_EVENT_SOUND_EFFECT = 27,
810 BD_EVENT_STEREOSCOPIC_STATUS = 31,
813 BD_EVENT_KEY_INTEREST_TABLE = 32,
816 BD_EVENT_UO_MASK_CHANGED = 33,
828 #define BD_ERROR_HDMV 1
829 #define BD_ERROR_BDJ 2
832 #define BD_ERROR_AACS 3
833 #define BD_ERROR_BDPLUS 4
836 #define BLURAY_TITLE_FIRST_PLAY 0xffff
837 #define BLURAY_TITLE_TOP_MENU 0
840 #define BLURAY_KIT_PLAY 0x1
841 #define BLURAY_KIT_STOP 0x2
842 #define BLURAY_KIT_FFW 0x4
843 #define BLURAY_KIT_REW 0x8
844 #define BLURAY_KIT_TRACK_NEXT 0x10
845 #define BLURAY_KIT_TRACK_PREV 0x20
846 #define BLURAY_KIT_PAUSE 0x40
847 #define BLURAY_KIT_STILL_OFF 0x80
848 #define BLURAY_KIT_SEC_AUDIO 0x100
849 #define BLURAY_KIT_SEC_VIDEO 0x200
850 #define BLURAY_KIT_PG_TEXTST 0x400
853 #define BLURAY_UO_MENU_CALL 0x1
854 #define BLURAY_UO_TITLE_SEARCH 0x2
866 const char *bd_event_name(uint32_t event);
873 struct bd_argb_overlay_s;
874 struct bd_argb_buffer_s;
875 typedef void (*bd_overlay_proc_f)(
void *,
const struct bd_overlay_s *
const);
876 typedef void (*bd_argb_overlay_proc_f)(
void *,
const struct bd_argb_overlay_s *
const);
1030 #define BLURAY_RATE_PAUSED 0
1031 #define BLURAY_RATE_NORMAL 90000
1032 int bd_set_rate(BLURAY *bd, uint32_t rate);
1081 struct clpi_cl *bd_read_clpi(
const char *clpi_file);
1093 struct mpls_pl *bd_read_mpls(
const char *mpls_file);
1094 void bd_free_mpls(
struct mpls_pl *);
1096 struct mobj_objects;
1097 struct mobj_objects *bd_read_mobj(
const char *mobj_file);
1098 void bd_free_mobj(
struct mobj_objects *);
1101 struct bdjo_data *bd_read_bdjo(
const char *bdjo_file);
1102 void bd_free_bdjo(
struct bdjo_data *);
1106 int bd_start_bdj(BLURAY *bd,
const char* start_object);
1107 void bd_stop_bdj(BLURAY *bd);
1142 struct bd_file_s *bd_open_file_dec(BLURAY *,
const char *path);
1155 int bd_get_clip_infos(BLURAY *bd,
unsigned clip, uint64_t *clip_start_time, uint64_t *stream_start_time, uint64_t *pos, uint64_t *duration);
int64_t bd_chapter_pos(BLURAY *bd, unsigned chapter)
void bd_set_scr(BLURAY *bd, int64_t pts)
int64_t bd_seek_mark(BLURAY *bd, unsigned mark)
const BLURAY_DISC_INFO * bd_get_disc_info(BLURAY *bd)
int bd_read_file(BLURAY *, const char *path, void **data, int64_t *size)
BLURAY_TITLE_INFO * bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned angle)
uint64_t bd_get_title_size(BLURAY *bd)
struct mpls_pl * bd_get_title_mpls(BLURAY *bd)
int64_t bd_find_seek_point(BLURAY *bd, uint64_t tick)
struct bd_dir_s * bd_open_dir(BLURAY *, const char *dir)
int64_t bd_seek_playitem(BLURAY *bd, unsigned clip_ref)
int64_t bd_seek_time(BLURAY *bd, uint64_t tick)
uint32_t bd_get_current_title(BLURAY *bd)
void bd_free_clpi(struct clpi_cl *cl)
int bd_get_event(BLURAY *bd, BD_EVENT *event)
int bd_read_skip_still(BLURAY *bd)
void bd_free_title_info(BLURAY_TITLE_INFO *title_info)
BLURAY_TITLE_INFO * bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle)
int bd_get_main_title(BLURAY *bd)
BLURAY * bd_open(const char *device_path, const char *keyfile_path)
int bd_read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event)
int bd_read(BLURAY *bd, unsigned char *buf, int len)
struct clpi_cl * bd_get_clpi(BLURAY *bd, unsigned clip_ref)
uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length)
unsigned bd_get_current_angle(BLURAY *bd)
void bd_close(BLURAY *bd)
void bd_seamless_angle_change(BLURAY *bd, unsigned angle)
int bd_select_angle(BLURAY *bd, unsigned angle)
int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value)
int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter)
int bd_open_disc(BLURAY *bd, const char *device_path, const char *keyfile_path)
uint32_t bd_get_current_chapter(BLURAY *bd)
int bd_get_clip_infos(BLURAY *bd, unsigned clip, uint64_t *clip_start_time, uint64_t *stream_start_time, uint64_t *pos, uint64_t *duration)
void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func)
int bd_select_title(BLURAY *bd, uint32_t title)
uint64_t bd_tell(BLURAY *bd)
int bd_get_meta_file(BLURAY *bd, const char *file_name, void **data, int64_t *size)
int64_t bd_seek(BLURAY *bd, uint64_t pos)
void bd_get_version(int *major, int *minor, int *micro)
int bd_user_input(BLURAY *bd, int64_t pts, uint32_t key)
int bd_select_playlist(BLURAY *bd, uint32_t playlist)
int bd_open_stream(BLURAY *bd, void *read_blocks_handle, int(*read_blocks)(void *handle, void *buf, int lba, int num_blocks))
void bd_register_argb_overlay_proc(BLURAY *bd, void *handle, bd_argb_overlay_proc_f func, struct bd_argb_buffer_s *buf)
uint64_t bd_tell_time(BLURAY *bd)
int bd_menu_call(BLURAY *bd, int64_t pts)
int bd_play_title(BLURAY *bd, unsigned title)
int bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y)
int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, struct bd_sound_effect *effect)