[libbluray-devel] [Git][videolan/libbluray][master] (disc): Use bdpriv_ prefix for internal functions
Petri Hintukainen (@hpi)
gitlab at videolan.org
Wed Jul 15 15:37:07 UTC 2026
Petri Hintukainen pushed to branch master at VideoLAN / libbluray
Commits:
d8cfc454 by Petri Hintukainen at 2026-07-15T18:34:58+03:00
(disc): Use bdpriv_ prefix for internal functions
Reduces risk of symbol collisions when linking statically.
- - - - -
11 changed files:
- src/libbluray/disc/aacs.c
- src/libbluray/disc/aacs.h
- src/libbluray/disc/bdplus.c
- src/libbluray/disc/bdplus.h
- src/libbluray/disc/dec.c
- src/libbluray/disc/dec.h
- src/libbluray/disc/disc.c
- src/libbluray/disc/properties.c
- src/libbluray/disc/properties.h
- src/libbluray/disc/udf_fs.c
- src/libbluray/disc/udf_fs.h
Changes:
=====================================
src/libbluray/disc/aacs.c
=====================================
@@ -1,6 +1,6 @@
/*
* This file is part of libbluray
- * Copyright (C) 2013-2015 VideoLAN
+ * Copyright (C) 2013-2026 VideoLAN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -65,7 +65,7 @@ static void _unload(BD_AACS *p)
}
}
-void libaacs_unload(BD_AACS **p)
+void bdpriv_aacs_unload(BD_AACS **p)
{
if (p && *p) {
_unload(*p);
@@ -73,7 +73,7 @@ void libaacs_unload(BD_AACS **p)
}
}
-int libaacs_required(void *have_file_handle, int (*have_file)(void *, const char *, const char *))
+int bdpriv_aacs_required(void *have_file_handle, int (*have_file)(void *, const char *, const char *))
{
if (have_file(have_file_handle, "AACS", "Unit_Key_RO.inf")) {
BD_DEBUG(DBG_BLURAY, "AACS" DIR_SEP "Unit_Key_RO.inf found. Disc seems to be AACS protected.\n");
@@ -143,7 +143,7 @@ static BD_AACS *_load(int impl_id)
if (!p->decrypt_unit) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "libaacs dlsym failed! (%p)\n", p->h_libaacs);
- libaacs_unload(&p);
+ bdpriv_aacs_unload(&p);
return NULL;
}
@@ -157,12 +157,12 @@ static BD_AACS *_load(int impl_id)
return p;
}
-BD_AACS *libaacs_load(int force_mmbd)
+BD_AACS *bdpriv_aacs_load(int force_mmbd)
{
return _load(force_mmbd ? IMPL_LIBMMBD : 0);
}
-int libaacs_open(BD_AACS *p, const char *device,
+int bdpriv_aacs_open(BD_AACS *p, const char *device,
void *file_open_handle, AACS_FILE_OPEN2 file_open_fp,
const char *keyfile_path)
@@ -212,7 +212,7 @@ int libaacs_open(BD_AACS *p, const char *device,
/* failed. try next aacs implementation if available. */
BD_AACS *p2 = _load(p->impl_id + 1);
if (p2) {
- if (!libaacs_open(p2, device, file_open_handle, file_open_fp, keyfile_path)) {
+ if (!bdpriv_aacs_open(p2, device, file_open_handle, file_open_fp, keyfile_path)) {
/* succeed - swap implementations */
_unload(p);
*p = *p2;
@@ -220,7 +220,7 @@ int libaacs_open(BD_AACS *p, const char *device,
return 0;
}
/* failed - report original errors */
- libaacs_unload(&p2);
+ bdpriv_aacs_unload(&p2);
}
}
@@ -241,14 +241,14 @@ int libaacs_open(BD_AACS *p, const char *device,
*
*/
-void libaacs_select_title(BD_AACS *p, uint32_t title)
+void bdpriv_aacs_select_title(BD_AACS *p, uint32_t title)
{
if (p && p->aacs) {
DL_CALL(p->h_libaacs, aacs_select_title, p->aacs, title);
}
}
-int libaacs_decrypt_unit(BD_AACS *p, uint8_t *buf)
+int bdpriv_aacs_decrypt_unit(BD_AACS *p, uint8_t *buf)
{
if (p && p->aacs) {
if (!p->decrypt_unit(p->aacs, buf)) {
@@ -261,7 +261,7 @@ int libaacs_decrypt_unit(BD_AACS *p, uint8_t *buf)
return 0;
}
-int libaacs_decrypt_bus(BD_AACS *p, uint8_t *buf)
+int bdpriv_aacs_decrypt_bus(BD_AACS *p, uint8_t *buf)
{
if (p && p->aacs && p->decrypt_bus) {
if (p->decrypt_bus(p->aacs, buf) > 0) {
@@ -277,12 +277,12 @@ int libaacs_decrypt_bus(BD_AACS *p, uint8_t *buf)
*
*/
-uint32_t libaacs_get_mkbv(BD_AACS *p)
+uint32_t bdpriv_aacs_get_mkbv(BD_AACS *p)
{
return p ? p->mkbv : 0;
}
-int libaacs_get_bec_enabled(BD_AACS *p)
+int bdpriv_aacs_get_bec_enabled(BD_AACS *p)
{
fptr_int get_bec;
@@ -327,7 +327,7 @@ static const char *_type2str(int type)
}
}
-BD_PRIVATE const uint8_t *libaacs_get_aacs_data(BD_AACS *p, int type)
+BD_PRIVATE const uint8_t *bdpriv_aacs_get_aacs_data(BD_AACS *p, int type)
{
if (!p || !p->aacs) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "get_aacs_data(%s): libaacs not initialized!\n", _type2str(type));
=====================================
src/libbluray/disc/aacs.h
=====================================
@@ -1,6 +1,6 @@
/*
* This file is part of libbluray
- * Copyright (C) 2013-2015 VideoLAN
+ * Copyright (C) 2013-2026 VideoLAN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -29,19 +29,19 @@ typedef struct bd_file_s * (*AACS_FILE_OPEN2)(void *handle, const char* filename
typedef struct bd_aacs BD_AACS;
-BD_PRIVATE int libaacs_required(void *h, int (*have_file)(void *, const char *, const char *));
-BD_PRIVATE BD_AACS *libaacs_load(int force_mmbd);
-BD_PRIVATE int libaacs_open(BD_AACS *p, const char *device,
- void *file_open_handle, AACS_FILE_OPEN2 file_open_fp,
- const char *keyfile_path);
-BD_PRIVATE void libaacs_unload(BD_AACS **p);
+BD_PRIVATE int bdpriv_aacs_required(void *h, int (*have_file)(void *, const char *, const char *));
+BD_PRIVATE BD_AACS *bdpriv_aacs_load(int force_mmbd);
+BD_PRIVATE int bdpriv_aacs_open(BD_AACS *p, const char *device,
+ void *file_open_handle, AACS_FILE_OPEN2 file_open_fp,
+ const char *keyfile_path);
+BD_PRIVATE void bdpriv_aacs_unload(BD_AACS **p);
-BD_PRIVATE void libaacs_select_title(BD_AACS *p, uint32_t title);
-BD_PRIVATE int libaacs_decrypt_unit(BD_AACS *p, uint8_t *buf);
-BD_PRIVATE int libaacs_decrypt_bus(BD_AACS *p, uint8_t *buf);
+BD_PRIVATE void bdpriv_aacs_select_title(BD_AACS *p, uint32_t title);
+BD_PRIVATE int bdpriv_aacs_decrypt_unit(BD_AACS *p, uint8_t *buf);
+BD_PRIVATE int bdpriv_aacs_decrypt_bus(BD_AACS *p, uint8_t *buf);
-BD_PRIVATE uint32_t libaacs_get_mkbv(BD_AACS *p);
-BD_PRIVATE int libaacs_get_bec_enabled(BD_AACS *p);
+BD_PRIVATE uint32_t bdpriv_aacs_get_mkbv(BD_AACS *p);
+BD_PRIVATE int bdpriv_aacs_get_bec_enabled(BD_AACS *p);
#define BD_AACS_DISC_ID 1
#define BD_AACS_MEDIA_VID 2
@@ -52,7 +52,7 @@ BD_PRIVATE int libaacs_get_bec_enabled(BD_AACS *p);
#define BD_AACS_CONTENT_CERT_ID 7
#define BD_AACS_BDJ_ROOT_CERT_HASH 8
-BD_PRIVATE const uint8_t *libaacs_get_aacs_data(BD_AACS *p, int type);
+BD_PRIVATE const uint8_t *bdpriv_aacs_get_aacs_data(BD_AACS *p, int type);
#endif /* _BD_LIBAACS_H_ */
=====================================
src/libbluray/disc/bdplus.c
=====================================
@@ -1,6 +1,6 @@
/*
* This file is part of libbluray
- * Copyright (C) 2013-2015 VideoLAN
+ * Copyright (C) 2013-2026 VideoLAN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -69,7 +69,7 @@ static void _unload(BD_BDPLUS *p)
}
}
-void libbdplus_unload(BD_BDPLUS **p)
+void bdpriv_bdplus_unload(BD_BDPLUS **p)
{
if (p && *p) {
_unload(*p);
@@ -77,7 +77,7 @@ void libbdplus_unload(BD_BDPLUS **p)
}
}
-int libbdplus_required(void *have_file_handle, int (*have_file)(void *, const char *, const char *))
+int bdpriv_bdplus_required(void *have_file_handle, int (*have_file)(void *, const char *, const char *))
{
if (have_file(have_file_handle, "BDSVM", "00000.svm")) {
BD_DEBUG(DBG_BLURAY, "BDSVM" DIR_SEP "00000.svm found. Disc seems to be BD+ protected.\n");
@@ -126,7 +126,7 @@ static void *_libbdplus_open(int *impl_id)
return NULL;
}
-int libbdplus_is_mmbd(BD_BDPLUS *p)
+int bdpriv_bdplus_is_mmbd(BD_BDPLUS *p)
{
return p && (p->impl_id == IMPL_LIBMMBD);
}
@@ -164,7 +164,7 @@ static BD_BDPLUS *_load(int impl_id)
if (!p->seek || !p->fixup || !((p->m2ts && p->m2ts_close) || p->title)) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "libbdplus dlsym failed! (%p)\n", p->h_libbdplus);
- libbdplus_unload(&p);
+ bdpriv_bdplus_unload(&p);
return NULL;
}
@@ -172,12 +172,12 @@ static BD_BDPLUS *_load(int impl_id)
return p;
}
-BD_BDPLUS *libbdplus_load()
+BD_BDPLUS *bdpriv_bdplus_load()
{
return _load(0);
}
-int libbdplus_init(BD_BDPLUS *p, const char *root, const char *device,
+int bdpriv_bdplus_init(BD_BDPLUS *p, const char *root, const char *device,
void *file_open_handle, BDPLUS_FILE_OPEN file_open_fp,
const uint8_t *vid, const uint8_t *mk)
{
@@ -194,7 +194,7 @@ int libbdplus_init(BD_BDPLUS *p, const char *root, const char *device,
if (mk == NULL && p->impl_id == IMPL_LIBBDPLUS) {
BD_BDPLUS *p2 = _load(IMPL_LIBMMBD);
if (p2) {
- if (!libbdplus_init(p2, root, device, file_open_handle, file_open_fp, vid, mk)) {
+ if (!bdpriv_bdplus_init(p2, root, device, file_open_handle, file_open_fp, vid, mk)) {
/* succeed - swap implementations */
_unload(p);
*p = *p2;
@@ -202,7 +202,7 @@ int libbdplus_init(BD_BDPLUS *p, const char *root, const char *device,
return 0;
}
/* failed - continue with original bd+ implementation */
- libbdplus_unload(&p2);
+ bdpriv_bdplus_unload(&p2);
}
}
@@ -258,21 +258,21 @@ static uint32_t _bdplus_get(BD_BDPLUS *p, const char *func)
return 0;
}
-int libbdplus_get_gen(BD_BDPLUS *p)
+int bdpriv_bdplus_get_gen(BD_BDPLUS *p)
{
return _bdplus_get(p, "bdplus_get_code_gen");
}
-int libbdplus_get_date(BD_BDPLUS *p)
+int bdpriv_bdplus_get_date(BD_BDPLUS *p)
{
return _bdplus_get(p, "bdplus_get_code_date");
}
-const uint8_t *libbdplus_get_data(BD_BDPLUS *p, int type)
+const uint8_t *bdpriv_bdplus_get_data(BD_BDPLUS *p, int type)
{
switch (type) {
case BD_BDPLUS_TYPE:
- if (libbdplus_is_mmbd(p)) {
+ if (bdpriv_bdplus_is_mmbd(p)) {
return (const uint8_t *)"mmbd";
}
if ((int32_t)_bdplus_get(p, "bdplus_is_cached") > 0) {
@@ -284,28 +284,28 @@ const uint8_t *libbdplus_get_data(BD_BDPLUS *p, int type)
return NULL;
}
-void libbdplus_event(BD_BDPLUS *p, uint32_t event, uint32_t param1, uint32_t param2)
+void bdpriv_bdplus_event(BD_BDPLUS *p, uint32_t event, uint32_t param1, uint32_t param2)
{
if (p && p->bdplus && p->event) {
p->event(p->bdplus, event, param1, param2);
}
}
-void libbdplus_mmap(BD_BDPLUS *p, uint32_t region_id, void *mem)
+void bdpriv_bdplus_mmap(BD_BDPLUS *p, uint32_t region_id, void *mem)
{
if (p && p->bdplus) {
DL_CALL(p->h_libbdplus, bdplus_mmap, p->bdplus, region_id, mem);
}
}
-void libbdplus_psr(BD_BDPLUS *p, void *regs, void *read, void *write)
+void bdpriv_bdplus_psr(BD_BDPLUS *p, void *regs, void *read, void *write)
{
if (p && p->bdplus) {
DL_CALL(p->h_libbdplus, bdplus_psr, p->bdplus, regs, read, write);
}
}
-void libbdplus_start(BD_BDPLUS *p)
+void bdpriv_bdplus_start(BD_BDPLUS *p)
{
if (p && p->bdplus) {
DL_CALL(p->h_libbdplus, bdplus_start, p->bdplus);
@@ -321,7 +321,7 @@ struct bd_bdplus_st {
void *st;
};
-BD_BDPLUS_ST *libbdplus_m2ts(BD_BDPLUS *p, uint32_t clip_id, uint64_t pos)
+BD_BDPLUS_ST *bdpriv_bdplus_m2ts(BD_BDPLUS *p, uint32_t clip_id, uint64_t pos)
{
if (p && p->bdplus) {
@@ -359,7 +359,7 @@ BD_BDPLUS_ST *libbdplus_m2ts(BD_BDPLUS *p, uint32_t clip_id, uint64_t pos)
return NULL;
}
-int libbdplus_m2ts_close(BD_BDPLUS_ST **p)
+int bdpriv_bdplus_m2ts_close(BD_BDPLUS_ST **p)
{
int result = -1;
if (p && *p) {
@@ -372,7 +372,7 @@ int libbdplus_m2ts_close(BD_BDPLUS_ST **p)
return result;
}
-int libbdplus_seek(BD_BDPLUS_ST *p, uint64_t pos)
+int bdpriv_bdplus_seek(BD_BDPLUS_ST *p, uint64_t pos)
{
if (p) {
if (p->st) {
@@ -386,7 +386,7 @@ int libbdplus_seek(BD_BDPLUS_ST *p, uint64_t pos)
return -1;
}
-int libbdplus_fixup(BD_BDPLUS_ST *p, uint8_t *buf, int len)
+int bdpriv_bdplus_fixup(BD_BDPLUS_ST *p, uint8_t *buf, int len)
{
if (p && !p->lib->m2ts) {
/* use old API */
=====================================
src/libbluray/disc/bdplus.h
=====================================
@@ -1,6 +1,6 @@
/*
* This file is part of libbluray
- * Copyright (C) 2013-2015 VideoLAN
+ * Copyright (C) 2013-2026 VideoLAN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -29,24 +29,24 @@ typedef struct bd_file_s *(*BDPLUS_FILE_OPEN)(void *handle, const char *filename
typedef struct bd_bdplus BD_BDPLUS;
-BD_PRIVATE int libbdplus_required(void *have_file_handle, int (*have_file)(void *, const char *, const char *));
-BD_PRIVATE BD_BDPLUS *libbdplus_load(void);
-BD_PRIVATE int libbdplus_is_mmbd(BD_BDPLUS *);
-BD_PRIVATE int libbdplus_init(BD_BDPLUS *p, const char *root, const char *device,
+BD_PRIVATE int bdpriv_bdplus_required(void *have_file_handle, int (*have_file)(void *, const char *, const char *));
+BD_PRIVATE BD_BDPLUS *bdpriv_bdplus_load(void);
+BD_PRIVATE int bdpriv_bdplus_is_mmbd(BD_BDPLUS *);
+BD_PRIVATE int bdpriv_bdplus_init(BD_BDPLUS *p, const char *root, const char *device,
void *file_open_handle, BDPLUS_FILE_OPEN file_open_fp,
const uint8_t *vid, const uint8_t *mk);
-BD_PRIVATE void libbdplus_unload(BD_BDPLUS **p);
+BD_PRIVATE void bdpriv_bdplus_unload(BD_BDPLUS **p);
-BD_PRIVATE int libbdplus_get_gen(BD_BDPLUS *p);
-BD_PRIVATE int libbdplus_get_date(BD_BDPLUS *p);
+BD_PRIVATE int bdpriv_bdplus_get_gen(BD_BDPLUS *p);
+BD_PRIVATE int bdpriv_bdplus_get_date(BD_BDPLUS *p);
-BD_PRIVATE void libbdplus_mmap(BD_BDPLUS *p, uint32_t region_id, void *mem);
-BD_PRIVATE void libbdplus_psr(BD_BDPLUS *p, void *regs, void *read, void *write);
-BD_PRIVATE void libbdplus_start(BD_BDPLUS *p);
-BD_PRIVATE void libbdplus_event(BD_BDPLUS *p, uint32_t event, uint32_t param1, uint32_t param2);
+BD_PRIVATE void bdpriv_bdplus_mmap(BD_BDPLUS *p, uint32_t region_id, void *mem);
+BD_PRIVATE void bdpriv_bdplus_psr(BD_BDPLUS *p, void *regs, void *read, void *write);
+BD_PRIVATE void bdpriv_bdplus_start(BD_BDPLUS *p);
+BD_PRIVATE void bdpriv_bdplus_event(BD_BDPLUS *p, uint32_t event, uint32_t param1, uint32_t param2);
#define BD_BDPLUS_TYPE 0x1000
-BD_PRIVATE const uint8_t *libbdplus_get_data(BD_BDPLUS *p, int type);
+BD_PRIVATE const uint8_t *bdpriv_bdplus_get_data(BD_BDPLUS *p, int type);
/*
* stream layer
@@ -54,10 +54,10 @@ BD_PRIVATE const uint8_t *libbdplus_get_data(BD_BDPLUS *p, int type);
typedef struct bd_bdplus_st BD_BDPLUS_ST;
-BD_PRIVATE BD_BDPLUS_ST *libbdplus_m2ts(BD_BDPLUS *p, uint32_t clip_id, uint64_t pos);
-BD_PRIVATE int libbdplus_seek(BD_BDPLUS_ST *p, uint64_t pos);
-BD_PRIVATE int libbdplus_fixup(BD_BDPLUS_ST *p, uint8_t *buf, int len);
-BD_PRIVATE int libbdplus_m2ts_close(BD_BDPLUS_ST **p);
+BD_PRIVATE BD_BDPLUS_ST *bdpriv_bdplus_m2ts(BD_BDPLUS *p, uint32_t clip_id, uint64_t pos);
+BD_PRIVATE int bdpriv_bdplus_seek(BD_BDPLUS_ST *p, uint64_t pos);
+BD_PRIVATE int bdpriv_bdplus_fixup(BD_BDPLUS_ST *p, uint8_t *buf, int len);
+BD_PRIVATE int bdpriv_bdplus_m2ts_close(BD_BDPLUS_ST **p);
#endif /* _BD_BDPLUS_H_ */
=====================================
src/libbluray/disc/dec.c
=====================================
@@ -1,6 +1,6 @@
/*
* This file is part of libbluray
- * Copyright (C) 2014 VideoLAN
+ * Copyright (C) 2014-2026 VideoLAN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -66,13 +66,13 @@ static int64_t _stream_read(BD_FILE_H *fp, uint8_t *buf, int64_t size)
}
if (st->aacs) {
- if (libaacs_decrypt_unit(st->aacs, buf)) {
+ if (bdpriv_aacs_decrypt_unit(st->aacs, buf)) {
/* failure is detected from TP header */
}
}
if (st->bdplus) {
- if (libbdplus_fixup(st->bdplus, buf, (int)size) < 0) {
+ if (bdpriv_bdplus_fixup(st->bdplus, buf, (int)size) < 0) {
/* there's no way to verify if the stream was decoded correctly */
}
}
@@ -85,7 +85,7 @@ static int64_t _stream_seek(BD_FILE_H *fp, int64_t offset, int32_t origin)
DEC_STREAM *st = (DEC_STREAM *)fp->internal;
int64_t result = st->fp->seek(st->fp, offset, origin);
if (result >= 0 && st->bdplus) {
- libbdplus_seek(st->bdplus, st->fp->tell(st->fp));
+ bdpriv_bdplus_seek(st->bdplus, st->fp->tell(st->fp));
}
return result;
}
@@ -100,14 +100,14 @@ static void _stream_close(BD_FILE_H *fp)
{
DEC_STREAM *st = (DEC_STREAM *)fp->internal;
if (st->bdplus) {
- libbdplus_m2ts_close(&st->bdplus);
+ bdpriv_bdplus_m2ts_close(&st->bdplus);
}
st->fp->close(st->fp);
X_FREE(fp->internal);
X_FREE(fp);
}
-BD_FILE_H *dec_open_stream(BD_DEC *dec, BD_FILE_H *fp, uint32_t clip_id)
+BD_FILE_H *bdpriv_dec_open_stream(BD_DEC *dec, BD_FILE_H *fp, uint32_t clip_id)
{
DEC_STREAM *st;
BD_FILE_H *p = calloc(1, sizeof(BD_FILE_H));
@@ -123,14 +123,14 @@ BD_FILE_H *dec_open_stream(BD_DEC *dec, BD_FILE_H *fp, uint32_t clip_id)
st->fp = fp;
if (dec->bdplus) {
- st->bdplus = libbdplus_m2ts(dec->bdplus, clip_id, 0);
+ st->bdplus = bdpriv_bdplus_m2ts(dec->bdplus, clip_id, 0);
}
if (dec->aacs) {
st->aacs = dec->aacs;
if (!dec->use_menus) {
/* There won't be title events --> need to manually reset AACS CPS */
- libaacs_select_title(dec->aacs, 0xffff);
+ bdpriv_aacs_select_title(dec->aacs, 0xffff);
}
}
@@ -183,19 +183,19 @@ static int _libaacs_init(BD_DEC *dec, struct dec_dev *dev,
return 0;
}
- result = libaacs_open(dec->aacs, dev->device, dev->file_open_vfs_handle, dev->pf_file_open_vfs, keyfile_path);
+ result = bdpriv_aacs_open(dec->aacs, dev->device, dev->file_open_vfs_handle, dev->pf_file_open_vfs, keyfile_path);
i->aacs_error_code = result;
i->aacs_handled = !result;
- i->aacs_mkbv = libaacs_get_mkbv(dec->aacs);
- disc_id = libaacs_get_aacs_data(dec->aacs, BD_AACS_DISC_ID);
+ i->aacs_mkbv = bdpriv_aacs_get_mkbv(dec->aacs);
+ disc_id = bdpriv_aacs_get_aacs_data(dec->aacs, BD_AACS_DISC_ID);
if (disc_id) {
memcpy(i->disc_id, disc_id, 20);
}
if (result) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_open() failed: %d!\n", result);
- libaacs_unload(&dec->aacs);
+ bdpriv_aacs_unload(&dec->aacs);
return 0;
}
@@ -211,33 +211,33 @@ static int _libbdplus_init(BD_DEC *dec, struct dec_dev *dev,
return 0;
}
- const uint8_t *vid = libaacs_get_aacs_data(dec->aacs, BD_AACS_MEDIA_VID);
- const uint8_t *mk = libaacs_get_aacs_data(dec->aacs, BD_AACS_MEDIA_KEY);
+ const uint8_t *vid = bdpriv_aacs_get_aacs_data(dec->aacs, BD_AACS_MEDIA_VID);
+ const uint8_t *mk = bdpriv_aacs_get_aacs_data(dec->aacs, BD_AACS_MEDIA_KEY);
if (!vid) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "BD+ initialization failed (no AACS ?)\n");
- libbdplus_unload(&dec->bdplus);
+ bdpriv_bdplus_unload(&dec->bdplus);
return 0;
}
- if (libbdplus_init(dec->bdplus, dev->root, dev->device, dev->file_open_bdrom_handle, dev->pf_file_open_bdrom, vid, mk)) {
+ if (bdpriv_bdplus_init(dec->bdplus, dev->root, dev->device, dev->file_open_bdrom_handle, dev->pf_file_open_bdrom, vid, mk)) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bdplus_init() failed\n");
i->bdplus_handled = 0;
- libbdplus_unload(&dec->bdplus);
+ bdpriv_bdplus_unload(&dec->bdplus);
return 0;
}
BD_DEBUG(DBG_BLURAY, "libbdplus initialized\n");
/* map player memory regions */
- libbdplus_mmap(dec->bdplus, 0, regs);
- libbdplus_mmap(dec->bdplus, 1, (void*)((uint8_t *)regs + sizeof(uint32_t) * 128));
+ bdpriv_bdplus_mmap(dec->bdplus, 0, regs);
+ bdpriv_bdplus_mmap(dec->bdplus, 1, (void*)((uint8_t *)regs + sizeof(uint32_t) * 128));
/* connect registers */
- libbdplus_psr(dec->bdplus, regs, psr_read, psr_write);
+ bdpriv_bdplus_psr(dec->bdplus, regs, psr_read, psr_write);
- i->bdplus_gen = libbdplus_get_gen(dec->bdplus);
- i->bdplus_date = libbdplus_get_date(dec->bdplus);
+ i->bdplus_gen = bdpriv_bdplus_get_gen(dec->bdplus);
+ i->bdplus_date = bdpriv_bdplus_get_date(dec->bdplus);
i->bdplus_handled = 1;
if (i->bdplus_date == 0) {
@@ -252,14 +252,14 @@ static int _libbdplus_init(BD_DEC *dec, struct dec_dev *dev,
static int _dec_detect(struct dec_dev *dev, BD_ENC_INFO *i)
{
/* Check for AACS */
- i->aacs_detected = libaacs_required((void*)dev, _bdrom_have_file);
+ i->aacs_detected = bdpriv_aacs_required((void*)dev, _bdrom_have_file);
if (!i->aacs_detected) {
/* No AACS (=> no BD+) */
return 0;
}
/* check for BD+ */
- i->bdplus_detected = libbdplus_required((void*)dev, _bdrom_have_file);
+ i->bdplus_detected = bdpriv_bdplus_required((void*)dev, _bdrom_have_file);
return 1;
}
@@ -269,12 +269,12 @@ static void _dec_load(BD_DEC *dec, BD_ENC_INFO *i)
if (i->bdplus_detected) {
/* load BD+ library and check BD+ library type. libmmbd doesn't work with libaacs */
- dec->bdplus = libbdplus_load();
- force_mmbd_aacs = dec->bdplus && libbdplus_is_mmbd(dec->bdplus);
+ dec->bdplus = bdpriv_bdplus_load();
+ force_mmbd_aacs = dec->bdplus && bdpriv_bdplus_is_mmbd(dec->bdplus);
}
/* load AACS library */
- dec->aacs = libaacs_load(force_mmbd_aacs);
+ dec->aacs = bdpriv_aacs_load(force_mmbd_aacs);
i->libaacs_detected = !!dec->aacs;
i->libbdplus_detected = !!dec->bdplus;
@@ -284,9 +284,9 @@ static void _dec_load(BD_DEC *dec, BD_ENC_INFO *i)
*
*/
-BD_DEC *dec_init(struct dec_dev *dev, BD_ENC_INFO *enc_info,
- const char *keyfile_path,
- void *regs, void *psr_read, void *psr_write)
+BD_DEC *bdpriv_dec_init(struct dec_dev *dev, BD_ENC_INFO *enc_info,
+ const char *keyfile_path,
+ void *regs, void *psr_read, void *psr_write)
{
BD_DEC *dec = NULL;
@@ -313,7 +313,7 @@ BD_DEC *dec_init(struct dec_dev *dev, BD_ENC_INFO *enc_info,
if (!enc_info->aacs_handled) {
/* AACS failed, clean up */
- dec_close(&dec);
+ bdpriv_dec_close(&dec);
}
/* BD+ failure may be non-fatal (not all titles in disc use BD+).
@@ -323,12 +323,12 @@ BD_DEC *dec_init(struct dec_dev *dev, BD_ENC_INFO *enc_info,
return dec;
}
-void dec_close(BD_DEC **pp)
+void bdpriv_dec_close(BD_DEC **pp)
{
if (pp && *pp) {
BD_DEC *p = *pp;
- libaacs_unload(&p->aacs);
- libbdplus_unload(&p->bdplus);
+ bdpriv_aacs_unload(&p->aacs);
+ bdpriv_bdplus_unload(&p->bdplus);
X_FREE(*pp);
}
}
@@ -337,57 +337,57 @@ void dec_close(BD_DEC **pp)
*
*/
-const uint8_t *dec_data(BD_DEC *dec, int type)
+const uint8_t *bdpriv_dec_data(BD_DEC *dec, int type)
{
const uint8_t *ret = NULL;
if (type >= 0x1000) {
if (dec->bdplus) {
- ret = libbdplus_get_data(dec->bdplus, type);
+ ret = bdpriv_bdplus_get_data(dec->bdplus, type);
}
} else {
if (dec->aacs) {
- ret = libaacs_get_aacs_data(dec->aacs, type);
+ ret = bdpriv_aacs_get_aacs_data(dec->aacs, type);
}
}
return ret;
}
-const uint8_t *dec_disc_id(BD_DEC *dec)
+const uint8_t *bdpriv_dec_disc_id(BD_DEC *dec)
{
- return dec_data(dec, BD_AACS_DISC_ID);
+ return bdpriv_dec_data(dec, BD_AACS_DISC_ID);
}
-void dec_start(BD_DEC *dec, uint32_t num_titles)
+void bdpriv_dec_start(BD_DEC *dec, uint32_t num_titles)
{
if (num_titles == 0) {
dec->use_menus = 1;
if (dec->bdplus) {
- libbdplus_start(dec->bdplus);
- libbdplus_event(dec->bdplus, 0x110, 0xffff, 0);
+ bdpriv_bdplus_start(dec->bdplus);
+ bdpriv_bdplus_event(dec->bdplus, 0x110, 0xffff, 0);
}
} else {
if (dec->bdplus) {
- libbdplus_start(dec->bdplus);
- libbdplus_event(dec->bdplus, 0xffffffff, num_titles, 0);
+ bdpriv_bdplus_start(dec->bdplus);
+ bdpriv_bdplus_event(dec->bdplus, 0xffffffff, num_titles, 0);
}
}
}
-void dec_title(BD_DEC *dec, uint32_t title)
+void bdpriv_dec_title(BD_DEC *dec, uint32_t title)
{
if (dec->aacs) {
- libaacs_select_title(dec->aacs, title);
+ bdpriv_aacs_select_title(dec->aacs, title);
}
if (dec->bdplus) {
- libbdplus_event(dec->bdplus, 0x110, title, 0);
+ bdpriv_bdplus_event(dec->bdplus, 0x110, title, 0);
}
}
-void dec_application(BD_DEC *dec, uint32_t data)
+void bdpriv_dec_application(BD_DEC *dec, uint32_t data)
{
if (dec->bdplus) {
- libbdplus_event(dec->bdplus, 0x210, data, 0);
+ bdpriv_bdplus_event(dec->bdplus, 0x210, data, 0);
}
}
=====================================
src/libbluray/disc/dec.h
=====================================
@@ -1,6 +1,6 @@
/*
* This file is part of libbluray
- * Copyright (C) 2014 VideoLAN
+ * Copyright (C) 2014-2026 VideoLAN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -45,23 +45,23 @@ struct dec_dev {
typedef struct bd_dec BD_DEC;
-BD_PRIVATE BD_DEC *dec_init(struct dec_dev *dev,
- struct bd_enc_info *enc_info,
- const char *keyfile_path,
- void *regs, void *psr_read, void *psr_write);
-BD_PRIVATE void dec_close(BD_DEC **);
+BD_PRIVATE BD_DEC *bdpriv_dec_init(struct dec_dev *dev,
+ struct bd_enc_info *enc_info,
+ const char *keyfile_path,
+ void *regs, void *psr_read, void *psr_write);
+BD_PRIVATE void bdpriv_dec_close(BD_DEC **);
/* get decoder data */
-BD_PRIVATE const uint8_t *dec_data(BD_DEC *, int type);
-BD_PRIVATE const uint8_t *dec_disc_id(BD_DEC *);
+BD_PRIVATE const uint8_t *bdpriv_dec_data(BD_DEC *, int type);
+BD_PRIVATE const uint8_t *bdpriv_dec_disc_id(BD_DEC *);
/* status events from upper layers */
-BD_PRIVATE void dec_start(BD_DEC *, uint32_t num_titles);
-BD_PRIVATE void dec_title(BD_DEC *, uint32_t title);
-BD_PRIVATE void dec_application(BD_DEC *, uint32_t data);
+BD_PRIVATE void bdpriv_dec_start(BD_DEC *, uint32_t num_titles);
+BD_PRIVATE void bdpriv_dec_title(BD_DEC *, uint32_t title);
+BD_PRIVATE void bdpriv_dec_application(BD_DEC *, uint32_t data);
/* open low-level stream */
-BD_PRIVATE struct bd_file_s *dec_open_stream(BD_DEC *dec, struct bd_file_s *fp, uint32_t clip_id);
+BD_PRIVATE struct bd_file_s *bdpriv_dec_open_stream(BD_DEC *dec, struct bd_file_s *fp, uint32_t clip_id);
#endif /* _BD_DISC_DEC_H_ */
=====================================
src/libbluray/disc/disc.c
=====================================
@@ -1,6 +1,6 @@
/*
* This file is part of libbluray
- * Copyright (C) 2014-2017 Petri Hintukainen <phintuka at users.sourceforge.net>
+ * Copyright (C) 2014-2026 Petri Hintukainen <phintuka at 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
@@ -328,16 +328,16 @@ BD_DISC *disc_open(const char *device_path,
/* check if disc root directory can be opened. If not, treat it as device/image file. */
BD_DIR_H *dp_img = device_path ? dir_open(device_path) : NULL;
if (!dp_img) {
- void *udf = udf_image_open(device_path, p_fs ? p_fs->fs_handle : NULL, p_fs ? p_fs->read_blocks : NULL);
+ void *udf = bdpriv_udf_image_open(device_path, p_fs ? p_fs->fs_handle : NULL, p_fs ? p_fs->read_blocks : NULL);
if (!udf) {
BD_DEBUG(DBG_FILE | DBG_CRIT, "failed opening UDF image %s\n", device_path);
} else {
p->fs_handle = udf;
- p->pf_fs_close = udf_image_close;
- p->pf_file_open_bdrom = udf_file_open;
- p->pf_dir_open_bdrom = udf_dir_open;
+ p->pf_fs_close = bdpriv_udf_image_close;
+ p->pf_file_open_bdrom = bdpriv_udf_file_open;
+ p->pf_dir_open_bdrom = bdpriv_udf_dir_open;
- p->udf_volid = udf_volume_id(udf);
+ p->udf_volid = bdpriv_udf_volume_id(udf);
/* root not accessible with stdio */
X_FREE(p->disc_root);
@@ -348,7 +348,7 @@ BD_DISC *disc_open(const char *device_path,
}
struct dec_dev dev = { p->fs_handle, p->pf_file_open_bdrom, p, (file_openFp)disc_open_path, p->disc_root, device_path };
- p->dec = dec_init(&dev, enc_info, keyfile_path, regs, psr_read, psr_write);
+ p->dec = bdpriv_dec_init(&dev, enc_info, keyfile_path, regs, psr_read, psr_write);
return p;
}
@@ -358,7 +358,7 @@ void disc_close(BD_DISC **pp)
if (pp && *pp) {
BD_DISC *p = *pp;
- dec_close(&p->dec);
+ bdpriv_dec_close(&p->dec);
if (p->pf_fs_close) {
p->pf_fs_close(p->fs_handle);
@@ -607,7 +607,7 @@ static char *_properties_file(BD_DISC *p)
/* get disc ID */
if (p->dec) {
id_type = 'A';
- disc_id = dec_disc_id(p->dec);
+ disc_id = bdpriv_dec_disc_id(p->dec);
}
if (!disc_id) {
id_type = 'P';
@@ -653,7 +653,7 @@ int disc_property_put(BD_DISC *p, const char *property, const char *val)
}
bd_mutex_lock(&p->properties_mutex);
- result = properties_put(p->properties_file, property, val);
+ result = bdpriv_properties_put(p->properties_file, property, val);
bd_mutex_unlock(&p->properties_mutex);
return result;
@@ -668,7 +668,7 @@ char *disc_property_get(BD_DISC *p, const char *property)
}
bd_mutex_lock(&p->properties_mutex);
- result = properties_get(p->properties_file, property);
+ result = bdpriv_properties_get(p->properties_file, property);
bd_mutex_unlock(&p->properties_mutex);
return result;
@@ -681,7 +681,7 @@ char *disc_property_get(BD_DISC *p, const char *property)
static BD_FILE_H *_open_stream(BD_DISC *disc, BD_FILE_H *fp, const char *file)
{
if (disc->dec) {
- BD_FILE_H *st = dec_open_stream(disc->dec, fp, atoi(file));
+ BD_FILE_H *st = bdpriv_dec_open_stream(disc->dec, fp, atoi(file));
if (st) {
return st;
}
@@ -730,7 +730,7 @@ BD_FILE_H *disc_open_path_dec(BD_DISC *p, const char *rel_path)
const uint8_t *disc_get_data(BD_DISC *disc, int type)
{
if (disc->dec) {
- return dec_data(disc->dec, type);
+ return bdpriv_dec_data(disc->dec, type);
}
if (type == 0x1000) {
/* this shouldn't cause any extra optical disc access */
@@ -749,13 +749,13 @@ void disc_event(BD_DISC *disc, uint32_t event, uint32_t param)
if (disc && disc->dec) {
switch (event) {
case DISC_EVENT_START:
- dec_start(disc->dec, param);
+ bdpriv_dec_start(disc->dec, param);
return;
case DISC_EVENT_TITLE:
- dec_title(disc->dec, param);
+ bdpriv_dec_title(disc->dec, param);
return;
case DISC_EVENT_APPLICATION:
- dec_application(disc->dec, param);
+ bdpriv_dec_application(disc->dec, param);
return;
}
}
=====================================
src/libbluray/disc/properties.c
=====================================
@@ -1,6 +1,6 @@
/*
* This file is part of libbluray
- * Copyright (C) 2017 Petri Hintukainen <phintuka at users.sourceforge.net>
+ * Copyright (C) 2017-2026 Petri Hintukainen <phintuka at 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
@@ -159,7 +159,7 @@ static char *_scan_prop(char *data, const char *key, size_t *data_size)
return NULL;
}
-char *properties_get(const char *file, const char *property)
+char *bdpriv_properties_get(const char *file, const char *property)
{
char *key, *data;
size_t data_size;
@@ -191,7 +191,7 @@ char *properties_get(const char *file, const char *property)
return result;
}
-int properties_put(const char *file, const char *property, const char *val)
+int bdpriv_properties_put(const char *file, const char *property, const char *val)
{
char *key = NULL, *old_data = NULL, *new_data = NULL;
char *old_val;
=====================================
src/libbluray/disc/properties.h
=====================================
@@ -1,6 +1,6 @@
/*
* This file is part of libbluray
- * Copyright (C) 2017 Petri Hintukainen <phintuka at users.sourceforge.net>
+ * Copyright (C) 2017-2026 Petri Hintukainen <phintuka at 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
@@ -39,7 +39,7 @@
* @param val value for property
* @return 0 on success, -1 on error
*/
-BD_PRIVATE int properties_put(const char *file, const char *property, const char *val);
+BD_PRIVATE int bdpriv_properties_put(const char *file, const char *property, const char *val);
/**
*
@@ -49,7 +49,7 @@ BD_PRIVATE int properties_put(const char *file, const char *property, const char
* @param property property name
* @return property value or NULL
*/
-BD_PRIVATE char *properties_get(const char *file, const char *property);
+BD_PRIVATE char *bdpriv_properties_get(const char *file, const char *property);
#endif /* _BD_PROPERTIES_H_ */
=====================================
src/libbluray/disc/udf_fs.c
=====================================
@@ -1,6 +1,6 @@
/*
* This file is part of libbluray
- * Copyright (C) 2015 Petri Hintukainen
+ * Copyright (C) 2015-2026 Petri Hintukainen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -69,7 +69,7 @@ static int64_t _file_read(BD_FILE_H *file, uint8_t *buf, int64_t size)
return udfread_file_read((UDFFILE*)file->internal, buf, size);
}
-BD_FILE_H *udf_file_open(void *udf, const char *filename)
+BD_FILE_H *bdpriv_udf_file_open(void *udf, const char *filename)
{
BD_FILE_H *file = calloc(1, sizeof(BD_FILE_H));
if (!file) {
@@ -121,7 +121,7 @@ static int _dir_read(BD_DIR_H *dir, BD_DIRENT *entry)
return 0;
}
-BD_DIR_H *udf_dir_open(void *udf, const char* dirname)
+BD_DIR_H *bdpriv_udf_dir_open(void *udf, const char* dirname)
{
BD_DIR_H *dir = calloc(1, sizeof(BD_DIR_H));
if (!dir) {
@@ -246,9 +246,9 @@ static struct udfread_block_input *_stream_input(void *read_block_handle,
}
-void *udf_image_open(const char *img_path,
- void *read_block_handle,
- int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks))
+void *bdpriv_udf_image_open(const char *img_path,
+ void *read_block_handle,
+ int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks))
{
udfread *udf = udfread_init();
int result = -1;
@@ -292,12 +292,12 @@ void *udf_image_open(const char *img_path,
return (void*)udf;
}
-const char *udf_volume_id(void *udf)
+const char *bdpriv_udf_volume_id(void *udf)
{
return udfread_get_volume_id((udfread*)udf);
}
-void udf_image_close(void *udf)
+void bdpriv_udf_image_close(void *udf)
{
udfread_close((udfread*)udf);
}
=====================================
src/libbluray/disc/udf_fs.h
=====================================
@@ -1,6 +1,6 @@
/*
* This file is part of libbluray
- * Copyright (C) 2015 Petri Hintukainen
+ * Copyright (C) 2015-2026 Petri Hintukainen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -25,13 +25,13 @@
struct bd_file_s;
struct bd_dir_s;
-BD_PRIVATE void *udf_image_open(const char *img_path,
- void *read_block_handle,
- int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks));
-BD_PRIVATE void udf_image_close(void *udf);
+BD_PRIVATE void *bdpriv_udf_image_open(const char *img_path,
+ void *read_block_handle,
+ int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks));
+BD_PRIVATE void bdpriv_udf_image_close(void *udf);
-BD_PRIVATE const char *udf_volume_id(void *udf);
-BD_PRIVATE struct bd_file_s *udf_file_open(void *udf, const char *filename);
-BD_PRIVATE struct bd_dir_s *udf_dir_open(void *udf, const char* dirname);
+BD_PRIVATE const char *bdpriv_udf_volume_id(void *udf);
+BD_PRIVATE struct bd_file_s *bdpriv_udf_file_open(void *udf, const char *filename);
+BD_PRIVATE struct bd_dir_s *bdpriv_udf_dir_open(void *udf, const char* dirname);
#endif /* _BD_UDF_FS_H_ */
View it on GitLab: https://code.videolan.org/videolan/libbluray/-/commit/d8cfc454bd377efafbdde469cfe5cb5a655e8483
--
View it on GitLab: https://code.videolan.org/videolan/libbluray/-/commit/d8cfc454bd377efafbdde469cfe5cb5a655e8483
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the libbluray-devel
mailing list