<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-04-10 12:16 GMT+02:00 Petri Hintukainen <span dir="ltr"><<a href="mailto:phintuka@users.sourceforge.net" target="_blank">phintuka@users.sourceforge.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
We can add this to API if it would be useful. Maybe it would be more<br>
generic if it would return ex. bit mask of available features (BD-J,<br>
JVM, JAR, UDF, metadata, ...). Would there be any real use for the<br>
other flags ?<br>
<br>
Do you need to know BD-J status before opening the disc ? vlc/xine do<br>
similar check between bd_open() and bd_play() , and pop up a message or<br>
play the disc without menus if BD-J or some other required feature is<br>
missing.<br></blockquote><div><br></div><div>Currently we have a similar check/pop-up when a user tries to start a disc with a menu.<br></div><div><br></div><div>Our use case is as follows: Kodi has a setting for Blu-ray "discs" to<br></div><div>a) play the main title<br></div><div>b) show a simplified menu<br></div><div>c) show/play the disc's menu<br><br></div><div>If a user selects c) I would like to add a check and show a message if something does not work.<br></div><div>Most probably that will be bd-j because of a missing/wrong jre.<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
We could also make existing API to work without opening the disc. This<br>
information is in BLURAY_DISC_INFO. Something like:<br>
BLURAY *bd = bd_init();<br>
const BLURAY_DISC_INFO *info = bd_get_disc_info(bd);<br>
if (!info->bdj_handled) {<br>
...<br>
}<br>
Currently these fields are not initialized if bd_open*() was not<br>
called, but that's easy to fix.<br>
<br></blockquote><div>Yes, that would be another way to achieve my goal.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Before adding new API for this I'd like to discuss about simplifying<br>
the build configuration. I think we could unconditionally build BD-J<br>
and UDF support into the library. That does not add any new<br>
dependencies, and code size increase is not that big. Any opinions ?<br></blockquote><div><br></div><div>Sure. I've planned to replace our udf code with your libudfread for some time now, but my free-time is quite limited.<br></div><div>Bd-j menus from isos, e.g., do not work currently, since we use our own vfs.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5"><br>
su, 2017-04-09 kello 13:13 +0200, Andreas Zelend kirjoitti:<br>
> From: ace20022 <<a href="mailto:ace20022@ymail.com">ace20022@ymail.com</a>><br>
><br>
> ---<br>
> src/libbluray/bdj/bdj.c | 14 ++++++++++++++<br>
> src/libbluray/bdj/bdj.h | 1 +<br>
> src/libbluray/bluray.c | 10 ++++++++++<br>
> src/libbluray/bluray.h | 13 +++++++++++++<br>
> 4 files changed, 38 insertions(+)<br>
><br>
> diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c<br>
> index eeb3040f..8c6708f0 100644<br>
> --- a/src/libbluray/bdj/bdj.c<br>
> +++ b/src/libbluray/bdj/bdj.c<br>
> @@ -631,6 +631,20 @@ static int _bdj_init(JNIEnv *env, struct bluray<br>
> *bd, const char *disc_root, cons<br>
> return 1;<br>
> }<br>
> <br>
> +int bdj_functional()<br>
> +{<br>
> + BDJ_STORAGE* bds = calloc(1, sizeof(BDJ_STORAGE));<br>
> + if (!bds) {<br>
> + BD_DEBUG(DBG_CRIT, "out of memory\n");<br>
> + return 0;<br>
> + }<br>
> +<br>
> + int ret = bdj_jvm_available(bds);<br>
> + X_FREE(bds);<br>
> +<br>
> + return ret;<br>
> +}<br>
> +<br>
> int bdj_jvm_available(BDJ_STORAGE *storage)<br>
> {<br>
> const char *java_home;<br>
> diff --git a/src/libbluray/bdj/bdj.h b/src/libbluray/bdj/bdj.h<br>
> index 789e7fee..748c9917 100644<br>
> --- a/src/libbluray/bdj/bdj.h<br>
> +++ b/src/libbluray/bdj/bdj.h<br>
> @@ -81,5 +81,6 @@ BD_PRIVATE void bdj_close(BDJAVA *bdjava);<br>
> BD_PRIVATE int bdj_process_event(BDJAVA *bdjava, unsigned ev,<br>
> unsigned param);<br>
> <br>
> BD_PRIVATE int bdj_jvm_available(BDJ_<wbr>STORAGE *storage); /* 0: no.<br>
> 1: only jvm. 2: jvm + libbluray.jar. */<br>
> +BD_PRIVATE int bdj_functional(); /* wrapper for bdj_jvm_available<br>
> without a specific disc*/<br>
> <br>
> #endif<br>
> diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c<br>
> index 4eddac0f..9dd2577c 100644<br>
> --- a/src/libbluray/bluray.c<br>
> +++ b/src/libbluray/bluray.c<br>
> @@ -3862,3 +3862,13 @@ void bd_free_bdjo(struct bdjo_data *obj)<br>
> (void)obj;<br>
> #endif<br>
> }<br>
> +<br>
> +int bd_bdj_functional()<br>
> +{<br>
> +#ifdef USING_BDJAVA<br>
> + return bdj_functional();<br>
> +#else<br>
> + return -1;<br>
> +#endif<br>
> +<br>
> +}<br>
> diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h<br>
> index e53a9779..53ea1abe 100644<br>
> --- a/src/libbluray/bluray.h<br>
> +++ b/src/libbluray/bluray.h<br>
> @@ -1086,6 +1086,19 @@ void bd_stop_bdj(BLURAY *bd); // shutdown BD-J<br>
> and clean up resources<br>
> */<br>
> int bd_read_file(BLURAY *, const char *path, void **data, int64_t<br>
> *size);<br>
> <br>
> +/**<br>
> +*<br>
> +* Check if BD-J is functional<br>
> +*<br>
> +* Checks whether BD-J support was compiled in and if so<br>
> +* whether jvm and/or libbluray.jar is usable or not.<br>
> +*<br>
> +* @return -1 if BD-J support was not compiled in,<br>
> +* 0: JVM library could not be loaded<br>
> +* 1: only the JVM library could be loaded<br>
> +* 2: the JVM library and the libbluray.jar could be loaded<br>
> +*/<br>
> +int bd_bdj_functional();<br>
> <br>
> #ifdef __cplusplus<br>
> }<br>
</div></div>______________________________<wbr>_________________<br>
libbluray-devel mailing list<br>
<a href="mailto:libbluray-devel@videolan.org">libbluray-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/libbluray-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/libbluray-devel</a><br>
</blockquote></div><br></div></div>