first commit
Some checks failed
/ buid (push) Has been cancelled

This commit is contained in:
2026-04-16 14:48:09 +07:00
commit 4b968a3347
5625 changed files with 1685474 additions and 0 deletions

View File

@ -0,0 +1,50 @@
/*
* This file is part of libbluray
* Copyright (C) 2011 hpi1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
/**
* @file
* \brief libbluray API version
*/
#ifndef BLURAY_VERSION_H_
#define BLURAY_VERSION_H_
/** Pack version number to single integer */
#define BLURAY_VERSION_CODE(major, minor, micro) \
(((major) * 10000) + \
((minor) * 100) + \
((micro) * 1))
/** libbluray major version number */
#define BLURAY_VERSION_MAJOR 1
/** libbluray minor version number */
#define BLURAY_VERSION_MINOR 3
/** libbluray micro version number */
#define BLURAY_VERSION_MICRO 4
/** libbluray version number as a string */
#define BLURAY_VERSION_STRING "1.3.4"
/** libbluray version number as a single integer */
#define BLURAY_VERSION \
BLURAY_VERSION_CODE(BLURAY_VERSION_MAJOR, BLURAY_VERSION_MINOR, BLURAY_VERSION_MICRO)
#endif /* BLURAY_VERSION_H_ */

View File

@ -0,0 +1,181 @@
/*
* This file is part of libbluray
* Copyright (C) 2009-2010 John Stebbins
* Copyright (C) 2012-2013 Petri Hintukainen <phintuka@users.sourceforge.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
/**
* @file
* \brief CLPI (Clip Information) file data
*/
#if !defined(_CLPI_DATA_H_)
#define _CLPI_DATA_H_
#include <stdint.h>
typedef struct
{
uint16_t pcr_pid;
uint32_t spn_stc_start;
uint32_t presentation_start_time;
uint32_t presentation_end_time;
} CLPI_STC_SEQ;
typedef struct
{
uint32_t spn_atc_start;
uint8_t num_stc_seq;
uint8_t offset_stc_id;
CLPI_STC_SEQ *stc_seq;
} CLPI_ATC_SEQ;
typedef struct
{
uint8_t num_atc_seq;
CLPI_ATC_SEQ *atc_seq;
} CLPI_SEQ_INFO;
typedef struct
{
uint8_t validity;
char format_id[5];
} CLPI_TS_TYPE;
typedef struct
{
uint32_t delta;
char file_id[6];
char file_code[5];
} CLPI_ATC_DELTA;
typedef struct {
char file_id[6];
} CLPI_FONT;
typedef struct {
uint8_t font_count;
CLPI_FONT *font;
} CLPI_FONT_INFO;
typedef struct
{
uint8_t clip_stream_type;
uint8_t application_type;
uint8_t is_atc_delta;
uint32_t ts_recording_rate;
uint32_t num_source_packets;
CLPI_TS_TYPE ts_type_info;
uint8_t atc_delta_count;
CLPI_ATC_DELTA *atc_delta;
CLPI_FONT_INFO font_info; /* Text subtitle stream font files */
} CLPI_CLIP_INFO;
typedef struct
{
uint16_t pid;
uint8_t coding_type;
uint8_t format;
uint8_t rate;
uint8_t aspect;
uint8_t oc_flag;
uint8_t char_code;
char lang[4];
uint8_t cr_flag;
uint8_t dynamic_range_type;
uint8_t color_space;
uint8_t hdr_plus_flag;
uint8_t isrc[12]; /* International Standard Recording Code (usually empty or all zeroes) */
} CLPI_PROG_STREAM;
typedef struct
{
uint32_t spn_program_sequence_start;
uint16_t program_map_pid;
uint8_t num_streams;
uint8_t num_groups;
CLPI_PROG_STREAM *streams;
} CLPI_PROG;
typedef struct
{
uint8_t num_prog;
CLPI_PROG *progs;
} CLPI_PROG_INFO;
typedef struct
{
int ref_ep_fine_id;
int pts_ep;
uint32_t spn_ep;
} CLPI_EP_COARSE;
typedef struct
{
uint8_t is_angle_change_point;
uint8_t i_end_position_offset;
int pts_ep;
int spn_ep;
} CLPI_EP_FINE;
typedef struct
{
uint16_t pid;
uint8_t ep_stream_type;
int num_ep_coarse;
int num_ep_fine;
uint32_t ep_map_stream_start_addr;
CLPI_EP_COARSE *coarse;
CLPI_EP_FINE *fine;
} CLPI_EP_MAP_ENTRY;
typedef struct
{
uint8_t type;
// ep_map
uint8_t num_stream_pid;
CLPI_EP_MAP_ENTRY *entry;
} CLPI_CPI;
/* Extent start points (profile 5 / version 2.4) */
typedef struct {
uint32_t num_point;
uint32_t *point;
} CLPI_EXTENT_START;
typedef struct clpi_cl {
uint32_t type_indicator;
uint32_t type_indicator2;
uint32_t sequence_info_start_addr;
uint32_t program_info_start_addr;
uint32_t cpi_start_addr;
uint32_t clip_mark_start_addr;
uint32_t ext_data_start_addr;
CLPI_CLIP_INFO clip;
CLPI_SEQ_INFO sequence;
CLPI_PROG_INFO program;
CLPI_CPI cpi;
// skip clip mark & extension data
// extensions for 3D
CLPI_EXTENT_START extent_start; /* extent start points (.ssif interleaving) */
CLPI_PROG_INFO program_ss;
CLPI_CPI cpi_ss;
} CLPI_CL;
#endif // _CLPI_DATA_H_

