00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef BLURAY_H_
00023 #define BLURAY_H_
00024
00030 #include <stdint.h>
00031
00032 #define TITLES_ALL 0
00033 #define TITLES_FILTER_DUP_TITLE 0x01
00034 #define TITLES_FILTER_DUP_CLIP 0x02
00036 #define TITLES_RELEVANT \
00037 (TITLES_FILTER_DUP_TITLE | TITLES_FILTER_DUP_CLIP)
00040 typedef struct bluray BLURAY;
00041
00042 typedef enum {
00043 BLURAY_STREAM_TYPE_VIDEO_MPEG1 = 0x01,
00044 BLURAY_STREAM_TYPE_VIDEO_MPEG2 = 0x02,
00045 BLURAY_STREAM_TYPE_AUDIO_MPEG1 = 0x03,
00046 BLURAY_STREAM_TYPE_AUDIO_MPEG2 = 0x04,
00047 BLURAY_STREAM_TYPE_AUDIO_LPCM = 0x80,
00048 BLURAY_STREAM_TYPE_AUDIO_AC3 = 0x81,
00049 BLURAY_STREAM_TYPE_AUDIO_DTS = 0x82,
00050 BLURAY_STREAM_TYPE_AUDIO_TRUHD = 0x83,
00051 BLURAY_STREAM_TYPE_AUDIO_AC3PLUS = 0x84,
00052 BLURAY_STREAM_TYPE_AUDIO_DTSHD = 0x85,
00053 BLURAY_STREAM_TYPE_AUDIO_DTSHD_MASTER = 0x86,
00054 BLURAY_STREAM_TYPE_VIDEO_VC1 = 0xea,
00055 BLURAY_STREAM_TYPE_VIDEO_H264 = 0x1b,
00056 BLURAY_STREAM_TYPE_SUB_PG = 0x90,
00057 BLURAY_STREAM_TYPE_SUB_IG = 0x91,
00058 BLURAY_STREAM_TYPE_SUB_TEXT = 0x92
00059 } bd_stream_type_e;
00060
00061 typedef enum {
00062 BLURAY_VIDEO_FORMAT_480I = 1,
00063 BLURAY_VIDEO_FORMAT_576I = 2,
00064 BLURAY_VIDEO_FORMAT_480P = 3,
00065 BLURAY_VIDEO_FORMAT_1080I = 4,
00066 BLURAY_VIDEO_FORMAT_720P = 5,
00067 BLURAY_VIDEO_FORMAT_1080P = 6,
00068 BLURAY_VIDEO_FORMAT_576P = 7
00069 } bd_video_format_e;
00070
00071 typedef enum {
00072 BLURAY_VIDEO_RATE_24000_1001 = 1,
00073 BLURAY_VIDEO_RATE_24 = 2,
00074 BLURAY_VIDEO_RATE_25 = 3,
00075 BLURAY_VIDEO_RATE_30000_1001 = 4,
00076 BLURAY_VIDEO_RATE_50 = 6,
00077 BLURAY_VIDEO_RATE_60000_1001 = 7
00078 } bd_video_rate_e;
00079
00080 typedef enum {
00081 BLURAY_ASPECT_RATIO_4_3 = 2,
00082 BLURAY_ASPECT_RATIO_16_9 = 3
00083 } bd_video_aspect_e;
00084
00085 typedef enum {
00086 BLURAY_AUDIO_FORMAT_MONO = 1,
00087 BLURAY_AUDIO_FORMAT_STEREO = 3,
00088 BLURAY_AUDIO_FORMAT_MULTI_CHAN = 6,
00089 BLURAY_AUDIO_FORMAT_COMBO = 12
00090 } bd_audio_format_e;
00091
00092
00093 typedef enum {
00094 BLURAY_AUDIO_RATE_48 = 1,
00095 BLURAY_AUDIO_RATE_96 = 4,
00096 BLURAY_AUDIO_RATE_192 = 5,
00097 BLURAY_AUDIO_RATE_192_COMBO = 12,
00098
00099 BLURAY_AUDIO_RATE_96_COMBO = 14
00100
00101 } bd_audio_rate_e;
00102
00103 typedef enum {
00104 BLURAY_TEXT_CHAR_CODE_UTF8 = 0x01,
00105 BLURAY_TEXT_CHAR_CODE_UTF16BE = 0x02,
00106 BLURAY_TEXT_CHAR_CODE_SHIFT_JIS = 0x03,
00107 BLURAY_TEXT_CHAR_CODE_EUC_KR = 0x04,
00108 BLURAY_TEXT_CHAR_CODE_GB18030_20001 = 0x05,
00109 BLURAY_TEXT_CHAR_CODE_CN_GB = 0x06,
00110 BLURAY_TEXT_CHAR_CODE_BIG5 = 0x07
00111 } bd_char_code_e;
00112
00113 typedef struct bd_stream_info {
00114 uint8_t coding_type;
00115 uint8_t format;
00116 uint8_t rate;
00117 uint8_t char_code;
00118 uint8_t lang[4];
00119 uint16_t pid;
00120 uint8_t aspect;
00121 } BLURAY_STREAM_INFO;
00122
00123 typedef struct bd_clip {
00124 uint32_t pkt_count;
00125 uint8_t video_stream_count;
00126 uint8_t audio_stream_count;
00127 uint8_t pg_stream_count;
00128 uint8_t ig_stream_count;
00129 uint8_t sec_audio_stream_count;
00130 uint8_t sec_video_stream_count;
00131 BLURAY_STREAM_INFO *video_streams;
00132 BLURAY_STREAM_INFO *audio_streams;
00133 BLURAY_STREAM_INFO *pg_streams;
00134 BLURAY_STREAM_INFO *ig_streams;
00135 BLURAY_STREAM_INFO *sec_audio_streams;
00136 BLURAY_STREAM_INFO *sec_video_streams;
00137 } BLURAY_CLIP_INFO;
00138
00139 typedef struct bd_chapter {
00140 uint32_t idx;
00141 uint64_t start;
00142 uint64_t duration;
00143 uint64_t offset;
00144 } BLURAY_TITLE_CHAPTER;
00145
00146 typedef struct bd_title_info {
00147 uint32_t idx;
00148 uint32_t playlist;
00149 uint64_t duration;
00150 uint32_t clip_count;
00151 uint8_t angle_count;
00152 uint32_t chapter_count;
00153 BLURAY_CLIP_INFO *clips;
00154 BLURAY_TITLE_CHAPTER *chapters;
00155 } BLURAY_TITLE_INFO;
00156
00167 uint32_t bd_get_titles(BLURAY *bd, uint8_t flags);
00168
00177 BLURAY_TITLE_INFO* bd_get_title_info(BLURAY *bd, uint32_t title_idx);
00178
00187 BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist);
00188
00195 void bd_free_title_info(BLURAY_TITLE_INFO *title_info);
00196
00204 BLURAY *bd_open(const char* device_path, const char* keyfile_path);
00205
00211 void bd_close(BLURAY *bd);
00212
00220 int64_t bd_seek(BLURAY *bd, uint64_t pos);
00221
00230 int64_t bd_seek_time(BLURAY *bd, uint64_t tick);
00231
00241 int bd_read(BLURAY *bd, unsigned char *buf, int len);
00242
00251 int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter);
00252
00261 int64_t bd_chapter_pos(BLURAY *bd, unsigned chapter);
00262
00270 uint32_t bd_get_current_chapter(BLURAY *bd);
00271
00280 int64_t bd_seek_mark(BLURAY *bd, unsigned mark);
00281
00290 int bd_select_playlist(BLURAY *bd, uint32_t playlist);
00291
00300 int bd_select_title(BLURAY *bd, uint32_t title);
00301
00310 int bd_select_angle(BLURAY *bd, unsigned angle);
00311
00319 void bd_seamless_angle_change(BLURAY *bd, unsigned angle);
00320
00330 uint64_t bd_get_title_size(BLURAY *bd);
00331
00339 uint32_t bd_get_current_title(BLURAY *bd);
00340
00348 unsigned bd_get_current_angle(BLURAY *bd);
00349
00357 uint64_t bd_tell(BLURAY *bd);
00358
00366 uint64_t bd_tell_time(BLURAY *bd);
00367
00368
00369
00370
00371
00372 typedef struct {
00373 uint8_t bluray_detected;
00374
00375 uint8_t first_play_supported;
00376 uint8_t top_menu_supported;
00377
00378 uint32_t num_hdmv_titles;
00379 uint32_t num_bdj_titles;
00380 uint32_t num_unsupported_titles;
00381
00382 uint8_t aacs_detected;
00383 uint8_t libaacs_detected;
00384 uint8_t aacs_handled;
00385
00386 uint8_t bdplus_detected;
00387 uint8_t libbdplus_detected;
00388 uint8_t bdplus_handled;
00389
00390 } BLURAY_DISC_INFO;
00391
00392 const BLURAY_DISC_INFO *bd_get_disc_info(BLURAY*);
00393
00394
00395
00396
00397
00398 typedef enum {
00399 BLURAY_PLAYER_SETTING_PARENTAL = 13,
00400 BLURAY_PLAYER_SETTING_AUDIO_CAP = 15,
00401 BLURAY_PLAYER_SETTING_AUDIO_LANG = 16,
00402 BLURAY_PLAYER_SETTING_PG_LANG = 17,
00403 BLURAY_PLAYER_SETTING_MENU_LANG = 18,
00404 BLURAY_PLAYER_SETTING_COUNTRY_CODE = 19,
00405 BLURAY_PLAYER_SETTING_REGION_CODE = 20,
00406 BLURAY_PLAYER_SETTING_VIDEO_CAP = 29,
00407 BLURAY_PLAYER_SETTING_TEXT_CAP = 30,
00408 BLURAY_PLAYER_SETTING_PLAYER_PROFILE = 31,
00409 } bd_player_setting;
00410
00421 int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value);
00422 int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *s);
00423
00424
00425
00426
00427 int bd_start_bdj(BLURAY *bd, const char* start_object);
00428 void bd_stop_bdj(BLURAY *bd);
00429
00430
00431
00432
00433
00434 typedef enum {
00435 BD_EVENT_NONE = 0,
00436 BD_EVENT_ERROR,
00437
00438
00439 BD_EVENT_ANGLE,
00440 BD_EVENT_TITLE,
00441 BD_EVENT_PLAYLIST,
00442 BD_EVENT_PLAYITEM,
00443 BD_EVENT_CHAPTER,
00444
00445
00446 BD_EVENT_AUDIO_STREAM,
00447 BD_EVENT_IG_STREAM,
00448 BD_EVENT_PG_TEXTST_STREAM,
00449 BD_EVENT_PIP_PG_TEXTST_STREAM,
00450 BD_EVENT_SECONDARY_AUDIO_STREAM,
00451 BD_EVENT_SECONDARY_VIDEO_STREAM,
00452
00453 BD_EVENT_PG_TEXTST,
00454 BD_EVENT_PIP_PG_TEXTST,
00455 BD_EVENT_SECONDARY_AUDIO,
00456 BD_EVENT_SECONDARY_VIDEO,
00457 BD_EVENT_SECONDARY_VIDEO_SIZE,
00458
00459
00460 BD_EVENT_MENU_PAGE_ID,
00461 BD_EVENT_SELECTED_BUTTON_ID,
00462 BD_EVENT_POPUP_OFF,
00463 BD_EVENT_ENABLE_BUTTON,
00464 BD_EVENT_DISABLE_BUTTON,
00465
00466
00467 BD_EVENT_STILL,
00468
00469 } bd_event_e;
00470
00471 typedef struct {
00472 uint32_t event;
00473 uint32_t param;
00474 } BD_EVENT;
00475
00476 struct bd_overlay_s;
00477 typedef void (*bd_overlay_proc_f)(void *, const struct bd_overlay_s * const);
00478
00479 int bd_play(BLURAY *bd);
00480 int bd_read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event);
00481 int bd_get_event(BLURAY *bd, BD_EVENT *event);
00482
00483 int bd_play_title(BLURAY *bd, unsigned title);
00484 int bd_menu_call(BLURAY *bd);
00485
00486 void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func);
00487 void bd_user_input(BLURAY *bd, int64_t pts, uint32_t key);
00488
00489 #endif