23 #include <libbluray/bluray.h>
30 #define BLURAY_PROTO_PREFIX "bluray:"
31 #define MIN_PLAYLIST_LENGTH 180
44 #define OFFSET(x) offsetof(BlurayContext, x)
64 const BLURAY_DISC_INFO *disc_info;
66 disc_info = bd_get_disc_info(bd->
bd);
72 if (!disc_info->bluray_detected) {
78 if (disc_info->aacs_detected && !disc_info->aacs_handled) {
79 if (!disc_info->libaacs_detected) {
81 "Media stream encrypted with AACS, install and configure libaacs\n");
89 if (disc_info->bdplus_detected && !disc_info->bdplus_handled) {
118 const char *diskname = path;
122 bd->
bd = bd_open(diskname,
NULL);
144 if (num_title_idx < 1) {
152 for (i = 0; i < num_title_idx; i++) {
153 BLURAY_TITLE_INFO *info = bd_get_title_info(bd->
bd, i, 0);
157 ((
int)(info->duration / 90000) / 3600),
158 ((
int)(info->duration / 90000) % 3600) / 60,
159 ((
int)(info->duration / 90000) % 60));
161 if (info->duration > duration) {
163 duration = info->duration;
166 bd_free_title_info(info);
172 if (bd_select_playlist(bd->
bd, bd->
playlist) <= 0) {
178 if (bd->
angle >= 0) {
179 bd_select_angle(bd->
bd, bd->
angle);
184 bd_seek_chapter(bd->
bd, bd->
chapter - 1);
195 if (!bd || !bd->
bd) {
199 len = bd_read(bd->
bd, buf, size);
208 if (!bd || !bd->
bd) {
216 return bd_seek(bd->
bd, pos);
219 return bd_get_title_size(bd->
bd);
234 .priv_data_class = &bluray_context_class,
#define LIBAVUTIL_VERSION_INT
static int bluray_open(URLContext *h, const char *path, int flags)
const char * av_default_item_name(void *ptr)
Return the context name.
static const AVClass bluray_context_class
static int check_disc_info(URLContext *h)
#define MIN_PLAYLIST_LENGTH
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define AVERROR_EOF
End of file.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int bluray_read(URLContext *h, unsigned char *buf, int size)
#define AV_LOG_INFO
Standard information.
Describe the class of an AVClass context structure.
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
#define flags(name, subs,...)
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
#define BLURAY_PROTO_PREFIX
#define AVSEEK_SIZE
ORing this as the "whence" parameter to a seek function causes it to return the filesize without seek...
static int bluray_close(URLContext *h)
const URLProtocol ff_bluray_protocol
unbuffered private I/O API
static const AVOption options[]
static int64_t bluray_seek(URLContext *h, int64_t pos, int whence)