View File

@ -0,0 +1,191 @@
/*
* This file is part of libbluray
* Copyright (C) 2009-2010 Obliter0n
* Copyright (C) 2009-2010 John Stebbins
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
/**
* @file
* \brief Filesystem interface
*
* File access wrappers can be used to bind libbluray to external filesystem.
* Typical use case would be playing BluRay from network filesystem.
*/
#ifndef BD_FILESYSTEM_H_
#define BD_FILESYSTEM_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/**
* File access
*/
typedef struct bd_file_s BD_FILE_H;
struct bd_file_s
{
/** Reserved for BD_FILE_H implementation use.
* Implementation can store here ex. file handle, FILE*, ...
*/
void* internal;
/**
* Close file
*
* @param file BD_FILE_H object
*/
void (*close) (BD_FILE_H *file);
/**
* Reposition file offset
*
* - SEEK_SET: seek to 'offset' bytes from file start
* - SEEK_CUR: seek 'offset' bytes from current position
* - SEEK_END: seek 'offset' bytes from file end
*
* @param file BD_FILE_H object
* @param offset byte offset
* @param origin SEEK_SET, SEEK_CUR or SEEK_END
* @return current file offset, < 0 on error
*/
int64_t (*seek) (BD_FILE_H *file, int64_t offset, int32_t origin);
/**
* Get current read or write position
*
* @param file BD_FILE_H object
* @return current file offset, < 0 on error
*/
int64_t (*tell) (BD_FILE_H *file);
/**
* Check for end of file
*
* - optional, currently not used
*
* @param file BD_FILE_H object
* @return 1 on EOF, < 0 on error, 0 if not EOF
*/
int (*eof) (BD_FILE_H *file);
/**
* Read from file
*
* @param file BD_FILE_H object
* @param buf buffer where to store the data
* @param size bytes to read
* @return number of bytes read, 0 on EOF, < 0 on error
*/
int64_t (*read) (BD_FILE_H *file, uint8_t *buf, int64_t size);
/**
* Write to file
*
* Writing 0 bytes can be used to flush previous writes and check for errors.
*
* @param file BD_FILE_H object
* @param buf data to be written
* @param size bytes to write
* @return number of bytes written, < 0 on error
*/
int64_t (*write) (BD_FILE_H *file, const uint8_t *buf, int64_t size);
};
/**
* Directory entry
*/
typedef struct
{
char d_name[256]; /**< Null-terminated filename */
} BD_DIRENT;
/**
* Directory access
*/
typedef struct bd_dir_s BD_DIR_H;
struct bd_dir_s
{
void* internal; /**< reserved for BD_DIR_H implementation use */
/**
* Close directory stream
*
* @param dir BD_DIR_H object
*/
void (*close)(BD_DIR_H *dir);
/**
* Read next directory entry
*
* @param dir BD_DIR_H object
* @param entry BD_DIRENT where to store directory entry data
* @return 0 on success, 1 on EOF, <0 on error
*/
int (*read)(BD_DIR_H *dir, BD_DIRENT *entry);
};
/**
* Open a file
*
* Prototype for a function that returns BD_FILE_H implementation.
*
* @param filename name of the file to open
* @param mode string starting with "r" for reading or "w" for writing
* @return BD_FILE_H object, NULL on error
*/
typedef BD_FILE_H* (*BD_FILE_OPEN)(const char* filename, const char *mode);
/**
* Open a directory
*
* Prototype for a function that returns BD_DIR_H implementation.
*
* @param dirname name of the directory to open
* @return BD_DIR_H object, NULL on error
*/
typedef BD_DIR_H* (*BD_DIR_OPEN) (const char* dirname);
/**
* Register function pointer that will be used to open a file
*
* @deprecated Use bd_open_files() instead.
*
* @param p function pointer
* @return previous function pointer registered
*/
BD_FILE_OPEN bd_register_file(BD_FILE_OPEN p);
/**
* Register function pointer that will be used to open a directory
*
* @deprecated Use bd_open_files() instead.
*
* @param p function pointer
* @return previous function pointer registered
*/
BD_DIR_OPEN bd_register_dir(BD_DIR_OPEN p);
#ifdef __cplusplus
}
#endif
#endif /* BD_FILESYSTEM_H_ */

