Loading...
Searching...
No Matches
bluray.h File Reference

libbluray API More...

`#include <stdint.h>`

Go to the source code of this file.

## Data Structures

struct | BLURAY_TITLE
| HDMV / BD-J title information. More...
struct | BLURAY_DISC_INFO
| BluRay disc information. More...
struct | BLURAY_STREAM_INFO
| Clip substream information. More...
struct | BLURAY_CLIP_INFO
| Clip information. More...
struct | BLURAY_TITLE_CHAPTER
| Chapter entry. More...
struct | BLURAY_TITLE_MARK
| Playmark information. More...
struct | BLURAY_TITLE_INFO
| Playlist information. More...
struct | BLURAY_SOUND_EFFECT
| Sound effect data. More...
struct | BD_EVENT
| Event. More...

## Macros

#define | BD_PUBLIC
#define | TITLES_ALL 0
| all titles.
#define | TITLES_FILTER_DUP_TITLE 0x01
| remove duplicate titles.
#define | TITLES_FILTER_DUP_CLIP 0x02
| remove titles that have duplicate clips.
#define | TITLES_RELEVANT (TITLES_FILTER_DUP_TITLE | TITLES_FILTER_DUP_CLIP)
| remove duplicate titles and clips
#define | BD_AACS_CORRUPTED_DISC -1
| Corrupt disc (missing/invalid files).
#define | BD_AACS_NO_CONFIG -2
| AACS configuration file missing.
#define | BD_AACS_NO_PK -3
| No valid processing key found.
#define | BD_AACS_NO_CERT -4
| No valid certificate found.
#define | BD_AACS_CERT_REVOKED -5
| All certificates have been revoked.
#define | BD_AACS_MMC_FAILED -6
| MMC (disc drive interaction) failed.
#define | BLURAY_AUDIO_STREAM 0
| Select audio stream.
#define | BLURAY_PG_TEXTST_STREAM 1
| Select subtitle stream.
#define | BD_ERROR_HDMV 1
| HDMV VM failed to play the title.
#define | BD_ERROR_BDJ 2
| BD-J failed to play the title.
#define | BD_ERROR_AACS 3
| AACS failed or not supported.
#define | BD_ERROR_BDPLUS 4
| BD+ failed or not supported.
#define | BLURAY_TITLE_FIRST_PLAY 0xffff
| "First Play" title started
#define | BLURAY_TITLE_TOP_MENU 0
| "Top Menu" title started
#define | BLURAY_KIT_PLAY 0x1
| BD-J requests to handle "Play" UO.
#define | BLURAY_KIT_STOP 0x2
| BD-J requests to handle "Stop" UO.
#define | BLURAY_KIT_FFW 0x4
| BD-J requests to handle "Fast Forward" UO.
#define | BLURAY_KIT_REW 0x8
| BD-J requests to handle "Reverse" UO.
#define | BLURAY_KIT_TRACK_NEXT 0x10
| BD-J requests to handle "Next Track" UO.
#define | BLURAY_KIT_TRACK_PREV 0x20
| BD-J requests to handle "Prev Track" UO.
#define | BLURAY_KIT_PAUSE 0x40
| BD-J requests to handle "Pause" UO.
#define | BLURAY_KIT_STILL_OFF 0x80
| BD-J requests to handle "Still Off" UO.
#define | BLURAY_KIT_SEC_AUDIO 0x100
| BD-J requests to handle "Sec. Audio" UO.
#define | BLURAY_KIT_SEC_VIDEO 0x200
| BD-J requests to handle "Sec. Video" UO.
#define | BLURAY_KIT_PG_TEXTST 0x400
| BD-J requests to handle "Subtitle" UO.
#define | BLURAY_UO_MENU_CALL 0x1
| "Menu Call" masked (not allowed)
#define | BLURAY_UO_TITLE_SEARCH 0x2
| "Title Search" masked (not allowed)
#define | BLURAY_UO_CHAPTER_SEARCH 0x4
| "Chapter Search" masked (not allowed)
#define | BLURAY_UO_TIME_SEARCH_MASK 0x8
| "Time Search" masked (not allowed)
#define | BLURAY_UO_SKIP_TO_NEXT_POINT_MASK 0x10
| "Skip to Next Point" masked (not allowed)
#define | BLURAY_UO_SKIP_BACK_TO_PREVIOUS_POINT_MASK 0x20
| "Skip Back to Previous Point" masked (not allowed)
#define | BLURAY_UO_STOP_MASK 0x40
| "Stop" masked (not allowed)
#define | BLURAY_UO_PAUSE_ON_MASK 0x80
| "Pause On" masked (not allowed)
#define | BLURAY_UO_STILL_OFF_MASK 0x100
| "Still Off" masked (not allowed)
#define | BLURAY_UO_FORWARD_PLAY_MASK 0x200
| "Forward Play" masked (not allowed)
#define | BLURAY_UO_BACKWARD_PLAY_MASK 0x400
| "Backward Play" masked (not allowed)
#define | BLURAY_UO_RESUME_MASK 0x800
| "Resume" masked (not allowed)
#define | BLURAY_UO_MOVE_UP_SELECTED_BUTTON_MASK 0x1000
| "Move Up Selected Button" masked (not allowed)
#define | BLURAY_UO_MOVE_DOWN_SELECTED_BUTTON_MASK 0x2000
| "Move Down Selected Button" masked (not allowed)
#define | BLURAY_UO_MOVE_LEFT_SELECTED_BUTTON_MASK 0x4000
| "Move Left Selected Button" masked (not allowed)
#define | BLURAY_UO_MOVE_RIGHT_SELECTED_BUTTON_MASK 0x8000
| "Move Right Selected Button" masked (not allowed)
#define | BLURAY_UO_SELECT_BUTTON_MASK 0x10000
| "Select Button" masked (not allowed)
#define | BLURAY_UO_ACTIVATE_BUTTON_MASK 0x20000
| "Activate Button" masked (not allowed)
#define | BLURAY_UO_SELECT_AND_ACTIVATE_MASK 0x40000
| "Select Button and Activate" masked (not allowed)
#define | BLURAY_UO_PRIMARY_AUDIO_CHANGE_MASK 0x80000
| "Primary Audio Stream Number Change" masked (not allowed)
#define | BLURAY_UO_ANGLE_CHANGE_MASK 0x100000
| "Angle Number Change" masked (not allowed)
#define | BLURAY_UO_POPUP_ON_MASK 0x200000
| "PopUp On" masked (not allowed)
#define | BLURAY_UO_POPUP_OFF_MASK 0x400000
| "PopUp Off" masked (not allowed)
#define | BLURAY_UO_PG_TEXTST_ENABLE_DISABLE_MASK 0x800000
| "PG textST Enable Disable" masked (not allowed)
#define | BLURAY_UO_PG_TEXTST_CHANGE_MASK 0x1000000
| "PG textST Stream Number Change" masked (not allowed)
#define | BLURAY_UO_SECONDARY_VIDEO_ENABLE_DISABLE_MASK 0x2000000
| "Secondary Video Enable Disable" masked (not allowed)
#define | BLURAY_UO_SECONDARY_VIDEO_CHANGE_MASK 0x4000000
| "Secondary Video Stream Number Change" masked (not allowed)
#define | BLURAY_UO_SECONDARY_AUDIO_ENABLE_DISABLE_MASK 0x8000000
| "Secondary Audio Enable Disable" masked (not allowed)
#define | BLURAY_UO_SECONDARY_AUDIO_CHANGE_MASK 0x10000000
| "Secondary Audio Stream Number Change" masked (not allowed)
#define | BLURAY_UO_PIP_PG_TEXTST_CHANGE_MASK 0x20000000
| "PiP PG textST Stream Number Change" masked (not allowed)
#define | BLURAY_RATE_PAUSED 0
| Set playback rate to PAUSED.
#define | BLURAY_RATE_NORMAL 90000
| Set playback rate to NORMAL.

