Commit 415da366 authored by Petri Hintukainen's avatar Petri Hintukainen

Remove --disable-bdjava configure option

parent dec9a6bc
......@@ -197,7 +197,6 @@ libbluray_la_SOURCES += \
contrib/libudfread/src/udfread.c
if USING_BDJAVA
if USING_BDJAVA_BUILD_JAR
jardir=$(datadir)/java/
jar_DATA=$(top_builddir)/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar
......@@ -242,7 +241,6 @@ clean-local:
-Dversion='$(BDJ_TYPE)-$(VERSION)' \
clean
endif
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = src/libbluray.pc
......@@ -255,6 +253,7 @@ pkgconfig_DATA = src/libbluray.pc
if USING_EXAMPLES
noinst_PROGRAMS = \
bdj_test \
bdjo_dump \
bdsplice \
clpi_dump \
......@@ -266,11 +265,6 @@ noinst_PROGRAMS = \
mpls_dump \
sound_dump
if USING_BDJAVA
noinst_PROGRAMS += \
bdj_test
endif
bin_PROGRAMS = \
bd_info
......
......@@ -81,11 +81,6 @@ AC_ARG_ENABLE([examples],
[use_examples=$enableval],
[use_examples=yes])
AC_ARG_ENABLE([bdjava],
[AS_HELP_STRING([--disable-bdjava], [disable BD-Java support @<:@default=enabled@:>@])],
[use_bdjava=$enableval],
[use_bdjava=yes])
AC_ARG_ENABLE([bdjava-jar],
[AS_HELP_STRING([--disable-bdjava-jar],
[disable building of BD-Java JAR file @<:@default=enabled@:>@])],
......@@ -198,7 +193,6 @@ dnl use examples
AM_CONDITIONAL([USING_EXAMPLES], [ test $use_examples = "yes" ])
dnl use bdjava
if [[ $use_bdjava = "yes" ]]; then
case $host_cpu in
x86_64) java_arch=amd64 ;;
i?86) java_arch=i386 ;;
......@@ -231,11 +225,8 @@ if [[ $use_bdjava = "yes" ]]; then
AC_MSG_ERROR([BD-J requires ANT, but ant was not found. Please install it.])
fi
AC_DEFINE([USING_BDJAVA], [1], ["Define to 1 if using BD-Java"])
AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$java_arch"], ["Defines the architecture of the java vm."])
AC_DEFINE_UNQUOTED([JDK_HOME], ["$JDK_HOME"], [""])
fi
AM_CONDITIONAL([USING_BDJAVA], [ test $use_bdjava = "yes" ])
AM_CONDITIONAL([USING_BDJAVA_BUILD_JAR], [ test $use_bdjava_jar = "yes" ])
dnl BD-J type
......@@ -284,24 +275,19 @@ dnl ---------------------------------------------
echo " Summary:"
echo " --------"
echo " BD-J support: $use_bdjava"
if [[ $use_bdjava = "yes" ]]; then
echo " BD-J type: $BDJ_TYPE"
echo " build JAR: $use_bdjava_jar"
if test x"$BDJ_BOOTCLASSPATH" != x""; then
echo " BD-J bootclasspath: $BDJ_BOOTCLASSPATH"
fi
fi
echo " Font support (freetype2): $with_freetype"
if [[ $with_freetype = "yes" ]]; then
if [[ $use_bdjava = "yes" ]]; then
if test "${SYS}" != "mingw32"; then
echo " Use system fonts (fontconfig): $with_fontconfig"
else
echo " Use system fonts: yes"
fi
fi
fi
echo " Metadata support (libxml2): $with_libxml2"
echo " UDF filesystem support: yes"
echo " Build examples: $use_examples"
......
......@@ -51,10 +51,8 @@
#include "disc/disc.h"
#include "disc/enc_info.h"
#include "file/file.h"
#ifdef USING_BDJAVA
#include "bdj/bdj.h"
#include "bdj/bdjo_parse.h"
#endif
#include <stdio.h> // SEEK_
#include <stdlib.h>
......@@ -152,11 +150,9 @@ struct bluray {
uint8_t hdmv_suspended;
/* BD-J */
#ifdef USING_BDJAVA
BDJAVA *bdjava;
BDJ_STORAGE bdjstorage;
uint8_t bdj_wait_start; /* BD-J has selected playlist (prefetch) but not yet started playback */
#endif
/* HDMV graphics */
GRAPHICS_CONTROLLER *graphics_controller;
......@@ -170,12 +166,10 @@ struct bluray {
uint64_t gc_wakeup_pos; /* stream position of gc_wakeup_time */
/* ARGB overlay output */
#ifdef USING_BDJAVA
void *argb_overlay_proc_handle;
bd_argb_overlay_proc_f argb_overlay_proc;
BD_ARGB_BUFFER *argb_buffer;
BD_MUTEX argb_buffer_mutex;
#endif
};
/* Stream Packet Number = byte offset / 192. Avoid 64-bit division. */
......@@ -538,16 +532,6 @@ static void _update_uo_mask(BLURAY *bd)
bd->uo_mask = new_mask;
}
#ifdef USING_BDJAVA
void bd_set_bdj_uo_mask(BLURAY *bd, unsigned mask)
{
bd->title_uo_mask.title_search = !!(mask & BDJ_TITLE_SEARCH_MASK);
bd->title_uo_mask.menu_call = !!(mask & BDJ_MENU_CALL_MASK);
_update_uo_mask(bd);
}
#endif
static void _update_hdmv_uo_mask(BLURAY *bd)
{
uint32_t mask = hdmv_vm_get_uo_mask(bd->hdmv_vm);
......@@ -943,7 +927,7 @@ static void _fill_disc_info(BLURAY *bd, BD_ENC_INFO *enc_info)
bd->disc_info.num_unsupported_titles = 0;
bd->disc_info.bdj_detected = 0;
bd->disc_info.bdj_supported = 0;
bd->disc_info.bdj_supported = 1;
bd->disc_info.libjvm_detected = 0;
bd->disc_info.bdj_handled = 0;
......@@ -1027,10 +1011,7 @@ static void _fill_disc_info(BLURAY *bd, BD_ENC_INFO *enc_info)
}
/* check for BD-J capability */
#ifdef USING_BDJAVA
if (bd->disc_info.bdj_detected) {
bd->disc_info.bdj_supported = 1;
/* BD-J titles found. Check if jvm + jar can be loaded ? */
switch (bdj_jvm_available(&bd->bdjstorage)) {
case 2: bd->disc_info.bdj_handled = 1;
......@@ -1038,7 +1019,6 @@ static void _fill_disc_info(BLURAY *bd, BD_ENC_INFO *enc_info)
default:;
}
}
#endif /* USING_BDJAVA */
/* mark supported titles */
......@@ -1096,17 +1076,22 @@ static void _fill_disc_info(BLURAY *bd, BD_ENC_INFO *enc_info)
}
/*
* bdj
* bdj callbacks
*/
#ifdef USING_BDJAVA
void bd_set_bdj_uo_mask(BLURAY *bd, unsigned mask)
{
bd->title_uo_mask.title_search = !!(mask & BDJ_TITLE_SEARCH_MASK);
bd->title_uo_mask.menu_call = !!(mask & BDJ_MENU_CALL_MASK);
_update_uo_mask(bd);
}
const uint8_t *bd_get_aacs_data(BLURAY *bd, int type)
{
return disc_get_data(bd->disc, type);
}
#endif
#ifdef USING_BDJAVA
uint64_t bd_get_uo_mask(BLURAY *bd)
{
/* internal function. Used by BD-J. */
......@@ -1121,16 +1106,25 @@ uint64_t bd_get_uo_mask(BLURAY *bd)
return mask.u64;
}
#endif
#ifdef USING_BDJAVA
void bd_set_bdj_kit(BLURAY *bd, int mask)
{
_queue_event(bd, BD_EVENT_KEY_INTEREST_TABLE, mask);
}
#endif
#ifdef USING_BDJAVA
int bd_bdj_sound_effect(BLURAY *bd, int id)
{
if (bd->sound_effects && id >= bd->sound_effects->num_sounds) {
return -1;
}
if (id < 0 || id > 0xff) {
return -1;
}
_queue_event(bd, BD_EVENT_SOUND_EFFECT, id);
return 0;
}
void bd_select_rate(BLURAY *bd, float rate, int reason)
{
if (reason == BDJ_PLAYBACK_STOP) {
......@@ -1149,9 +1143,26 @@ void bd_select_rate(BLURAY *bd, float rate, int reason)
_queue_event(bd, BD_EVENT_STILL, 0);
}
}
#endif
#ifdef USING_BDJAVA
int bd_bdj_seek(BLURAY *bd, int playitem, int playmark, int64_t time)
{
bd_mutex_lock(&bd->mutex);
if (playitem > 0) {
bd_seek_playitem(bd, playitem);
}
if (playmark >= 0) {
bd_seek_mark(bd, playmark);
}
if (time >= 0) {
bd_seek_time(bd, time);
}
bd_mutex_unlock(&bd->mutex);
return 1;
}
int bd_set_virtual_package(BLURAY *bd, const char *vp_path, int psr_init_backup)
{
bd_mutex_lock(&bd->mutex);
......@@ -1177,16 +1188,12 @@ int bd_set_virtual_package(BLURAY *bd, const char *vp_path, int psr_init_backup)
return 0;
}
#endif
#ifdef USING_BDJAVA
BD_DISC *bd_get_disc(BLURAY *bd)
{
return bd ? bd->disc : NULL;
}
#endif
#ifdef USING_BDJAVA
uint32_t bd_reg_read(BLURAY *bd, int psr, int reg)
{
if (psr) {
......@@ -1195,9 +1202,7 @@ uint32_t bd_reg_read(BLURAY *bd, int psr, int reg)
return bd_gpr_read(bd->regs, reg);
}
}
#endif
#ifdef USING_BDJAVA
int bd_reg_write(BLURAY *bd, int psr, int reg, uint32_t value, uint32_t psr_value_mask)
{
if (psr) {
......@@ -1214,9 +1219,7 @@ int bd_reg_write(BLURAY *bd, int psr, int reg, uint32_t value, uint32_t psr_valu
return bd_gpr_write(bd->regs, reg, value);
}
}
#endif
#ifdef USING_BDJAVA
BD_ARGB_BUFFER *bd_lock_osd_buffer(BLURAY *bd)
{
bd_mutex_lock(&bd->argb_buffer_mutex);
......@@ -1302,11 +1305,13 @@ void bd_bdj_osd_cb(BLURAY *bd, const unsigned *img, int w, int h,
bd->argb_buffer->dirty[BD_OVERLAY_IG].y1 = 0;
}
}
#endif
/*
* BD-J
*/
static int _start_bdj(BLURAY *bd, unsigned title)
{
#ifdef USING_BDJAVA
if (bd->bdjava == NULL) {
const char *root = disc_root(bd->disc);
bd->bdjava = bdj_open(root, bd, bd->disc_info.bdj_disc_id, &bd->bdjstorage);
......@@ -1316,14 +1321,8 @@ static int _start_bdj(BLURAY *bd, unsigned title)
}
return !bdj_process_event(bd->bdjava, BDJ_EVENT_START, title);
#else
(void)bd;
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Title %d: BD-J not compiled in\n", title);
return 0;
#endif
}
#ifdef USING_BDJAVA
static int _bdj_event(BLURAY *bd, unsigned ev, unsigned param)
{
if (bd->bdjava != NULL) {
......@@ -1331,11 +1330,7 @@ static int _bdj_event(BLURAY *bd, unsigned ev, unsigned param)
}
return -1;
}
#else
#define _bdj_event(bd, ev, param) do{}while(0)
#endif
#ifdef USING_BDJAVA
static void _stop_bdj(BLURAY *bd)
{
if (bd->bdjava != NULL) {
......@@ -1344,11 +1339,7 @@ static void _stop_bdj(BLURAY *bd)
_queue_event(bd, BD_EVENT_KEY_INTEREST_TABLE, 0);
}
}
#else
#define _stop_bdj(bd) do{}while(0)
#endif
#ifdef USING_BDJAVA
static void _close_bdj(BLURAY *bd)
{
if (bd->bdjava != NULL) {
......@@ -1356,20 +1347,13 @@ static void _close_bdj(BLURAY *bd)
bd->bdjava = NULL;
}
}
#else
#define _close_bdj(bd) do{}while(0)
#endif
#ifdef USING_BDJAVA
static void _storage_free(BLURAY *bd)
{
X_FREE(bd->bdjstorage.cache_root);
X_FREE(bd->bdjstorage.persistent_root);
X_FREE(bd->bdjstorage.classpath);
}
#else
#define _storage_free(bd) do{}while(0)
#endif
/*
* open / close
......@@ -1396,7 +1380,6 @@ BLURAY *bd_init(void)
}
bd_mutex_init(&bd->mutex);
#ifdef USING_BDJAVA
bd_mutex_init(&bd->argb_buffer_mutex);
env = getenv("LIBBLURAY_PERSISTENT_STORAGE");
......@@ -1404,7 +1387,6 @@ BLURAY *bd_init(void)
int v = (!strcmp(env, "yes")) ? 1 : (!strcmp(env, "no")) ? 0 : atoi(env);
bd->bdjstorage.no_persistent_storage = !v;
}
#endif
BD_DEBUG(DBG_BLURAY, "BLURAY initialized!\n");
......@@ -1519,9 +1501,7 @@ void bd_close(BLURAY *bd)
disc_close(&bd->disc);
bd_mutex_destroy(&bd->mutex);
#ifdef USING_BDJAVA
bd_mutex_destroy(&bd->argb_buffer_mutex);
#endif
BD_DEBUG(DBG_BLURAY, "BLURAY destroyed!\n");
......@@ -2393,26 +2373,7 @@ int bd_select_playlist(BLURAY *bd, uint32_t playlist)
return result;
}
#ifdef USING_BDJAVA
int bd_bdj_seek(BLURAY *bd, int playitem, int playmark, int64_t time)
{
bd_mutex_lock(&bd->mutex);
if (playitem > 0) {
bd_seek_playitem(bd, playitem);
}
if (playmark >= 0) {
bd_seek_mark(bd, playmark);
}
if (time >= 0) {
bd_seek_time(bd, time);
}
bd_mutex_unlock(&bd->mutex);
return 1;
}
/* BD-J callback */
static int _play_playlist_at(BLURAY *bd, int playlist, int playitem, int playmark, int64_t time)
{
if (playlist < 0) {
......@@ -2424,15 +2385,14 @@ static int _play_playlist_at(BLURAY *bd, int playlist, int playitem, int playmar
return 0;
}
#ifdef USING_BDJAVA
bd->bdj_wait_start = 1; /* playback is triggered by bd_select_rate() */
#endif
bd_bdj_seek(bd, playitem, playmark, time);
return 1;
}
/* BD-J callback */
int bd_play_playlist_at(BLURAY *bd, int playlist, int playitem, int playmark, int64_t time)
{
int result;
......@@ -2445,21 +2405,6 @@ int bd_play_playlist_at(BLURAY *bd, int playlist, int playitem, int playmark, in
return result;
}
int bd_bdj_sound_effect(BLURAY *bd, int id)
{
if (bd->sound_effects && id >= bd->sound_effects->num_sounds) {
return -1;
}
if (id < 0 || id > 0xff) {
return -1;
}
_queue_event(bd, BD_EVENT_SOUND_EFFECT, id);
return 0;
}
#endif /* USING_BDJAVA */
// Select a title for playback
// The title index is an index into the list
// established by bd_get_titles()
......@@ -2832,7 +2777,7 @@ int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value)
bd_mutex_unlock(&bd->mutex);
return result;
}
#ifdef USING_BDJAVA
if (idx == BLURAY_PLAYER_SETTING_PERSISTENT_STORAGE) {
if (bd->title_type != title_undef) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Can't disable persistent storage during playback\n");
......@@ -2841,7 +2786,6 @@ int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value)
bd->bdjstorage.no_persistent_storage = !value;
return 1;
}
#endif
for (i = 0; i < sizeof(map) / sizeof(map[0]); i++) {
if (idx == map[i].idx) {
......@@ -2866,10 +2810,6 @@ int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *s)
case BLURAY_PLAYER_SETTING_COUNTRY_CODE:
return bd_set_player_setting(bd, idx, str_to_uint32(s, 2));
#ifdef USING_BDJAVA
case BLURAY_PLAYER_CACHE_ROOT:
case BLURAY_PLAYER_PERSISTENT_ROOT:
switch (idx) {
case BLURAY_PLAYER_CACHE_ROOT:
bd_mutex_lock(&bd->mutex);
X_FREE(bd->bdjstorage.cache_root);
......@@ -2885,8 +2825,7 @@ int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *s)
bd_mutex_unlock(&bd->mutex);
BD_DEBUG(DBG_BDJ, "Persistent root dir set to %s\n", bd->bdjstorage.persistent_root);
return 1;
}
#endif /* USING_BDJAVA */
default:
return 0;
}
......@@ -3301,7 +3240,7 @@ static int _play_title(BLURAY *bd, unsigned title)
return 0;
}
#ifdef USING_BDJAVA
/* BD-J callback */
int bd_play_title_internal(BLURAY *bd, unsigned title)
{
/* used by BD-J. Like bd_play_title() but bypasses UO mask checks. */
......@@ -3311,7 +3250,6 @@ int bd_play_title_internal(BLURAY *bd, unsigned title)
bd_mutex_unlock(&bd->mutex);
return ret;
}
#endif
int bd_play(BLURAY *bd)
{
......@@ -3542,7 +3480,6 @@ static int _read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event)
return 0;
}
#ifdef USING_BDJAVA
if (bd->title_type == title_bdj) {
if (bd->end_of_playlist == 1) {
_bdj_event(bd, BDJ_EVENT_END_OF_PLAYLIST, bd_psr_read(bd->regs, PSR_PLAYLIST));
......@@ -3561,7 +3498,6 @@ static int _read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event)
return 0;
}
}
#endif
int bytes = _bd_read(bd, buf, len);
......@@ -3623,11 +3559,9 @@ static int _set_rate(BLURAY *bd, uint32_t rate)
return -1;
}
#ifdef USING_BDJAVA
if (bd->title_type == title_bdj) {
return _bdj_event(bd, BDJ_EVENT_RATE, rate);
}
#endif
return 0;
}
......@@ -3654,10 +3588,8 @@ int bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y)
if (bd->title_type == title_hdmv) {
result = _run_gc(bd, GC_CTRL_MOUSE_MOVE, param);
#ifdef USING_BDJAVA
} else if (bd->title_type == title_bdj) {
result = _bdj_event(bd, BDJ_EVENT_MOUSE, param);
#endif
}
bd_mutex_unlock(&bd->mutex);
......@@ -3679,10 +3611,8 @@ int bd_user_input(BLURAY *bd, int64_t pts, uint32_t key)
if (bd->title_type == title_hdmv) {
result = _run_gc(bd, GC_CTRL_VK_KEY, key);
#ifdef USING_BDJAVA
} else if (bd->title_type == title_bdj) {
result = _bdj_event(bd, BDJ_EVENT_VK_KEY, key);
#endif
}
bd_mutex_unlock(&bd->mutex);
......@@ -3709,7 +3639,6 @@ void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func)
void bd_register_argb_overlay_proc(BLURAY *bd, void *handle, bd_argb_overlay_proc_f func, BD_ARGB_BUFFER *buf)
{
#ifdef USING_BDJAVA
if (!bd) {
return;
}
......@@ -3721,12 +3650,6 @@ void bd_register_argb_overlay_proc(BLURAY *bd, void *handle, bd_argb_overlay_pro
bd->argb_buffer = buf;
bd_mutex_unlock(&bd->argb_buffer_mutex);
#else
(void)bd;
(void)handle;
(void)func;
(void)buf;
#endif
}
int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, BLURAY_SOUND_EFFECT *effect)
......@@ -3877,19 +3800,10 @@ void bd_free_mobj(struct mobj_objects *obj)
struct bdjo_data *bd_read_bdjo(const char *bdjo_file)
{
#ifdef USING_BDJAVA
return bdjo_parse(bdjo_file);
#else
(void)bdjo_file;
return NULL;
#endif
}
void bd_free_bdjo(struct bdjo_data *obj)
{
#ifdef USING_BDJAVA
bdjo_free(&obj);
#else
(void)obj;
#endif
}
......@@ -90,7 +90,7 @@ typedef struct {
/* BD-J info (valid only if disc uses BD-J) */
uint8_t bdj_detected; /* 1 if disc uses BD-J */
uint8_t bdj_supported; /* 1 if BD-J support was compiled in */
uint8_t bdj_supported; /* (deprecated) */
uint8_t libjvm_detected; /* 1 if usable Java VM was found */
uint8_t bdj_handled; /* 1 if usable Java VM + libbluray.jar was found */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment