37 #define TITLES_FILTER_DUP_TITLE 0x01
38 #define TITLES_FILTER_DUP_CLIP 0x02
40 #define TITLES_RELEVANT \
41 (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
72 uint8_t bluray_detected;
75 const char *disc_name;
76 const char *udf_volume_id;
80 uint8_t no_menu_support;
81 uint8_t first_play_supported;
82 uint8_t top_menu_supported;
89 uint32_t num_hdmv_titles;
90 uint32_t num_bdj_titles;
91 uint32_t num_unsupported_titles;
95 uint8_t bdj_supported;
96 uint8_t libjvm_detected;
100 char bdj_disc_id[33];
103 uint8_t video_format;
105 uint8_t content_exist_3D;
106 uint8_t initial_output_mode_preference;
107 uint8_t provider_data[32];
110 uint8_t aacs_detected;
111 uint8_t libaacs_detected;
112 uint8_t aacs_handled;
118 uint8_t bdplus_detected;
119 uint8_t libbdplus_detected;
120 uint8_t bdplus_handled;
123 uint32_t bdplus_date;
126 uint8_t initial_dynamic_range_type;
136 BLURAY_STREAM_TYPE_VIDEO_MPEG1 = 0x01,
137 BLURAY_STREAM_TYPE_VIDEO_MPEG2 = 0x02,
138 BLURAY_STREAM_TYPE_AUDIO_MPEG1 = 0x03,
139 BLURAY_STREAM_TYPE_AUDIO_MPEG2 = 0x04,
140 BLURAY_STREAM_TYPE_AUDIO_LPCM = 0x80,
141 BLURAY_STREAM_TYPE_AUDIO_AC3 = 0x81,
142 BLURAY_STREAM_TYPE_AUDIO_DTS = 0x82,
143 BLURAY_STREAM_TYPE_AUDIO_TRUHD = 0x83,
144 BLURAY_STREAM_TYPE_AUDIO_AC3PLUS = 0x84,
145 BLURAY_STREAM_TYPE_AUDIO_DTSHD = 0x85,
146 BLURAY_STREAM_TYPE_AUDIO_DTSHD_MASTER = 0x86,
147 BLURAY_STREAM_TYPE_VIDEO_VC1 = 0xea,
148 BLURAY_STREAM_TYPE_VIDEO_H264 = 0x1b,
149 BLURAY_STREAM_TYPE_VIDEO_HEVC = 0x24,
150 BLURAY_STREAM_TYPE_SUB_PG = 0x90,
151 BLURAY_STREAM_TYPE_SUB_IG = 0x91,
152 BLURAY_STREAM_TYPE_SUB_TEXT = 0x92,
153 BLURAY_STREAM_TYPE_AUDIO_AC3PLUS_SECONDARY = 0xa1,
154 BLURAY_STREAM_TYPE_AUDIO_DTSHD_SECONDARY = 0xa2
181 BLURAY_ASPECT_RATIO_4_3 = 2,
182 BLURAY_ASPECT_RATIO_16_9 = 3
187 BLURAY_AUDIO_FORMAT_MONO = 1,
188 BLURAY_AUDIO_FORMAT_STEREO = 3,
189 BLURAY_AUDIO_FORMAT_MULTI_CHAN = 6,
190 BLURAY_AUDIO_FORMAT_COMBO = 12
195 BLURAY_AUDIO_RATE_48 = 1,
196 BLURAY_AUDIO_RATE_96 = 4,
197 BLURAY_AUDIO_RATE_192 = 5,
198 BLURAY_AUDIO_RATE_192_COMBO = 12,
200 BLURAY_AUDIO_RATE_96_COMBO = 14
206 BLURAY_TEXT_CHAR_CODE_UTF8 = 0x01,
207 BLURAY_TEXT_CHAR_CODE_UTF16BE = 0x02,
208 BLURAY_TEXT_CHAR_CODE_SHIFT_JIS = 0x03,
209 BLURAY_TEXT_CHAR_CODE_EUC_KR = 0x04,
210 BLURAY_TEXT_CHAR_CODE_GB18030_20001 = 0x05,
211 BLURAY_TEXT_CHAR_CODE_CN_GB = 0x06,
212 BLURAY_TEXT_CHAR_CODE_BIG5 = 0x07
230 BLURAY_DYNAMIC_RANGE_SDR = 0,
231 BLURAY_DYNAMIC_RANGE_HDR10 = 1,
232 BLURAY_DYNAMIC_RANGE_DOLBY_VISION = 2
236 typedef struct bd_stream_info {
248 typedef struct bd_clip {
252 uint8_t video_stream_count;
253 uint8_t audio_stream_count;
254 uint8_t pg_stream_count;
255 uint8_t ig_stream_count;
256 uint8_t sec_audio_stream_count;
257 uint8_t sec_video_stream_count;
272 typedef struct bd_chapter {
281 typedef struct bd_mark {
291 typedef struct bd_title_info {
297 uint32_t chapter_count;
303 uint8_t mvc_base_view_r_flag;
307 typedef struct bd_sound_effect {
308 uint8_t num_channels;
310 const int16_t *samples;
344 BLURAY *
bd_open(
const char *device_path,
const char *keyfile_path);
374 void *read_blocks_handle,
375 int (*read_blocks)(
void *handle,
void *buf,
int lba,
int num_blocks));
388 struct bd_dir_s *(*open_dir)(
void *handle,
const char *rel_path),
389 struct bd_file_s *(*open_file)(
void *handle,
const char *rel_path));
623 #define BLURAY_AUDIO_STREAM 0
624 #define BLURAY_PG_TEXTST_STREAM 1
850 #define BD_ERROR_HDMV 1
851 #define BD_ERROR_BDJ 2
854 #define BD_ERROR_AACS 3
855 #define BD_ERROR_BDPLUS 4
858 #define BLURAY_TITLE_FIRST_PLAY 0xffff
859 #define BLURAY_TITLE_TOP_MENU 0
862 #define BLURAY_KIT_PLAY 0x1
863 #define BLURAY_KIT_STOP 0x2
864 #define BLURAY_KIT_FFW 0x4
865 #define BLURAY_KIT_REW 0x8
866 #define BLURAY_KIT_TRACK_NEXT 0x10
867 #define BLURAY_KIT_TRACK_PREV 0x20
868 #define BLURAY_KIT_PAUSE 0x40
869 #define BLURAY_KIT_STILL_OFF 0x80
870 #define BLURAY_KIT_SEC_AUDIO 0x100
871 #define BLURAY_KIT_SEC_VIDEO 0x200
872 #define BLURAY_KIT_PG_TEXTST 0x400
875 #define BLURAY_UO_MENU_CALL 0x1
876 #define BLURAY_UO_TITLE_SEARCH 0x2
886 int bd_get_event(BLURAY *bd, BD_EVENT *event);
902 struct bd_argb_overlay_s;
903 struct bd_argb_buffer_s;
911 typedef void (*
bd_overlay_proc_f)(
void *handle,
const struct bd_overlay_s *
const event);
1075 #define BLURAY_RATE_PAUSED 0
1076 #define BLURAY_RATE_NORMAL 90000
1093 int bd_user_input(BLURAY *bd, int64_t pts, uint32_t key);
1121 struct mobj_objects;
1151 struct mobj_objects *
bd_read_mobj(
const char *mobj_file);
bd_dynamic_range_type_e
Clip dynamic range.
Definition: bluray.h:231
Age for parental control.
Definition: bluray.h:703
current angle, 1...N
Definition: bluray.h:770
bd_video_aspect_e
Stream video aspect ratio.
Definition: bluray.h:182
current chapter, 1...N
Definition: bluray.h:774
SMPTE 296M.
Definition: bluray.h:165
Infinite still.
Definition: bluray.h:221
BT.2020.
Definition: bluray.h:168
uint32_t bd_get_current_chapter(BLURAY *bd)
Get the current chapter.
Fatal error.
Definition: bluray.h:762
struct clpi_cl * bd_read_clpi(const char *clpi_file)
Testing/debugging: Parse clip information (CLPI) file.
1..255, 0xfff = none
Definition: bluray.h:784
discontinuity in the stream (non-seamless connection).
Definition: bluray.h:803
void bd_set_scr(BLURAY *bd, int64_t pts)
Update current pts.
const char * bd_event_name(uint32_tevent)
Get name of event.
Nothing to do.
Definition: bluray.h:824
UHD display capability.
Definition: bluray.h:709
24 Hz
Definition: bluray.h:174
struct bdjo_data * bd_read_bdjo(const char *bdjo_file)
Testing/debugging: Parse BD-J object file (BDJO)
SMPTE 274M.
Definition: bluray.h:166
HDR preference.
Definition: bluray.h:710
void bd_select_stream(BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag)
Select stream (PG / TextST track)
void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func)
Register handler for compressed YUV overlays.
.m2ts file is encrypted and can't be played
Definition: bluray.h:764
void bd_stop_bdj(BLURAY *bd)
Testing/debugging: shutdown BD-J and clean up resources.
50 Hz
Definition: bluray.h:177
0 - PIP, 0xf - fullscreen
Definition: bluray.h:793
no pending events
Definition: bluray.h:756
bd_mark_type_e
Mark type.
Definition: bluray.h:225
Sound effect data.
Definition: bluray.h:309
struct bd_dir_s * bd_open_dir(BLURAY *bd, const char *dir)
Open a directory from BluRay Virtual File System.
int64_t bd_chapter_pos(BLURAY *bd, unsigned chapter)
Find the byte position of a chapter.
int bd_read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event)
Read from currently playing title.
Directory access.
Definition: filesystem.h:125
0 - disable, 1 - enable
Definition: bluray.h:792
1..32, 0xff = none
Definition: bluray.h:787
Video capability.
Definition: bluray.h:705
current title, 1...N (0 = top menu)
Definition: bluray.h:771
bd_video_format_e
Stream video format.
Definition: bluray.h:160
BLURAY * bd_open(const char *device_path, const char *keyfile_path)
Open BluRay disc.
int bd_select_title(BLURAY *bd, uint32_t title)
Select the title from the list created by bd_get_titles()
SDR conversion preference.
Definition: bluray.h:711
int bd_get_main_title(BLURAY *bd)
Get main title Returned number is an index to the list created by bd_get_titles() ...
int64_t bd_seek_mark(BLURAY *bd, unsigned mark)
Seek to a playmark.
Play sound effect.
Definition: bluray.h:816
UHD capability.
Definition: bluray.h:708
bd_audio_rate_e
Stream audio rate.
Definition: bluray.h:196
Output mode preference.
Definition: bluray.h:702
int bd_read_file(BLURAY *bd, const char *path, void **data, int64_t *size)
Read a file from BluRay Virtual File System.
unsigned bd_get_current_angle(BLURAY *bd)
Return the current angle.
bd_player_setting
Player setting.
Definition: bluray.h:696
Initial PG/SPU language.
Definition: bluray.h:698
Playlist information.
Definition: bluray.h:293
uint32_t bd_get_current_title(BLURAY *bd)
Returns the current title index.
SMPTE 293M.
Definition: bluray.h:163
struct mpls_pl * bd_read_mpls(const char *mpls_file)
Testing/debugging: Parse playlist (MPLS) file.
bd_event_e
Event type.
Definition: bluray.h:754
void bd_register_argb_overlay_proc(BLURAY *bd, void *handle, bd_argb_overlay_proc_f func, struct bd_argb_buffer_s *buf)
Register handler for ARGB overlays.
int bd_play_title(BLURAY *bd, unsigned title)
Play a title (from disc index).
void bd_free_bdjo(struct bdjo_data *)
Testing/debugging: Free parsed BDJO object.
current play item, 0...N-1
Definition: bluray.h:773
HDMV VM or JVM stopped playlist playback.
Definition: bluray.h:800
int bd_open_disc(BLURAY *bd, const char *device_path, const char *keyfile_path)
Open BluRay disc.
int bd_select_angle(BLURAY *bd, unsigned angle)
Set the angle to play.
void bd_close(BLURAY *bd)
Close BluRay disc.
Initial audio language.
Definition: bluray.h:697
Reading of .m2ts aligned unit failed.
Definition: bluray.h:763
uint64_t bd_get_title_size(BLURAY *bd)
Returns file size in bytes of currently selected title, 0 in no title selected.
int bd_get_meta_file(BLURAY *bd, const char *file_name, void **data, int64_t *size)
Read metadata file from BluRay disc.
Enable/disable BD-J persistent storage.
Definition: bluray.h:716
int bd_open_files(BLURAY *bd, void *handle, struct bd_dir_s *(*open_dir)(void *handle, const char *rel_path), struct bd_file_s *(*open_file)(void *handle, const char *rel_path))
Open BluRay disc.
struct clpi_cl * bd_get_clpi(BLURAY *bd, unsigned clip_ref)
Get copy of clip information for requested playitem.
Root path to the BD_J persistent storage location.
Definition: bluray.h:718
playmark reached
Definition: bluray.h:775
1..32, 0xff = none
Definition: bluray.h:786
struct meta_dl * bd_get_meta(BLURAY *bd)
Get meta information about current BluRay disc.
59.94 Hz
Definition: bluray.h:178
25 Hz
Definition: bluray.h:175
BluRay disc information.
Definition: bluray.h:73
3D
Definition: bluray.h:833
1..255, 0xfff = none
Definition: bluray.h:785
bd_still_mode_e
Clip still mode type.
Definition: bluray.h:218
int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value)
Update player setting.
3D capability.
Definition: bluray.h:707
Display capability.
Definition: bluray.h:706
int bd_menu_call(BLURAY *bd, int64_t pts)
Open BluRay disc Top Menu.
bd_audio_format_e
Stream audio format.
Definition: bluray.h:188
Audio capability.
Definition: bluray.h:704
int bd_open_stream(BLURAY *bd, void *read_blocks_handle, int(*read_blocks)(void *handle, void *buf, int lba, int num_blocks))
Open BluRay disc.
const BLURAY_DISC_INFO * bd_get_disc_info(BLURAY *bd)
Get information about current BluRay disc.
29.97 Hz
Definition: bluray.h:176
Pop-Up menu available.
Definition: bluray.h:827
1..32
Definition: bluray.h:783
BLURAY_TITLE_INFO * bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned angle)
Get information about a title.
BD-J key interest table changed.
Definition: bluray.h:836
HDMV VM or JVM seeked the stream.
Definition: bluray.h:806
struct mobj_objects * bd_read_mobj(const char *mobj_file)
Testing/debugging: Parse movie objects (MOBJ) file.
0 - disable, 1 - enable
Definition: bluray.h:790
File access.
Definition: filesystem.h:42
uint64_t bd_tell(BLURAY *bd)
Return current pos.
23.976 Hz
Definition: bluray.h:173
bd_char_code_e
Text subtitle charset.
Definition: bluray.h:207
end of title reached
Definition: bluray.h:776
Root path to the BD_J cache storage location.
Definition: bluray.h:719
void(* bd_overlay_proc_f)(void *handle, const struct bd_overlay_s *const event)
YUV overlay handler function type.
Definition: bluray.h:913
int bd_read_skip_still(BLURAY *bd)
Continue reading after still mode clip.
int bd_read(BLURAY *bd, unsigned char *buf, int len)
Read from currently selected title file, decrypt if possible.
Playmark information.
Definition: bluray.h:283
Still playback for fixed time.
Definition: bluray.h:220
Still playback for n seconds (reached end of still mode play item).
Definition: bluray.h:813
bd_stream_type_e
Stream video coding type.
Definition: bluray.h:137
int64_t bd_seek_playitem(BLURAY *bd, unsigned clip_ref)
Seek to a playitem.
Chapter entry.
Definition: bluray.h:274
1..32, 0xff = none
Definition: bluray.h:782
Location of JRE.
Definition: bluray.h:720
uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length)
Get number of titles (playlists)
BLURAY_TITLE_INFO * bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle)
Get information about a playlist.
entry mark for chapter search
Definition: bluray.h:226
int bd_play(BLURAY *bd)
Start playing disc with on-disc menus.
SMPTE 274M.
Definition: bluray.h:164
UO mask changed.
Definition: bluray.h:839
ITU-R BT.601-4.
Definition: bluray.h:162
uint64_t bd_tell_time(BLURAY *bd)
Return current time.
void bd_seamless_angle_change(BLURAY *bd, unsigned angle)
Initiate seamless angle change.
int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *value)
Update player setting (string)
Clip substream information.
Definition: bluray.h:238
0 - disable, 1 - enable
Definition: bluray.h:791
still playback (pause)
Definition: bluray.h:809
Clip information.
Definition: bluray.h:250
void(* bd_argb_overlay_proc_f)(void *handle, const struct bd_argb_overlay_s *const event)
ARGB overlay handler function type.
Definition: bluray.h:921
Player region code.
Definition: bluray.h:701
int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, struct bd_sound_effect *effect)
Get sound effect.
int64_t bd_seek(BLURAY *bd, uint64_t pos)
Seek to pos in currently selected title.
HDMV / BD-J title information.
Definition: bluray.h:62
Player profile and version.
Definition: bluray.h:713
void bd_get_version(int *major, int *minor, int *micro)
Get libbluray version.
void bd_free_mobj(struct mobj_objects *)
Testing/debugging: Free parsed movie objects.
No still (normal playback)
Definition: bluray.h:219
struct bd_file_s * bd_open_file_dec(BLURAY *bd, const char *path)
Open a file from BluRay Virtual File System.
current playlist (xxxxx.mpls)
Definition: bluray.h:772
0 - disable, 1 - enable
Definition: bluray.h:789
ITU-R BT.1358.
Definition: bluray.h:167
int bd_select_playlist(BLURAY *bd, uint32_t playlist)
Select a playlist.
bd_video_rate_e
Stream video frame rate.
Definition: bluray.h:172
Player country code.
Definition: bluray.h:700
ITU-R BT.601-5.
Definition: bluray.h:161
link point
Definition: bluray.h:227
Enable/disable PG (subtitle) decoder.
Definition: bluray.h:715
void bd_free_title_info(BLURAY_TITLE_INFO *title_info)
Free BLURAY_TITLE_INFO object.
void bd_free_clpi(struct clpi_cl *cl)
Free CLPI_CL object.
struct bluray BLURAY
This structure is opaque.
Definition: bluray.h:47
int bd_set_rate(BLURAY *bd, uint32_t rate)
Set current playback rate.
Initial menu language.
Definition: bluray.h:699
void bd_free_mpls(struct mpls_pl *)
Testing/debugging: Free parsed playlist.
int bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y)
Select menu button at location (x,y).
Event.
Definition: bluray.h:846
int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter)
Seek to a chapter.
int64_t bd_seek_time(BLURAY *bd, uint64_t tick)
Seek to specific time in 90Khz ticks.
Interactive menu visible.
Definition: bluray.h:830
BLURAY * bd_init(void)
Initialize BLURAY object.
int bd_start_bdj(BLURAY *bd, const char *start_object)
Testing/debugging: start BD-J from the specified BD-J object (should be a 5 character string) ...
Text Subtitle capability.
Definition: bluray.h:712