## Typedefs

typedef struct bluray | BLURAY
| This structure is opaque.
typedef void(* | bd_overlay_proc_f) (void *handle, const struct bd_overlay_s *const event)
| YUV overlay handler function type.
typedef void(* | bd_argb_overlay_proc_f) (void *handle, const struct bd_argb_overlay_s *const event)
| ARGB overlay handler function type.

## Enumerations

enum

bd_stream_type_e {
BLURAY_STREAM_TYPE_VIDEO_MPEG1 = 0x01 ,
BLURAY_STREAM_TYPE_VIDEO_MPEG2 = 0x02 ,
BLURAY_STREAM_TYPE_AUDIO_MPEG1 = 0x03 ,
BLURAY_STREAM_TYPE_AUDIO_MPEG2 = 0x04 ,
BLURAY_STREAM_TYPE_AUDIO_LPCM = 0x80 ,
BLURAY_STREAM_TYPE_AUDIO_AC3 = 0x81 ,
BLURAY_STREAM_TYPE_AUDIO_DTS = 0x82 ,
BLURAY_STREAM_TYPE_AUDIO_TRUHD = 0x83 ,
BLURAY_STREAM_TYPE_AUDIO_AC3PLUS = 0x84 ,
BLURAY_STREAM_TYPE_AUDIO_DTSHD = 0x85 ,
BLURAY_STREAM_TYPE_AUDIO_DTSHD_MASTER = 0x86 ,
BLURAY_STREAM_TYPE_VIDEO_VC1 = 0xea ,
BLURAY_STREAM_TYPE_VIDEO_H264 = 0x1b ,
BLURAY_STREAM_TYPE_VIDEO_HEVC = 0x24 ,
BLURAY_STREAM_TYPE_SUB_PG = 0x90 ,
BLURAY_STREAM_TYPE_SUB_IG = 0x91 ,
BLURAY_STREAM_TYPE_SUB_TEXT = 0x92 ,
BLURAY_STREAM_TYPE_AUDIO_AC3PLUS_SECONDARY = 0xa1 ,
BLURAY_STREAM_TYPE_AUDIO_DTSHD_SECONDARY = 0xa2
}

| Stream video coding type.
enum | bd_video_format_e { BLURAY_VIDEO_FORMAT_480I = 1 , BLURAY_VIDEO_FORMAT_576I = 2 , BLURAY_VIDEO_FORMAT_480P = 3 , BLURAY_VIDEO_FORMAT_1080I = 4 , BLURAY_VIDEO_FORMAT_720P = 5 , BLURAY_VIDEO_FORMAT_1080P = 6 , BLURAY_VIDEO_FORMAT_576P = 7 , BLURAY_VIDEO_FORMAT_2160P = 8 }
| Stream video format. More...
enum | bd_video_rate_e { BLURAY_VIDEO_RATE_24000_1001 = 1 , BLURAY_VIDEO_RATE_24 = 2 , BLURAY_VIDEO_RATE_25 = 3 , BLURAY_VIDEO_RATE_30000_1001 = 4 , BLURAY_VIDEO_RATE_50 = 6 , BLURAY_VIDEO_RATE_60000_1001 = 7 }
| Stream video frame rate. More...
enum | bd_video_aspect_e { BLURAY_ASPECT_RATIO_4_3 = 2 , BLURAY_ASPECT_RATIO_16_9 = 3 }
| Stream video aspect ratio.
enum | bd_audio_format_e { BLURAY_AUDIO_FORMAT_MONO = 1 , BLURAY_AUDIO_FORMAT_STEREO = 3 , BLURAY_AUDIO_FORMAT_MULTI_CHAN = 6 , BLURAY_AUDIO_FORMAT_COMBO = 12 }
| Stream audio format.
enum | bd_audio_rate_e { BLURAY_AUDIO_RATE_48 = 1 , BLURAY_AUDIO_RATE_96 = 4 , BLURAY_AUDIO_RATE_192 = 5 , BLURAY_AUDIO_RATE_192_COMBO = 12 , BLURAY_AUDIO_RATE_96_COMBO = 14 }
| Stream audio rate.
enum | bd_char_code_e { BLURAY_TEXT_CHAR_CODE_UTF8 = 0x01 , BLURAY_TEXT_CHAR_CODE_UTF16BE = 0x02 , BLURAY_TEXT_CHAR_CODE_SHIFT_JIS = 0x03 , BLURAY_TEXT_CHAR_CODE_EUC_KR = 0x04 , BLURAY_TEXT_CHAR_CODE_GB18030_20001 = 0x05 , BLURAY_TEXT_CHAR_CODE_CN_GB = 0x06 , BLURAY_TEXT_CHAR_CODE_BIG5 = 0x07 }
| Text subtitle charset.
enum | bd_still_mode_e { BLURAY_STILL_NONE = 0x00 , BLURAY_STILL_TIME = 0x01 , BLURAY_STILL_INFINITE = 0x02 }
| Clip still mode type. More...
enum | bd_mark_type_e { BLURAY_MARK_ENTRY = 0x01 , BLURAY_MARK_LINK = 0x02 }
| Mark type. More...
enum | bd_dynamic_range_type_e { BLURAY_DYNAMIC_RANGE_SDR = 0 , BLURAY_DYNAMIC_RANGE_HDR10 = 1 , BLURAY_DYNAMIC_RANGE_DOLBY_VISION = 2 }
| Clip dynamic range.
enum | bd_color_space_e { BLURAY_COLOR_SPACE_BT709 = 1 , BLURAY_COLOR_SPACE_BT2020 = 2 }