View File

@ -0,0 +1,76 @@
/*
* This file is part of libbluray
* Copyright (C) 2010-2022 Petri Hintukainen <phintuka@users.sourceforge.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
/**
* @file
* \brief User input key definitions
*/
#if !defined(_BD_KEYS_H_)
#define _BD_KEYS_H_
/**
* Key codes
*/
typedef enum {
BD_VK_NONE = 0xffff, /**< no key pressed */
/* numeric key events */
BD_VK_0 = 0, /**< "1" */
BD_VK_1 = 1, /**< "2" */
BD_VK_2 = 2, /**< "3" */
BD_VK_3 = 3, /**< "4" */
BD_VK_4 = 4, /**< "5" */
BD_VK_5 = 5, /**< "6" */
BD_VK_6 = 6, /**< "7" */
BD_VK_7 = 7, /**< "8" */
BD_VK_8 = 8, /**< "9" */
BD_VK_9 = 9, /**< "0" */
/* */
BD_VK_ROOT_MENU = 10, /**< Open disc root menu */
BD_VK_POPUP = 11, /**< Toggle popup menu */
/* interactive key events */
BD_VK_UP = 12, /**< Arrow up */
BD_VK_DOWN = 13, /**< Arrow down */
BD_VK_LEFT = 14, /**< Arrow left */
BD_VK_RIGHT = 15, /**< Arrow right */
BD_VK_ENTER = 16, /**< Select */
/** Mouse click. Translated to BD_VK_ENTER if mouse is over a valid button. */
BD_VK_MOUSE_ACTIVATE = 17,
BD_VK_RED = 403, /**< Color key "Red" */
BD_VK_GREEN = 404, /**< Color key "Green" */
BD_VL_YELLOW = 405, /**< Color key "Yellow" */
BD_VK_BLUE = 406, /**< Color key "Blue" */
} bd_vk_key_e;
/*
* Application may optionally provide KEY_PRESSED, KEY_TYPED and KEY_RELEASED events.
* These masks are OR'd with the key code when calling bd_user_input().
*/
#define BD_VK_KEY_PRESSED 0x80000000 /**< Key was pressed down */
#define BD_VK_KEY_TYPED 0x40000000 /**< Key was typed */
#define BD_VK_KEY_RELEASED 0x20000000 /**< Key was released */
#endif // _BD_KEYS_H_

View File

