libbluray
Loading...
Searching...
No Matches
bluray.h
Go to the documentation of this file.
1/*
2 * This file is part of libbluray
3 * Copyright (C) 2009-2010 Obliter0n
4 * Copyright (C) 2009-2010 John Stebbins
5 * Copyright (C) 2010-2017 Petri Hintukainen
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library. If not, see
19 * <http://www.gnu.org/licenses/>.
20 */
21
26
27#ifndef BLURAY_H_
28#define BLURAY_H_
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include <stdint.h>
35
36#ifdef BLURAY_API_EXPORT
37#include "util/attributes.h"
38#elif !defined(BD_PUBLIC)
39#define BD_PUBLIC
40#endif
41
42#define TITLES_ALL 0
43#define TITLES_FILTER_DUP_TITLE 0x01
44#define TITLES_FILTER_DUP_CLIP 0x02
46#define TITLES_RELEVANT \
47 (TITLES_FILTER_DUP_TITLE | TITLES_FILTER_DUP_CLIP)
48
49
51typedef struct bluray BLURAY;
52
53/*
54 * Disc info
55 */
56
57/* AACS error codes */
58#define BD_AACS_CORRUPTED_DISC -1
59#define BD_AACS_NO_CONFIG -2
60#define BD_AACS_NO_PK -3
61#define BD_AACS_NO_CERT -4
62#define BD_AACS_CERT_REVOKED -5
63#define BD_AACS_MMC_FAILED -6
64
66typedef struct {
67 const char *name;
68 uint8_t interactive;
69 uint8_t accessible;
70 uint8_t hidden;
71
72 uint8_t bdj;
73 uint32_t id_ref;
75
77typedef struct {
79
80 /* Disc ID */
81 const char *disc_name;
82 const char *udf_volume_id;
83 uint8_t disc_id[20];
84
89
90 uint32_t num_titles;
91 const BLURAY_TITLE *const *titles;
94
95 uint32_t num_hdmv_titles;
96 uint32_t num_bdj_titles;
98
100 uint8_t bdj_detected;
103 uint8_t bdj_handled;
104
105 char bdj_org_id[9];
106 char bdj_disc_id[33];
107
108 /* disc application info */
109 uint8_t video_format;
110 uint8_t frame_rate;
113 uint8_t provider_data[32];
114
115 /* AACS info (valid only if disc uses AACS) */
118 uint8_t aacs_handled;
119
122
123 /* BD+ info (valid only if disc uses BD+) */
127
128 uint8_t bdplus_gen;
129 uint32_t bdplus_date;
130
131 /* disc application info (libbluray > 1.2.0) */
133
135
136/*
137 * Playlist info
138 */
139
141typedef enum {
142 BLURAY_STREAM_TYPE_VIDEO_MPEG1 = 0x01,
143 BLURAY_STREAM_TYPE_VIDEO_MPEG2 = 0x02,
144 BLURAY_STREAM_TYPE_AUDIO_MPEG1 = 0x03,
145 BLURAY_STREAM_TYPE_AUDIO_MPEG2 = 0x04,
146 BLURAY_STREAM_TYPE_AUDIO_LPCM = 0x80,
147 BLURAY_STREAM_TYPE_AUDIO_AC3 = 0x81,
148 BLURAY_STREAM_TYPE_AUDIO_DTS = 0x82,
149 BLURAY_STREAM_TYPE_AUDIO_TRUHD = 0x83,
150 BLURAY_STREAM_TYPE_AUDIO_AC3PLUS = 0x84,
151 BLURAY_STREAM_TYPE_AUDIO_DTSHD = 0x85,
152 BLURAY_STREAM_TYPE_AUDIO_DTSHD_MASTER = 0x86,
153 BLURAY_STREAM_TYPE_VIDEO_VC1 = 0xea,
154 BLURAY_STREAM_TYPE_VIDEO_H264 = 0x1b,
155 BLURAY_STREAM_TYPE_VIDEO_HEVC = 0x24,
156 BLURAY_STREAM_TYPE_SUB_PG = 0x90,
157 BLURAY_STREAM_TYPE_SUB_IG = 0x91,
158 BLURAY_STREAM_TYPE_SUB_TEXT = 0x92,
159 BLURAY_STREAM_TYPE_AUDIO_AC3PLUS_SECONDARY = 0xa1,
160 BLURAY_STREAM_TYPE_AUDIO_DTSHD_SECONDARY = 0xa2
162
174
184
186typedef enum {
187 BLURAY_ASPECT_RATIO_4_3 = 2,
188 BLURAY_ASPECT_RATIO_16_9 = 3
190
192typedef enum {
193 BLURAY_AUDIO_FORMAT_MONO = 1,
194 BLURAY_AUDIO_FORMAT_STEREO = 3,
195 BLURAY_AUDIO_FORMAT_MULTI_CHAN = 6,
196 BLURAY_AUDIO_FORMAT_COMBO = 12 // Stereo ac3/dts,
198 // multi mlp/dts-hd
200typedef enum {
201 BLURAY_AUDIO_RATE_48 = 1,
202 BLURAY_AUDIO_RATE_96 = 4,
203 BLURAY_AUDIO_RATE_192 = 5,
204 BLURAY_AUDIO_RATE_192_COMBO = 12, // 48 or 96 ac3/dts
205 // 192 mpl/dts-hd
206 BLURAY_AUDIO_RATE_96_COMBO = 14 // 48 ac3/dts
207 // 96 mpl/dts-hd
209
211typedef enum {
212 BLURAY_TEXT_CHAR_CODE_UTF8 = 0x01,
213 BLURAY_TEXT_CHAR_CODE_UTF16BE = 0x02,
214 BLURAY_TEXT_CHAR_CODE_SHIFT_JIS = 0x03,
215 BLURAY_TEXT_CHAR_CODE_EUC_KR = 0x04,
216 BLURAY_TEXT_CHAR_CODE_GB18030_20001 = 0x05,
217 BLURAY_TEXT_CHAR_CODE_CN_GB = 0x06,
218 BLURAY_TEXT_CHAR_CODE_BIG5 = 0x07
220
227
229typedef enum {
233
235typedef enum {
236 BLURAY_DYNAMIC_RANGE_SDR = 0,
237 BLURAY_DYNAMIC_RANGE_HDR10 = 1,
238 BLURAY_DYNAMIC_RANGE_DOLBY_VISION = 2
240
242typedef struct bd_stream_info {
243 uint8_t coding_type;
244 uint8_t format;
245 uint8_t rate;
246 uint8_t char_code;
247 uint8_t lang[4];
248 uint16_t pid;
249 uint8_t aspect;
250 uint8_t subpath_id;
252
276
278typedef struct bd_chapter {
279 uint32_t idx;
280 uint64_t start;
281 uint64_t duration;
282 uint64_t offset;
283 unsigned clip_ref;
285
287typedef struct bd_mark {
288 uint32_t idx;
289 int type;
290 uint64_t start;
291 uint64_t duration;
292 uint64_t offset;
293 unsigned clip_ref;
295
311
313typedef struct bd_sound_effect {
314 uint8_t num_channels;
315 uint32_t num_frames;
316 const int16_t *samples;
318
319
331BD_PUBLIC void bd_get_version(int *major, int *minor, int *micro);
332
333/*
334 * Disc functions
335 */
336
337struct bd_dir_s;
338struct bd_file_s;
339struct meta_dl;
340
350BD_PUBLIC BLURAY *bd_open(const char *device_path, const char *keyfile_path);
351
359BD_PUBLIC BLURAY *bd_init(void);
360
369BD_PUBLIC int bd_open_disc(BLURAY *bd, const char *device_path, const char *keyfile_path);
370
379BD_PUBLIC int bd_open_stream(BLURAY *bd,
380 void *read_blocks_handle,
381 int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks));
382
392BD_PUBLIC int bd_open_files(BLURAY *bd,
393 void *handle,
394 struct bd_dir_s *(*open_dir)(void *handle, const char *rel_path),
395 struct bd_file_s *(*open_file)(void *handle, const char *rel_path));
396
402BD_PUBLIC void bd_close(BLURAY *bd);
403
412
426BD_PUBLIC const struct meta_dl *bd_get_meta(BLURAY *bd);
427
441BD_PUBLIC int bd_get_meta_file(BLURAY *bd, const char *file_name, void **data, int64_t *size);
442
443
444/*
445 * Title selection without on-disc menus
446 */
447
461BD_PUBLIC uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length);
462
471BD_PUBLIC int bd_get_main_title(BLURAY *bd);
472
482BD_PUBLIC BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned angle);
483
490BD_PUBLIC void bd_free_title_info(BLURAY_TITLE_INFO *title_info);
491
500BD_PUBLIC int bd_select_title(BLURAY *bd, uint32_t title);
501
510BD_PUBLIC int bd_select_playlist(BLURAY *bd, uint32_t playlist);
511
519BD_PUBLIC uint32_t bd_get_current_title(BLURAY *bd);
520
530BD_PUBLIC int bd_read(BLURAY *bd, unsigned char *buf, int len);
531
532
533/*
534 * Playback control functions
535 */
536
544BD_PUBLIC int64_t bd_seek(BLURAY *bd, uint64_t pos);
545
554BD_PUBLIC int64_t bd_seek_time(BLURAY *bd, uint64_t tick);
555
564BD_PUBLIC int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter);
565
574BD_PUBLIC int64_t bd_seek_mark(BLURAY *bd, unsigned mark);
575
584BD_PUBLIC int64_t bd_seek_playitem(BLURAY *bd, unsigned clip_ref);
585
594BD_PUBLIC int bd_select_angle(BLURAY *bd, unsigned angle);
595
603BD_PUBLIC void bd_seamless_angle_change(BLURAY *bd, unsigned angle);
604
627BD_PUBLIC void bd_select_stream(BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag);
628
629#define BLURAY_AUDIO_STREAM 0
630#define BLURAY_PG_TEXTST_STREAM 1
631
632
633/*
634 * Playback status functions
635 */
636
645BD_PUBLIC int64_t bd_chapter_pos(BLURAY *bd, unsigned chapter);
646
654BD_PUBLIC uint32_t bd_get_current_chapter(BLURAY *bd);
655
665BD_PUBLIC uint64_t bd_get_title_size(BLURAY *bd);
666
674BD_PUBLIC unsigned bd_get_current_angle(BLURAY *bd);
675
683BD_PUBLIC uint64_t bd_tell(BLURAY *bd);
684
692BD_PUBLIC uint64_t bd_tell_time(BLURAY *bd);
693
694
695/*
696 * player settings
697 */
698
726
738
739BD_PUBLIC int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value);
740
750BD_PUBLIC int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *value);
751
752
753/*
754 * events
755 */
756
848
850typedef struct {
851 uint32_t event;
852 uint32_t param;
853} BD_EVENT;
854
855/* BD_EVENT_ERROR param values */
856#define BD_ERROR_HDMV 1
857#define BD_ERROR_BDJ 2
858
859/* BD_EVENT_ENCRYPTED param vlues */
860#define BD_ERROR_AACS 3
861#define BD_ERROR_BDPLUS 4
862
863/* BD_EVENT_TITLE special titles */
864#define BLURAY_TITLE_FIRST_PLAY 0xffff
865#define BLURAY_TITLE_TOP_MENU 0
866
867/* BD_EVENT_KEY_INTEREST flags */
868#define BLURAY_KIT_PLAY 0x1
869#define BLURAY_KIT_STOP 0x2
870#define BLURAY_KIT_FFW 0x4
871#define BLURAY_KIT_REW 0x8
872#define BLURAY_KIT_TRACK_NEXT 0x10
873#define BLURAY_KIT_TRACK_PREV 0x20
874#define BLURAY_KIT_PAUSE 0x40
875#define BLURAY_KIT_STILL_OFF 0x80
876#define BLURAY_KIT_SEC_AUDIO 0x100
877#define BLURAY_KIT_SEC_VIDEO 0x200
878#define BLURAY_KIT_PG_TEXTST 0x400
879
880/* BD_EVENT_UO_MASK flags */
881#define BLURAY_UO_MENU_CALL 0x1
882#define BLURAY_UO_TITLE_SEARCH 0x2
883
892BD_PUBLIC int bd_get_event(BLURAY *bd, BD_EVENT *event);
893
901BD_PUBLIC const char *bd_event_name(uint32_t /* bd_event_e */ event);
902
903/*
904 * On-screen display
905 */
906
907struct bd_overlay_s; /* defined in overlay.h */
908struct bd_argb_overlay_s; /* defined in overlay.h */
909struct bd_argb_buffer_s; /* defined in overlay.h */
910
917typedef void (*bd_overlay_proc_f)(void *handle, const struct bd_overlay_s * const event);
918
925typedef void (*bd_argb_overlay_proc_f)(void *handle, const struct bd_argb_overlay_s * const event);
926
946BD_PUBLIC void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func);
947
963BD_PUBLIC void bd_register_argb_overlay_proc(BLURAY *bd, void *handle, bd_argb_overlay_proc_f func, struct bd_argb_buffer_s *buf);
964
965
966/*
967 * Playback with on-disc menus
968 */
969
979BD_PUBLIC int bd_play(BLURAY *bd);
980
993BD_PUBLIC int bd_play_title(BLURAY *bd, unsigned title);
994
1005BD_PUBLIC int bd_menu_call(BLURAY *bd, int64_t pts);
1006
1019BD_PUBLIC int bd_read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event);
1020
1028BD_PUBLIC int bd_read_skip_still(BLURAY *bd);
1029
1039BD_PUBLIC BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle);
1040
1050BD_PUBLIC int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, struct bd_sound_effect *effect);
1051
1052
1053/*
1054 * User interaction
1055 */
1056
1064BD_PUBLIC void bd_set_scr(BLURAY *bd, int64_t pts);
1065
1079BD_PUBLIC int bd_set_rate(BLURAY *bd, uint32_t rate);
1080
1081#define BLURAY_RATE_PAUSED 0
1082#define BLURAY_RATE_NORMAL 90000
1083
1099BD_PUBLIC int bd_user_input(BLURAY *bd, int64_t pts, uint32_t key);
1100
1113BD_PUBLIC int bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y);
1114
1115
1116/*
1117 * Testing and debugging
1118 *
1119 * Note: parsing functions can't be used with UDF images.
1120 */
1121
1122/* access to internal information */
1123
1124struct clpi_cl;
1125struct mpls_pl;
1126struct bdjo_data;
1127struct mobj_objects;
1128
1137BD_PUBLIC struct clpi_cl *bd_get_clpi(BLURAY *bd, unsigned clip_ref);
1138
1140BD_PUBLIC struct clpi_cl *bd_read_clpi(const char *clpi_file);
1141
1148BD_PUBLIC void bd_free_clpi(struct clpi_cl *cl);
1149
1150
1152BD_PUBLIC struct mpls_pl *bd_read_mpls(const char *mpls_file);
1154BD_PUBLIC void bd_free_mpls(struct mpls_pl *);
1155
1157BD_PUBLIC struct mobj_objects *bd_read_mobj(const char *mobj_file);
1159BD_PUBLIC void bd_free_mobj(struct mobj_objects *);
1160
1162BD_PUBLIC struct bdjo_data *bd_read_bdjo(const char *bdjo_file);
1164BD_PUBLIC void bd_free_bdjo(struct bdjo_data *);
1165
1166/* BD-J testing */
1167
1169BD_PUBLIC int bd_start_bdj(BLURAY *bd, const char* start_object);
1171BD_PUBLIC void bd_stop_bdj(BLURAY *bd);
1172
1186BD_PUBLIC int bd_read_file(BLURAY *bd, const char *path, void **data, int64_t *size);
1187
1198BD_PUBLIC struct bd_dir_s *bd_open_dir(BLURAY *bd, const char *dir);
1199
1217BD_PUBLIC struct bd_file_s *bd_open_file_dec(BLURAY *bd, const char *path);
1218
1219#ifdef __cplusplus
1220}
1221#endif
1222
1223#endif /* BLURAY_H_ */
BD_PUBLIC int bd_open_disc(BLURAY *bd, const char *device_path, const char *keyfile_path)
Open BluRay disc.
BD_PUBLIC int64_t bd_seek(BLURAY *bd, uint64_t pos)
Seek to pos in currently selected title.
BD_PUBLIC int bd_play(BLURAY *bd)
Start playing disc with on-disc menus.
BD_PUBLIC int bd_get_meta_file(BLURAY *bd, const char *file_name, void **data, int64_t *size)
Read metadata file from BluRay disc.
void(* bd_overlay_proc_f)(void *handle, const struct bd_overlay_s *const event)
YUV overlay handler function type.
Definition bluray.h:917
BD_PUBLIC uint64_t bd_tell(BLURAY *bd)
Return current pos.
BD_PUBLIC int64_t bd_seek_playitem(BLURAY *bd, unsigned clip_ref)
Seek to a playitem.
BD_PUBLIC BLURAY_TITLE_INFO * bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle)
Get information about a playlist.
BD_PUBLIC void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func)
Register handler for compressed YUV overlays.
BD_PUBLIC int bd_read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event)
Read from currently playing title.
BD_PUBLIC int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *value)
Update player setting (string).
BD_PUBLIC int bd_user_input(BLURAY *bd, int64_t pts, uint32_t key)
Pass user input to graphics controller or BD-J.
BD_PUBLIC int bd_get_event(BLURAY *bd, BD_EVENT *event)
Get event from libbluray event queue.
BD_PUBLIC void bd_close(BLURAY *bd)
Close BluRay disc.
BD_PUBLIC struct bdjo_data * bd_read_bdjo(const char *bdjo_file)
Testing/debugging: Parse BD-J object file (BDJO).
BD_PUBLIC struct mobj_objects * bd_read_mobj(const char *mobj_file)
Testing/debugging: Parse movie objects (MOBJ) file.
BD_PUBLIC void bd_free_bdjo(struct bdjo_data *)
Testing/debugging: Free parsed BDJO object.
bd_player_setting
Player setting.
Definition bluray.h:700
@ BLURAY_PLAYER_SETTING_DISPLAY_CAP
Display capability.
Definition bluray.h:710
@ BLURAY_PLAYER_SETTING_PERSISTENT_STORAGE
Enable/disable BD-J persistent storage.
Definition bluray.h:720
@ BLURAY_PLAYER_SETTING_AUDIO_LANG
Initial audio language.
Definition bluray.h:701
@ BLURAY_PLAYER_SETTING_COUNTRY_CODE
Player country code.
Definition bluray.h:704
@ BLURAY_PLAYER_SETTING_OUTPUT_PREFER
Output mode preference.
Definition bluray.h:706
@ BLURAY_PLAYER_CACHE_ROOT
Root path to the BD_J cache storage location.
Definition bluray.h:723
@ BLURAY_PLAYER_SETTING_HDR_PREFERENCE
HDR preference.
Definition bluray.h:714
@ BLURAY_PLAYER_SETTING_VIDEO_CAP
Video capability.
Definition bluray.h:709
@ BLURAY_PLAYER_SETTING_TEXT_CAP
Text Subtitle capability.
Definition bluray.h:716
@ BLURAY_PLAYER_SETTING_PLAYER_PROFILE
Player profile and version.
Definition bluray.h:717
@ BLURAY_PLAYER_SETTING_REGION_CODE
Player region code.
Definition bluray.h:705
@ BLURAY_PLAYER_SETTING_PG_LANG
Initial PG/SPU language.
Definition bluray.h:702
@ BLURAY_PLAYER_SETTING_3D_CAP
3D capability.
Definition bluray.h:711
@ BLURAY_PLAYER_SETTING_PARENTAL
Age for parental control.
Definition bluray.h:707
@ BLURAY_PLAYER_SETTING_SDR_CONV_PREFER
SDR conversion preference.
Definition bluray.h:715
@ BLURAY_PLAYER_SETTING_UHD_CAP
UHD capability.
Definition bluray.h:712
@ BLURAY_PLAYER_SETTING_MENU_LANG
Initial menu language.
Definition bluray.h:703
@ BLURAY_PLAYER_SETTING_DECODE_PG
Enable/disable PG (subtitle) decoder.
Definition bluray.h:719
@ BLURAY_PLAYER_SETTING_UHD_DISPLAY_CAP
UHD display capability.
Definition bluray.h:713
@ BLURAY_PLAYER_SETTING_AUDIO_CAP
Audio capability.
Definition bluray.h:708
@ BLURAY_PLAYER_PERSISTENT_ROOT
Root path to the BD_J persistent storage location.
Definition bluray.h:722
@ BLURAY_PLAYER_JAVA_HOME
Location of JRE.
Definition bluray.h:724
BD_PUBLIC const char * bd_event_name(uint32_t event)
Get name of event.
BD_PUBLIC int bd_get_main_title(BLURAY *bd)
Get main title Returned number is an index to the list created by bd_get_titles().
BD_PUBLIC unsigned bd_get_current_angle(BLURAY *bd)
Return the current angle.
BD_PUBLIC 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.
BD_PUBLIC struct clpi_cl * bd_read_clpi(const char *clpi_file)
Testing/debugging: Parse clip information (CLPI) file.
BD_PUBLIC uint64_t bd_tell_time(BLURAY *bd)
Return current time.
void(* bd_argb_overlay_proc_f)(void *handle, const struct bd_argb_overlay_s *const event)
ARGB overlay handler function type.
Definition bluray.h:925
bd_mark_type_e
Mark type.
Definition bluray.h:229
@ BLURAY_MARK_ENTRY
entry mark for chapter search
Definition bluray.h:230
@ BLURAY_MARK_LINK
link point
Definition bluray.h:231
BD_PUBLIC int bd_play_title(BLURAY *bd, unsigned title)
Play a title (from disc index).
BD_PUBLIC int bd_select_title(BLURAY *bd, uint32_t title)
Select the title from the list created by bd_get_titles().
BD_PUBLIC int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value)
Update player setting.
bd_dynamic_range_type_e
Clip dynamic range.
Definition bluray.h:235
bd_video_rate_e
Stream video frame rate.
Definition bluray.h:176
@ BLURAY_VIDEO_RATE_60000_1001
59.94 Hz
Definition bluray.h:182
@ BLURAY_VIDEO_RATE_24000_1001
23.976 Hz
Definition bluray.h:177
@ BLURAY_VIDEO_RATE_50
50 Hz
Definition bluray.h:181
@ BLURAY_VIDEO_RATE_24
24 Hz
Definition bluray.h:178
@ BLURAY_VIDEO_RATE_25
25 Hz
Definition bluray.h:179
@ BLURAY_VIDEO_RATE_30000_1001
29.97 Hz
Definition bluray.h:180
BD_PUBLIC int bd_read(BLURAY *bd, unsigned char *buf, int len)
Read from currently selected title file, decrypt if possible.
BD_PUBLIC void bd_select_stream(BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag)
Select stream (PG / TextST track).
BD_PUBLIC uint32_t bd_get_current_chapter(BLURAY *bd)
Get the current chapter.
BD_PUBLIC void bd_free_title_info(BLURAY_TITLE_INFO *title_info)
Free BLURAY_TITLE_INFO object.
BD_PUBLIC void bd_free_mobj(struct mobj_objects *)
Testing/debugging: Free parsed movie objects.
BD_PUBLIC BLURAY * bd_open(const char *device_path, const char *keyfile_path)
Open BluRay disc.
BD_PUBLIC int bd_menu_call(BLURAY *bd, int64_t pts)
Open BluRay disc Top Menu.
bd_stream_type_e
Stream video coding type.
Definition bluray.h:141
bd_char_code_e
Text subtitle charset.
Definition bluray.h:211
bd_video_format_e
Stream video format.
Definition bluray.h:164
@ BLURAY_VIDEO_FORMAT_1080P
SMPTE 274M.
Definition bluray.h:170
@ BLURAY_VIDEO_FORMAT_720P
SMPTE 296M.
Definition bluray.h:169
@ BLURAY_VIDEO_FORMAT_576P
ITU-R BT.1358.
Definition bluray.h:171
@ BLURAY_VIDEO_FORMAT_576I
ITU-R BT.601-4.
Definition bluray.h:166
@ BLURAY_VIDEO_FORMAT_480P
SMPTE 293M.
Definition bluray.h:167
@ BLURAY_VIDEO_FORMAT_1080I
SMPTE 274M.
Definition bluray.h:168
@ BLURAY_VIDEO_FORMAT_480I
ITU-R BT.601-5.
Definition bluray.h:165
@ BLURAY_VIDEO_FORMAT_2160P
BT.2020.
Definition bluray.h:172
BD_PUBLIC BLURAY * bd_init(void)
Initialize BLURAY object.
BD_PUBLIC int bd_read_file(BLURAY *bd, const char *path, void **data, int64_t *size)
Read a file from BluRay Virtual File System.
BD_PUBLIC uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length)
Get number of titles (playlists).
BD_PUBLIC struct mpls_pl * bd_read_mpls(const char *mpls_file)
Testing/debugging: Parse playlist (MPLS) file.
BD_PUBLIC int bd_read_skip_still(BLURAY *bd)
Continue reading after still mode clip.
BD_PUBLIC void bd_free_mpls(struct mpls_pl *)
Testing/debugging: Free parsed playlist.
BD_PUBLIC int64_t bd_seek_time(BLURAY *bd, uint64_t tick)
Seek to specific time in 90Khz ticks.
BD_PUBLIC void bd_set_scr(BLURAY *bd, int64_t pts)
Update current pts.
BD_PUBLIC int64_t bd_seek_mark(BLURAY *bd, unsigned mark)
Seek to a playmark.
BD_PUBLIC 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 bluray BLURAY
This structure is opaque.
Definition bluray.h:51
BD_PUBLIC 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).
BD_PUBLIC int bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y)
Select menu button at location (x,y).
BD_PUBLIC uint64_t bd_get_title_size(BLURAY *bd)
Returns file size in bytes of currently selected title, 0 in no title selected.
BD_PUBLIC void bd_stop_bdj(BLURAY *bd)
Testing/debugging: shutdown BD-J and clean up resources.
BD_PUBLIC const struct meta_dl * bd_get_meta(BLURAY *bd)
Get meta information about current BluRay disc.
BD_PUBLIC int64_t bd_chapter_pos(BLURAY *bd, unsigned chapter)
Find the byte position of a chapter.
BD_PUBLIC void bd_free_clpi(struct clpi_cl *cl)
Free CLPI_CL object.
BD_PUBLIC int bd_select_angle(BLURAY *bd, unsigned angle)
Set the angle to play.
BD_PUBLIC int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, struct bd_sound_effect *effect)
Get sound effect.
BD_PUBLIC struct clpi_cl * bd_get_clpi(BLURAY *bd, unsigned clip_ref)
Get copy of clip information for requested playitem.
BD_PUBLIC const BLURAY_DISC_INFO * bd_get_disc_info(BLURAY *bd)
Get information about current BluRay disc.
BD_PUBLIC 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.
BD_PUBLIC BLURAY_TITLE_INFO * bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned angle)
Get information about a title.
BD_PUBLIC struct bd_dir_s * bd_open_dir(BLURAY *bd, const char *dir)
Open a directory from BluRay Virtual File System.
BD_PUBLIC void bd_seamless_angle_change(BLURAY *bd, unsigned angle)
Initiate seamless angle change.
BD_PUBLIC int bd_select_playlist(BLURAY *bd, uint32_t playlist)
Select a playlist.
BD_PUBLIC uint32_t bd_get_current_title(BLURAY *bd)
Returns the current title index.
bd_video_aspect_e
Stream video aspect ratio.
Definition bluray.h:186
BD_PUBLIC struct bd_file_s * bd_open_file_dec(BLURAY *bd, const char *path)
Open a file from BluRay Virtual File System.
bd_audio_format_e
Stream audio format.
Definition bluray.h:192
bd_audio_rate_e
Stream audio rate.
Definition bluray.h:200
BD_PUBLIC int bd_set_rate(BLURAY *bd, uint32_t rate)
Set current playback rate.
BD_PUBLIC int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter)
Seek to a chapter.
BD_PUBLIC void bd_get_version(int *major, int *minor, int *micro)
Get libbluray version.
bd_event_e
Event type.
Definition bluray.h:758
@ BD_EVENT_SEEK
HDMV VM or JVM seeked the stream.
Definition bluray.h:810
@ BD_EVENT_MENU
Interactive menu visible.
Definition bluray.h:834
@ BD_EVENT_PIP_PG_TEXTST_STREAM
1..255, 0xfff = none
Definition bluray.h:789
@ BD_EVENT_STILL_TIME
Still playback for n seconds (reached end of still mode play item).
Definition bluray.h:817
@ BD_EVENT_SECONDARY_VIDEO_STREAM
1..32, 0xff = none
Definition bluray.h:791
@ BD_EVENT_TITLE
current title, 1...N (0 = top menu)
Definition bluray.h:775
@ BD_EVENT_PG_TEXTST_STREAM
1..255, 0xfff = none
Definition bluray.h:788
@ BD_EVENT_STEREOSCOPIC_STATUS
3D
Definition bluray.h:837
@ BD_EVENT_PIP_PG_TEXTST
0 - disable, 1 - enable
Definition bluray.h:794
@ BD_EVENT_IDLE
Nothing to do.
Definition bluray.h:828
@ BD_EVENT_PLAYLIST
current playlist (xxxxx.mpls)
Definition bluray.h:776
@ BD_EVENT_PG_TEXTST
0 - disable, 1 - enable
Definition bluray.h:793
@ BD_EVENT_CHAPTER
current chapter, 1...N
Definition bluray.h:778
@ BD_EVENT_ANGLE
current angle, 1...N
Definition bluray.h:774
@ BD_EVENT_PLAYITEM
current play item, 0...N-1
Definition bluray.h:777
@ BD_EVENT_UO_MASK_CHANGED
UO mask changed.
Definition bluray.h:843
@ BD_EVENT_ENCRYPTED
.m2ts file is encrypted and can't be played
Definition bluray.h:768
@ BD_EVENT_POPUP
Pop-Up menu available.
Definition bluray.h:831
@ BD_EVENT_PLAYLIST_STOP
HDMV VM or JVM stopped playlist playback.
Definition bluray.h:804
@ BD_EVENT_SECONDARY_VIDEO
0 - disable, 1 - enable
Definition bluray.h:796
@ BD_EVENT_KEY_INTEREST_TABLE
BD-J key interest table changed.
Definition bluray.h:840
@ BD_EVENT_END_OF_TITLE
end of title reached
Definition bluray.h:780
@ BD_EVENT_IG_STREAM
1..32
Definition bluray.h:787
@ BD_EVENT_PLAYMARK
playmark reached
Definition bluray.h:779
@ BD_EVENT_SECONDARY_AUDIO
0 - disable, 1 - enable
Definition bluray.h:795
@ BD_EVENT_SOUND_EFFECT
Play sound effect.
Definition bluray.h:820
@ BD_EVENT_SECONDARY_VIDEO_SIZE
0 - PIP, 0xf - fullscreen
Definition bluray.h:797
@ BD_EVENT_STILL
still playback (pause)
Definition bluray.h:813
@ BD_EVENT_DISCONTINUITY
discontinuity in the stream (non-seamless connection).
Definition bluray.h:807
@ BD_EVENT_NONE
no pending events
Definition bluray.h:760
@ BD_EVENT_SECONDARY_AUDIO_STREAM
1..32, 0xff = none
Definition bluray.h:790
@ BD_EVENT_ERROR
Fatal error.
Definition bluray.h:766
@ BD_EVENT_AUDIO_STREAM
1..32, 0xff = none
Definition bluray.h:786
@ BD_EVENT_READ_ERROR
Reading of .m2ts aligned unit failed.
Definition bluray.h:767
bd_still_mode_e
Clip still mode type.
Definition bluray.h:222
@ BLURAY_STILL_INFINITE
Infinite still.
Definition bluray.h:225
@ BLURAY_STILL_TIME
Still playback for fixed time.
Definition bluray.h:224
@ BLURAY_STILL_NONE
No still (normal playback).
Definition bluray.h:223
Event.
Definition bluray.h:850
uint32_t event
Event type (bd_event_e).
Definition bluray.h:851
uint32_t param
Event data.
Definition bluray.h:852
Clip information.
Definition bluray.h:254
uint16_t still_time
Still time (seconds) if still_mode == BD_STILL_TIME.
Definition bluray.h:257
uint8_t sec_video_stream_count
Number of secondary video streams.
Definition bluray.h:263
BLURAY_STREAM_INFO * audio_streams
Audio streams information.
Definition bluray.h:265
uint8_t pg_stream_count
Number of PG (Presentation Graphics) streams.
Definition bluray.h:260
uint64_t start_time
start media time, 90kHz, ("playlist time")
Definition bluray.h:271
BLURAY_STREAM_INFO * pg_streams
PG (Presentation Graphics) streams information.
Definition bluray.h:266
uint8_t sec_audio_stream_count
Number of secondary audio streams.
Definition bluray.h:262
uint64_t out_time
end timestamp, 90kHz
Definition bluray.h:273
uint8_t audio_stream_count
Number of audio streams.
Definition bluray.h:259
uint64_t in_time
start timestamp, 90kHz
Definition bluray.h:272
char clip_id[6]
Clip identifier (.m2ts file name).
Definition bluray.h:274
uint32_t pkt_count
Number of mpeg-ts packets.
Definition bluray.h:255
BLURAY_STREAM_INFO * video_streams
Video streams information.
Definition bluray.h:264
uint8_t video_stream_count
Number of video streams.
Definition bluray.h:258
uint8_t ig_stream_count
Number of IG (Interactive Graphics) streams.
Definition bluray.h:261
BLURAY_STREAM_INFO * sec_audio_streams
Secondary audio streams information.
Definition bluray.h:268
BLURAY_STREAM_INFO * ig_streams
IG (Interactive Graphics) streams information.
Definition bluray.h:267
BLURAY_STREAM_INFO * sec_video_streams
Secondary video streams information.
Definition bluray.h:269
uint8_t still_mode
Clip still mode (bd_still_mode_e).
Definition bluray.h:256
BluRay disc information.
Definition bluray.h:77
const BLURAY_TITLE * top_menu
titles[0].
Definition bluray.h:93
uint8_t libjvm_detected
1 if usable Java VM was found
Definition bluray.h:102
uint8_t frame_rate
bd_video_rate_e
Definition bluray.h:110
uint8_t bdplus_detected
1 if disc is using BD+ encoding
Definition bluray.h:124
const BLURAY_TITLE *const * titles
index is title number 1 ... N
Definition bluray.h:91
uint8_t content_exist_3D
1 if 3D content exists on the disc
Definition bluray.h:111
uint8_t initial_dynamic_range_type
bd_dynamic_range_type_e
Definition bluray.h:132
uint32_t bdplus_date
BD+ content code relese date ((year<<16)|(month<<8)|day).
Definition bluray.h:129
uint8_t libaacs_detected
1 if usable AACS decoding library was found
Definition bluray.h:117
uint8_t bdplus_gen
BD+ content code generation.
Definition bluray.h:128
char bdj_disc_id[33]
(BD-J) disc ID
Definition bluray.h:106
uint32_t num_unsupported_titles
number of unsupported titles
Definition bluray.h:97
uint8_t provider_data[32]
Content provider data.
Definition bluray.h:113
const char * disc_name
optional disc name in preferred language
Definition bluray.h:81
uint8_t aacs_handled
1 if disc is using supported AACS encoding
Definition bluray.h:118
uint8_t first_play_supported
1 if First Play title is present on the disc and can be played
Definition bluray.h:87
uint8_t disc_id[20]
Disc ID.
Definition bluray.h:83
uint8_t bdj_supported
(deprecated)
Definition bluray.h:101
const char * udf_volume_id
optional UDF volume identifier
Definition bluray.h:82
uint8_t no_menu_support
HDMV / BD-J titles.
Definition bluray.h:86
uint8_t bdplus_handled
1 if disc is using supporred BD+ encoding
Definition bluray.h:126
uint8_t bdj_detected
BD-J info (valid only if disc uses BD-J).
Definition bluray.h:100
uint32_t num_hdmv_titles
number of HDMV titles
Definition bluray.h:95
uint32_t num_bdj_titles
number of BD-J titles
Definition bluray.h:96
uint8_t initial_output_mode_preference
0 - 2D, 1 - 3D
Definition bluray.h:112
uint8_t bluray_detected
1 if BluRay disc was detected
Definition bluray.h:78
const BLURAY_TITLE * first_play
titles[N+1].
Definition bluray.h:92
int aacs_error_code
AACS error code (BD_AACS_*).
Definition bluray.h:120
int aacs_mkbv
AACS MKB version.
Definition bluray.h:121
char bdj_org_id[9]
(BD-J) disc organization ID
Definition bluray.h:105
uint8_t top_menu_supported
1 if Top Menu title is present on the disc and can be played
Definition bluray.h:88
uint8_t libbdplus_detected
1 if usable BD+ decoding library was found
Definition bluray.h:125
uint8_t bdj_handled
1 if usable Java VM + libbluray.jar was found
Definition bluray.h:103
uint8_t aacs_detected
1 if disc is using AACS encoding
Definition bluray.h:116
uint32_t num_titles
number of titles on the disc, not including "First Play" and "Top Menu"
Definition bluray.h:90
uint8_t video_format
bd_video_format_e
Definition bluray.h:109
Sound effect data.
Definition bluray.h:313
const int16_t * samples
48000 Hz, 16 bit LPCM.
Definition bluray.h:316
uint32_t num_frames
Number of audio frames.
Definition bluray.h:315
uint8_t num_channels
1 - mono, 2 - stereo
Definition bluray.h:314
Clip substream information.
Definition bluray.h:242
uint8_t lang[4]
Language code.
Definition bluray.h:247
uint8_t aspect
Stream video aspect ratio (bd_video_aspect_e).
Definition bluray.h:249
uint8_t rate
Stream frame rate (bd_audio_rate_e or bd_video_rate_e).
Definition bluray.h:245
uint8_t format
Stream format (bd_video_format_e or bd_audio_format_e).
Definition bluray.h:244
uint8_t char_code
Text subtitle charachter code (bd_char_code_e).
Definition bluray.h:246
uint8_t subpath_id
Sub path identifier (= separate mpeg-ts mux / .m2ts file).
Definition bluray.h:250
uint8_t coding_type
Stream coding (bd_stream_type_e).
Definition bluray.h:243
uint16_t pid
mpeg-ts PID
Definition bluray.h:248
Chapter entry.
Definition bluray.h:278
uint32_t idx
Chapter index (number - 1).
Definition bluray.h:279
uint64_t start
start media time, 90kHz, ("playlist time")
Definition bluray.h:280
unsigned clip_ref
Clip reference (index to playlist clips list).
Definition bluray.h:283
uint64_t offset
distance from title start, bytes
Definition bluray.h:282
uint64_t duration
duration
Definition bluray.h:281
Playlist information.
Definition bluray.h:297
uint8_t mvc_base_view_r_flag
MVC base view (0 - left, 1 - right).
Definition bluray.h:309
BLURAY_CLIP_INFO * clips
Clip information.
Definition bluray.h:305
uint32_t chapter_count
Number of chapters.
Definition bluray.h:303
uint8_t angle_count
Number of angles.
Definition bluray.h:302
BLURAY_TITLE_CHAPTER * chapters
Chapter information.
Definition bluray.h:306
uint32_t mark_count
Number of playmarks.
Definition bluray.h:304
uint32_t clip_count
Number of clips.
Definition bluray.h:301
BLURAY_TITLE_MARK * marks
Playmark information.
Definition bluray.h:307
uint64_t duration
Playlist duration, 90 kHz.
Definition bluray.h:300
uint32_t idx
Playlist index number (filled only with bd_get_title_info()).
Definition bluray.h:298
uint32_t playlist
Playlist ID (mpls file name).
Definition bluray.h:299
Playmark information.
Definition bluray.h:287
unsigned clip_ref
Clip reference (index to playlist clips list).
Definition bluray.h:293
uint64_t duration
time to next mark
Definition bluray.h:291
uint64_t start
mark media time, 90kHz, ("playlist time")
Definition bluray.h:290
uint32_t idx
Mark index (number - 1).
Definition bluray.h:288
int type
bd_mark_type_e
Definition bluray.h:289
uint64_t offset
mark distance from title start, bytes
Definition bluray.h:292
HDMV / BD-J title information.
Definition bluray.h:66
uint8_t bdj
0 - HDMV title.
Definition bluray.h:72
uint8_t interactive
1 if title is interactive (title length and playback position should not be shown in UI)
Definition bluray.h:68
uint32_t id_ref
Movie Object number / bdjo file number.
Definition bluray.h:73
uint8_t hidden
1 if title number should not be shown during playback
Definition bluray.h:70
uint8_t accessible
1 if it is allowed to jump into this title
Definition bluray.h:69
const char * name
optional title name in preferred language
Definition bluray.h:67
Directory access.
Definition filesystem.h:132
File access.
Definition filesystem.h:49