enum

bd_player_setting {
BLURAY_PLAYER_SETTING_AUDIO_LANG = 16 ,
BLURAY_PLAYER_SETTING_PG_LANG = 17 ,
BLURAY_PLAYER_SETTING_MENU_LANG = 18 ,
BLURAY_PLAYER_SETTING_COUNTRY_CODE = 19 ,
BLURAY_PLAYER_SETTING_REGION_CODE = 20 ,
BLURAY_PLAYER_SETTING_OUTPUT_PREFER = 21 ,
BLURAY_PLAYER_SETTING_PARENTAL = 13 ,
BLURAY_PLAYER_SETTING_AUDIO_CAP = 15 ,
BLURAY_PLAYER_SETTING_VIDEO_CAP = 29 ,
BLURAY_PLAYER_SETTING_DISPLAY_CAP = 23 ,
BLURAY_PLAYER_SETTING_3D_CAP = 24 ,
BLURAY_PLAYER_SETTING_UHD_CAP = 25 ,
BLURAY_PLAYER_SETTING_UHD_DISPLAY_CAP = 26 ,
BLURAY_PLAYER_SETTING_HDR_PREFERENCE = 27 ,
BLURAY_PLAYER_SETTING_SDR_CONV_PREFER = 28 ,
BLURAY_PLAYER_SETTING_TEXT_CAP = 30 ,
BLURAY_PLAYER_SETTING_PLAYER_PROFILE = 31 ,
BLURAY_PLAYER_SETTING_DECODE_PG = 0x100 ,
BLURAY_PLAYER_SETTING_PERSISTENT_STORAGE = 0x101 ,
BLURAY_PLAYER_SETTING_UO_RESTRICTION_LEVEL = 0x102 ,
BLURAY_PLAYER_PERSISTENT_ROOT = 0x200 ,
BLURAY_PLAYER_CACHE_ROOT = 0x201 ,
BLURAY_PLAYER_JAVA_HOME = 0x202
}

| Player setting. More...

enum

bd_event_e {
BD_EVENT_NONE = 0 ,
BD_EVENT_ERROR = 1 ,
BD_EVENT_READ_ERROR = 2 ,
BD_EVENT_ENCRYPTED = 3 ,
BD_EVENT_ANGLE = 4 ,
BD_EVENT_TITLE = 5 ,
BD_EVENT_PLAYLIST = 6 ,
BD_EVENT_PLAYITEM = 7 ,
BD_EVENT_CHAPTER = 8 ,
BD_EVENT_PLAYMARK = 9 ,
BD_EVENT_END_OF_TITLE = 10 ,
BD_EVENT_AUDIO_STREAM = 11 ,
BD_EVENT_IG_STREAM = 12 ,
BD_EVENT_PG_TEXTST_STREAM = 13 ,
BD_EVENT_PIP_PG_TEXTST_STREAM = 14 ,
BD_EVENT_SECONDARY_AUDIO_STREAM = 15 ,
BD_EVENT_SECONDARY_VIDEO_STREAM = 16 ,
BD_EVENT_PG_TEXTST = 17 ,
BD_EVENT_PIP_PG_TEXTST = 18 ,
BD_EVENT_SECONDARY_AUDIO = 19 ,
BD_EVENT_SECONDARY_VIDEO = 20 ,
BD_EVENT_SECONDARY_VIDEO_SIZE = 21 ,
BD_EVENT_PLAYLIST_STOP = 22 ,
BD_EVENT_DISCONTINUITY = 23 ,
BD_EVENT_SEEK = 24 ,
BD_EVENT_STILL = 25 ,
BD_EVENT_STILL_TIME = 26 ,
BD_EVENT_SOUND_EFFECT = 27 ,
BD_EVENT_IDLE = 28 ,
BD_EVENT_POPUP = 29 ,
BD_EVENT_MENU = 30 ,
BD_EVENT_STEREOSCOPIC_STATUS = 31 ,
BD_EVENT_KEY_INTEREST_TABLE = 32 ,
BD_EVENT_UO_MASK_CHANGED = 33
}

| Event type. More...

## Functions