@ -0,0 +1,101 @@
/*
* This file is part of libbluray
* Copyright (C) 2009-2010 Obliter0n
* Copyright (C) 2009-2010 John Stebbins
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
/**
* @file
* \brief Log control and capture
*
* Logging level can be changed with function bd_set_debug_mask() or environment variable BD_DEBUG_MASK.
* Default is to log only errors and critical messages (DBG_CRIT).
*
* Application can capture log messages with bd_set_debug_handler().
* Messages can be written to a log file with BD_DEBUG_FILE environment variable.
* By default messages are written to standard error output.
*/
#ifndef BD_LOG_CONTROL_H_
#define BD_LOG_CONTROL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/**
* Flags for log filtering.
*/
typedef enum debug_mask_enum {
DBG_RESERVED = 0x00001, /* (reserved) */
DBG_CONFIGFILE = 0x00002, /* (reserved for libaacs) */
DBG_FILE = 0x00004, /* (reserved for libaacs) */
DBG_AACS = 0x00008, /* (reserved for libaacs) */
DBG_MKB = 0x00010, /* (reserved for libaacs) */
DBG_MMC = 0x00020, /* (reserved for libaacs) */
DBG_BLURAY = 0x00040, /**< BluRay player */
DBG_DIR = 0x00080, /**< Directory access */
DBG_NAV = 0x00100, /**< Database files (playlist and clip info) */
DBG_BDPLUS = 0x00200, /* (reserved for libbdplus) */
DBG_DLX = 0x00400, /* (reserved for libbdplus) */
DBG_CRIT = 0x00800, /**< **Critical messages and errors** (default) */
DBG_HDMV = 0x01000, /**< HDMV virtual machine execution trace */
DBG_BDJ = 0x02000, /**< BD-J subsystem and Xlet trace */
DBG_STREAM = 0x04000, /**< m2ts stream trace */
DBG_GC = 0x08000, /**< graphics controller trace */
DBG_DECODE = 0x10000, /**< PG / IG decoders, m2ts demuxer */
DBG_JNI = 0x20000, /**< JNI calls */
} debug_mask_t;
/**
* Log a message
*
* @param msg Log message as null-terminated string
*/
typedef void (*BD_LOG_FUNC)(const char *msg);
/**
* Set (global) debug handler
*
* The function will receive all enabled log messages.
*
* @param handler function that will receive all enabled log and trace messages
*
*/
void bd_set_debug_handler(BD_LOG_FUNC handler);
/**
* Set (global) debug mask
*
* @param mask combination of flags from debug_mask_enum
*/
void bd_set_debug_mask(uint32_t mask);
/**
* Get current (global) debug mask
*
* @return combination of flags from debug_mask_enum
*/
uint32_t bd_get_debug_mask(void);
#ifdef __cplusplus
}
#endif
#endif /* BD_LOG_CONTROL_H_ */

View File

@ -0,0 +1,58 @@
/*
* This file is part of libbluray
* Copyright (C) 2010 fraxinas
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
/**
* @file
* \brief Disc metadata definitions
*/
#if !defined(_META_DATA_H_)
#define _META_DATA_H_
#include <stdint.h>
/** Thumbnail path and resolution */
typedef struct meta_thumbnail {
char * path; /**< Path to thumbnail image (relative to disc root) */
uint32_t xres; /**< Thumbnail width */
uint32_t yres; /**< Thumbnail height */
} META_THUMBNAIL;
/** Title name */
typedef struct meta_title {
uint32_t title_number; /**< Title number (from disc index) */
char * title_name; /**< Title name */
} META_TITLE;
/** DL (Disc Library) metadata entry */
typedef struct meta_dl {
char language_code[4]; /**< Language used in this metadata entry */
char * filename; /**< Source file (relative to disc root) */
char * di_name; /**< Disc name */
char * di_alternative; /**< Alternative name */
uint8_t di_num_sets; /**< Number of discs in original volume or collection */
uint8_t di_set_number; /**< Sequence order of the disc from an original collection */
uint32_t toc_count; /**< Number of title entries */
META_TITLE * toc_entries; /**< Title data */
uint8_t thumb_count; /**< Number of thumbnails */
META_THUMBNAIL * thumbnails; /**< Thumbnail data */
} META_DL;
#endif // _META_DATA_H_

View File

