#include <stdint.h>
Go to the source code of this file.
Classes | |
struct | BLURAY_TITLE |
struct | BLURAY_DISC_INFO |
struct | bd_stream_info |
struct | bd_clip |
struct | bd_chapter |
struct | bd_mark |
struct | bd_title_info |
struct | bd_sound_effect |
struct | BD_EVENT |
Macros | |
#define | TITLES_ALL 0 |
#define | TITLES_FILTER_DUP_TITLE 0x01 |
#define | TITLES_FILTER_DUP_CLIP 0x02 |
#define | TITLES_RELEVANT (TITLES_FILTER_DUP_TITLE | TITLES_FILTER_DUP_CLIP) |
#define | BD_AACS_CORRUPTED_DISC -1 |
#define | BD_AACS_NO_CONFIG -2 |
#define | BD_AACS_NO_PK -3 |
#define | BD_AACS_NO_CERT -4 |
#define | BD_AACS_CERT_REVOKED -5 |
#define | BD_AACS_MMC_FAILED -6 |
#define | BLURAY_PG_TEXTST_STREAM 1 |
#define | BD_ERROR_HDMV 1 |
#define | BD_ERROR_BDJ 2 |
#define | BD_ERROR_AACS 3 |
#define | BD_ERROR_BDPLUS 4 |
#define | BLURAY_TITLE_FIRST_PLAY 0xffff |
#define | BLURAY_TITLE_TOP_MENU 0 |
#define | BLURAY_KIT_PLAY 0x1 |
#define | BLURAY_KIT_STOP 0x2 |
#define | BLURAY_KIT_FFW 0x4 |
#define | BLURAY_KIT_REW 0x8 |
#define | BLURAY_KIT_TRACK_NEXT 0x10 |
#define | BLURAY_KIT_TRACK_PREV 0x20 |
#define | BLURAY_KIT_PAUSE 0x40 |
#define | BLURAY_KIT_STILL_OFF 0x80 |
#define | BLURAY_KIT_SEC_AUDIO 0x100 |
#define | BLURAY_KIT_SEC_VIDEO 0x200 |
#define | BLURAY_KIT_PG_TEXTST 0x400 |
#define | BLURAY_UO_MENU_CALL 0x1 |
#define | BLURAY_UO_TITLE_SEARCH 0x2 |
Typedefs | |
typedef struct bluray | BLURAY |
typedef struct bd_stream_info | BLURAY_STREAM_INFO |
typedef struct bd_clip | BLURAY_CLIP_INFO |
typedef struct bd_chapter | BLURAY_TITLE_CHAPTER |
typedef struct bd_mark | BLURAY_TITLE_MARK |
typedef struct bd_title_info | BLURAY_TITLE_INFO |
typedef struct bd_sound_effect | BLURAY_SOUND_EFFECT |
typedef void(* | bd_overlay_proc_f )(void *, const struct bd_overlay_s *const) |
typedef void(* | bd_argb_overlay_proc_f )(void *, const struct bd_argb_overlay_s *const) |
Functions | |
void | bd_get_version (int *major, int *minor, int *micro) |
BLURAY * | bd_open (const char *device_path, const char *keyfile_path) |
BLURAY * | bd_init (void) |
int | bd_open_disc (BLURAY *bd, const char *device_path, const char *keyfile_path) |
int | bd_open_stream (BLURAY *bd, void *read_blocks_handle, int(*read_blocks)(void *handle, void *buf, int lba, int num_blocks)) |
void | bd_close (BLURAY *bd) |
const BLURAY_DISC_INFO * | bd_get_disc_info (BLURAY *bd) |
struct meta_dl * | bd_get_meta (BLURAY *bd) |
uint32_t | bd_get_titles (BLURAY *bd, uint8_t flags, uint32_t min_title_length) |
int | bd_get_main_title (BLURAY *bd) |
BLURAY_TITLE_INFO * | bd_get_title_info (BLURAY *bd, uint32_t title_idx, unsigned angle) |
void | bd_free_title_info (BLURAY_TITLE_INFO *title_info) |
int | bd_select_title (BLURAY *bd, uint32_t title) |
int | bd_select_playlist (BLURAY *bd, uint32_t playlist) |
uint32_t | bd_get_current_title (BLURAY *bd) |
int | bd_read (BLURAY *bd, unsigned char *buf, int len) |
int64_t | bd_seek (BLURAY *bd, uint64_t pos) |
int64_t | bd_seek_time (BLURAY *bd, uint64_t tick) |
int64_t | bd_seek_chapter (BLURAY *bd, unsigned chapter) |
int64_t | bd_seek_mark (BLURAY *bd, unsigned mark) |
int64_t | bd_seek_playitem (BLURAY *bd, unsigned clip_ref) |
int | bd_select_angle (BLURAY *bd, unsigned angle) |
void | bd_seamless_angle_change (BLURAY *bd, unsigned angle) |
void | bd_select_stream (BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag) |
int64_t | bd_chapter_pos (BLURAY *bd, unsigned chapter) |
uint32_t | bd_get_current_chapter (BLURAY *bd) |
uint64_t | bd_get_title_size (BLURAY *bd) |
unsigned | bd_get_current_angle (BLURAY *bd) |
uint64_t | bd_tell (BLURAY *bd) |
uint64_t | bd_tell_time (BLURAY *bd) |
int | bd_set_player_setting (BLURAY *bd, uint32_t idx, uint32_t value) |
int | bd_set_player_setting_str (BLURAY *bd, uint32_t idx, const char *value) |
int | bd_get_event (BLURAY *bd, BD_EVENT *event) |
void | bd_register_overlay_proc (BLURAY *bd, void *handle, bd_overlay_proc_f func) |
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 (BLURAY *bd) |
int | bd_play_title (BLURAY *bd, unsigned title) |
int | bd_menu_call (BLURAY *bd, int64_t pts) |
int | bd_read_ext (BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event) |
int | bd_read_skip_still (BLURAY *bd) |
BLURAY_TITLE_INFO * | bd_get_playlist_info (BLURAY *bd, uint32_t playlist, unsigned angle) |
int | bd_get_sound_effect (BLURAY *bd, unsigned sound_id, struct bd_sound_effect *effect) |
void | bd_set_scr (BLURAY *bd, int64_t pts) |
int | bd_user_input (BLURAY *bd, int64_t pts, uint32_t key) |
int | bd_mouse_select (BLURAY *bd, int64_t pts, uint16_t x, uint16_t y) |
struct clpi_cl * | bd_get_clpi (BLURAY *bd, unsigned clip_ref) |
struct clpi_cl * | bd_read_clpi (const char *clpi_file) |
void | bd_free_clpi (struct clpi_cl *cl) |
struct mpls_pl * | bd_read_mpls (const char *mpls_file) |
void | bd_free_mpls (struct mpls_pl *) |
struct mobj_objects * | bd_read_mobj (const char *mobj_file) |
void | bd_free_mobj (struct mobj_objects *) |
struct bdjo_data * | bd_read_bdjo (const char *bdjo_file) |
void | bd_free_bdjo (struct bdjo_data *) |
int | bd_start_bdj (BLURAY *bd, const char *start_object) |
void | bd_stop_bdj (BLURAY *bd) |
external API header
#define BLURAY_PG_TEXTST_STREAM 1 |
Select stream (PG / TextST track)
This function can be used to override automatic stream selection. Selecting the stream is useful only when using libbluray internal decoders or stream is stored in a sub-path.
bd | BLURAY object |
stream_type | BLURAY_*_STREAM |
stream_id | stream number (1..N) |
enable_flag | set to 0 to disable streams of this type |
#define TITLES_ALL 0 |
all titles.
#define TITLES_FILTER_DUP_CLIP 0x02 |
remove titles that have duplicate clips.
#define TITLES_FILTER_DUP_TITLE 0x01 |
remove duplicate titles.
#define TITLES_RELEVANT (TITLES_FILTER_DUP_TITLE | TITLES_FILTER_DUP_CLIP) |
remove duplicate titles and clips
int64_t bd_chapter_pos | ( | BLURAY * | bd, |
unsigned | chapter | ||
) |
Find the byte position of a chapter
bd | BLURAY object |
chapter | chapter to find position of |
void bd_close | ( | BLURAY * | bd | ) |
Close BluRay disc
bd | BLURAY object |
void bd_free_clpi | ( | struct clpi_cl * | cl | ) |
Free CLPI_CL object
cl | CLPI_CL objects |
void bd_free_title_info | ( | BLURAY_TITLE_INFO * | title_info | ) |
Free BLURAY_TITLE_INFO object
title_info | BLURAY_TITLE_INFO object |
|
read |
Get copy of clip information for requested playitem.
bd | BLURAY objects |
clip_ref | requested playitem number |
unsigned bd_get_current_angle | ( | BLURAY * | bd | ) |
Return the current angle
bd | BLURAY object |
uint32_t bd_get_current_chapter | ( | BLURAY * | bd | ) |
Get the current chapter
bd | BLURAY object |
uint32_t bd_get_current_title | ( | BLURAY * | bd | ) |
Returns the current title index
bd | BLURAY object |
const BLURAY_DISC_INFO* bd_get_disc_info | ( | BLURAY * | bd | ) |
Get information about current BluRay disc
bd | BLURAY object |
int bd_get_event | ( | BLURAY * | bd, |
BD_EVENT * | event | ||
) |
Get event from libbluray event queue.
bd | BLURAY object |
event | next BD_EVENT from event queue, NULL to initialize event queue |
int bd_get_main_title | ( | BLURAY * | bd | ) |
Get main title Returned number is an index to the list created by bd_get_titles()
bd | BLURAY object |
BLURAY_TITLE_INFO* bd_get_playlist_info | ( | BLURAY * | bd, |
uint32_t | playlist, | ||
unsigned | angle | ||
) |
Get information about a playlist
bd | BLURAY object |
playlist | playlist number |
angle | angle number (chapter offsets and clip size depend on selected angle) |
int bd_get_sound_effect | ( | BLURAY * | bd, |
unsigned | sound_id, | ||
struct bd_sound_effect * | effect | ||
) |
Get sound effect
bd | BLURAY object |
effect_id | sound effect id (0...N) |
effect | sound effect data |
BLURAY_TITLE_INFO* bd_get_title_info | ( | BLURAY * | bd, |
uint32_t | title_idx, | ||
unsigned | angle | ||
) |
Get information about a title
bd | BLURAY object |
title_idx | title index number |
angle | angle number (chapter offsets and clip size depend on selected angle) |
uint64_t bd_get_title_size | ( | BLURAY * | bd | ) |
Returns file size in bytes of currently selected title, 0 in no title selected
bd | BLURAY object |
uint32_t bd_get_titles | ( | BLURAY * | bd, |
uint8_t | flags, | ||
uint32_t | min_title_length | ||
) |
Get number of titles (playlists)
This must be called after bd_open() and before bd_select_title(). Populates the title list in BLURAY. Filtering of the returned list is controled through title flags
bd | BLURAY object |
flags | title flags |
min_title_length | filter out titles shorter than min_title_length seconds |
void bd_get_version | ( | int * | major, |
int * | minor, | ||
int * | micro | ||
) |
Get library version
BLURAY* bd_init | ( | void | ) |
Initialize BLURAY object
Resulting object can be passed to following bd_open_??? functions.
int bd_menu_call | ( | BLURAY * | bd, |
int64_t | pts | ||
) |
Open BluRay disc Top Menu.
Current pts is needed for resuming playback when menu is closed.
bd | BLURAY object |
pts | current playback position (1/90000s) or -1 |
int bd_mouse_select | ( | BLURAY * | bd, |
int64_t | pts, | ||
uint16_t | x, | ||
uint16_t | y | ||
) |
Select menu button at location (x,y).
bd | BLURAY object |
pts | current playback position (1/90000s) or -1 |
x | mouse pointer x-position |
y | mouse pointer y-position |
BLURAY* bd_open | ( | const char * | device_path, |
const char * | keyfile_path | ||
) |
Open BluRay disc
Shortcut for bd_open_disc(bd_init(), device_path, keyfile_path)
device_path | path to mounted Blu-ray disc, device or image file |
keyfile_path | path to KEYDB.cfg (may be NULL) |
int bd_open_disc | ( | BLURAY * | bd, |
const char * | device_path, | ||
const char * | keyfile_path | ||
) |
Open BluRay disc
bd | BLURAY object |
device_path | path to mounted Blu-ray disc, device or image file |
keyfile_path | path to KEYDB.cfg (may be NULL) |
int bd_open_stream | ( | BLURAY * | bd, |
void * | read_blocks_handle, | ||
int(*)(void *handle, void *buf, int lba, int num_blocks) | read_blocks | ||
) |
Open BluRay disc
bd | BLURAY object |
handle | opaque handle for read_blocks |
read_blocks | function used to read disc blocks |
int bd_play | ( | BLURAY * | bd | ) |
Start playing disc with on-disc menus
Playback is started from "First Play" title.
bd | BLURAY object |
int bd_play_title | ( | BLURAY * | bd, |
unsigned | title | ||
) |
Play a title (from disc index).
Title 0 = Top Menu Title 0xffff = First Play title Number of titles can be found from BLURAY_DISC_INFO.
bd | BLURAY object |
title | title number from disc index |
int bd_read | ( | BLURAY * | bd, |
unsigned char * | buf, | ||
int | len | ||
) |
Read from currently selected title file, decrypt if possible
bd | BLURAY object |
buf | buffer to read data into |
len | size of data to be read |
int bd_read_ext | ( | BLURAY * | bd, |
unsigned char * | buf, | ||
int | len, | ||
BD_EVENT * | event | ||
) |
Read from currently playing title.
When playing disc in navigation mode this function must be used instead of bd_read().
bd | BLURAY object |
buf | buffer to read data into |
len | size of data to be read |
event | next BD_EVENT from event queue (BD_EVENT_NONE if no events) |
int bd_read_skip_still | ( | BLURAY * | bd | ) |
Continue reading after still mode clip
bd | BLURAY object |
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
ARGB overlays are used with BD-J (Java) menus.
Callback function can be called at any time by a thread created by Java VM. No more than single call for each overlay plane are executed in paraller.
bd | BLURAY object |
handle | application-specific handle that will be passed to handler function |
func | handler function pointer |
buf | optional application-allocated frame buffer |
void bd_register_overlay_proc | ( | BLURAY * | bd, |
void * | handle, | ||
bd_overlay_proc_f | func | ||
) |
Register handler for compressed YUV overlays
Compressed YUV overlays are used with presentation graphics (subtitles) and HDMV mode menus. This function can be used when player does not support full-screen ARGB overlays or player can optimize drawing of compressed overlays, color space conversion etc.
Callback function is called from application thread context while bd_*() functions are called.
Note that BD-J mode outputs only ARGB graphics.
bd | BLURAY object |
handle | application-specific handle that will be passed to handler function |
func | handler function pointer |
void bd_seamless_angle_change | ( | BLURAY * | bd, |
unsigned | angle | ||
) |
Initiate seamless angle change
bd | BLURAY object |
angle | angle to change to |
int64_t bd_seek | ( | BLURAY * | bd, |
uint64_t | pos | ||
) |
Seek to pos in currently selected title
bd | BLURAY object |
pos | position to seek to |
int64_t bd_seek_chapter | ( | BLURAY * | bd, |
unsigned | chapter | ||
) |
Seek to a chapter. First chapter is 0
bd | BLURAY object |
chapter | chapter to seek to |
int64_t bd_seek_mark | ( | BLURAY * | bd, |
unsigned | mark | ||
) |
Seek to a playmark. First mark is 0
bd | BLURAY object |
mark | playmark to seek to |
int64_t bd_seek_playitem | ( | BLURAY * | bd, |
unsigned | clip_ref | ||
) |
Seek to a playitem.
bd | BLURAY object |
playitem | to seek to |
int64_t bd_seek_time | ( | BLURAY * | bd, |
uint64_t | tick | ||
) |
Seek to specific time in 90Khz ticks
bd | BLURAY ojbect |
tick | tick count |
int bd_select_angle | ( | BLURAY * | bd, |
unsigned | angle | ||
) |
Set the angle to play
bd | BLURAY object |
angle | angle to play |
int bd_select_playlist | ( | BLURAY * | bd, |
uint32_t | playlist | ||
) |
Select a playlist
bd | BLURAY object |
playlist | playlist to select |
int bd_select_title | ( | BLURAY * | bd, |
uint32_t | title | ||
) |
Select the title from the list created by bd_get_titles()
bd | BLURAY object |
title | title to select |
int bd_set_player_setting | ( | BLURAY * | bd, |
uint32_t | idx, | ||
uint32_t | value | ||
) |
Update player setting
Bit masks and enumeration values are defined in player_settings.h.
bd | BLURAY object |
idx | Player setting to update |
value | New value for player setting |
void bd_set_scr | ( | BLURAY * | bd, |
int64_t | pts | ||
) |
Update current pts.
bd | BLURAY object |
pts | current playback position (1/90000s) or -1 |
uint64_t bd_tell | ( | BLURAY * | bd | ) |
Return current pos
bd | BLURAY object |
uint64_t bd_tell_time | ( | BLURAY * | bd | ) |
Return current time
bd | BLURAY object |
int bd_user_input | ( | BLURAY * | bd, |
int64_t | pts, | ||
uint32_t | key | ||
) |
Pass user input to graphics controller. Keys are defined in libbluray/keys.h. Current pts can be updated by using BD_VK_NONE key. This is required for animated menus.
bd | BLURAY object |
pts | current playback position (1/90000s) or -1 |
key | input key |