BD_PUBLIC void | bd_get_version (int *major, int *minor, int *micro)
| Get libbluray version.
BD_PUBLIC BLURAY * | bd_open (const char *device_path, const char *keyfile_path)
| Open BluRay disc.
BD_PUBLIC BLURAY * | bd_init (void)
| Initialize BLURAY object.
BD_PUBLIC int | bd_open_disc (BLURAY *bd, const char *device_path, const char *keyfile_path)
| Open BluRay disc.
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 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.
BD_PUBLIC void | bd_close (BLURAY *bd)
| Close BluRay disc.
BD_PUBLIC const BLURAY_DISC_INFO * | bd_get_disc_info (BLURAY *bd)
| Get information about current BluRay disc.
BD_PUBLIC const struct meta_dl * | bd_get_meta (BLURAY *bd)
| Get meta information about current BluRay disc.
BD_PUBLIC int | bd_get_meta_file (BLURAY *bd, const char *file_name, void **data, int64_t *size)
| Read metadata file from BluRay disc.
BD_PUBLIC uint32_t | bd_get_titles (BLURAY *bd, uint8_t flags, uint32_t min_title_length)
| Get number of titles (playlists).
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 BLURAY_TITLE_INFO * | bd_get_title_info (BLURAY *bd, uint32_t title_idx, unsigned angle)
| Get information about a title.
BD_PUBLIC void | bd_free_title_info (BLURAY_TITLE_INFO *title_info)
| Free BLURAY_TITLE_INFO object.
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_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_PUBLIC int | bd_read (BLURAY *bd, unsigned char *buf, int len)
| Read from currently selected title file, decrypt if possible.
BD_PUBLIC int64_t | bd_seek (BLURAY *bd, uint64_t pos)
| Seek to pos in currently selected title.
BD_PUBLIC int64_t | bd_seek_time (BLURAY *bd, uint64_t tick)
| Seek to specific time in 90Khz ticks.
BD_PUBLIC int64_t | bd_seek_chapter (BLURAY *bd, unsigned chapter)
| Seek to a chapter.
BD_PUBLIC int64_t | bd_seek_mark (BLURAY *bd, unsigned mark)
| Seek to a playmark.
BD_PUBLIC int64_t | bd_seek_playitem (BLURAY *bd, unsigned clip_ref)
| Seek to a playitem.
BD_PUBLIC int | bd_select_angle (BLURAY *bd, unsigned angle)
| Set the angle to play.
BD_PUBLIC void | bd_seamless_angle_change (BLURAY *bd, unsigned angle)
| Initiate seamless angle change.
BD_PUBLIC int | bd_select_stream (BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag)
| Select stream (PG / TextST track).
BD_PUBLIC int64_t | bd_chapter_pos (BLURAY *bd, unsigned chapter)
| Find the byte position of a chapter.
BD_PUBLIC uint32_t | bd_get_current_chapter (BLURAY *bd)
| Get the current chapter.
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 unsigned | bd_get_current_angle (BLURAY *bd)
| Return the current angle.
BD_PUBLIC uint64_t | bd_tell (BLURAY *bd)
| Return current pos.
BD_PUBLIC uint64_t | bd_tell_time (BLURAY *bd)
| Return current time.
BD_PUBLIC int | bd_set_player_setting (BLURAY *bd, uint32_t idx, uint32_t value)
| Update player setting.
BD_PUBLIC int | bd_set_player_setting_str (BLURAY *bd, uint32_t idx, const char *value)
| Update player setting (string).
BD_PUBLIC int | bd_get_event (BLURAY *bd, BD_EVENT *event)
| Get event from libbluray event queue.
BD_PUBLIC const char * | bd_event_name (uint32_t event)
| Get name of event.
BD_PUBLIC void | bd_register_overlay_proc (BLURAY *bd, void *handle, bd_overlay_proc_f func)
| Register handler for compressed YUV overlays.
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 int | bd_play (BLURAY *bd)
| Start playing disc with on-disc menus.
BD_PUBLIC int | bd_play_title (BLURAY *bd, unsigned title)
| Play a title (from disc index).
BD_PUBLIC int | bd_menu_call (BLURAY *bd, int64_t pts)
| Open BluRay disc Top Menu.
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_read_skip_still (BLURAY *bd)
| Continue reading after still mode clip.
BD_PUBLIC BLURAY_TITLE_INFO * | bd_get_playlist_info (BLURAY *bd, uint32_t playlist, unsigned angle)
| Get information about a playlist.
BD_PUBLIC int | bd_get_sound_effect (BLURAY *bd, unsigned sound_id, struct bd_sound_effect *effect)
| Get sound effect.
BD_PUBLIC void | bd_set_scr (BLURAY *bd, int64_t pts)
| Update current pts.
BD_PUBLIC int | bd_set_rate (BLURAY *bd, uint32_t rate)
| Set current playback rate.
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_mouse_select (BLURAY *bd, int64_t pts, uint16_t x, uint16_t y)
| Select menu button at location (x,y).
BD_PUBLIC struct clpi_cl * | bd_get_clpi (BLURAY *bd, unsigned clip_ref)
| Get copy of clip information for requested playitem.
BD_PUBLIC struct clpi_cl * | bd_read_clpi (const char *clpi_file)
| Testing/debugging: Parse clip information (CLPI) file.
BD_PUBLIC void | bd_free_clpi (struct clpi_cl *cl)
| Free CLPI_CL object.
BD_PUBLIC struct mpls_pl * | bd_read_mpls (const char *mpls_file)
| Testing/debugging: Parse playlist (MPLS) file.
BD_PUBLIC void | bd_free_mpls (struct mpls_pl *)
| Testing/debugging: Free parsed playlist.
BD_PUBLIC struct mobj_objects * | bd_read_mobj (const char *mobj_file)
| Testing/debugging: Parse movie objects (MOBJ) file.
BD_PUBLIC void | bd_free_mobj (struct mobj_objects *)
| Testing/debugging: Free parsed movie objects.
BD_PUBLIC struct bdjo_data * | bd_read_bdjo (const char *bdjo_file)
| Testing/debugging: Parse BD-J object file (BDJO).
BD_PUBLIC void | bd_free_bdjo (struct bdjo_data *)
| Testing/debugging: Free parsed BDJO object.
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 void | bd_stop_bdj (BLURAY *bd)
| Testing/debugging: shutdown BD-J and clean up resources.
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 struct bd_dir_s * | bd_open_dir (BLURAY *bd, const char *dir)
| Open a directory from BluRay Virtual File System.
BD_PUBLIC struct bd_file_s * | bd_open_file_dec (BLURAY *bd, const char *path)
| Open a file from BluRay Virtual File System.

## Detailed Description

libbluray API

## Typedef Documentation

## bd_argb_overlay_proc_f

typedef void(* bd_argb_overlay_proc_f) (void *handle, const struct bd_argb_overlay_s *const event)

ARGB overlay handler function type.

Parameters

  handle | opaque handle that was given to bd_register_argb_overlay_proc()
  event | BD_ARGB_OVERLAY event

## bd_overlay_proc_f

typedef void(* bd_overlay_proc_f) (void *handle, const struct bd_overlay_s *const event)

YUV overlay handler function type.

Parameters

  handle | opaque handle that was given to bd_register_overlay_proc()
  event | BD_OVERLAY event

## BLURAY

typedef struct bluray BLURAY

This structure is opaque.

It represents a libbluray instance.

## Enumeration Type Documentation

## bd_event_e

enum bd_event_e

Event type.

