libbluray
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 
22 #ifndef BLURAY_H_
23 #define BLURAY_H_
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
34 #include <stdint.h>
35 
36 #define TITLES_ALL 0
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)
44 typedef struct bluray BLURAY;
45 
46 /*
47  * Disc info
48  */
49 
50 /* AACS error codes */
51 #define BD_AACS_CORRUPTED_DISC -1
52 #define BD_AACS_NO_CONFIG -2
53 #define BD_AACS_NO_PK -3
54 #define BD_AACS_NO_CERT -4
55 #define BD_AACS_CERT_REVOKED -5
56 #define BD_AACS_MMC_FAILED -6
57 
58 /* HDMV / BD-J title */
59 typedef struct {
60  const char *name; /* optional title name in preferred language */
61  uint8_t interactive; /* 1 if title is interactive (title length and playback position should not be shown in UI) */
62  uint8_t accessible; /* 1 if it is allowed to jump into this title */
63  uint8_t hidden; /* 1 if title number should not be shown during playback */
64 
65  uint8_t bdj; /* 0 - HDMV title. 1 - BD-J title */
66  uint32_t id_ref; /* Movie Object number / bdjo file number */
67 } BLURAY_TITLE;
68 
69 typedef struct {
70  uint8_t bluray_detected;
71 
72  /* Disc ID */
73  const char *disc_name; /* optional disc name in preferred language */
74  const char *udf_volume_id; /* optional UDF volume identifier */
75  uint8_t disc_id[20];
76 
77  /* HDMV / BD-J titles */
78  uint8_t no_menu_support; /* 1 if this disc can't be played using on-disc menus */
79  uint8_t first_play_supported;
80  uint8_t top_menu_supported;
81 
82  uint32_t num_titles;
83  const BLURAY_TITLE *const *titles; /* index is title number 1 ... N */
84  const BLURAY_TITLE *first_play; /* titles[N+1]. NULL if not present on the disc. */
85  const BLURAY_TITLE *top_menu; /* titles[0]. NULL if not present on the disc. */
86 
87  uint32_t num_hdmv_titles;
88  uint32_t num_bdj_titles;
89  uint32_t num_unsupported_titles;
90 
91  /* BD-J info (valid only if disc uses BD-J) */
92  uint8_t bdj_detected; /* 1 if disc uses BD-J */
93  uint8_t bdj_supported; /* (deprecated) */
94  uint8_t libjvm_detected; /* 1 if usable Java VM was found */
95  uint8_t bdj_handled; /* 1 if usable Java VM + libbluray.jar was found */
96 
97  char bdj_org_id[9]; /* (BD-J) disc organization ID */
98  char bdj_disc_id[33]; /* (BD-J) disc ID */
99 
100  /* disc application info */
101  uint8_t video_format; /* bd_video_format_e */
102  uint8_t frame_rate; /* bd_frame_rate_e */
103  uint8_t content_exist_3D;
104  uint8_t initial_output_mode_preference; /* 0 - 2D, 1 - 3D */
105  uint8_t provider_data[32];
106 
107  /* AACS info (valid only if disc uses AACS) */
108  uint8_t aacs_detected; /* 1 if disc is using AACS encoding */
109  uint8_t libaacs_detected; /* 1 if usable AACS decoding library was found */
110  uint8_t aacs_handled; /* 1 if disc is using supported AACS encoding */
111 
112  int aacs_error_code; /* AACS error code (BD_AACS_*) */
113  int aacs_mkbv; /* AACS MKB version */
114 
115  /* BD+ info (valid only if disc uses BD+) */
116  uint8_t bdplus_detected; /* 1 if disc is using BD+ encoding */
117  uint8_t libbdplus_detected; /* 1 if usable BD+ decoding library was found */
118  uint8_t bdplus_handled; /* 1 if disc is using supporred BD+ encoding */
119 
120  uint8_t bdplus_gen; /* BD+ content code generation */
121  uint32_t bdplus_date; /* BD+ content code relese date ((year<<16)|(month<<8)|day) */
122 
124 
125 /*
126  * Playlist info
127  */
128 
129 typedef enum {
130  BLURAY_STREAM_TYPE_VIDEO_MPEG1 = 0x01,
131  BLURAY_STREAM_TYPE_VIDEO_MPEG2 = 0x02,
132  BLURAY_STREAM_TYPE_AUDIO_MPEG1 = 0x03,
133  BLURAY_STREAM_TYPE_AUDIO_MPEG2 = 0x04,
134  BLURAY_STREAM_TYPE_AUDIO_LPCM = 0x80,
135  BLURAY_STREAM_TYPE_AUDIO_AC3 = 0x81,
136  BLURAY_STREAM_TYPE_AUDIO_DTS = 0x82,
137  BLURAY_STREAM_TYPE_AUDIO_TRUHD = 0x83,
138  BLURAY_STREAM_TYPE_AUDIO_AC3PLUS = 0x84,
139  BLURAY_STREAM_TYPE_AUDIO_DTSHD = 0x85,
140  BLURAY_STREAM_TYPE_AUDIO_DTSHD_MASTER = 0x86,
141  BLURAY_STREAM_TYPE_VIDEO_VC1 = 0xea,
142  BLURAY_STREAM_TYPE_VIDEO_H264 = 0x1b,
143  BLURAY_STREAM_TYPE_VIDEO_HEVC = 0x24,
144  BLURAY_STREAM_TYPE_SUB_PG = 0x90,
145  BLURAY_STREAM_TYPE_SUB_IG = 0x91,
146  BLURAY_STREAM_TYPE_SUB_TEXT = 0x92,
147  BLURAY_STREAM_TYPE_AUDIO_AC3PLUS_SECONDARY = 0xa1,
148  BLURAY_STREAM_TYPE_AUDIO_DTSHD_SECONDARY = 0xa2
149 } bd_stream_type_e;
150 
151 typedef enum {
152  BLURAY_VIDEO_FORMAT_480I = 1, // ITU-R BT.601-5
153  BLURAY_VIDEO_FORMAT_576I = 2, // ITU-R BT.601-4
154  BLURAY_VIDEO_FORMAT_480P = 3, // SMPTE 293M
155  BLURAY_VIDEO_FORMAT_1080I = 4, // SMPTE 274M
156  BLURAY_VIDEO_FORMAT_720P = 5, // SMPTE 296M
157  BLURAY_VIDEO_FORMAT_1080P = 6, // SMPTE 274M
158  BLURAY_VIDEO_FORMAT_576P = 7, // ITU-R BT.1358
159  BLURAY_VIDEO_FORMAT_2160P = 8, //
160 } bd_video_format_e;
161 
162 typedef enum {
163  BLURAY_VIDEO_RATE_24000_1001 = 1, // 23.976
164  BLURAY_VIDEO_RATE_24 = 2,
165  BLURAY_VIDEO_RATE_25 = 3,
166  BLURAY_VIDEO_RATE_30000_1001 = 4, // 29.97
167  BLURAY_VIDEO_RATE_50 = 6,
168  BLURAY_VIDEO_RATE_60000_1001 = 7 // 59.94
169 } bd_video_rate_e;
170 
171 typedef enum {
172  BLURAY_ASPECT_RATIO_4_3 = 2,
173  BLURAY_ASPECT_RATIO_16_9 = 3
174 } bd_video_aspect_e;
175 
176 typedef enum {
177  BLURAY_AUDIO_FORMAT_MONO = 1,
178  BLURAY_AUDIO_FORMAT_STEREO = 3,
179  BLURAY_AUDIO_FORMAT_MULTI_CHAN = 6,
180  BLURAY_AUDIO_FORMAT_COMBO = 12 // Stereo ac3/dts,
181 } bd_audio_format_e;
182  // multi mlp/dts-hd
183 
184 typedef enum {
185  BLURAY_AUDIO_RATE_48 = 1,
186  BLURAY_AUDIO_RATE_96 = 4,
187  BLURAY_AUDIO_RATE_192 = 5,
188  BLURAY_AUDIO_RATE_192_COMBO = 12, // 48 or 96 ac3/dts
189  // 192 mpl/dts-hd
190  BLURAY_AUDIO_RATE_96_COMBO = 14 // 48 ac3/dts
191  // 96 mpl/dts-hd
192 } bd_audio_rate_e;
193 
194 typedef enum {
195  BLURAY_TEXT_CHAR_CODE_UTF8 = 0x01,
196  BLURAY_TEXT_CHAR_CODE_UTF16BE = 0x02,
197  BLURAY_TEXT_CHAR_CODE_SHIFT_JIS = 0x03,
198  BLURAY_TEXT_CHAR_CODE_EUC_KR = 0x04,
199  BLURAY_TEXT_CHAR_CODE_GB18030_20001 = 0x05,
200  BLURAY_TEXT_CHAR_CODE_CN_GB = 0x06,
201  BLURAY_TEXT_CHAR_CODE_BIG5 = 0x07
202 } bd_char_code_e;
203 
204 typedef enum {
205  BLURAY_STILL_NONE = 0x00,
206  BLURAY_STILL_TIME = 0x01,
207  BLURAY_STILL_INFINITE = 0x02,
208 } bd_still_mode_e;
209 
210 typedef enum {
211  BLURAY_MARK_ENTRY = 0x01, /* entry mark for chapter search */
212  BLURAY_MARK_LINK = 0x02, /* link point */
213 } bd_mark_type_e;
214 
215 typedef struct bd_stream_info {
216  uint8_t coding_type;
217  uint8_t format;
218  uint8_t rate;
219  uint8_t char_code;
220  uint8_t lang[4];
221  uint16_t pid;
222  uint8_t aspect;
223  uint8_t subpath_id;
225 
226 typedef struct bd_clip {
227  uint32_t pkt_count;
228  uint8_t still_mode;
229  uint16_t still_time; /* seconds */
230  uint8_t video_stream_count;
231  uint8_t audio_stream_count;
232  uint8_t pg_stream_count;
233  uint8_t ig_stream_count;
234  uint8_t sec_audio_stream_count;
235  uint8_t sec_video_stream_count;
236  BLURAY_STREAM_INFO *video_streams;
237  BLURAY_STREAM_INFO *audio_streams;
238  BLURAY_STREAM_INFO *pg_streams;
239  BLURAY_STREAM_INFO *ig_streams;
240  BLURAY_STREAM_INFO *sec_audio_streams;
241  BLURAY_STREAM_INFO *sec_video_streams;
242 
243  uint64_t start_time; /* start media time, 90kHz, ("playlist time") */
244  uint64_t in_time; /* start timestamp, 90kHz */
245  uint64_t out_time; /* end timestamp, 90kHz */
246  char clip_id[6];
248 
249 typedef struct bd_chapter {
250  uint32_t idx;
251  uint64_t start; /* start media time, 90kHz, ("playlist time") */
252  uint64_t duration; /* duration */
253  uint64_t offset; /* distance from title start, bytes */
254  unsigned clip_ref;
256 
257 typedef struct bd_mark {
258  uint32_t idx;
259  int type; /* bd_mark_type_e */
260  uint64_t start; /* mark media time, 90kHz, ("playlist time") */
261  uint64_t duration; /* time to next mark */
262  uint64_t offset; /* mark distance from title start, bytes */
263  unsigned clip_ref;
265 
266 typedef struct bd_title_info {
267  uint32_t idx; /* filled only with bd_get_title_info() */
268  uint32_t playlist;
269  uint64_t duration;
270  uint32_t clip_count;
271  uint8_t angle_count;
272  uint32_t chapter_count;
273  uint32_t mark_count;
274  BLURAY_CLIP_INFO *clips;
275  BLURAY_TITLE_CHAPTER *chapters;
276  BLURAY_TITLE_MARK *marks;
277 
278  uint8_t mvc_base_view_r_flag;
280 
281 /*
282  * Sound effect data
283  */
284 
285 typedef struct bd_sound_effect {
286  uint8_t num_channels; /* 1 - mono, 2 - stereo */
287  uint32_t num_frames;
288  const int16_t *samples; /* 48000 Hz, 16 bit LPCM. interleaved if stereo */
290 
291 
296 void bd_get_version(int *major, int *minor, int *micro);
297 
298 /*
299  * Disc functions
300  */
301 
311 BLURAY *bd_open(const char *device_path, const char *keyfile_path);
312 
320 BLURAY *bd_init(void);
321 
330 int bd_open_disc(BLURAY *bd, const char *device_path, const char *keyfile_path);
331 
340 int bd_open_stream(BLURAY *bd,
341  void *read_blocks_handle,
342  int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks));
343 
353 struct bd_dir_s;
354 struct bd_file_s;
355 int bd_open_files(BLURAY *bd,
356  void *handle,
357  struct bd_dir_s *(*open_dir)(void *handle, const char *rel_path),
358  struct bd_file_s *(*open_file)(void *handle, const char *rel_path));
359 
365 void bd_close(BLURAY *bd);
366 
375 
389 struct meta_dl;
390 const struct meta_dl *bd_get_meta(BLURAY *bd);
391 
405 int bd_get_meta_file(BLURAY *bd, const char *file_name, void **data, int64_t *size);
406 
407 
408 /*
409  * Title selection without on-disc menus
410  */
411 
425 uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length);
426 
435 int bd_get_main_title(BLURAY *bd);
436 
446 BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned angle);
447 
455 
464 int bd_select_title(BLURAY *bd, uint32_t title);
465 
474 int bd_select_playlist(BLURAY *bd, uint32_t playlist);
475 
483 uint32_t bd_get_current_title(BLURAY *bd);
484 
494 int bd_read(BLURAY *bd, unsigned char *buf, int len);
495 
496 
497 /*
498  * Playback control functions
499  */
500 
508 int64_t bd_seek(BLURAY *bd, uint64_t pos);
509 
518 int64_t bd_seek_time(BLURAY *bd, uint64_t tick);
519 
528 int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter);
529 
538 int64_t bd_seek_mark(BLURAY *bd, unsigned mark);
539 
548 int64_t bd_seek_playitem(BLURAY *bd, unsigned clip_ref);
549 
558 int bd_select_angle(BLURAY *bd, unsigned angle);
559 
567 void bd_seamless_angle_change(BLURAY *bd, unsigned angle);
568 
591 #define BLURAY_AUDIO_STREAM 0
592 #define BLURAY_PG_TEXTST_STREAM 1
593 
594 void bd_select_stream(BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag);
595 
596 
597 /*
598  * Playback status functions
599  */
600 
609 int64_t bd_chapter_pos(BLURAY *bd, unsigned chapter);
610 
618 uint32_t bd_get_current_chapter(BLURAY *bd);
619 
629 uint64_t bd_get_title_size(BLURAY *bd);
630 
638 unsigned bd_get_current_angle(BLURAY *bd);
639 
647 uint64_t bd_tell(BLURAY *bd);
648 
656 uint64_t bd_tell_time(BLURAY *bd);
657 
658 
659 /*
660  * player settings
661  */
662 
663 typedef enum {
664  BLURAY_PLAYER_SETTING_AUDIO_LANG = 16, /* Initial audio language. String (ISO 639-2/T). */
665  BLURAY_PLAYER_SETTING_PG_LANG = 17, /* Initial PG/SPU language. String (ISO 639-2/T). */
666  BLURAY_PLAYER_SETTING_MENU_LANG = 18, /* Initial menu language. String (ISO 639-2/T). */
667  BLURAY_PLAYER_SETTING_COUNTRY_CODE = 19, /* Player country code. String (ISO 3166-1/alpha-2). */
668  BLURAY_PLAYER_SETTING_REGION_CODE = 20, /* Player region code. Integer. */
669  BLURAY_PLAYER_SETTING_OUTPUT_PREFER = 21, /* Output mode preference. Integer. */
670  BLURAY_PLAYER_SETTING_PARENTAL = 13, /* Age for parental control. Integer. */
671  BLURAY_PLAYER_SETTING_AUDIO_CAP = 15, /* Audio capability. Bit mask. */
672  BLURAY_PLAYER_SETTING_VIDEO_CAP = 29, /* Video capability. Bit mask. */
673  BLURAY_PLAYER_SETTING_DISPLAY_CAP = 23, /* Display capability. Bit mask. */
674  BLURAY_PLAYER_SETTING_3D_CAP = 24, /* 3D capability. Bit mask. */
675  BLURAY_PLAYER_SETTING_UHD_CAP = 25, /* UHD capability. */
676  BLURAY_PLAYER_SETTING_UHD_DISPLAY_CAP = 26, /* UHD display capability. */
677  BLURAY_PLAYER_SETTING_HDR_PREFERENCE = 27, /* HDR preference. */
678  BLURAY_PLAYER_SETTING_SDR_CONV_PREFER = 28, /* SDR conversion preference. */
679  BLURAY_PLAYER_SETTING_TEXT_CAP = 30, /* Text Subtitle capability. Bit mask. */
680  BLURAY_PLAYER_SETTING_PLAYER_PROFILE = 31, /* Player profile and version. */
681 
682  BLURAY_PLAYER_SETTING_DECODE_PG = 0x100, /* Enable/disable PG (subtitle) decoder. Integer. Default: disabled. */
683  BLURAY_PLAYER_SETTING_PERSISTENT_STORAGE = 0x101, /* Enable/disable BD-J persistent storage. Integer. Default: enabled. */
684 
685  BLURAY_PLAYER_PERSISTENT_ROOT = 0x200, /* Root path to the BD_J persistent storage location. String. */
686  BLURAY_PLAYER_CACHE_ROOT = 0x201, /* Root path to the BD_J cache storage location. String. */
687 } bd_player_setting;
688 
701 int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value);
702 int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *value);
703 
704 
705 /*
706  * events
707  */
708 
709 typedef enum {
710 
711  BD_EVENT_NONE = 0, /* no pending events */
712 
713  /*
714  * errors
715  */
716 
717  BD_EVENT_ERROR = 1, /* Fatal error. Playback can't be continued. */
718  BD_EVENT_READ_ERROR = 2, /* Reading of .m2ts aligned unit failed. Next call to read will try next block. */
719  BD_EVENT_ENCRYPTED = 3, /* .m2ts file is encrypted and can't be played */
720 
721  /*
722  * current playback position
723  */
724 
725  BD_EVENT_ANGLE = 4, /* current angle, 1...N */
726  BD_EVENT_TITLE = 5, /* current title, 1...N (0 = top menu) */
727  BD_EVENT_PLAYLIST = 6, /* current playlist (xxxxx.mpls) */
728  BD_EVENT_PLAYITEM = 7, /* current play item, 0...N-1 */
729  BD_EVENT_CHAPTER = 8, /* current chapter, 1...N */
730  BD_EVENT_PLAYMARK = 9, /* playmark reached */
731  BD_EVENT_END_OF_TITLE = 10,
732 
733  /*
734  * stream selection
735  */
736 
737  BD_EVENT_AUDIO_STREAM = 11, /* 1..32, 0xff = none */
738  BD_EVENT_IG_STREAM = 12, /* 1..32 */
739  BD_EVENT_PG_TEXTST_STREAM = 13, /* 1..255, 0xfff = none */
740  BD_EVENT_PIP_PG_TEXTST_STREAM = 14, /* 1..255, 0xfff = none */
741  BD_EVENT_SECONDARY_AUDIO_STREAM = 15, /* 1..32, 0xff = none */
742  BD_EVENT_SECONDARY_VIDEO_STREAM = 16, /* 1..32, 0xff = none */
743 
744  BD_EVENT_PG_TEXTST = 17, /* 0 - disable, 1 - enable */
745  BD_EVENT_PIP_PG_TEXTST = 18, /* 0 - disable, 1 - enable */
746  BD_EVENT_SECONDARY_AUDIO = 19, /* 0 - disable, 1 - enable */
747  BD_EVENT_SECONDARY_VIDEO = 20, /* 0 - disable, 1 - enable */
748  BD_EVENT_SECONDARY_VIDEO_SIZE = 21, /* 0 - PIP, 0xf - fullscreen */
749 
750  /*
751  * playback control
752  */
753 
754  /* HDMV VM or JVM stopped playlist playback. Flush all buffers. */
755  BD_EVENT_PLAYLIST_STOP = 22,
756 
757  /* discontinuity in the stream (non-seamless connection). Reset demuxer PES buffers. */
758  BD_EVENT_DISCONTINUITY = 23, /* new timestamp (45 kHz) */
759 
760  /* HDMV VM or JVM seeked the stream. Next read() will return data from new position. Flush all buffers. */
761  BD_EVENT_SEEK = 24, /* new media time (45 kHz) */
762 
763  /* still playback (pause) */
764  BD_EVENT_STILL = 25, /* 0 - off, 1 - on */
765 
766  /* Still playback for n seconds (reached end of still mode play item).
767  * Playback continues by calling bd_read_skip_still(). */
768  BD_EVENT_STILL_TIME = 26, /* 0 = infinite ; 1...300 = seconds */
769 
770  /* Play sound effect */
771  BD_EVENT_SOUND_EFFECT = 27, /* effect ID */
772 
773  /*
774  * status
775  */
776 
777  /* Nothing to do. Playlist is not playing, but title applet is running.
778  * Application should not call bd_read*() immediately again to avoid busy loop. */
779  BD_EVENT_IDLE = 28,
780 
781  /* Pop-Up menu available */
782  BD_EVENT_POPUP = 29, /* 0 - no, 1 - yes */
783 
784  /* Interactive menu visible */
785  BD_EVENT_MENU = 30, /* 0 - no, 1 - yes */
786 
787  /* 3D */
788  BD_EVENT_STEREOSCOPIC_STATUS = 31, /* 0 - 2D, 1 - 3D */
789 
790  /* BD-J key interest table changed */
791  BD_EVENT_KEY_INTEREST_TABLE = 32, /* bitmask, BLURAY_KIT_* */
792 
793  /* UO mask changed */
794  BD_EVENT_UO_MASK_CHANGED = 33, /* bitmask, BLURAY_UO_* */
795 
796  /*BD_EVENT_LAST = 33, */
797 
798 } bd_event_e;
799 
800 typedef struct {
801  uint32_t event; /* bd_event_e */
802  uint32_t param;
803 } BD_EVENT;
804 
805 /* BD_EVENT_ERROR param values */
806 #define BD_ERROR_HDMV 1
807 #define BD_ERROR_BDJ 2
808 
809 /* BD_EVENT_ENCRYPTED param vlues */
810 #define BD_ERROR_AACS 3
811 #define BD_ERROR_BDPLUS 4
812 
813 /* BD_EVENT_TITLE special titles */
814 #define BLURAY_TITLE_FIRST_PLAY 0xffff
815 #define BLURAY_TITLE_TOP_MENU 0
816 
817 /* BD_EVENT_KEY_INTEREST flags */
818 #define BLURAY_KIT_PLAY 0x1
819 #define BLURAY_KIT_STOP 0x2
820 #define BLURAY_KIT_FFW 0x4
821 #define BLURAY_KIT_REW 0x8
822 #define BLURAY_KIT_TRACK_NEXT 0x10
823 #define BLURAY_KIT_TRACK_PREV 0x20
824 #define BLURAY_KIT_PAUSE 0x40
825 #define BLURAY_KIT_STILL_OFF 0x80
826 #define BLURAY_KIT_SEC_AUDIO 0x100
827 #define BLURAY_KIT_SEC_VIDEO 0x200
828 #define BLURAY_KIT_PG_TEXTST 0x400
829 
830 /* BD_EVENT_UO_MASK flags */
831 #define BLURAY_UO_MENU_CALL 0x1
832 #define BLURAY_UO_TITLE_SEARCH 0x2
833 
842 int bd_get_event(BLURAY *bd, BD_EVENT *event);
843 
844 
845 /*
846  * On-screen display
847  */
848 
849 struct bd_overlay_s; /* defined in overlay.h */
850 struct bd_argb_overlay_s; /* defined in overlay.h */
851 struct bd_argb_buffer_s; /* defined in overlay.h */
852 typedef void (*bd_overlay_proc_f)(void *, const struct bd_overlay_s * const);
853 typedef void (*bd_argb_overlay_proc_f)(void *, const struct bd_argb_overlay_s * const);
854 
874 void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func);
875 
891 void bd_register_argb_overlay_proc(BLURAY *bd, void *handle, bd_argb_overlay_proc_f func, struct bd_argb_buffer_s *buf);
892 
893 
894 /*
895  * Playback with on-disc menus
896  */
897 
907 int bd_play(BLURAY *bd);
908 
921 int bd_play_title(BLURAY *bd, unsigned title);
922 
933 int bd_menu_call(BLURAY *bd, int64_t pts);
934 
947 int bd_read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event);
948 
956 int bd_read_skip_still(BLURAY *bd);
957 
967 BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle);
968 
978 int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, struct bd_sound_effect *effect);
979 
980 
981 /*
982  * User interaction
983  */
984 
992 void bd_set_scr(BLURAY *bd, int64_t pts);
993 
1007 #define BLURAY_RATE_PAUSED 0
1008 #define BLURAY_RATE_NORMAL 90000
1009 int bd_set_rate(BLURAY *bd, uint32_t rate);
1010 
1026 int bd_user_input(BLURAY *bd, int64_t pts, uint32_t key);
1027 
1040 int bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y);
1041 
1042 
1043 /*
1044  * Testing and debugging
1045  */
1046 
1047 /* access to internal information */
1048 
1049 struct clpi_cl;
1058 struct clpi_cl *bd_get_clpi(BLURAY *bd, unsigned clip_ref);
1059 struct clpi_cl *bd_read_clpi(const char *clpi_file);
1060 
1067 void bd_free_clpi(struct clpi_cl *cl);
1068 
1069 
1070 struct mpls_pl;
1071 struct mpls_pl *bd_read_mpls(const char *mpls_file);
1072 void bd_free_mpls(struct mpls_pl *);
1073 
1074 struct mobj_objects;
1075 struct mobj_objects *bd_read_mobj(const char *mobj_file);
1076 void bd_free_mobj(struct mobj_objects *);
1077 
1078 struct bdjo_data;
1079 struct bdjo_data *bd_read_bdjo(const char *bdjo_file);
1080 void bd_free_bdjo(struct bdjo_data *);
1081 
1082 /* BD-J testing */
1083 
1084 int bd_start_bdj(BLURAY *bd, const char* start_object); // start BD-J from the specified BD-J object (should be a 5 character string)
1085 void bd_stop_bdj(BLURAY *bd); // shutdown BD-J and clean up resources
1086 
1100 int bd_read_file(BLURAY *, const char *path, void **data, int64_t *size);
1101 
1119 struct bd_dir_s *bd_open_dir(BLURAY *, const char *dir);
1120 struct bd_file_s *bd_open_file_dec(BLURAY *, const char *path);
1121 
1122 
1123 #ifdef __cplusplus
1124 }
1125 #endif
1126 
1127 #endif /* BLURAY_H_ */
bd_read_file
int bd_read_file(BLURAY *, const char *path, void **data, int64_t *size)
bd_select_title
int bd_select_title(BLURAY *bd, uint32_t title)
bd_get_main_title
int bd_get_main_title(BLURAY *bd)
bd_tell_time
uint64_t bd_tell_time(BLURAY *bd)
bd_read_skip_still
int bd_read_skip_still(BLURAY *bd)
bd_seamless_angle_change
void bd_seamless_angle_change(BLURAY *bd, unsigned angle)
bd_play_title
int bd_play_title(BLURAY *bd, unsigned title)
bd_register_argb_overlay_proc
void bd_register_argb_overlay_proc(BLURAY *bd, void *handle, bd_argb_overlay_proc_f func, struct bd_argb_buffer_s *buf)
bd_seek_mark
int64_t bd_seek_mark(BLURAY *bd, unsigned mark)
bd_seek
int64_t bd_seek(BLURAY *bd, uint64_t pos)
bd_close
void bd_close(BLURAY *bd)
bd_select_angle
int bd_select_angle(BLURAY *bd, unsigned angle)
BD_EVENT
Definition: bluray.h:800
bd_stream_info
Definition: bluray.h:215
bd_get_event
int bd_get_event(BLURAY *bd, BD_EVENT *event)
bd_get_meta_file
int bd_get_meta_file(BLURAY *bd, const char *file_name, void **data, int64_t *size)
bd_get_version
void bd_get_version(int *major, int *minor, int *micro)
bd_set_player_setting
int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value)
bd_menu_call
int bd_menu_call(BLURAY *bd, int64_t pts)
bd_get_title_info
BLURAY_TITLE_INFO * bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned angle)
bd_free_title_info
void bd_free_title_info(BLURAY_TITLE_INFO *title_info)
bd_open_stream
int bd_open_stream(BLURAY *bd, void *read_blocks_handle, int(*read_blocks)(void *handle, void *buf, int lba, int num_blocks))
bd_mouse_select
int bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y)
bd_seek_chapter
int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter)
bd_get_disc_info
const BLURAY_DISC_INFO * bd_get_disc_info(BLURAY *bd)
bd_init
BLURAY * bd_init(void)
bd_set_scr
void bd_set_scr(BLURAY *bd, int64_t pts)
bd_clip
Definition: bluray.h:226
bd_mark
Definition: bluray.h:257
bd_read
int bd_read(BLURAY *bd, unsigned char *buf, int len)
bd_get_titles
uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length)
bd_chapter_pos
int64_t bd_chapter_pos(BLURAY *bd, unsigned chapter)
BLURAY_DISC_INFO
Definition: bluray.h:69
bd_register_overlay_proc
void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func)
bd_get_sound_effect
int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, struct bd_sound_effect *effect)
bd_open_dir
struct bd_dir_s * bd_open_dir(BLURAY *, const char *dir)
bd_free_clpi
void bd_free_clpi(struct clpi_cl *cl)
bd_get_current_angle
unsigned bd_get_current_angle(BLURAY *bd)
bd_read_ext
int bd_read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event)
bd_get_current_title
uint32_t bd_get_current_title(BLURAY *bd)
bd_open
BLURAY * bd_open(const char *device_path, const char *keyfile_path)
bd_seek_time
int64_t bd_seek_time(BLURAY *bd, uint64_t tick)
bd_select_playlist
int bd_select_playlist(BLURAY *bd, uint32_t playlist)
bd_open_disc
int bd_open_disc(BLURAY *bd, const char *device_path, const char *keyfile_path)
bd_get_title_size
uint64_t bd_get_title_size(BLURAY *bd)
bd_get_current_chapter
uint32_t bd_get_current_chapter(BLURAY *bd)
bd_user_input
int bd_user_input(BLURAY *bd, int64_t pts, uint32_t key)
bd_chapter
Definition: bluray.h:249
bd_get_clpi
struct clpi_cl * bd_get_clpi(BLURAY *bd, unsigned clip_ref)
bd_sound_effect
Definition: bluray.h:285
BLURAY_TITLE
Definition: bluray.h:59
bd_seek_playitem
int64_t bd_seek_playitem(BLURAY *bd, unsigned clip_ref)
bd_title_info
Definition: bluray.h:266
bd_tell
uint64_t bd_tell(BLURAY *bd)
bd_get_playlist_info
BLURAY_TITLE_INFO * bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle)
bd_play
int bd_play(BLURAY *bd)