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-2014 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 #include "bdnav/clpi_data.h"
36 
37 #define TITLES_ALL 0
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;
46 
47 /*
48  * Disc info
49  */
50 
51 /* AACS error codes */
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
58 
59 /* HDMV / BD-J title */
60 typedef struct {
61  const char *name; /* optional title name in preferred language */
62  uint8_t interactive; /* 1 if title is interactive (title length and playback position should not be shown in UI) */
63  uint8_t accessible; /* 1 if it is allowed to jump into this title */
64  uint8_t hidden; /* 1 if title number should not be shown during playback */
65 
66  uint8_t bdj; /* 0 - HDMV title. 1 - BD-J title */
67  uint32_t id_ref; /* Movie Object number / bdjo file number */
68 } BLURAY_TITLE;
69 
70 typedef struct {
71  uint8_t bluray_detected;
72 
73  uint8_t first_play_supported;
74  uint8_t top_menu_supported;
75 
76  uint32_t num_hdmv_titles;
77  uint32_t num_bdj_titles;
78  uint32_t num_unsupported_titles;
79 
80  uint8_t aacs_detected;
81  uint8_t libaacs_detected;
82  uint8_t aacs_handled;
83 
84  uint8_t bdplus_detected;
85  uint8_t libbdplus_detected;
86  uint8_t bdplus_handled;
87 
88  /* aacs error code */
89  int aacs_error_code;
90  /* aacs MKB version */
91  int aacs_mkbv;
92 
93  /* Disc ID */
94  uint8_t disc_id[20];
95 
96  /* BD-J */
97  uint8_t bdj_detected; /* 1 if disc uses BD-J */
98  uint8_t bdj_supported; /* 1 if BD-J support was compiled in */
99  uint8_t libjvm_detected; /* 1 if usable Java VM was found */
100  uint8_t bdj_handled; /* 1 if usable Java VM + libbluray.jar was found */
101 
102  /* BD+ content code generation */
103  uint8_t bdplus_gen;
104  /* BD+ content code relese date */
105  uint32_t bdplus_date; /* (year << 16) | (month << 8) | day */
106 
107  /* disc application info */
108  uint8_t video_format; /* bd_video_format_e */
109  uint8_t frame_rate; /* bd_frame_rate_e */
110  uint8_t content_exist_3D;
111  uint8_t initial_output_mode_preference; /* 0 - 2D, 1 - 3D */
112  uint8_t provider_data[32];
113 
114  /* HDMV / BD-J titles */
115  uint32_t num_titles;
116  const BLURAY_TITLE *const *titles; /* index is title number 1 ... N */
117  const BLURAY_TITLE *first_play; /* titles[N+1]. NULL if not present on the disc. */
118  const BLURAY_TITLE *top_menu; /* titles[0]. NULL if not present on the disc. */
119 
120  char bdj_org_id[9]; /* (BD-J) disc organization ID */
121  char bdj_disc_id[33]; /* (BD-J) disc ID */
122 
123  const char *udf_volume_id; /* optional UDF volume identifier */
124 
125  uint8_t no_menu_support; /* 1 if this disc can't be played using on-disc menus */
126 
128 
129 /*
130  * Playlist info
131  */
132 
133 typedef enum {
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_SUB_PG = 0x90,
148  BLURAY_STREAM_TYPE_SUB_IG = 0x91,
149  BLURAY_STREAM_TYPE_SUB_TEXT = 0x92,
150  BLURAY_STREAM_TYPE_AUDIO_AC3PLUS_SECONDARY = 0xa1,
151  BLURAY_STREAM_TYPE_AUDIO_DTSHD_SECONDARY = 0xa2
152 } bd_stream_type_e;
153 
154 typedef enum {
155  BLURAY_VIDEO_FORMAT_480I = 1, // ITU-R BT.601-5
156  BLURAY_VIDEO_FORMAT_576I = 2, // ITU-R BT.601-4
157  BLURAY_VIDEO_FORMAT_480P = 3, // SMPTE 293M
158  BLURAY_VIDEO_FORMAT_1080I = 4, // SMPTE 274M
159  BLURAY_VIDEO_FORMAT_720P = 5, // SMPTE 296M
160  BLURAY_VIDEO_FORMAT_1080P = 6, // SMPTE 274M
161  BLURAY_VIDEO_FORMAT_576P = 7 // ITU-R BT.1358
162 } bd_video_format_e;
163 
164 typedef enum {
165  BLURAY_VIDEO_RATE_24000_1001 = 1, // 23.976
166  BLURAY_VIDEO_RATE_24 = 2,
167  BLURAY_VIDEO_RATE_25 = 3,
168  BLURAY_VIDEO_RATE_30000_1001 = 4, // 29.97
169  BLURAY_VIDEO_RATE_50 = 6,
170  BLURAY_VIDEO_RATE_60000_1001 = 7 // 59.94
171 } bd_video_rate_e;
172 
173 typedef enum {
174  BLURAY_ASPECT_RATIO_4_3 = 2,
175  BLURAY_ASPECT_RATIO_16_9 = 3
176 } bd_video_aspect_e;
177 
178 typedef enum {
179  BLURAY_AUDIO_FORMAT_MONO = 1,
180  BLURAY_AUDIO_FORMAT_STEREO = 3,
181  BLURAY_AUDIO_FORMAT_MULTI_CHAN = 6,
182  BLURAY_AUDIO_FORMAT_COMBO = 12 // Stereo ac3/dts,
183 } bd_audio_format_e;
184  // multi mlp/dts-hd
185 
186 typedef enum {
187  BLURAY_AUDIO_RATE_48 = 1,
188  BLURAY_AUDIO_RATE_96 = 4,
189  BLURAY_AUDIO_RATE_192 = 5,
190  BLURAY_AUDIO_RATE_192_COMBO = 12, // 48 or 96 ac3/dts
191  // 192 mpl/dts-hd
192  BLURAY_AUDIO_RATE_96_COMBO = 14 // 48 ac3/dts
193  // 96 mpl/dts-hd
194 } bd_audio_rate_e;
195 
196 typedef enum {
197  BLURAY_TEXT_CHAR_CODE_UTF8 = 0x01,
198  BLURAY_TEXT_CHAR_CODE_UTF16BE = 0x02,
199  BLURAY_TEXT_CHAR_CODE_SHIFT_JIS = 0x03,
200  BLURAY_TEXT_CHAR_CODE_EUC_KR = 0x04,
201  BLURAY_TEXT_CHAR_CODE_GB18030_20001 = 0x05,
202  BLURAY_TEXT_CHAR_CODE_CN_GB = 0x06,
203  BLURAY_TEXT_CHAR_CODE_BIG5 = 0x07
204 } bd_char_code_e;
205 
206 typedef enum {
207  BLURAY_STILL_NONE = 0x00,
208  BLURAY_STILL_TIME = 0x01,
209  BLURAY_STILL_INFINITE = 0x02,
210 } bd_still_mode_e;
211 
212 typedef enum {
213  BLURAY_MARK_ENTRY = 0x01, /* entry mark for chapter search */
214  BLURAY_MARK_LINK = 0x02, /* link point */
215 } bd_mark_type_e;
216 
217 typedef struct bd_stream_info {
218  uint8_t coding_type;
219  uint8_t format;
220  uint8_t rate;
221  uint8_t char_code;
222  uint8_t lang[4];
223  uint16_t pid;
224  uint8_t aspect;
225  uint8_t subpath_id;
227 
228 typedef struct bd_clip {
229  uint32_t idx;
230  uint32_t pkt_count;
231  uint8_t still_mode;
232  uint16_t still_time; /* seconds */
233  uint8_t video_stream_count;
234  uint8_t audio_stream_count;
235  uint8_t pg_stream_count;
236  uint8_t ig_stream_count;
237  uint8_t sec_audio_stream_count;
238  uint8_t sec_video_stream_count;
239  BLURAY_STREAM_INFO *video_streams;
240  BLURAY_STREAM_INFO *audio_streams;
241  BLURAY_STREAM_INFO *pg_streams;
242  BLURAY_STREAM_INFO *ig_streams;
243  BLURAY_STREAM_INFO *sec_audio_streams;
244  BLURAY_STREAM_INFO *sec_video_streams;
245 
246  uint64_t start_time; /* start media time, 90kHz, ("playlist time") */
247  uint64_t in_time; /* start timestamp, 90kHz */
248  uint64_t out_time; /* end timestamp, 90kHz */
250 
251 typedef struct bd_chapter {
252  uint32_t idx;
253  uint64_t start; /* start media time, 90kHz, ("playlist time") */
254  uint64_t duration; /* duration */
255  uint64_t offset; /* distance from title start, bytes */
256  unsigned clip_ref;
258 
259 typedef struct bd_mark {
260  uint32_t idx;
261  int type; /* bd_mark_type_e */
262  uint64_t start; /* mark media time, 90kHz, ("playlist time") */
263  uint64_t duration; /* time to next mark */
264  uint64_t offset; /* mark distance from title start, bytes */
265  unsigned clip_ref;
267 
268 typedef struct bd_title_info {
269  uint32_t idx;
270  uint32_t playlist;
271  uint64_t duration;
272  uint32_t clip_count;
273  uint8_t angle_count;
274  uint32_t chapter_count;
275  BLURAY_CLIP_INFO *clips;
276  BLURAY_TITLE_CHAPTER *chapters;
277 
278  uint32_t mark_count;
279  BLURAY_TITLE_MARK *marks;
280 
281  uint8_t mvc_base_view_r_flag;
283 
284 /*
285  * Sound effect data
286  */
287 
288 typedef struct bd_sound_effect {
289  uint8_t num_channels; /* 1 - mono, 2 - stereo */
290  uint32_t num_frames;
291  const int16_t *samples; /* 48000 Hz, 16 bit LPCM. interleaved if stereo */
293 
294 
299 void bd_get_version(int *major, int *minor, int *micro);
300 
301 /*
302  * Disc functions
303  */
304 
314 BLURAY *bd_open(const char *device_path, const char *keyfile_path);
315 
323 BLURAY *bd_init(void);
324 
333 int bd_open_disc(BLURAY *bd, const char *device_path, const char *keyfile_path);
334 
343 int bd_open_stream(BLURAY *bd,
344  void *read_blocks_handle,
345  int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks));
346 
356 struct bd_dir_s;
357 struct bd_file_s;
358 int bd_open_files(BLURAY *bd,
359  void *handle,
360  struct bd_dir_s *(*open_dir)(void *handle, const char *rel_path),
361  struct bd_file_s *(*open_file)(void *handle, const char *rel_path));
362 
368 void bd_close(BLURAY *bd);
369 
377 const BLURAY_DISC_INFO *bd_get_disc_info(BLURAY *bd);
378 
392 struct meta_dl;
393 const struct meta_dl *bd_get_meta(BLURAY *bd);
394 
408 int bd_get_meta_file(BLURAY *bd, const char *file_name, void **data, int64_t *size);
409 
410 
411 /*
412  * Title selection without on-disc menus
413  */
414 
428 uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length);
429 
438 int bd_get_main_title(BLURAY *bd);
439 
449 BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned angle);
450 
457 void bd_free_title_info(BLURAY_TITLE_INFO *title_info);
458 
467 int bd_select_title(BLURAY *bd, uint32_t title);
468 
477 int bd_select_playlist(BLURAY *bd, uint32_t playlist);
478 
486 uint32_t bd_get_current_title(BLURAY *bd);
487 
496 int64_t bd_find_seek_point(BLURAY *bd, uint64_t tick);
497 
507 int bd_read(BLURAY *bd, unsigned char *buf, int len);
508 
509 
510 /*
511  * Playback control functions
512  */
513 
521 int64_t bd_seek(BLURAY *bd, uint64_t pos);
522 
531 int64_t bd_seek_time(BLURAY *bd, uint64_t tick);
532 
541 int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter);
542 
551 int64_t bd_seek_mark(BLURAY *bd, unsigned mark);
552 
561 int64_t bd_seek_playitem(BLURAY *bd, unsigned clip_ref);
562 
571 int bd_select_angle(BLURAY *bd, unsigned angle);
572 
580 void bd_seamless_angle_change(BLURAY *bd, unsigned angle);
581 
595 #define BLURAY_AUDIO_STREAM 0
596 #define BLURAY_PG_TEXTST_STREAM 1
598 void bd_select_stream(BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag);
599 
600 
601 /*
602  * Playback status functions
603  */
604 
613 int64_t bd_chapter_pos(BLURAY *bd, unsigned chapter);
614 
622 uint32_t bd_get_current_chapter(BLURAY *bd);
623 
633 uint64_t bd_get_title_size(BLURAY *bd);
634 
642 unsigned bd_get_current_angle(BLURAY *bd);
643 
651 uint64_t bd_tell(BLURAY *bd);
652 
660 uint64_t bd_tell_time(BLURAY *bd);
661 
662 
663 /*
664  * player settings
665  */
666 
667 typedef enum {
668  BLURAY_PLAYER_SETTING_AUDIO_LANG = 16, /* Initial audio language. String (ISO 639-2/T). */
669  BLURAY_PLAYER_SETTING_PG_LANG = 17, /* Initial PG/SPU language. String (ISO 639-2/T). */
670  BLURAY_PLAYER_SETTING_MENU_LANG = 18, /* Initial menu language. String (ISO 639-2/T). */
671  BLURAY_PLAYER_SETTING_COUNTRY_CODE = 19, /* Player country code. String (ISO 3166-1/alpha-2). */
672  BLURAY_PLAYER_SETTING_REGION_CODE = 20, /* Player region code. Integer. */
673  BLURAY_PLAYER_SETTING_OUTPUT_PREFER = 21, /* Output mode preference. Integer. */
674  BLURAY_PLAYER_SETTING_PARENTAL = 13, /* Age for parental control. Integer. */
675  BLURAY_PLAYER_SETTING_AUDIO_CAP = 15, /* Audio capability. Bit mask. */
676  BLURAY_PLAYER_SETTING_VIDEO_CAP = 29, /* Video capability. Bit mask. */
677  BLURAY_PLAYER_SETTING_DISPLAY_CAP = 23, /* Display capability. Bit mask. */
678  BLURAY_PLAYER_SETTING_3D_CAP = 24, /* 3D capability. Bit mask. */
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. */
683  BLURAY_PLAYER_PERSISTENT_ROOT = 400, /* Root path to the BD_J persistent storage location. String. */
684  BLURAY_PLAYER_CACHE_ROOT = 401, /* Root path to the BD_J cache storage location. String. */
685 } bd_player_setting;
686 
699 int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value);
700 int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *value);
701 
702 
703 /*
704  * events
705  */
706 
707 typedef enum {
708 
709  BD_EVENT_NONE = 0, /* no pending events */
710 
711  /*
712  * errors
713  */
714 
715  BD_EVENT_ERROR = 1, /* Fatal error. Playback can't be continued. */
716  BD_EVENT_READ_ERROR = 2, /* Reading of .m2ts aligned unit failed. Next call to read will try next block. */
717  BD_EVENT_ENCRYPTED = 3, /* .m2ts file is encrypted and can't be played */
718 
719  /*
720  * current playback position
721  */
722 
723  BD_EVENT_ANGLE = 4, /* current angle, 1...N */
724  BD_EVENT_TITLE = 5, /* current title, 1...N (0 = top menu) */
725  BD_EVENT_PLAYLIST = 6, /* current playlist (xxxxx.mpls) */
726  BD_EVENT_PLAYITEM = 7, /* current play item, 0...N-1 */
727  BD_EVENT_CHAPTER = 8, /* current chapter, 1...N */
728  BD_EVENT_PLAYMARK = 30, /* playmark reached */
729  BD_EVENT_END_OF_TITLE = 9,
730 
731  /*
732  * stream selection
733  */
734 
735  BD_EVENT_AUDIO_STREAM = 10, /* 1..32, 0xff = none */
736  BD_EVENT_IG_STREAM = 11, /* 1..32 */
737  BD_EVENT_PG_TEXTST_STREAM = 12, /* 1..255, 0xfff = none */
738  BD_EVENT_PIP_PG_TEXTST_STREAM = 13, /* 1..255, 0xfff = none */
739  BD_EVENT_SECONDARY_AUDIO_STREAM = 14, /* 1..32, 0xff = none */
740  BD_EVENT_SECONDARY_VIDEO_STREAM = 15, /* 1..32, 0xff = none */
741 
742  BD_EVENT_PG_TEXTST = 16, /* 0 - disable, 1 - enable */
743  BD_EVENT_PIP_PG_TEXTST = 17, /* 0 - disable, 1 - enable */
744  BD_EVENT_SECONDARY_AUDIO = 18, /* 0 - disable, 1 - enable */
745  BD_EVENT_SECONDARY_VIDEO = 19, /* 0 - disable, 1 - enable */
746  BD_EVENT_SECONDARY_VIDEO_SIZE = 20, /* 0 - PIP, 0xf - fullscreen */
747 
748  /*
749  * playback control
750  */
751 
752  /* HDMV VM or JVM stopped playlist playback. Flush all buffers. */
753  BD_EVENT_PLAYLIST_STOP = 31,
754 
755  /* discontinuity in the stream (non-seamless connection). Reset demuxer PES buffers. */
756  BD_EVENT_DISCONTINUITY = 28, /* new timestamp (45 kHz) */
757 
758  /* HDMV VM or JVM seeked the stream. Next read() will return data from new position. Flush all buffers. */
759  BD_EVENT_SEEK = 21,
760 
761  /* still playback (pause) */
762  BD_EVENT_STILL = 22, /* 0 - off, 1 - on */
763 
764  /* Still playback for n seconds (reached end of still mode play item).
765  * Playback continues by calling bd_read_skip_still(). */
766  BD_EVENT_STILL_TIME = 23, /* 0 = infinite ; 1...300 = seconds */
767 
768  /* Play sound effect */
769  BD_EVENT_SOUND_EFFECT = 24, /* effect ID */
770 
771  /*
772  * status
773  */
774 
775  /* Nothing to do. Playlist is not playing, but title applet is running.
776  * Application should not call bd_read*() immediately again to avoid busy loop. */
777  BD_EVENT_IDLE = 29,
778 
779  /* Pop-Up menu available */
780  BD_EVENT_POPUP = 25, /* 0 - no, 1 - yes */
781 
782  /* Interactive menu visible */
783  BD_EVENT_MENU = 26, /* 0 - no, 1 - yes */
784 
785  /* 3D */
786  BD_EVENT_STEREOSCOPIC_STATUS = 27, /* 0 - 2D, 1 - 3D */
787 
788  /* BD-J key interest table changed */
789  BD_EVENT_KEY_INTEREST_TABLE = 32, /* bitmask, BLURAY_KIT_* */
790 
791  /* UO mask changed */
792  BD_EVENT_UO_MASK_CHANGED = 33, /* bitmask, BLURAY_UO_* */
793 
794  /*BD_EVENT_LAST = 33, */
795 
796 } bd_event_e;
797 
798 typedef struct {
799  uint32_t event; /* bd_event_e */
800  uint32_t param;
801 } BD_EVENT;
802 
803 /* BD_EVENT_ERROR param values */
804 #define BD_ERROR_HDMV 1
805 #define BD_ERROR_BDJ 2
806 
807 /* BD_EVENT_ENCRYPTED param vlues */
808 #define BD_ERROR_AACS 3
809 #define BD_ERROR_BDPLUS 4
810 
811 /* BD_EVENT_TITLE special titles */
812 #define BLURAY_TITLE_FIRST_PLAY 0xffff
813 #define BLURAY_TITLE_TOP_MENU 0
814 
815 /* BD_EVENT_KEY_INTEREST flags */
816 #define BLURAY_KIT_PLAY 0x1
817 #define BLURAY_KIT_STOP 0x2
818 #define BLURAY_KIT_FFW 0x4
819 #define BLURAY_KIT_REW 0x8
820 #define BLURAY_KIT_TRACK_NEXT 0x10
821 #define BLURAY_KIT_TRACK_PREV 0x20
822 #define BLURAY_KIT_PAUSE 0x40
823 #define BLURAY_KIT_STILL_OFF 0x80
824 #define BLURAY_KIT_SEC_AUDIO 0x100
825 #define BLURAY_KIT_SEC_VIDEO 0x200
826 #define BLURAY_KIT_PG_TEXTST 0x400
827 
828 /* BD_EVENT_UO_MASK flags */
829 #define BLURAY_UO_MENU_CALL 0x1
830 #define BLURAY_UO_TITLE_SEARCH 0x2
831 
840 int bd_get_event(BLURAY *bd, BD_EVENT *event);
841 
842 
843 /*
844  * On-screen display
845  */
846 
847 struct bd_overlay_s; /* defined in overlay.h */
848 struct bd_argb_overlay_s; /* defined in overlay.h */
849 struct bd_argb_buffer_s; /* defined in overlay.h */
850 typedef void (*bd_overlay_proc_f)(void *, const struct bd_overlay_s * const);
851 typedef void (*bd_argb_overlay_proc_f)(void *, const struct bd_argb_overlay_s * const);
852 
872 void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func);
873 
889 void bd_register_argb_overlay_proc(BLURAY *bd, void *handle, bd_argb_overlay_proc_f func, struct bd_argb_buffer_s *buf);
890 
891 
892 /*
893  * Playback with on-disc menus
894  */
895 
905 int bd_play(BLURAY *bd);
906 
919 int bd_play_title(BLURAY *bd, unsigned title);
920 
931 int bd_menu_call(BLURAY *bd, int64_t pts);
932 
945 int bd_read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event);
946 
954 int bd_read_skip_still(BLURAY *bd);
955 
965 BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle);
966 
976 int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, struct bd_sound_effect *effect);
977 
978 
979 /*
980  * User interaction
981  */
982 
990 void bd_set_scr(BLURAY *bd, int64_t pts);
991 
1003 int bd_user_input(BLURAY *bd, int64_t pts, uint32_t key);
1004 
1015 int bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y);
1016 
1017 
1018 /*
1019  * Testing and debugging
1020  */
1021 
1022 /* access to internal information */
1023 
1032 struct clpi_cl *bd_get_clpi(BLURAY *bd, unsigned clip_ref);
1033 struct clpi_cl *bd_read_clpi(const char *clpi_file);
1034 
1041 void bd_free_clpi(struct clpi_cl *cl);
1042 
1043 
1044 struct mpls_pl;
1045 struct mpls_pl *bd_read_mpls(const char *mpls_file);
1046 void bd_free_mpls(struct mpls_pl *);
1047 
1048 struct mobj_objects;
1049 struct mobj_objects *bd_read_mobj(const char *mobj_file);
1050 void bd_free_mobj(struct mobj_objects *);
1051 
1052 struct bdjo_data;
1053 struct bdjo_data *bd_read_bdjo(const char *bdjo_file);
1054 void bd_free_bdjo(struct bdjo_data *);
1055 
1056 /* BD-J testing */
1057 
1058 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)
1059 void bd_stop_bdj(BLURAY *bd); // shutdown BD-J and clean up resources
1060 
1074 int bd_read_file(BLURAY *, const char *path, void **data, int64_t *size);
1075 
1087 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);
1088 
1097 struct mpls_pl* bd_get_title_mpls(BLURAY * bd);
1098 
1099 #ifdef __cplusplus
1100 }
1101 #endif
1102 
1103 #endif /* BLURAY_H_ */
uint32_t bd_get_current_chapter(BLURAY *bd)
void bd_set_scr(BLURAY *bd, int64_t pts)
void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func)
int bd_user_input(BLURAY *bd, int64_t pts, uint32_t key)
int64_t bd_chapter_pos(BLURAY *bd, unsigned chapter)
int bd_read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event)
Definition: bluray.h:270
BLURAY * bd_open(const char *device_path, const char *keyfile_path)
int bd_select_title(BLURAY *bd, uint32_t title)
int bd_get_main_title(BLURAY *bd)
int64_t bd_seek_mark(BLURAY *bd, unsigned mark)
Definition: bluray.h:261
unsigned bd_get_current_angle(BLURAY *bd)
uint32_t bd_get_current_title(BLURAY *bd)
void bd_register_argb_overlay_proc(BLURAY *bd, void *handle, bd_argb_overlay_proc_f func, struct bd_argb_buffer_s *buf)
int bd_play_title(BLURAY *bd, unsigned title)
int bd_open_disc(BLURAY *bd, const char *device_path, const char *keyfile_path)
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)
int bd_select_angle(BLURAY *bd, unsigned angle)
void bd_close(BLURAY *bd)
Definition: bluray.h:230
uint64_t bd_get_title_size(BLURAY *bd)
int bd_get_meta_file(BLURAY *bd, const char *file_name, void **data, int64_t *size)
struct clpi_cl * bd_get_clpi(BLURAY *bd, unsigned clip_ref)
Definition: bluray.h:290
Definition: bluray.h:72
int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value)
int bd_menu_call(BLURAY *bd, int64_t pts)
Definition: bluray.h:219
int bd_open_stream(BLURAY *bd, void *read_blocks_handle, int(*read_blocks)(void *handle, void *buf, int lba, int num_blocks))
const BLURAY_DISC_INFO * bd_get_disc_info(BLURAY *bd)
BLURAY_TITLE_INFO * bd_get_title_info(BLURAY *bd, uint32_t title_idx, unsigned angle)
uint64_t bd_tell(BLURAY *bd)
int bd_read_skip_still(BLURAY *bd)
int bd_read(BLURAY *bd, unsigned char *buf, int len)
int64_t bd_seek_playitem(BLURAY *bd, unsigned clip_ref)
int64_t bd_find_seek_point(BLURAY *bd, uint64_t tick)
uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length)
BLURAY_TITLE_INFO * bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle)
int bd_play(BLURAY *bd)
int bd_read_file(BLURAY *, const char *path, void **data, int64_t *size)
Definition: bluray.h:253
uint64_t bd_tell_time(BLURAY *bd)
void bd_seamless_angle_change(BLURAY *bd, unsigned angle)
int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, struct bd_sound_effect *effect)
int64_t bd_seek(BLURAY *bd, uint64_t pos)
Definition: bluray.h:62
struct mpls_pl * bd_get_title_mpls(BLURAY *bd)
void bd_get_version(int *major, int *minor, int *micro)
int bd_select_playlist(BLURAY *bd, uint32_t playlist)
int bd_get_event(BLURAY *bd, BD_EVENT *event)
void bd_free_title_info(BLURAY_TITLE_INFO *title_info)
void bd_free_clpi(struct clpi_cl *cl)
int bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y)
Definition: bluray.h:800
int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter)
int64_t bd_seek_time(BLURAY *bd, uint64_t tick)
BLURAY * bd_init(void)