Enumerator
BD_EVENT_NONE | no pending events
BD_EVENT_ERROR | Fatal error. Playback can't be continued.
BD_EVENT_READ_ERROR | Reading of .m2ts aligned unit failed. Next call to read will try next block.
BD_EVENT_ENCRYPTED | .m2ts file is encrypted and can't be played
BD_EVENT_ANGLE | current angle, 1...N
BD_EVENT_TITLE | current title, 1...N (0 = top menu)
BD_EVENT_PLAYLIST | current playlist (xxxxx.mpls)
BD_EVENT_PLAYITEM | current play item, 0...N-1
BD_EVENT_CHAPTER | current chapter, 1...N
BD_EVENT_PLAYMARK | playmark reached
BD_EVENT_END_OF_TITLE | end of title reached
BD_EVENT_AUDIO_STREAM | 1..32, 0xff = none
BD_EVENT_IG_STREAM | 1..32
BD_EVENT_PG_TEXTST_STREAM | 1..255, 0xfff = none
BD_EVENT_PIP_PG_TEXTST_STREAM | 1..255, 0xfff = none
BD_EVENT_SECONDARY_AUDIO_STREAM | 1..32, 0xff = none
BD_EVENT_SECONDARY_VIDEO_STREAM | 1..32, 0xff = none
BD_EVENT_PG_TEXTST | 0 - disable, 1 - enable
BD_EVENT_PIP_PG_TEXTST | 0 - disable, 1 - enable
BD_EVENT_SECONDARY_AUDIO | 0 - disable, 1 - enable
BD_EVENT_SECONDARY_VIDEO | 0 - disable, 1 - enable
BD_EVENT_SECONDARY_VIDEO_SIZE | 0 - PIP, 0xf - fullscreen
BD_EVENT_PLAYLIST_STOP | HDMV VM or JVM stopped playlist playback. Flush all buffers.
BD_EVENT_DISCONTINUITY | discontinuity in the stream (non-seamless connection). Reset demuxer PES buffers. new timestamp (45 kHz)
BD_EVENT_SEEK | HDMV VM or JVM seeked the stream. Next read() will return data from new position. Flush all buffers. new media time (45 kHz)
BD_EVENT_STILL | still playback (pause) 0 - off, 1 - on
BD_EVENT_STILL_TIME | Still playback for n seconds (reached end of still mode play item). Playback continues by calling bd_read_skip_still(). 0 = infinite ; 1...300 = seconds
BD_EVENT_SOUND_EFFECT | Play sound effect. effect ID
BD_EVENT_IDLE | Nothing to do. Playlist is not playing, but title applet is running. Application should not call bd_read*() immediately again to avoid busy loop.
BD_EVENT_POPUP | Pop-Up menu available. 0 - no, 1 - yes
BD_EVENT_MENU | Interactive menu visible. 0 - no, 1 - yes
BD_EVENT_STEREOSCOPIC_STATUS | 3D 0 - 2D, 1 - 3D
BD_EVENT_KEY_INTEREST_TABLE | BD-J key interest table changed. bitmask, BLURAY_KIT_*
BD_EVENT_UO_MASK_CHANGED | UO mask changed. bitmask, BLURAY_UO_*

## bd_mark_type_e

enum bd_mark_type_e

Mark type.

Enumerator
BLURAY_MARK_ENTRY | entry mark for chapter search
BLURAY_MARK_LINK | link point

## bd_player_setting

enum bd_player_setting

Player setting.

Enumerator
BLURAY_PLAYER_SETTING_AUDIO_LANG | Initial audio language. String (ISO 639-2/T).
BLURAY_PLAYER_SETTING_PG_LANG | Initial PG/SPU language. String (ISO 639-2/T).
BLURAY_PLAYER_SETTING_MENU_LANG | Initial menu language. String (ISO 639-2/T).
BLURAY_PLAYER_SETTING_COUNTRY_CODE | Player country code. String (ISO 3166-1/alpha-2).
BLURAY_PLAYER_SETTING_REGION_CODE | Player region code. Integer.
BLURAY_PLAYER_SETTING_OUTPUT_PREFER | Output mode preference. Integer.
BLURAY_PLAYER_SETTING_PARENTAL | Age for parental control. Integer.
BLURAY_PLAYER_SETTING_AUDIO_CAP | Audio capability. Bit mask.
BLURAY_PLAYER_SETTING_VIDEO_CAP | Video capability. Bit mask.
BLURAY_PLAYER_SETTING_DISPLAY_CAP | Display capability. Bit mask.
BLURAY_PLAYER_SETTING_3D_CAP | 3D capability. Bit mask.
BLURAY_PLAYER_SETTING_UHD_CAP | UHD capability.
BLURAY_PLAYER_SETTING_UHD_DISPLAY_CAP | UHD display capability.
BLURAY_PLAYER_SETTING_HDR_PREFERENCE | HDR preference.
BLURAY_PLAYER_SETTING_SDR_CONV_PREFER | SDR conversion preference.
BLURAY_PLAYER_SETTING_TEXT_CAP | Text Subtitle capability. Bit mask.
BLURAY_PLAYER_SETTING_PLAYER_PROFILE | Player profile and version.
BLURAY_PLAYER_SETTING_DECODE_PG | Enable/disable PG (subtitle) decoder. Integer. Default: disabled.
BLURAY_PLAYER_SETTING_PERSISTENT_STORAGE | Enable/disable BD-J persistent storage. Integer. Default: enabled.
BLURAY_PLAYER_SETTING_UO_RESTRICTION_LEVEL | Set User Operations (UO) restriction mask enforcement level. bd_player_setting_uo_restriction_level value. Default: BLURAY_PLAYER_SETTING_UO_RESTRICTION_RELAXED.
BLURAY_PLAYER_PERSISTENT_ROOT | Root path to the BD_J persistent storage location. String.
BLURAY_PLAYER_CACHE_ROOT | Root path to the BD_J cache storage location. String.
BLURAY_PLAYER_JAVA_HOME | Location of JRE. String. Default: NULL (autodetect).

## bd_still_mode_e

enum bd_still_mode_e

Clip still mode type.

Enumerator
BLURAY_STILL_NONE | No still (normal playback).
BLURAY_STILL_TIME | Still playback for fixed time.
BLURAY_STILL_INFINITE | Infinite still.

## bd_video_format_e

enum bd_video_format_e

Stream video format.

Enumerator
BLURAY_VIDEO_FORMAT_480I | ITU-R BT.601-5.
BLURAY_VIDEO_FORMAT_576I | ITU-R BT.601-4.
BLURAY_VIDEO_FORMAT_480P | SMPTE 293M.
BLURAY_VIDEO_FORMAT_1080I | SMPTE 274M.
BLURAY_VIDEO_FORMAT_720P | SMPTE 296M.
BLURAY_VIDEO_FORMAT_1080P | SMPTE 274M.
BLURAY_VIDEO_FORMAT_576P | ITU-R BT.1358.
BLURAY_VIDEO_FORMAT_2160P | BT.2020.

## bd_video_rate_e

enum bd_video_rate_e

Stream video frame rate.