@ -0,0 +1,236 @@
/*
* This file is part of libbluray
* Copyright (C) 2010-2017 Petri Hintukainen <phintuka@users.sourceforge.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
/**
* @file
* \brief Graphics overlay events
*/
#ifndef BD_OVERLAY_H_
#define BD_OVERLAY_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/** Version number of the interface described in this file. */
#define BD_OVERLAY_INTERFACE_VERSION 2
/**
* Overlay plane
*/
typedef enum {
BD_OVERLAY_PG = 0, /**< Presentation Graphics plane */
BD_OVERLAY_IG = 1, /**< Interactive Graphics plane (on top of PG plane) */
} bd_overlay_plane_e;
/*
* Compressed YUV overlays
*/
/**
* YUV overlay event type
*/
typedef enum {
/* following events are executed immediately */
BD_OVERLAY_INIT = 0, /**< Initialize overlay plane. Size and position of plane in x,y,w,h. */
BD_OVERLAY_CLOSE = 1, /**< Close overlay plane */
/* following events can be processed immediately, but changes
* should not be flushed to display before next FLUSH event
*/
BD_OVERLAY_CLEAR = 2, /**< Clear overlay plane */
BD_OVERLAY_DRAW = 3, /**< Draw bitmap. Size and position within plane (x, y, w, h) and image (img, palette). */
BD_OVERLAY_WIPE = 4, /**< Clear area. Size and position within plane (x, y, w, h). */
BD_OVERLAY_HIDE = 5, /**< Overlay is empty and can be hidden */
BD_OVERLAY_FLUSH = 6, /**< All changes have been done, flush overlay to display at given pts */
} bd_overlay_cmd_e;
/**
* Overlay palette entry
*
* Y, Cr and Cb have the same color matrix as the associated video stream.
*
* Entry 0xff is always transparent.
*
*/
typedef struct bd_pg_palette_entry_s {
uint8_t Y; /**< Y component (16...235) */
uint8_t Cr; /**< Cr component (16...240) */
uint8_t Cb; /**< Cb component (16...240) */
uint8_t T; /**< Transparency ( 0...255). 0 - transparent, 255 - opaque. */
} BD_PG_PALETTE_ENTRY;
/**
* RLE element
*/
typedef struct bd_pg_rle_elem_s {
uint16_t len; /**< RLE run length */
uint16_t color; /**< palette index */
} BD_PG_RLE_ELEM;
/**
* YUV overlay event
*/
typedef struct bd_overlay_s {
int64_t pts; /**< Timestamp, on video grid */
uint8_t plane; /**< Overlay plane (\ref bd_overlay_plane_e) */
uint8_t cmd; /**< Overlay event type (\ref bd_overlay_cmd_e) */
uint8_t palette_update_flag; /**< Set if only overlay palette is changed */
uint16_t x; /**< top-left x coordinate */
uint16_t y; /**< top-left y coordinate */
uint16_t w; /**< region width */
uint16_t h; /**< region height */
const BD_PG_PALETTE_ENTRY * palette; /**< overlay palette (256 entries) */
const BD_PG_RLE_ELEM * img; /**< RLE-compressed overlay image */
} BD_OVERLAY;
/*
RLE images are reference-counted. If application caches rle data for later use,
it needs to use bd_refcnt_inc() and bd_refcnt_dec().
*/
const void *bd_refcnt_inc(const void *); /**< Hold reference-counted object. Return object or NULL on invalid object. */
void bd_refcnt_dec(const void *); /**< Release reference-counted object */
#if 0
BD_OVERLAY *bd_overlay_copy(const BD_OVERLAY *src)
{
BD_OVERLAY *ov = malloc(sizeof(*ov));
memcpy(ov, src, sizeof(*ov));
if (ov->palette) {
ov->palette = malloc(256 * sizeof(BD_PG_PALETTE_ENTRY));
memcpy((void*)ov->palette, src->palette, 256 * sizeof(BD_PG_PALETTE_ENTRY));
}
if (ov->img) {
bd_refcnt_inc(ov->img);
}
return ov;
}
void bd_overlay_free(BD_OVERLAY **pov)
{
if (pov && *pov) {
BD_OVERLAY *ov = *pov;
void *p = (void*)ov->palette;
bd_refcnt_dec(ov->img);
X_FREE(p);
ov->palette = NULL;
X_FREE(*pov);
}
}
#endif
/**
* ARGB overlay event type
*/
typedef enum {
/* following events are executed immediately */
BD_ARGB_OVERLAY_INIT = 0, /**< Initialize overlay plane. Size and position of plane are in x,y,w,h */
BD_ARGB_OVERLAY_CLOSE = 1, /**< Close overlay plane */
/* following events can be processed immediately, but changes
* should not be flushed to display before next FLUSH event
*/
BD_ARGB_OVERLAY_DRAW = 3, /**< Draw ARGB image on plane */
BD_ARGB_OVERLAY_FLUSH = 6, /**< All changes have been done, flush overlay to display at given pts */
} bd_argb_overlay_cmd_e;
/**
* ARGB overlay event
*/
typedef struct bd_argb_overlay_s {
int64_t pts; /**< Event timestamp, on video grid */
uint8_t plane; /**< Overlay plane (\ref bd_overlay_plane_e) */
uint8_t cmd; /**< Overlay event type (\ref bd_argb_overlay_cmd_e) */
/* following fileds are used only when not using application-allocated
* frame buffer
*/
/* destination clip on the overlay plane */
uint16_t x; /**< top-left x coordinate */
uint16_t y; /**< top-left y coordinate */
uint16_t w; /**< region width */
uint16_t h; /**< region height */
uint16_t stride; /**< ARGB buffer stride */
const uint32_t * argb; /**< ARGB image data, 'h' lines, line stride 'stride' pixels */
} BD_ARGB_OVERLAY;
/**
* Application-allocated frame buffer for ARGB overlays
*
* When using application-allocated frame buffer DRAW events are
* executed by libbluray.
* Application needs to handle only OPEN/FLUSH/CLOSE events.
*
* DRAW events can still be used for optimizations.
*/
typedef struct bd_argb_buffer_s {
/* optional lock / unlock functions
* - Set by application
* - Called when buffer is accessed or modified
*/
void (*lock) (struct bd_argb_buffer_s *); /**< Lock (or prepare) buffer for writing */
void (*unlock)(struct bd_argb_buffer_s *); /**< Unlock buffer (write complete) */
/* ARGB frame buffers
* - Allocated by application (BD_ARGB_OVERLAY_INIT).
* - Buffer can be freed after BD_ARGB_OVERLAY_CLOSE.
* - buffer can be replaced in overlay callback or lock().
*/
uint32_t *buf[4]; /**< [0] - PG plane, [1] - IG plane. [2], [3] reserved for stereoscopic overlay. */
/* size of buffers
* - Set by application
* - If the buffer size is smaller than the size requested in BD_ARGB_OVERLAY_INIT,
* the buffer points only to the dirty area.
*/
int width; /**< overlay buffer width (pixels) */
int height; /**< overlay buffer height (pixels) */
/** Dirty area of frame buffers
* - Updated by library before lock() call.
* - Reset after each BD_ARGB_OVERLAY_FLUSH.
*/
struct {
uint16_t x0; /**< top-left x coordinate */
uint16_t y0; /**< top-left y coordinate */
uint16_t x1; /**< bottom-down x coordinate */
uint16_t y1; /**< bottom-down y coordinate */
} dirty[2]; /**< [0] - PG plane, [1] - IG plane */
} BD_ARGB_BUFFER;
#ifdef __cplusplus
}
#endif
#endif // BD_OVERLAY_H_