Enumerator
BLURAY_VIDEO_RATE_24000_1001 | 23.976 Hz
BLURAY_VIDEO_RATE_24 | 24 Hz
BLURAY_VIDEO_RATE_25 | 25 Hz
BLURAY_VIDEO_RATE_30000_1001 | 29.97 Hz
BLURAY_VIDEO_RATE_50 | 50 Hz
BLURAY_VIDEO_RATE_60000_1001 | 59.94 Hz

## Function Documentation

## bd_chapter_pos()

BD_PUBLIC int64_t bd_chapter_pos | ( | BLURAY * | bd,
|  | unsigned | chapter )

Find the byte position of a chapter.

Parameters

  bd | BLURAY object
  chapter | chapter to find position of

Returns
  seek position of chapter start

## bd_close()

BD_PUBLIC void bd_close | ( | BLURAY * | bd | ) |

Close BluRay disc.

Parameters

  bd | BLURAY object

## bd_event_name()

BD_PUBLIC const char * bd_event_name | ( | uint32_t | event | ) |

Get name of event.

Parameters

  event | event type (bd_event_e)

Returns
  1 on success, 0 if no events

## bd_free_clpi()

BD_PUBLIC void bd_free_clpi | ( | struct clpi_cl * | cl | ) |

Free CLPI_CL object.

Parameters

  cl | CLPI_CL objects

## bd_free_title_info()

BD_PUBLIC void bd_free_title_info | ( | BLURAY_TITLE_INFO * | title_info | ) |

Free BLURAY_TITLE_INFO object.

Parameters

  title_info | BLURAY_TITLE_INFO object

## bd_get_clpi()

BD_PUBLIC struct clpi_cl * bd_get_clpi | ( | BLURAY * | bd,
|  | unsigned | clip_ref )

Get copy of clip information for requested playitem.

Parameters

  bd | BLURAY objects
  clip_ref | requested playitem number

Returns
  pointer to allocated CLPI_CL object on success, NULL on error

## bd_get_current_angle()

BD_PUBLIC unsigned bd_get_current_angle | ( | BLURAY * | bd | ) |

Return the current angle.

Parameters

  bd | BLURAY object

Returns
  current angle

## bd_get_current_chapter()

BD_PUBLIC uint32_t bd_get_current_chapter | ( | BLURAY * | bd | ) |

Get the current chapter.

Parameters

  bd | BLURAY object

Returns
  current chapter

## bd_get_current_title()

BD_PUBLIC uint32_t bd_get_current_title | ( | BLURAY * | bd | ) |

Returns the current title index.

Parameters

  bd | BLURAY object

Returns
  current title index

## bd_get_disc_info()

BD_PUBLIC const BLURAY_DISC_INFO * bd_get_disc_info | ( | BLURAY * | bd | ) |

Get information about current BluRay disc.

Parameters

  bd | BLURAY object

Returns
  pointer to BLURAY_DISC_INFO object, NULL on error

## bd_get_event()

BD_PUBLIC int bd_get_event | ( | BLURAY * | bd,
|  | BD_EVENT * | event )

Get event from libbluray event queue.

Parameters

  bd | BLURAY object
  event | next BD_EVENT from event queue, NULL to initialize event queue

Returns
  1 on success, 0 if no events

## bd_get_main_title()

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().

Parameters

  bd | BLURAY object

Returns
  title index of main title, -1 on error

## bd_get_meta()

BD_PUBLIC const struct meta_dl * bd_get_meta | ( | BLURAY * | bd | ) |

Get meta information about current BluRay disc.

Meta information is optional in BluRay discs. If information is provided in multiple languages, currently selected language (BLURAY_PLAYER_SETTING_MENU_LANG) is used.

Referenced thumbnail images should be read with bd_get_meta_file().

Parameters

  bd | BLURAY object

Returns
  META_DL (disclib) object, NULL on error

## bd_get_meta_file()

BD_PUBLIC int bd_get_meta_file | ( | BLURAY * | bd,
|  | const char * | file_name,
|  | void ** | data,
|  | int64_t * | size )

Read metadata file from BluRay disc.

Allocate large enough memory block and read file contents. Caller must free the memory block with free().

Parameters

  bd | BLURAY object
  file_name | name of metadata file
  data | where to store pointer to file data
  size | where to store file size

Returns
  1 on success, 0 on error

## bd_get_playlist_info()

BD_PUBLIC BLURAY_TITLE_INFO * bd_get_playlist_info | ( | BLURAY * | bd,
|  | uint32_t | playlist,
|  | unsigned | angle )

Get information about a playlist.

Parameters

  bd | BLURAY object
  playlist | playlist number
  angle | angle number (chapter offsets and clip size depend on selected angle)

Returns
  allocated BLURAY_TITLE_INFO object, NULL on error

## bd_get_sound_effect()

BD_PUBLIC int bd_get_sound_effect | ( | BLURAY * | bd,
|  | unsigned | sound_id,
|  | struct bd_sound_effect * | effect )

Get sound effect.

Parameters

  bd | BLURAY object
  sound_id | sound effect id (0...N)
  effect | sound effect data

Returns
  <0 when no effects, 0 when id out of range, 1 on success

## bd_get_title_info()

BD_PUBLIC BLURAY_TITLE_INFO * bd_get_title_info | ( | BLURAY * | bd,
|  | uint32_t | title_idx,
|  | unsigned | angle )

Get information about a title.

Parameters

  bd | BLURAY object
  title_idx | title index number
  angle | angle number (chapter offsets and clip size depend on selected angle)

Returns
  allocated BLURAY_TITLE_INFO object, NULL on error

## bd_get_title_size()

BD_PUBLIC uint64_t bd_get_title_size | ( | BLURAY * | bd | ) |

Returns file size in bytes of currently selected title, 0 in no title selected.

Parameters

  bd | BLURAY object

Returns
  file size in bytes of currently selected title, 0 if no title selected

## bd_get_titles()

BD_PUBLIC 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

Parameters

  bd | BLURAY object
  flags | title flags
  min_title_length | filter out titles shorter than min_title_length seconds

Returns
  number of titles found

## bd_get_version()

BD_PUBLIC void bd_get_version | ( | int * | major,
|  | int * | minor,
|  | int * | micro )

Get libbluray version.

Get the version of libbluray (runtime)

See also bluray-version.h

Parameters

  major | where to store major version
  minor | where to store minor version
  micro | where to store micro version

## bd_init()

BD_PUBLIC BLURAY * bd_init | ( | void |  | ) |

Initialize BLURAY object.

Resulting object can be passed to following bd_open_??? functions.

Returns
  allocated BLURAY object, NULL if error

## bd_menu_call()

BD_PUBLIC 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. May fail if UO mask bit BLURAY_UO_MENU_CALL is set.

Parameters

  bd | BLURAY object
  pts | current playback position (1/90000s) or -1

Returns
  1 on success, 0 if error

## bd_mouse_select()

BD_PUBLIC int bd_mouse_select | ( | BLURAY * | bd,
|  | int64_t | pts,
|  | uint16_t | x,
|  | uint16_t | y )

Select menu button at location (x,y).

This function has no effect with BD-J menus.

Parameters

  bd | BLURAY object
  pts | current playback position (1/90000s) or -1
  x | mouse pointer x-position
  y | mouse pointer y-position

Returns
  <0 on error, 0 when mouse is outside of buttons, 1 when mouse is inside button

## bd_open()

BD_PUBLIC 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)

Parameters

  device_path | path to mounted Blu-ray disc, device or image file
  keyfile_path | path to KEYDB.cfg (may be NULL)

Returns
  allocated BLURAY object, NULL if error

## bd_open_dir()

BD_PUBLIC struct bd_dir_s * bd_open_dir | ( | BLURAY * | bd,
|  | const char * | dir )

Open a directory from BluRay Virtual File System.

Caller must close with dir->close().

Parameters

  bd | BLURAY object
  dir | target directory (relative to disc root)

Returns
  BD_DIR_H *, NULL if failed

## bd_open_disc()

BD_PUBLIC int bd_open_disc | ( | BLURAY * | bd,
|  | const char * | device_path,
|  | const char * | keyfile_path )

Open BluRay disc.

Parameters

  bd | BLURAY object
  device_path | path to mounted Blu-ray disc, device or image file
  keyfile_path | path to KEYDB.cfg (may be NULL)

Returns
  1 on success, 0 if error

## bd_open_file_dec()

BD_PUBLIC struct bd_file_s * bd_open_file_dec | ( | BLURAY * | bd,
|  | const char * | path )

Open a file from BluRay Virtual File System.

encrypted streams are decrypted, and because of how decryption works, it can only seek to (N*6144) bytes, and read 6144 bytes at a time. DO NOT mix any play functionalities with these functions. It might cause broken stream. In general, accessing mutiple file on disk at the same time is a bad idea.

Caller must close with file->close().

Parameters

  bd | BLURAY object
  path | path to the file (relative to disc root)

Returns
  BD_FILE_H *, NULL if failed

## bd_open_files()

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.

Parameters

  bd | BLURAY object
  handle | opaque handle for open_dir and open_file
  open_dir | function used to open a directory
  open_file | function used to open a file

Returns
  1 on success, 0 if error

## bd_open_stream()

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.

Parameters

  bd | BLURAY object
  read_blocks_handle | opaque handle for read_blocks
  read_blocks | function used to read disc blocks

Returns
  1 on success, 0 if error

## bd_play()

BD_PUBLIC int bd_play | ( | BLURAY * | bd | ) |

Start playing disc with on-disc menus.

Playback is started from "First Play" title.

Parameters

  bd | BLURAY object

Returns
  1 on success, 0 if error

## bd_play_title()

BD_PUBLIC 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.

Parameters

  bd | BLURAY object
  title | title number from disc index

Returns
  1 on success, 0 if error

## bd_read()

BD_PUBLIC int bd_read | ( | BLURAY * | bd,
|  | unsigned char * | buf,
|  | int | len )

Read from currently selected title file, decrypt if possible.

Parameters

  bd | BLURAY object
  buf | buffer to read data into
  len | size of data to be read

Returns
  size of data read, -1 if error, 0 if EOF

## bd_read_ext()

BD_PUBLIC 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().

Parameters

  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)

Returns
  size of data read, -1 if error, 0 if event needs to be handled first, 0 if end of title was reached

## bd_read_file()

BD_PUBLIC int bd_read_file | ( | BLURAY * | bd,
|  | const char * | path,
|  | void ** | data,
|  | int64_t * | size )

Read a file from BluRay Virtual File System.

Allocate large enough memory block and read file contents. Caller must free the memory block with free().

Parameters

  bd | BLURAY object
  path | path to the file (relative to disc root)
  data | where to store pointer to allocated data
  size | where to store file size

Returns
  1 on success, 0 on error

## bd_read_skip_still()

BD_PUBLIC int bd_read_skip_still | ( | BLURAY * | bd | ) |

Continue reading after still mode clip.

Parameters

  bd | BLURAY object

Returns
  0 on error

## bd_register_argb_overlay_proc()

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.

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.

Parameters

  bd | BLURAY object
  handle | application-specific handle that will be passed to handler function
  func | handler function pointer
  buf | optional application-allocated frame buffer

Returns
  1 on success, 0 if error

## bd_register_overlay_proc()

BD_PUBLIC 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.

Parameters

  bd | BLURAY object
  handle | application-specific handle that will be passed to handler function
  func | handler function pointer

Returns
  1 on success, 0 if error

## bd_seamless_angle_change()

BD_PUBLIC void bd_seamless_angle_change | ( | BLURAY * | bd,
|  | unsigned | angle )

Initiate seamless angle change.

Parameters

  bd | BLURAY object
  angle | angle to change to

## bd_seek()

BD_PUBLIC int64_t bd_seek | ( | BLURAY * | bd,
|  | uint64_t | pos )

Seek to pos in currently selected title.

Parameters

  bd | BLURAY object
  pos | position to seek to

Returns
  current seek position

## bd_seek_chapter()

BD_PUBLIC int64_t bd_seek_chapter | ( | BLURAY * | bd,
|  | unsigned | chapter )

Seek to a chapter.

First chapter is 0. May fail if UO mask bit BLURAY_UO_CHAPTER_SEARCH is set.

Parameters

  bd | BLURAY object
  chapter | chapter to seek to

Returns
  <0 on UO mask restriction, current seek position otherwise

## bd_seek_mark()

BD_PUBLIC int64_t bd_seek_mark | ( | BLURAY * | bd,
|  | unsigned | mark )

Seek to a playmark.

First mark is 0

Parameters

  bd | BLURAY object
  mark | playmark to seek to

Returns
  current seek position

## bd_seek_playitem()