View File

@ -0,0 +1,195 @@
/*
* This file is part of libbluray
* Copyright (C) 2014-2017 VideoLAN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
/**
* @file
* \brief Definitions for Blu-Ray player settings
*/
#ifndef BD_PLAYER_SETTINGS_H_
#define BD_PLAYER_SETTINGS_H_
/**
* BLURAY_PLAYER_SETTING_AUDIO_CAP (PSR15)
*
* Player capability for audio (bitmask)
*/
enum {
/* LPCM capability */
/* 48/96kHz (mandatory) */
BLURAY_ACAP_LPCM_48_96_STEREO_ONLY = 0x0001, /**< LPCM 48kHz and 96kHz stereo capable */
BLURAY_ACAP_LPCM_48_96_SURROUND = 0x0002, /**< LPCM 48kHz and 96kHz surround capable */
/* 192kHz (optional) */
BLURAY_ACAP_LPCM_192_NONE = 0x0000, /**< LPCM 192kHz not supported */
BLURAY_ACAP_LPCM_192_STEREO_ONLY = 0x0004, /**< LPCM 192kHz stereo capable */
BLURAY_ACAP_LPCM_192_SURROUND = 0x0008, /**< LPCM 192kHz surround capable */
/* Dolby Digital Plus capability */
/* independent substream (mandatory) */
BLURAY_ACAP_DDPLUS_STEREO_ONLY = 0x0010, /**< DD Plus independent substream stereo capable */
BLURAY_ACAP_DDPLUS_SURROUND = 0x0020, /**< DD Plus independent substream surround capable */
/* dependent substream (optional) */
BLURAY_ACAP_DDPLUS_DEP_NONE = 0x0000, /**< DD Plus dependent substream not supported */
BLURAY_ACAP_DDPLUS_DEP_STEREO_ONLY = 0x0040, /**< DD Plus dependent substream stereo capable */
BLURAY_ACAP_DDPLUS_DEP_SURROUND = 0x0080, /**< DD Plus dependent substream surround capable */
/* DTS-HD */
/* Core substream (mandatory) */
BLURAY_ACAP_DTSHD_CORE_STEREO_ONLY = 0x0100, /**< DTS-HD Core stereo capable */
BLURAY_ACAP_DTSHD_CORE_SURROUND = 0x0200, /**< DTS-HD Core surround capable */
/* Extension substream (optional) */
BLURAY_ACAP_DTSHD_EXT_NONE = 0x0000, /**< DTS-HD extension substream not supported */
BLURAY_ACAP_DTSHD_EXT_STEREO_ONLY = 0x0400, /**< DTS-HD extension substream stereo capable */
BLURAY_ACAP_DTSHD_EXT_SURROUND = 0x0800, /**< DTS-HD extension substream surround capable */
/* Dolby lossless (TrueHD) */
/* Dolby Digital (mandatory) */
BLURAY_ACAP_DD_STEREO_ONLY = 0x1000, /**< Dolby Digital audio stereo capable */
BLURAY_ACAP_DD_SURROUND = 0x2000, /**< Dolby Digital audio surround capable */
/* MLP (optional) */
BLURAY_ACAP_MLP_NONE = 0x0000, /**< MLP not supported */
BLURAY_ACAP_MLP_STEREO_ONLY = 0x4000, /**< MLP stereo capable */
BLURAY_ACAP_MLP_SURROUND = 0x8000, /**< MLP surround capable */
};
/**
* BLURAY_PLAYER_SETTING_REGION_CODE (PSR20)
*
* Player region code (integer)
*
*/
enum {
/** Region A: the Americas, East and Southeast Asia, U.S. territories, and Bermuda. */
BLURAY_REGION_A = 1,
/** Region B: Africa, Europe, Oceania, the Middle East, the Kingdom of the Netherlands,
* British overseas territories, French territories, and Greenland. */
BLURAY_REGION_B = 2,
/** Region C: Central and South Asia, Mongolia, Russia, and the People's Republic of China. */
BLURAY_REGION_C = 4,
};
/**
* BLURAY_PLAYER_SETTING_OUTPUT_PREFER (PSR21)
*
* Output mode preference (integer)
*/
enum {
BLURAY_OUTPUT_PREFER_2D = 0, /**< 2D output preferred */
BLURAY_OUTPUT_PREFER_3D = 1, /**< 3D output preferred */
};
/*
* BLURAY_PLAYER_SETTING_DISPLAY_CAP (PSR23)
*
* Display capability (bit mask) and display size
*/
#define BLURAY_DCAP_1080p_720p_3D 0x01 /**< capable of 1920x1080 23.976Hz and 1280x720 59.94Hz 3D */
#define BLURAY_DCAP_720p_50Hz_3D 0x02 /**< capable of 1280x720 50Hz 3D */
#define BLURAY_DCAP_NO_3D_CLASSES_REQUIRED 0x04 /**< 3D glasses are not required */
#define BLURAY_DCAP_INTERLACED_3D 0x08 /**< capable of interlaced 3D */
/* horizontal display size in centimeters */
#define BLURAY_DCAP_DISPLAY_SIZE_UNDEFINED 0 /**< connected display physical size unknown/undefined */
#define BLURAY_DCAP_DISPLAY_SIZE_MASK 0xfff00 /**< display size mask */
#define BLURAY_DCAP_DISPLAY_SIZE(cm) (((cm) > 0xfff ? 0xfff : (cm)) << 8) /**< connected display physical size (cm) */
/**
* BLURAY_PLAYER_SETTING_VIDEO_CAP (PSR29)
*
* Player capability for video (bit mask)
*/
enum {
BLURAY_VCAP_SECONDARY_HD = 0x01, /**< player can play secondary stream in HD */
BLURAY_VCAP_25Hz_50Hz = 0x02, /**< player can play 25Hz and 50Hz video */
};
/**
* BLURAY_PLAYER_SETTING_PLAYER_PROFILE (PSR31)
*
* Player profile and version
*
* - Profile 1, version 1.0: no local storage, no VFS, no internet
* - Profile 1, version 1.1: PiP, VFS, sec. audio, 256MB local storage, no internet
* - Profile 2, version 2.0: BdLive (internet), 1GB local storage
*/
enum {
BLURAY_PLAYER_PROFILE_1_v1_0 = ((0x00 << 16) | (0x0100)), /**< Profile 1, version 1.0 (Initial Standard Profile) */
BLURAY_PLAYER_PROFILE_1_v1_1 = ((0x01 << 16) | (0x0110)), /**< Profile 1, version 1.1 (secondary stream support) */
BLURAY_PLAYER_PROFILE_2_v2_0 = ((0x03 << 16) | (0x0200)), /**< Profile 2, version 2.0 (network access, BdLive) */
BLURAY_PLAYER_PROFILE_3_v2_0 = ((0x08 << 16) | (0x0200)), /**< Profile 3, version 2.0 (audio only player) */
BLURAY_PLAYER_PROFILE_5_v2_4 = ((0x13 << 16) | (0x0240)), /**< Profile 5, version 2.4 (3D) */
BLURAY_PLAYER_PROFILE_6_v3_0 = ((0x00 << 16) | (0x0300)), /**< Profile 6, version 3.0 (UHD) */
BLURAY_PLAYER_PROFILE_6_v3_1 = ((0x00 << 16) | (0x0310)), /**< Profile 6, version 3.1 (UHD) */
};
/* Player profile flags and version mask */
#define BLURAY_PLAYER_PROFILE_3D_FLAG 0x100000 /**< set for 3D profiles */
#define BLURAY_PLAYER_PROFILE_VERSION_MASK 0xffff /**< bit mask for player version */
//!@}
/**
* BLURAY_PLAYER_SETTING_DECODE_PG
*
* Enable Presentation Graphics and Text Subtitle decoder
*/
enum {
BLURAY_PG_TEXTST_DECODER_DISABLE = 0, /**< disable both decoders */
BLURAY_PG_TEXTST_DECODER_ENABLE = 1, /**< enable both decoders */
};
/**
* BLURAY_PLAYER_SETTING_PERSISTENT_STORAGE
*
* Enable / disable BD-J persistent storage.
*
* If persistent storage is disabled, BD-J Xlets can't access any data
* stored during earlier playback sessions. Persistent data stored during
* current playback session will be removed and can't be accessed later.
*
* This setting can't be changed after bd_play() has been called.
*/
enum {
BLURAY_PERSISTENT_STORAGE_DISABLE = 0, /**< disable persistent storage between playback sessions */
BLURAY_PERSISTENT_STORAGE_ENABLE = 1, /**< enable persistent storage */
};
#endif /* BD_PLAYER_SETTINGS_H_ */

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>libbluray</string>
<key>CFBundleIdentifier</key>
<string>com.kintan.ksplayer.libbluray</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>libbluray</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>87.88.520</string>
<key>CFBundleVersion</key>
<string>87.88.520</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>MinimumOSVersion</key>
<string>10.15</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,4 @@
framework module libbluray [system] {
umbrella "."
export *
}