BD_PUBLIC int64_t bd_seek_playitem | ( | BLURAY * | bd,
|  | unsigned | clip_ref )

Seek to a playitem.

Parameters

  bd | BLURAY object
  clip_ref | playitem to seek to

Returns
  current seek position

## bd_seek_time()

BD_PUBLIC int64_t bd_seek_time | ( | BLURAY * | bd,
|  | uint64_t | tick )

Seek to specific time in 90Khz ticks.

May fail if UO mask bit BLURAY_UO_TIME_SEARCH_MASK is set.

Parameters

  bd | BLURAY object
  tick | tick count

Returns
  <0 on UO mask restriction, current seek position otherwise

## bd_select_angle()

BD_PUBLIC int bd_select_angle | ( | BLURAY * | bd,
|  | unsigned | angle )

Set the angle to play.

May fail if UO mask bit UO_MASK_ANGLE_CHANGE_MASK_INDEX is set.

Parameters

  bd | BLURAY object
  angle | angle to play

Returns
  1 on success, 0 if error

## bd_select_playlist()

BD_PUBLIC int bd_select_playlist | ( | BLURAY * | bd,
|  | uint32_t | playlist )

Select a playlist.

Parameters

  bd | BLURAY object
  playlist | playlist to select

Returns
  1 on success, 0 if error

## bd_select_stream()

BD_PUBLIC int bd_select_stream | ( | BLURAY * | bd,
|  | uint32_t | stream_type,
|  | uint32_t | stream_id,
|  | uint32_t | enable_flag )

Select stream (PG / TextST track).

When playing with on-disc menus:

Stream selection is controlled by on-disc menus. If user can change stream selection also in player GUI, this function should be used to keep on-disc menus in sync with player GUI.

When playing the disc without on-disc menus:

Initial stream selection is done using preferred language settings. This function can be used to override automatic stream selection. Without on-disc menus selecting the stream is useful only when using libbluray internal decoders or the stream is stored in a sub-path.

Depending on stream type, may fail if one of the following UO mask bit is set:

- UO_MASK_PRIMARY_AUDIO_CHANGE_MASK_INDEX (BLURAY_AUDIO_STREAM);
- UO_MASK_PG_TEXTST_ENABLE_DISABLE_MASK_INDEX (BLURAY_PG_TEXTST_STREAM);
- UO_MASK_PG_TEXTST_CHANGE_MASK_INDEX (BLURAY_PG_TEXTST_STREAM); or if the requested stream number is out of range. If multiple changes are made (e.g. enable and change PG/TextST track), the non-masked UOs are applied (but this function might still return 0 if at least one change was prohibited).

Parameters

  bd | BLURAY object
  stream_type | BLURAY_AUDIO_STREAM or BLURAY_PG_TEXTST_STREAM
  stream_id | stream number (1..N)
  enable_flag | set to 0 to disable streams of this type

Returns
  <0 on error, 1 if the stream was selected, 0 if no change was made, or was prevented by the UO mask

## bd_select_title()

BD_PUBLIC int bd_select_title | ( | BLURAY * | bd,
|  | uint32_t | title )

Select the title from the list created by bd_get_titles().

Parameters

  bd | BLURAY object
  title | title to select

Returns
  1 on success, 0 if error

## bd_set_player_setting()

BD_PUBLIC 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.

Parameters

  bd | BLURAY object
  idx | Player setting to update
  value | New value for player setting

Returns
  1 on success, 0 on error (invalid setting)

## bd_set_player_setting_str()

BD_PUBLIC int bd_set_player_setting_str | ( | BLURAY * | bd,
|  | uint32_t | idx,
|  | const char * | value )

Update player setting (string).

Parameters

  bd | BLURAY object
  idx | Player setting to update
  value | New value for player setting

Returns
  1 on success, 0 on error (invalid setting)

## bd_set_rate()

BD_PUBLIC int bd_set_rate | ( | BLURAY * | bd,
|  | uint32_t | rate )

Set current playback rate.

Notify BD-J media player when user changes playback rate (ex. pauses playback). Changing rate may fail if corresponding UO is masked or playlist is not playing.

Parameters

  bd | BLURAY object
  rate | current playback rate * 90000 (0 = paused, 90000 = normal)

Returns
  <0 on error, 0 on success

## bd_set_scr()

BD_PUBLIC void bd_set_scr | ( | BLURAY * | bd,
|  | int64_t | pts )

Update current pts.

Parameters

  bd | BLURAY object
  pts | current playback position (1/90000s) or -1

## bd_tell()

BD_PUBLIC uint64_t bd_tell | ( | BLURAY * | bd | ) |

Return current pos.

Parameters

  bd | BLURAY object

Returns
  current seek position

## bd_tell_time()

BD_PUBLIC uint64_t bd_tell_time | ( | BLURAY * | bd | ) |

Return current time.

Parameters

  bd | BLURAY object

Returns
  current time

## bd_user_input()

BD_PUBLIC int bd_user_input | ( | BLURAY * | bd,
|  | int64_t | pts,
|  | uint32_t | key )

Pass user input to graphics controller or BD-J.

Keys are defined in libbluray/keys.h.

Two user input models are supported:

- Single event when a key is typed once.
- Separate events when key is pressed and released. VD_VK_KEY_PRESSED, BD_VK_TYPED and BD_VK_KEY_RELEASED are or'd with the key.

Depending on the action, may fail if one of the following UO mask bit is set:

- UO_MASK_MENU_CALL_INDEX (BD_VK_ROOT_MENU);
- UO_MASK_MOVE_UP_SELECTED_BUTTON_MASK_INDEX (BD_VK_UP);
- UO_MASK_MOVE_DOWN_SELECTED_BUTTON_MASK_INDEX (BD_VK_DOWN);
- UO_MASK_MOVE_LEFT_SELECTED_BUTTON_MASK_INDEX (BD_VK_LEFT);
- UO_MASK_MOVE_RIGHT_SELECTED_BUTTON_MASK_INDEX (BD_VK_RIGHT);
- UO_MASK_ACTIVATE_BUTTON_MASK_INDEX (BD_VK_ENTER);
- UO_MASK_POPUP_ON_MASK_INDEX (BD_VK_POPUP);
- UO_MASK_POPUP_OFF_MASK_INDEX (BD_VK_POPUP);

Parameters

  bd | BLURAY object
  pts | current playback position (1/90000s) or -1
  key | input key (

See also
  keys.h)

Returns
  <0 on error, 0 on success, >0 if selection/activation changed