diff -Nru libbluray-0.5.0/aclocal.m4 libbluray-0.6.2/aclocal.m4 --- libbluray-0.5.0/aclocal.m4 2013-12-21 08:35:52.000000000 +0000 +++ libbluray-0.6.2/aclocal.m4 2014-09-03 10:23:50.000000000 +0000 @@ -1,8 +1,7 @@ -# generated automatically by aclocal 1.11.6 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -12,33 +11,31 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' +[am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.6], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -54,24 +51,22 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.6])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and @@ -90,7 +85,7 @@ # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you +# harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, @@ -116,22 +111,19 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 - # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl @@ -150,16 +142,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing @@ -169,7 +159,7 @@ # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was @@ -182,12 +172,13 @@ AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], @@ -195,8 +186,8 @@ # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -236,16 +227,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -254,8 +245,8 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -263,7 +254,7 @@ fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -311,7 +302,7 @@ # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl @@ -321,9 +312,13 @@ # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' @@ -338,20 +333,18 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -364,7 +357,7 @@ # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -376,21 +369,19 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` @@ -408,7 +399,7 @@ # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will +# is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], @@ -418,18 +409,21 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 16 - # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -442,7 +436,7 @@ # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl +[AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -471,31 +465,40 @@ # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl @@ -506,34 +509,78 @@ [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -555,15 +602,12 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, -# Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -577,16 +621,14 @@ install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi -AC_SUBST(install_sh)]) +AC_SUBST([install_sh])]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], @@ -602,14 +644,12 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 - # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. @@ -627,7 +667,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -652,52 +692,14 @@ rm -f confinc confmf ]) -# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 - # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], @@ -705,11 +707,10 @@ $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) - # AM_MISSING_HAS_RUN # ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl @@ -722,54 +723,22 @@ esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + AC_MSG_WARN(['missing' script is too old or missing]) fi ]) -# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, -# Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], @@ -779,7 +748,7 @@ # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ @@ -793,13 +762,58 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- @@ -814,22 +828,16 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -840,32 +848,40 @@ esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$[2]" = conftest.file ) then @@ -875,46 +891,118 @@ AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT(yes)]) +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- -# One issue with vendor `install' (even GNU) is that you can't +# One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize +# always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 - # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. @@ -928,18 +1016,16 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory @@ -949,76 +1035,114 @@ # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar +# AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. + +# We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR diff -Nru libbluray-0.5.0/build-aux/compile libbluray-0.6.2/build-aux/compile --- libbluray-0.5.0/build-aux/compile 2013-12-21 08:36:03.000000000 +0000 +++ libbluray-0.6.2/build-aux/compile 2014-09-03 08:21:21.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-03-05.13; # UTC +scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free -# Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -113,6 +112,11 @@ lib=$dir/$lib.lib break fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi done IFS=$save_IFS diff -Nru libbluray-0.5.0/build-aux/config.guess libbluray-0.6.2/build-aux/config.guess --- libbluray-0.5.0/build-aux/config.guess 2013-12-21 08:36:03.000000000 +0000 +++ libbluray-0.6.2/build-aux/config.guess 2014-09-03 08:21:21.000000000 +0000 @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -22,19 +20,17 @@ # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + me=`echo "$0" | sed -e 's,.*/,,'` @@ -54,9 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -138,6 +132,27 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -200,6 +215,10 @@ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -302,7 +321,7 @@ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -801,6 +820,9 @@ i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; @@ -852,21 +874,21 @@ exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,59 +901,54 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -950,54 +967,63 @@ #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1201,6 +1227,9 @@ BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1227,19 +1256,21 @@ exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1256,7 +1287,7 @@ NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1330,9 +1361,6 @@ exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - eval $set_cc_for_build cat >$dummy.c <. @@ -26,11 +20,12 @@ # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -73,9 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -123,7 +116,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) @@ -156,7 +149,7 @@ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) + -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; @@ -259,10 +252,12 @@ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ @@ -273,7 +268,7 @@ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -291,16 +286,17 @@ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ - | or32 \ + | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ @@ -370,13 +366,13 @@ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -389,7 +385,8 @@ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -407,12 +404,13 @@ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ @@ -788,11 +786,15 @@ basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze*) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -828,7 +830,7 @@ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1019,7 +1021,11 @@ basic_machine=i586-unknown os=-pw32 ;; - rdos) + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) basic_machine=i386-pc os=-rdos ;; @@ -1346,21 +1352,21 @@ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ + | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1492,9 +1498,6 @@ -aros*) os=-aros ;; - -kaos*) - os=-kaos - ;; -zvmoe) os=-zvmoe ;; @@ -1543,6 +1546,9 @@ c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1586,6 +1592,9 @@ mips*-*) os=-elf ;; + or1k-*) + os=-elf + ;; or32-*) os=-coff ;; diff -Nru libbluray-0.5.0/build-aux/depcomp libbluray-0.6.2/build-aux/depcomp --- libbluray-0.5.0/build-aux/depcomp 2013-12-21 08:36:04.000000000 +0000 +++ libbluray-0.6.2/build-aux/depcomp 2014-09-03 08:21:21.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2012-03-27.16; # UTC +scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,9 +27,9 @@ case $1 in '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] @@ -57,11 +56,65 @@ ;; esac +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + # A tabulation character. tab=' ' # A newline character. nl=' ' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 @@ -75,6 +128,9 @@ rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -86,32 +142,32 @@ fi if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 fi if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. - gccflag=-qmakedep=gcc,-MF - depmode=gcc + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc fi case "$depmode" in @@ -134,8 +190,7 @@ done "$@" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -143,13 +198,17 @@ ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -157,15 +216,14 @@ fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. + # The second -e expression handles DOS-style file names with drive + # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. @@ -174,15 +232,15 @@ ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -200,8 +258,7 @@ "$@" -MDupdate "$tmpdepfile" fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -209,7 +266,6 @@ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in @@ -217,19 +273,15 @@ # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr "$nl" ' ' >> "$depfile" + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" - # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" ;; @@ -247,9 +299,8 @@ # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u @@ -262,9 +313,7 @@ "$@" -M fi stat=$? - - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi @@ -273,65 +322,113 @@ do test -f "$tmpdepfile" && break done - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependent.h'. - # Do two passes, one to just change these to - # '$object: dependent.h' and one to simply 'dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; -icc) - # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. - # However on - # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\': + # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... - # tcc 0.9.26 (FIXME still under development at the moment of writing) - # will emit a similar output, but also prepend the continuation lines - # with horizontal tabulation characters. - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" - # Each line is of the form 'foo.o: dependent.h', - # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to - # '$object: dependent.h' and one to simply 'dependent.h:'. - sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ - < "$tmpdepfile" > "$depfile" - sed ' - s/[ '"$tab"'][ '"$tab"']*/ /g - s/^ *// - s/ *\\*$// - s/^[^:]*: *// - /^$/d - /:$/d - s/$/ :/ - ' < "$tmpdepfile" >> "$depfile" + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -342,9 +439,8 @@ # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d @@ -355,8 +451,7 @@ "$@" +Maked fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi @@ -366,76 +461,61 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" else - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; msvc7) if test "$libtool" = yes; then @@ -446,8 +526,7 @@ "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" - if test "$stat" = 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -473,6 +552,7 @@ G p }' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; @@ -524,13 +604,14 @@ # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' "$nl" < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -583,10 +664,12 @@ # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; @@ -622,10 +705,10 @@ esac done - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" @@ -657,15 +740,15 @@ shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; + set fnord "$@" + shift + shift + ;; *) - set fnord "$@" "$arg" - shift - shift - ;; + set fnord "$@" "$arg" + shift + shift + ;; esac done "$@" -E 2>/dev/null | diff -Nru libbluray-0.5.0/build-aux/install-sh libbluray-0.6.2/build-aux/install-sh --- libbluray-0.5.0/build-aux/install-sh 2013-12-21 08:36:03.000000000 +0000 +++ libbluray-0.6.2/build-aux/install-sh 2014-09-03 08:21:21.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-01-19.21; # UTC +scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,7 +156,7 @@ -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac @@ -190,7 +190,7 @@ fi shift # arg dst_arg=$arg - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac @@ -202,7 +202,7 @@ echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi @@ -240,7 +240,7 @@ for src do - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac @@ -354,7 +354,7 @@ if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. + # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in diff -Nru libbluray-0.5.0/build-aux/ltmain.sh libbluray-0.6.2/build-aux/ltmain.sh --- libbluray-0.5.0/build-aux/ltmain.sh 2013-12-21 08:35:37.000000000 +0000 +++ libbluray-0.6.2/build-aux/ltmain.sh 2014-09-03 08:21:18.000000000 +0000 @@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.2ubuntu1 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.2ubuntu1" +VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" TIMESTAMP="" package_revision=1.3337 diff -Nru libbluray-0.5.0/build-aux/missing libbluray-0.6.2/build-aux/missing --- libbluray-0.5.0/build-aux/missing 2013-12-21 08:36:03.000000000 +0000 +++ libbluray-0.6.2/build-aux/missing 2014-09-03 08:21:21.000000000 +0000 @@ -1,11 +1,10 @@ #! /bin/sh -# Common stub for a few missing GNU programs while installing. +# Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-01-06.13; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,68 +25,40 @@ # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi +case $1 in -msg="missing on your system" + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." exit $? @@ -99,228 +70,141 @@ ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. - ;; +# Run the given program, remember its exit status. +"$@"; st=$? - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; +# If it succeeded, we are done. +test $st -eq 0 && exit 0 - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi -exit 0 +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff -Nru libbluray-0.5.0/ChangeLog libbluray-0.6.2/ChangeLog --- libbluray-0.5.0/ChangeLog 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/ChangeLog 2014-09-03 09:44:32.000000000 +0000 @@ -1,3 +1,33 @@ +2014-09-03: Version 0.6.2 +- Fix possible subtitle corruption after seek. +- Fix some main path embedded HDMV menus. +- Fix reading outside of source image in BD-J drawImage(). +- Fix missing BD_EVENT_ERROR when BD-J is not supported. +- Several stability and code quality fixes. + +2014-08-03: Version 0.6.1 +- Fix stream position when seamless angle change point is at clip boundary. +- Fix Mac OS X jni compilation +- Fix bd_seek() jumping outside of clip/playlist. +- Fix crash when stream selection is changed after playlist end. +- Fix J2ME build. +- Fix seamless angle change. +- Fix freetype2 resource leaks on shutdown. +- Improve duplicate playlist detection. + +2014-05-27: Version 0.6.0 +- Improved BD-J support (Most BD-J discs are correctly played). +- Mark BD-J titles supported in BLURAY_DISC_INFO if BD-J is functional. +- Install .jar files to datadir (/usr/share/java/) instead of libdir. +- Added version number to .jar file names. +- Added JNI headers for BD-J (cross) compilation. +- Added HDMV/BD-J title information to BLURAY_DISC_INFO. +- Added disc application info to BLURAY_DISC_INFO. +- Added bd_set_rate(). +- Added color keys (RED, GREEN, YELLOW, BLUE). +- Improved error resilence. +- Fix build without libxml. + 2013-12-21: Version 0.5.0 - Portability fixes. - Build system updates. diff -Nru libbluray-0.5.0/config.h.in libbluray-0.6.2/config.h.in --- libbluray-0.5.0/config.h.in 2013-12-21 08:36:01.000000000 +0000 +++ libbluray-0.6.2/config.h.in 2014-09-03 10:23:56.000000000 +0000 @@ -97,9 +97,6 @@ */ #undef LT_OBJDIR -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - /* Name of package */ #undef PACKAGE @@ -147,5 +144,5 @@ /* Define to '0x0501' for IE 5.01. */ #undef _WIN32_IE -/* Define to '0x0500' for Windows XP APIs. */ +/* Define to '0x0502' for Windows XP SP2 APIs. */ #undef _WIN32_WINNT diff -Nru libbluray-0.5.0/configure libbluray-0.6.2/configure --- libbluray-0.5.0/configure 2013-12-21 08:35:57.000000000 +0000 +++ libbluray-0.6.2/configure 2014-09-03 10:23:51.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libbluray 0.5.0. +# Generated by GNU Autoconf 2.69 for libbluray 0.6.2. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='libbluray' PACKAGE_TARNAME='libbluray' -PACKAGE_VERSION='0.5.0' -PACKAGE_STRING='libbluray 0.5.0' +PACKAGE_VERSION='0.6.2' +PACKAGE_STRING='libbluray 0.6.2' PACKAGE_BUGREPORT='http://www.videolan.org/developers/libbluray.html' PACKAGE_URL='' @@ -690,6 +690,7 @@ BDJ_TYPE USING_BDJAVA_FALSE USING_BDJAVA_TRUE +HAVE_ANT USING_EXAMPLES_FALSE USING_EXAMPLES_TRUE FT2_LIBS @@ -744,6 +745,10 @@ HAVE_DARWIN_TRUE HAVE_WIN32_FALSE HAVE_WIN32_TRUE +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V am__untar am__tar AMTAR @@ -816,6 +821,7 @@ ac_subst_files='' ac_user_opts=' enable_option_checking +enable_silent_rules enable_werror enable_extra_warnings enable_optimizations @@ -1403,7 +1409,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libbluray 0.5.0 to adapt to many kinds of systems. +\`configure' configures libbluray 0.6.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1473,7 +1479,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libbluray 0.5.0:";; + short | recursive ) echo "Configuration of libbluray 0.6.2:";; esac cat <<\_ACEOF @@ -1481,6 +1487,8 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") --enable-werror set warnings as errors via -Werror [default=disabled] --disable-extra-warnings @@ -1488,8 +1496,10 @@ --disable-optimizations disable optimizations [default=enabled] --enable-examples build examples (default is yes) --enable-bdjava enable BD-Java support (default is no) - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] @@ -1526,7 +1536,7 @@ (or the compiler's sysroot if not specified). Some influential environment variables: - JDK_HOME Path to the JDK [default=/usr/lib/jvm/java-6-openjdk] + JDK_HOME Path to the JDK CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a @@ -1615,7 +1625,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libbluray configure 0.5.0 +libbluray configure 0.6.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2041,7 +2051,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libbluray $as_me 0.5.0, which was +It was created by libbluray $as_me 0.6.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2490,7 +2500,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -am__api_version='1.11' +am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2587,9 +2597,6 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2600,32 +2607,40 @@ esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$2" = conftest.file ) then @@ -2637,6 +2652,16 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. @@ -2659,12 +2684,12 @@ esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then @@ -2676,10 +2701,10 @@ esac fi -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. +# will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. @@ -2818,12 +2843,6 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -2906,6 +2925,45 @@ fi rmdir .tst 2>/dev/null +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." @@ -2928,7 +2986,7 @@ # Define the identity of the package. PACKAGE='libbluray' - VERSION='0.5.0' + VERSION='0.6.2' cat >>confdefs.h <<_ACEOF @@ -2956,6 +3014,12 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used @@ -2963,95 +3027,216 @@ AMTAR='$${TAR-tar}' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 -$as_echo_n "checking how to create a ustar tar archive... " >&6; } -# Loop over all known methods to create a tar archive until one works. +# We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' -_am_tools=${am_cv_prog_tar_ustar-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - { echo "$as_me:$LINENO: $_am_tar --version" >&5 + +# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + if test $am_uid -le $am_max_uid; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + _am_tools=none + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + if test $am_gid -le $am_max_gid; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + _am_tools=none + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +$as_echo_n "checking how to create a ustar tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_ustar-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break - done - am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x ustar -w "$$tardir"' - am__tar_='pax -L -x ustar -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H ustar -L' - am__tar_='find "$tardir" -print | cpio -o -H ustar -L' - am__untar='cpio -i -H ustar -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_ustar}" && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } - rm -rf conftest.dir - if test -s conftest.tar; then - { echo "$as_me:$LINENO: $am__untar &5 + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } - grep GrepMe conftest.dir/file >/dev/null 2>&1 && break - fi -done -rm -rf conftest.dir + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir -if ${am_cv_prog_tar_ustar+:} false; then : + if ${am_cv_prog_tar_ustar+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_ustar=$_am_tool fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 $as_echo "$am_cv_prog_tar_ustar" >&6; } + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi ac_config_headers="$ac_config_headers config.h" +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + case "${host_os}" in "") SYS=unknown @@ -3064,11 +3249,12 @@ *mingw32*) SYS=mingw32 -$as_echo "#define _WIN32_WINNT 0x0501" >>confdefs.h +$as_echo "#define _WIN32_WINNT 0x0502" >>confdefs.h $as_echo "#define _WIN32_IE 0x0501" >>confdefs.h + CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1" ;; esac ;; @@ -3101,9 +3287,6 @@ function_not_found="Could not find required function!" -if test -z "$JDK_HOME"; then : - JDK_HOME="/usr/lib/jvm/java-6-openjdk" -fi # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : @@ -3959,6 +4142,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -3978,7 +4220,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -4034,8 +4276,8 @@ # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -4070,16 +4312,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -4088,8 +4330,8 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -4097,7 +4339,7 @@ fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -4151,131 +4393,6 @@ fi -if test "x$CC" != xcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 -$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 -$as_echo_n "checking whether cc understands -c and -o together... " >&6; } -fi -set dummy $CC; ac_cc=`$as_echo "$2" | - sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -# Make sure it works both with $CC and with simple cc. -# We do the test twice because some compilers refuse to overwrite an -# existing .o file with -o, though they will create one. -ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -rm -f conftest2.* -if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; -then - eval ac_cv_prog_cc_${ac_cc}_c_o=yes - if test "x$CC" != xcc; then - # Test first that cc exists at all. - if { ac_try='cc -c conftest.$ac_ext >&5' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' - rm -f conftest2.* - if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; - then - # cc works too. - : - else - # cc exists but doesn't like -o. - eval ac_cv_prog_cc_${ac_cc}_c_o=no - fi - fi - fi -else - eval ac_cv_prog_cc_${ac_cc}_c_o=no -fi -rm -f core conftest* - -fi -if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h - -fi - -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi - case `pwd` in *\ * | *\ *) @@ -6613,7 +6730,7 @@ rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -6638,7 +6755,10 @@ ;; esac ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -6657,7 +6777,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -12086,7 +12209,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -12132,7 +12255,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -12156,7 +12279,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -12201,7 +12324,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -12225,7 +12348,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -13001,6 +13124,7 @@ case $host_cpu in x86_64) java_arch=amd64 ;; i?86) java_arch=i386 ;; + arm*) java_arch=arm ;; *) java_arch=$host_cpu ;; esac case $host_os in @@ -13009,14 +13133,17 @@ mingw*) java_os=win32 ;; freebsd*) java_os=freebsd ;; solaris*) java_os=solaris ;; + darwin*) java_os=darwin ;; *) java_os=$host_os ;; esac - BDJAVA_CFLAGS="-I${JDK_HOME}/include -I${JDK_HOME}/include/$java_os" + if test "x${JDK_HOME}" != "x"; then : + + BDJAVA_CFLAGS="-I${JDK_HOME}/include -I${JDK_HOME}/include/$java_os" - temp_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$BDJAVA_CFLAGS $CPPFLAGS" - for ac_header in jni.h + temp_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$BDJAVA_CFLAGS $CPPFLAGS" + for ac_header in jni.h do : ac_fn_c_check_header_mongrel "$LINENO" "jni.h" "ac_cv_header_jni_h" "$ac_includes_default" if test "x$ac_cv_header_jni_h" = xyes; then : @@ -13025,12 +13152,60 @@ _ACEOF else - as_fn_error $? "\"Could not find jni.h\"" "$LINENO" 5 + as_fn_error $? "could not find jni.h" "$LINENO" 5 +fi + +done + + CPPFLAGS="$temp_CPPFLAGS" + +else + + BDJAVA_CFLAGS='-I${abs_top_srcdir}/jni -I${abs_top_srcdir}/jni/'"${java_os}" + fi + # Extract the first word of "ant", so it can be a program name with args. +set dummy ant; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_HAVE_ANT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_ANT"; then + ac_cv_prog_HAVE_ANT="$HAVE_ANT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_ANT="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS - CPPFLAGS="$temp_CPPFLAGS" + test -z "$ac_cv_prog_HAVE_ANT" && ac_cv_prog_HAVE_ANT="no" +fi +fi +HAVE_ANT=$ac_cv_prog_HAVE_ANT +if test -n "$HAVE_ANT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_ANT" >&5 +$as_echo "$HAVE_ANT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$HAVE_ANT" = "xno"; then + as_fn_error $? "BD-J requires ANT, but ant was not found. Please install it." "$LINENO" 5 + fi $as_echo "#define USING_BDJAVA 1" >>confdefs.h @@ -14985,12 +15160,12 @@ BLURAY_VERSION_MAJOR=0 -BLURAY_VERSION_MINOR=5 +BLURAY_VERSION_MINOR=6 -BLURAY_VERSION_MICRO=0 +BLURAY_VERSION_MICRO=2 -LT_VERSION_INFO="6:0:5" +LT_VERSION_INFO="7:2:6" @@ -15105,6 +15280,14 @@ LTLIBOBJS=$ac_ltlibobjs +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -15622,7 +15805,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libbluray $as_me 0.5.0, which was +This file was extended by libbluray $as_me 0.6.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15688,7 +15871,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libbluray config.status 0.5.0 +libbluray config.status 0.6.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -16697,7 +16880,7 @@ case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -16710,7 +16893,7 @@ # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -16744,21 +16927,19 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || diff -Nru libbluray-0.5.0/configure.ac libbluray-0.6.2/configure.ac --- libbluray-0.5.0/configure.ac 2013-12-21 08:34:24.000000000 +0000 +++ libbluray-0.6.2/configure.ac 2014-09-03 10:09:54.000000000 +0000 @@ -1,7 +1,7 @@ dnl library version number m4_define([bluray_major], 0) -m4_define([bluray_minor], 5) -m4_define([bluray_micro], 0) +m4_define([bluray_minor], 6) +m4_define([bluray_micro], 2) m4_define([bluray_version],[bluray_major.bluray_minor.bluray_micro]) dnl shared library version (.so version) @@ -12,9 +12,9 @@ dnl dnl Library file name will be libbluray.so.(current-age).age.revision dnl -m4_define([lt_current], 6) -m4_define([lt_revision], 0) -m4_define([lt_age], 5) +m4_define([lt_current], 7) +m4_define([lt_revision], 2) +m4_define([lt_age], 6) dnl initilization AC_INIT([libbluray], bluray_version, [http://www.videolan.org/developers/libbluray.html]) @@ -24,6 +24,9 @@ AM_INIT_AUTOMAKE([foreign tar-ustar dist-bzip2 no-dist-gzip subdir-objects]) AC_CONFIG_HEADERS(config.h) +dnl Enable silent rules only when available (automake 1.11 or later). +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + case "${host_os}" in "") SYS=unknown @@ -35,8 +38,9 @@ ;; *mingw32*) SYS=mingw32 - AC_DEFINE([_WIN32_WINNT], 0x0501, [Define to '0x0500' for Windows XP APIs.]) + AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows XP SP2 APIs.]) AC_DEFINE([_WIN32_IE], 0x0501, [Define to '0x0501' for IE 5.01.]) + CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1" ;; esac ;; @@ -56,8 +60,7 @@ function_not_found="Could not find required function!" dnl configure options -AC_ARG_VAR([JDK_HOME], [Path to the JDK @<:@default=/usr/lib/jvm/java-6-openjdk@:>@]) -AS_IF([test -z "$JDK_HOME"], [JDK_HOME="/usr/lib/jvm/java-6-openjdk"]) +AC_ARG_VAR([JDK_HOME], [Path to the JDK]) AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], [set warnings as errors via -Werror @<:@default=disabled@:>@])]) @@ -176,6 +179,7 @@ case $host_cpu in x86_64) java_arch=amd64 ;; i?86) java_arch=i386 ;; + arm*) java_arch=arm ;; *) java_arch=$host_cpu ;; esac case $host_os in @@ -184,15 +188,25 @@ mingw*) java_os=win32 ;; freebsd*) java_os=freebsd ;; solaris*) java_os=solaris ;; + darwin*) java_os=darwin ;; *) java_os=$host_os ;; esac - BDJAVA_CFLAGS="-I${JDK_HOME}/include -I${JDK_HOME}/include/$java_os" + AS_IF([test "x${JDK_HOME}" != "x"], [ + BDJAVA_CFLAGS="-I${JDK_HOME}/include -I${JDK_HOME}/include/$java_os" - temp_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$BDJAVA_CFLAGS $CPPFLAGS" - AC_CHECK_HEADERS([jni.h], [], [AC_MSG_ERROR("Could not find jni.h")]) - CPPFLAGS="$temp_CPPFLAGS" + temp_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$BDJAVA_CFLAGS $CPPFLAGS" + AC_CHECK_HEADERS([jni.h], [], [AC_MSG_ERROR(could not find jni.h)]) + CPPFLAGS="$temp_CPPFLAGS" + ], [ + BDJAVA_CFLAGS='-I${abs_top_srcdir}/jni -I${abs_top_srcdir}/jni/'"${java_os}" + ]) + + AC_CHECK_PROG(HAVE_ANT, [ant], yes, no) + if test "x$HAVE_ANT" = "xno"; 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."]) diff -Nru libbluray-0.5.0/debian/changelog libbluray-0.6.2/debian/changelog --- libbluray-0.5.0/debian/changelog 2014-02-09 01:10:54.000000000 +0000 +++ libbluray-0.6.2/debian/changelog 2015-02-01 18:46:13.000000000 +0000 @@ -1,3 +1,89 @@ +libbluray (1:0.6.2-1~trusty) trusty; urgency=medium + + * For trusty + + -- Doug McMahon Sun, 01 Feb 2015 13:45:22 -0500 + +libbluray (1:0.6.2-1) unstable; urgency=medium + + * New upstream release. + * debian/control: Add graphviz to Build-Depends-Indep for doxygen + documentation. + * debian/patches: Refreshed. + + -- Sebastian Ramacher Thu, 04 Sep 2014 19:11:51 +0200 + +libbluray (1:0.6.1-2) unstable; urgency=medium + + * debian/patches/03_split-jar-build-for-arch-all.patch: Don't fail if ant is + not there and we don't build the jar. + * debian/rules: Build with --disable-silent-rules. + + -- Sebastian Ramacher Mon, 04 Aug 2014 21:28:27 +0200 + +libbluray (1:0.6.1-1) unstable; urgency=medium + + * New upstream release. + * debian/copyright: Remove Files-Excluded again. Upstream no longer includes + the files we had to remove. + * debian/patches/04_kfreebsd-include.patch: Refreshed. + + -- Sebastian Ramacher Mon, 04 Aug 2014 19:13:20 +0200 + +libbluray (1:0.6.0+dfsg-2) unstable; urgency=medium + + * debian/patches/04_kfreebsd-include.patch: Add a workaround for #751532. + (Closes: #751433). + + -- Sebastian Ramacher Sat, 28 Jun 2014 02:27:46 +0200 + +libbluray (1:0.6.0+dfsg-1) unstable; urgency=medium + + [ Sebastian Ramacher ] + * debian/control: Remove Andres Meja from Uploaders. Andres is MIA according + to the MIA team. Thank you for maintaining libbluray, Andres! (Closes: + #743571) + * debian/watch: Mangle Debian version. + * debian/copyright: + - Add myself. + - Update copyright years. + - Document excluded files. + - Add license information for JNI headers. + + [ Rico Tzschichholz ] + * New upstream release (0.6.0) + - Improved BD-J support (Most BD-J discs are correctly played). + - Mark BD-J titles supported in BLURAY_DISC_INFO if BD-J is functional. + - Install .jar files to datadir (/usr/share/java/) instead of libdir. + (LP: #1302319) + - Added version number to .jar file names. + - Added JNI headers for BD-J (cross) compilation. + - Added HDMV/BD-J title information to BLURAY_DISC_INFO. + - Added disc application info to BLURAY_DISC_INFO. + - Added bd_set_rate(). + - Added color keys (RED, GREEN, YELLOW, BLUE). + - Improved error resilence. + - Fix build without libxml. + - Fix build failures with OpenJDK 8. (Closes: #746729) + * Repacked tarball to drop prebuilt binaries + * Upstream installs libbluray-.jar properly now + * Update symbols file + + -- Sebastian Ramacher Thu, 12 Jun 2014 14:34:26 +0200 + +libbluray (1:0.5.0-2) unstable; urgency=medium + + * Build JAR file only if we're building Architecture: all packages. + - debian/patches/03_split-jar-build-for-arch-all.patch: Add option to + selectively build JAR file. + - debian/rules: + + Only build JAR file if we are building libbluray-bdj. + + Build with BD-J support on all architectures. + - debian/control: Move ant to Build-Depends-Indep. + * debian/libbluray-doc.examples: Provide example source. + + -- Sebastian Ramacher Sun, 09 Feb 2014 22:11:25 +0100 + libbluray (1:0.5.0-1) unstable; urgency=low [ Rico Tzschichholz ] diff -Nru libbluray-0.5.0/debian/control libbluray-0.6.2/debian/control --- libbluray-0.5.0/debian/control 2014-02-09 00:00:07.000000000 +0000 +++ libbluray-0.6.2/debian/control 2014-09-04 17:07:13.000000000 +0000 @@ -2,7 +2,7 @@ Section: libs Priority: optional Maintainer: Debian Multimedia Maintainers -Uploaders: Andres Mejia , +Uploaders: Rico Tzschichholz , Reinhard Tartler , Alessio Treglia , @@ -10,17 +10,18 @@ Build-Depends: debhelper (>= 9), dh-autoreconf, pkg-config, - javahelper [linux-any], - default-jdk [linux-any], - ant [linux-any], + default-jdk, + javahelper, libfreetype6-dev, libxml2-dev -Build-Depends-Indep: doxygen, +Build-Depends-Indep: ant, + doxygen, + graphviz, texlive-latex-base, texlive-latex-recommended, texlive-latex-extra, latex-xcolor, - texlive-fonts-recommended, + texlive-fonts-recommended Standards-Version: 3.9.5 Homepage: http://www.videolan.org/developers/libbluray.html Vcs-Git: git://anonscm.debian.org/pkg-multimedia/libbluray.git diff -Nru libbluray-0.5.0/debian/copyright libbluray-0.6.2/debian/copyright --- libbluray-0.5.0/debian/copyright 2014-02-08 21:21:41.000000000 +0000 +++ libbluray-0.6.2/debian/copyright 2014-08-04 15:54:52.000000000 +0000 @@ -4,16 +4,20 @@ Files: * Copyright: - 2009-2010, hpi1 - 2010, fraxinas - 2009-2010, John Stebbins - 2010, Joakim - 2009-2010, Obliter0n - 2010, William Hahne - 2003,2011-2013, the VideoLAN team - 2010-2013, Petri Hintukainen - 2012, Konstantin Pavlov -License: LGPL-2.1 + 2009-2010, hpi1 + 2010, fraxinas + 2009-2010, John Stebbins + 2010, Joakim + 2009-2010, Obliter0n + 2010, William Hahne + 2003,2011-2013, the VideoLAN team + 2010-2014, Petri Hintukainen + 2012, Konstantin Pavlov +License: LGPL-2.1+ + +Files: jni/* +Copyright: 1993-1996 Netscape Communications Corporation and Sun Microsystems, Inc. +License: MPL-1.0 or GPL-2+ or LGPL-2.1+ Files: src/examples/bdj_test.c Copyright: 2010, William Hahne @@ -21,28 +25,12 @@ Files: debian/* Copyright: - 2010-2011 Andres Mejia - 2011, Rico Tzschichholz - 2013 Alessio Treglia + 2010-2011 Andres Mejia + 2011, Rico Tzschichholz + 2013 Alessio Treglia + 2014 Sebastian Ramacher License: LGPL-2.1+ -License: LGPL-2.1 - 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, - version 2.1 of the License. - . - 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. -Comment: You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - . - On Debian systems, the full text of the GNU Lesser General Public - License version 2.1 can be found in the file - '/usr/share/common-licenses/LGPL-2.1'. - License: LGPL-2.1+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -53,8 +41,6 @@ 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. -Comment: You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see . . On Debian systems, the full text of the GNU Lesser General Public License version 2.1 can be found in the file '/usr/share/common-licenses/LGPL-2.1'. @@ -84,3 +70,322 @@ . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file '/usr/share/common-licenses/GPL-2'. + +License: MPL-1.0 + Mozilla Public License Version 1.0 + . + 1. Definitions. + 1.1. "Contributor" means each entity that creates or contributes to + the creation of Modifications. + 1.2. "Contributor Version" means the combination of the Original + Code, prior Modifications used by a Contributor, and the + Modifications made by that particular Contributor. + 1.3. "Covered Code" means the Original Code or Modifications or + the combination of the Original Code and Modifications, in each + case including portions thereof. + 1.4. "Electronic Distribution Mechanism" means a mechanism + generally accepted in the software development community for the + electronic transfer of data. + 1.5. "Executable" means Covered Code in any form other than Source + Code. + 1.6. "Initial Developer" means the individual or entity identified + as the Initial Developer in the Source Code notice required by + Exhibit A. + 1.7. "Larger Work" means a work which combines Covered Code or + portions thereof with code not governed by the terms of this + License. + 1.8. "License" means this document. + 1.9. "Modifications" means any addition to or deletion from the + substance or structure of either the Original Code or any previous + Modifications. When Covered Code is released as a series of files, + a Modification is: + . + A. Any addition to or deletion from the contents of a file containing + Original Code or previous Modifications. + B. Any new file that contains any part of the Original Code or + previous Modifications. + . + 1.10. "Original Code" means Source Code of computer software code + which is described in the Source Code notice required by Exhibit A as + Original Code, and which, at the time of its release under this + License is not already Covered Code governed by this License. + . + 1.11. "Source Code" means the preferred form of the Covered Code for + making modifications to it, including all modules it contains, plus + any associated interface definition files, scripts used to control + compilation and installation of an Executable, or a list of source + code differential comparisons against either the Original Code or + another well known, available Covered Code of the Contributor's + choice. The Source Code can be in a compressed or archival form, + provided the appropriate decompression or de-archiving software is + widely available for no charge. + . + 1.12. "You" means an individual or a legal entity exercising rights + under, and complying with all of the terms of, this License or a + future version of this License issued under Section 6.1. For legal + entities, "You" includes any entity which controls, is controlled by, + or is under common control with You. For purposes of this definition, + "control" means (a) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (b) ownership of fifty percent (50%) or more of the + outstanding shares or beneficial ownership of such entity. + 2. Source Code License. + 2.1. The Initial Developer Grant. + The Initial Developer hereby grants You a world-wide, + royalty-free, non-exclusive license, subject to third party + intellectual property claims: + . + (a) to use, reproduce, modify, display, perform, sublicense and + distribute the Original Code (or portions thereof) with or without + Modifications, or as part of a Larger Work; and + (b) under patents now or hereafter owned or controlled by Initial + Developer, to make, have made, use and sell ("Utilize") the + Original Code (or portions thereof), but solely to the extent that + any such patent is reasonably necessary to enable You to Utilize + the Original Code (or portions thereof) and not to any greater + extent that may be necessary to Utilize further Modifications or + combinations. + . + 2.2. Contributor Grant. + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual property + claims: + (a) to use, reproduce, modify, display, perform, sublicense and + distribute the Modifications created by such Contributor (or + portions thereof) either on an unmodified basis, with other + Modifications, as Covered Code or as part of a Larger Work; and + (b) under patents now or hereafter owned or controlled by + Contributor, to Utilize the Contributor Version (or portions + thereof), but solely to the extent that any such patent is + reasonably necessary to enable You to Utilize the Contributor + Version (or portions thereof), and not to any greater extent that + may be necessary to Utilize further Modifications or combinations. + . + 3. Distribution Obligations. + 3.1. Application of License. + The Modifications which You create or to which You contribute are + governed by the terms of this License, including without + limitation Section 2.2. The Source Code version of Covered Code + may be distributed only under the terms of this License or a + future version of this License released under Section 6.1, and You + must include a copy of this License with every copy of the Source + Code You distribute. You may not offer or impose any terms on any + Source Code version that alters or restricts the applicable + version of this License or the recipients' rights hereunder. + However, You may include an additional document offering the + additional rights described in Section 3.5. + 3.2. Availability of Source Code. + Any Modification which You create or to which You contribute must + be made available in Source Code form under the terms of this + License either on the same media as an Executable version or via + an accepted Electronic Distribution Mechanism to anyone to whom + you made an Executable version available; and if made available + via Electronic Distribution Mechanism, must remain available for + at least twelve (12) months after the date it initially became + available, or at least six (6) months after a subsequent version + of that particular Modification has been made available to such + recipients. You are responsible for ensuring that the Source Code + version remains available even if the Electronic Distribution + Mechanism is maintained by a third party. + 3.3. Description of Modifications. + You must cause all Covered Code to which you contribute to contain + a file documenting the changes You made to create that Covered + Code and the date of any change. You must include a prominent + statement that the Modification is derived, directly or + indirectly, from Original Code provided by the Initial Developer + and including the name of the Initial Developer in (a) the Source + Code, and (b) in any notice in an Executable version or related + documentation in which You describe the origin or ownership of the + Covered Code. + 3.4. Intellectual Property Matters + . + (a) Third Party Claims. + If You have knowledge that a party claims an intellectual property + right in particular functionality or code (or its utilization + under this License), you must include a text file with the source + code distribution titled "LEGAL" which describes the claim and the + party making the claim in sufficient detail that a recipient will + know whom to contact. If you obtain such knowledge after You make + Your Modification available as described in Section 3.2, You shall + promptly modify the LEGAL file in all copies You make available + thereafter and shall take other steps (such as notifying + appropriate mailing lists or newsgroups) reasonably calculated to + inform those who received the Covered Code that new knowledge has + been obtained. + (b) Contributor APIs. + If Your Modification is an application programming interface and + You own or control patents which are reasonably necessary to + implement that API, you must also include this information in the + LEGAL file. + . + 3.5. Required Notices. + You must duplicate the notice in Exhibit A in each file of the Source + Code, and this License in any documentation for the Source Code, where + You describe recipients' rights relating to Covered Code. If You + created one or more Modification(s), You may add your name as a + Contributor to the notice described in Exhibit A. If it is not + possible to put such notice in a particular Source Code file due to + its structure, then you must include such notice in a location (such + as a relevant directory file) where a user would be likely to look for + such a notice. You may choose to offer, and to charge a fee for, + warranty, support, indemnity or liability obligations to one or more + recipients of Covered Code. However, You may do so only on Your own + behalf, and not on behalf of the Initial Developer or any Contributor. + You must make it absolutely clear than any such warranty, support, + indemnity or liability obligation is offered by You alone, and You + hereby agree to indemnify the Initial Developer and every Contributor + for any liability incurred by the Initial Developer or such + Contributor as a result of warranty, support, indemnity or liability + terms You offer. + . + 3.6. Distribution of Executable Versions. + You may distribute Covered Code in Executable form only if the + requirements of Section 3.1-3.5 have been met for that Covered Code, + and if You include a notice stating that the Source Code version of + the Covered Code is available under the terms of this License, + including a description of how and where You have fulfilled the + obligations of Section 3.2. The notice must be conspicuously included + in any notice in an Executable version, related documentation or + collateral in which You describe recipients' rights relating to the + Covered Code. You may distribute the Executable version of Covered + Code under a license of Your choice, which may contain terms different + from this License, provided that You are in compliance with the terms + of this License and that the license for the Executable version does + not attempt to limit or alter the recipient's rights in the Source + Code version from the rights set forth in this License. If You + distribute the Executable version under a different license You must + make it absolutely clear that any terms which differ from this License + are offered by You alone, not by the Initial Developer or any + Contributor. You hereby agree to indemnify the Initial Developer and + every Contributor for any liability incurred by the Initial Developer + or such Contributor as a result of any such terms You offer. + . + 3.7. Larger Works. + You may create a Larger Work by combining Covered Code with other code + not governed by the terms of this License and distribute the Larger + Work as a single product. In such a case, You must make sure the + requirements of this License are fulfilled for the Covered Code. + 4. Inability to Comply Due to Statute or Regulation. + If it is impossible for You to comply with any of the terms of + this License with respect to some or all of the Covered Code due + to statute or regulation then You must: (a) comply with the terms + of this License to the maximum extent possible; and (b) describe + the limitations and the code they affect. Such description must be + included in the LEGAL file described in Section 3.4 and must be + included with all distributions of the Source Code. Except to the + extent prohibited by statute or regulation, such description must + be sufficiently detailed for a recipient of ordinary skill to be + able to understand it. + . + 5. Application of this License. + This License applies to code to which the Initial Developer has + attached the notice in Exhibit A, and to related Covered Code. + . + 6. Versions of the License. + 6.1. New Versions. + Netscape Communications Corporation ("Netscape") may publish + revised and/or new versions of the License from time to time. Each + version will be given a distinguishing version number. + 6.2. Effect of New Versions. + Once Covered Code has been published under a particular version of + the License, You may always continue to use it under the terms of + that version. You may also choose to use such Covered Code under + the terms of any subsequent version of the License published by + Netscape. No one other than Netscape has the right to modify the + terms applicable to Covered Code created under this License. + 6.3. Derivative Works. + If you create or use a modified version of this License (which you + may only do in order to apply it to code which is not already + Covered Code governed by this License), you must (a) rename Your + license so that the phrases "Mozilla", "MOZILLAPL", "MOZPL", + "Netscape", "NPL" or any confusingly similar phrase do not appear + anywhere in your license and (b) otherwise make it clear that your + version of the license contains terms which differ from the + Mozilla Public License and Netscape Public License. (Filling in + the name of the Initial Developer, Original Code or Contributor in + the notice described in Exhibit A shall not of themselves be + deemed to be modifications of this License.) + . + 7. DISCLAIMER OF WARRANTY. + COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS + FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR + NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE + OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE + DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY + OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, + REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN + ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS + AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + . + 8. TERMINATION. + This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to + cure such breach within 30 days of becoming aware of the breach. + All sublicenses to the Covered Code which are properly granted + shall survive any termination of this License. Provisions which, + by their nature, must remain in effect beyond the termination of + this License shall survive. + . + 9. LIMITATION OF LIABILITY. + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL + DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED + CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR + ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT + LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER + FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR + LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE + POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL + NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM + SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS + SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR + LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT + EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + . + 10. U.S. GOVERNMENT END USERS. + The Covered Code is a "commercial item," as that term is defined in 48 + C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer + software" and "commercial computer software documentation," as + such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent + with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 + (June 1995), all U.S. Government End Users acquire Covered Code + with only those rights set forth herein. + . + 11. MISCELLANEOUS. + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed + by California law provisions (except to the extent applicable law, + if any, provides otherwise), excluding its conflict-of-law + provisions. With respect to disputes in which at least one party + is a citizen of, or an entity chartered or registered to do + business in, the United States of America: (a) unless otherwise + agreed in writing, all disputes relating to this License + (excepting any dispute relating to intellectual property rights) + shall be subject to final and binding arbitration, with the losing + party paying all costs of arbitration; (b) any arbitration + relating to this Agreement shall be held in Santa Clara County, + California, under the auspices of JAMS/EndDispute; and (c) any + litigation relating to this Agreement shall be subject to the + jurisdiction of the Federal Courts of the Northern District of + California, with venue lying in Santa Clara County, California, + with the losing party responsible for costs, including without + limitation, court costs and reasonable attorneys fees and + expenses. The application of the United Nations Convention on + Contracts for the International Sale of Goods is expressly + excluded. Any law or regulation which provides that the language + of a contract shall be construed against the drafter shall not + apply to this License. + . + 12. RESPONSIBILITY FOR CLAIMS. + Except in cases where another Contributor has failed to comply with + Section 3.4, You are responsible for damages arising, directly or + indirectly, out of Your utilization of rights under this License, + based on the number of copies of Covered Code you made available, + the revenues you received from utilizing such rights, and other + relevant factors. You agree to work with affected parties to + distribute responsibility on an equitable basis. diff -Nru libbluray-0.5.0/debian/libbluray1.symbols libbluray-0.6.2/debian/libbluray1.symbols --- libbluray-0.5.0/debian/libbluray1.symbols 2014-02-08 23:57:12.000000000 +0000 +++ libbluray-0.6.2/debian/libbluray1.symbols 2014-06-12 17:52:24.000000000 +0000 @@ -3,6 +3,7 @@ bd_chapter_pos@Base 1:0.2.2 bd_close@Base 1:0.2.2 bd_free_clpi@Base 1:0.2.2 + bd_free_mpls@Base 1:0.6.0 bd_free_title_info@Base 1:0.2.2 bd_get_clpi@Base 1:0.2.2 bd_get_current_angle@Base 1:0.2.2 @@ -36,9 +37,11 @@ bd_psr_unlock@Base 1:0.2.2 bd_psr_unregister_cb@Base 1:0.2.2 bd_psr_write@Base 1:0.2.2 + bd_psr_write_bits@Base 1:0.6.0 bd_read@Base 1:0.2.2 bd_read_clpi@Base 1:0.4.0 bd_read_ext@Base 1:0.2.2 + bd_read_mpls@Base 1:0.6.0 bd_read_skip_still@Base 1:0.2.2 bd_refcnt_dec@Base 1:0.4.0 bd_refcnt_inc@Base 1:0.4.0 diff -Nru libbluray-0.5.0/debian/libbluray-bdj.install libbluray-0.6.2/debian/libbluray-bdj.install --- libbluray-0.5.0/debian/libbluray-bdj.install 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/debian/libbluray-bdj.install 2014-06-12 17:52:24.000000000 +0000 @@ -0,0 +1 @@ +usr/share/java/libbluray-*.jar diff -Nru libbluray-0.5.0/debian/libbluray-bdj.jlibs libbluray-0.6.2/debian/libbluray-bdj.jlibs --- libbluray-0.5.0/debian/libbluray-bdj.jlibs 2014-02-05 14:13:34.000000000 +0000 +++ libbluray-0.6.2/debian/libbluray-bdj.jlibs 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -src/.libs/libbluray.jar diff -Nru libbluray-0.5.0/debian/libbluray-doc.examples libbluray-0.6.2/debian/libbluray-doc.examples --- libbluray-0.5.0/debian/libbluray-doc.examples 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/debian/libbluray-doc.examples 2014-06-12 17:52:07.000000000 +0000 @@ -0,0 +1 @@ +src/examples/*.c diff -Nru libbluray-0.5.0/debian/patches/01_java-compat.patch libbluray-0.6.2/debian/patches/01_java-compat.patch --- libbluray-0.5.0/debian/patches/01_java-compat.patch 2014-02-05 14:13:34.000000000 +0000 +++ libbluray-0.6.2/debian/patches/01_java-compat.patch 2014-09-04 15:50:50.000000000 +0000 @@ -9,7 +9,7 @@ --- libbluray.orig/src/libbluray/bdj/build.xml +++ libbluray/src/libbluray/bdj/build.xml -@@ -19,7 +19,7 @@ +@@ -20,7 +20,7 @@ description="compile the source " > Last-Update: 2014-02-09 ---- a/doc/doxygen-footer.html -+++ b/doc/doxygen-footer.html +--- libbluray.orig/doc/doxygen-footer.html ++++ libbluray/doc/doxygen-footer.html @@ -5,7 +5,6 @@ doxygen 1.7.1
diff -Nru libbluray-0.5.0/debian/patches/03_split-jar-build-for-arch-all.patch libbluray-0.6.2/debian/patches/03_split-jar-build-for-arch-all.patch --- libbluray-0.5.0/debian/patches/03_split-jar-build-for-arch-all.patch 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/debian/patches/03_split-jar-build-for-arch-all.patch 2014-09-04 15:50:50.000000000 +0000 @@ -0,0 +1,79 @@ +Description: Add extra argument to enable building of JAR files + The JAR file is shipped in an Architecture: all package so only needs to be + built once. This patch adds an extra argument to enable/disabling building of + the JAR file seperatly from the BD-Java support. +Author: Sebastian Ramacher +Forwarded: not-needed +Last-Update: 2014-02-09 + +--- libbluray.orig/configure.ac ++++ libbluray/configure.ac +@@ -83,6 +83,12 @@ AC_ARG_ENABLE([bdjava], + [use_bdjava=$enableval], + [use_bdjava=no]) + ++AC_ARG_ENABLE([bdjava-jar], ++ [AS_HELP_STRING([--enable-bdjava-jar], ++ [enable JAR file for BD-Java support (default is no)])], ++ [use_bdjava_jar=$enableval], ++ [use_bdjava_jar=no]) ++ + AC_ARG_WITH([libxml2], + [AS_HELP_STRING([--without-libxml2], [build without libxml2 support @<:@default=with@:>@])]) + +@@ -204,7 +210,7 @@ if [[ $use_bdjava = "yes" ]]; then + ]) + + AC_CHECK_PROG(HAVE_ANT, [ant], yes, no) +- if test "x$HAVE_ANT" = "xno"; then ++ if test "x$use_bdjava_jar" = "xyes" && test "x$HAVE_ANT" = "xno"; then + AC_MSG_ERROR([BD-J requires ANT, but ant was not found. Please install it.]) + fi + +@@ -213,6 +219,7 @@ if [[ $use_bdjava = "yes" ]]; then + 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 + if test "$BDJ_TYPE" = "j2me"; then +@@ -254,6 +261,7 @@ 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 +--- libbluray.orig/src/Makefile.am ++++ libbluray/src/Makefile.am +@@ -134,10 +134,12 @@ pkginclude_HEADERS = \ + util/log_control.h + + if USING_BDJAVA ++if USING_BDJAVA_BUILD_JAR + jardir=$(datadir)/java/ + jar_DATA=$(top_builddir)/src/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar + + $(top_builddir)/src/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar: all-local ++endif + + libbluray_la_SOURCES += \ + libbluray/bdj/bdj.h \ +@@ -161,6 +163,7 @@ libbluray_la_SOURCES += \ + + AM_CFLAGS += $(BDJAVA_CFLAGS) + ++if USING_BDJAVA_BUILD_JAR + all-local: + ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \ + -Dbuild='$(abs_builddir)/libbluray/bdj/build' \ +@@ -176,6 +179,7 @@ clean-local: + -Dversion='$(BDJ_TYPE)-$(VERSION)' \ + clean + endif ++endif + + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = libbluray.pc diff -Nru libbluray-0.5.0/debian/patches/04_kfreebsd-include.patch libbluray-0.6.2/debian/patches/04_kfreebsd-include.patch --- libbluray-0.5.0/debian/patches/04_kfreebsd-include.patch 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/debian/patches/04_kfreebsd-include.patch 2014-09-04 15:50:50.000000000 +0000 @@ -0,0 +1,17 @@ +Description: Work around #751532 + Once #751532 is fixed, this patch should be removed again or adapted + accordingly. +Author: Sebastian Ramacher +Bug-Debian: http://bugs.debian.org/751433 +Last-Update: 2014-06-28 + +--- libbluray.orig/configure.ac ++++ libbluray/configure.ac +@@ -195,6 +195,7 @@ if [[ $use_bdjava = "yes" ]]; then + freebsd*) java_os=freebsd ;; + solaris*) java_os=solaris ;; + darwin*) java_os=darwin ;; ++ kfreebsd*) java_os=linux ;; + *) java_os=$host_os ;; + esac + diff -Nru libbluray-0.5.0/debian/patches/series libbluray-0.6.2/debian/patches/series --- libbluray-0.5.0/debian/patches/series 2014-02-09 01:09:38.000000000 +0000 +++ libbluray-0.6.2/debian/patches/series 2014-06-28 00:00:09.000000000 +0000 @@ -1,2 +1,4 @@ 01_java-compat.patch 02_online-image.patch +03_split-jar-build-for-arch-all.patch +04_kfreebsd-include.patch diff -Nru libbluray-0.5.0/debian/rules libbluray-0.6.2/debian/rules --- libbluray-0.5.0/debian/rules 2014-02-09 00:18:07.000000000 +0000 +++ libbluray-0.6.2/debian/rules 2014-08-04 19:25:57.000000000 +0000 @@ -1,36 +1,31 @@ #!/usr/bin/make -f -DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS) - -confflags := --with-libxml2 --with-freetype - -# enable bdjava on linux hosts only -ifneq (,$(findstring linux,$(DEB_BUILD_ARCH_OS))) +confflags = --with-libxml2 --with-freetype \ + --enable-bdjava --with-bdj-type=j2se \ + --disable-silent-rules +# --enable-bdjava-jar is introduced by 03_split-jar-build-for-arch-all.patch. +# This enables us to build the JAR file only if the Architecture: all package +# libbluray-bdj is built. +confflags_java = --enable-bdjava-jar # Use default java implementation -JAVA_HOME=/usr/lib/jvm/default-java -ifeq (,$(wildcard $(JAVA_HOME))) - $(info "warning: No suitable jni.h was found. Package will most probably FTBFS!") -endif - -export JDK_HOME=$(JAVA_HOME) -$(info Located java at $(JAVA_HOME)) -confflags += --enable-bdjava --with-bdj-type=j2se +export JDK_HOME=/usr/lib/jvm/default-java +ifeq (,$(wildcard $(JDK_HOME))) + $(info "warning: No suitable jni.h was found. Package will most probably FTBFS!") endif # Set CFLAGS to DEB_CFLAGS CFLAGS=$(shell dpkg-buildflags --get CFLAGS 2>/dev/null | sed -e 's/-O2//g') -ifneq (,$(findstring linux,$(DEB_BUILD_ARCH_OS))) %: dh $@ --parallel --with javahelper,autoreconf -else -%: - dh $@ --parallel --with autoreconf -endif override_dh_auto_configure: +ifneq (,$(findstring libbluray-bdj,$(shell dh_listpackages))) + dh_auto_configure -- $(confflags) $(confflags_java) +else dh_auto_configure -- $(confflags) +endif override_dh_auto_build-indep: make doxygen-doc @@ -43,7 +38,7 @@ dh_installdocs --exclude=jquery.js override_dh_install: - dh_install -X.la -Xlibbluray.jar --fail-missing + dh_install -X.la --fail-missing override_dh_clean: dh_clean diff -Nru libbluray-0.5.0/debian/watch libbluray-0.6.2/debian/watch --- libbluray-0.5.0/debian/watch 2014-02-05 14:13:34.000000000 +0000 +++ libbluray-0.6.2/debian/watch 2014-06-12 17:52:24.000000000 +0000 @@ -1,3 +1,4 @@ version=3 +opts=dversionmangle=s/\+dfsg\d*$// \ http://www.videolan.org/developers/libbluray.html \ ftp://ftp.videolan.org/pub/videolan/libbluray/.*/libbluray-(.*)\.tar\.bz2 diff -Nru libbluray-0.5.0/doc/INSTALL libbluray-0.6.2/doc/INSTALL --- libbluray-0.5.0/doc/INSTALL 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/doc/INSTALL 2014-09-01 12:06:01.000000000 +0000 @@ -2,7 +2,7 @@ LIBBLURAY INSTALLATION INSTRUCTIONS =================================== -1. Build the source code (dependancies - full OpenSSL): +1. Build the source code: make diff -Nru libbluray-0.5.0/jni/darwin/jni_md.h libbluray-0.6.2/jni/darwin/jni_md.h --- libbluray-0.5.0/jni/darwin/jni_md.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/jni/darwin/jni_md.h 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Java Runtime Interface. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation and Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 1993-1996 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Jean-Baptiste Kempf + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef _JNI_MD_H_ +#define _JNI_MD_H_ + +#define JNIEXPORT __attribute__((visibility("default"))) +#define JNIIMPORT +#define JNICALL + +typedef int jint; +typedef long long jlong; +typedef signed char jbyte; + +#endif /* !_JNI_MD_H_ */ diff -Nru libbluray-0.5.0/jni/jni.h libbluray-0.6.2/jni/jni.h --- libbluray-0.5.0/jni/jni.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/jni/jni.h 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,1973 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Java Runtime Interface. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation and Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 1993-1996 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef JNI_H +#define JNI_H + +#include +#include + +/* jni_md.h contains the machine-dependent typedefs for jbyte, jint + and jlong */ + +#include "jni_md.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * JNI Types + */ + +typedef unsigned char jboolean; +typedef unsigned short jchar; +typedef short jshort; +typedef float jfloat; +typedef double jdouble; + +typedef jint jsize; + +#ifdef __cplusplus + +class _jobject {}; +class _jclass : public _jobject {}; +class _jthrowable : public _jobject {}; +class _jstring : public _jobject {}; +class _jarray : public _jobject {}; +class _jbooleanArray : public _jarray {}; +class _jbyteArray : public _jarray {}; +class _jcharArray : public _jarray {}; +class _jshortArray : public _jarray {}; +class _jintArray : public _jarray {}; +class _jlongArray : public _jarray {}; +class _jfloatArray : public _jarray {}; +class _jdoubleArray : public _jarray {}; +class _jobjectArray : public _jarray {}; + +typedef _jobject *jobject; +typedef _jclass *jclass; +typedef _jthrowable *jthrowable; +typedef _jstring *jstring; +typedef _jarray *jarray; +typedef _jbooleanArray *jbooleanArray; +typedef _jbyteArray *jbyteArray; +typedef _jcharArray *jcharArray; +typedef _jshortArray *jshortArray; +typedef _jintArray *jintArray; +typedef _jlongArray *jlongArray; +typedef _jfloatArray *jfloatArray; +typedef _jdoubleArray *jdoubleArray; +typedef _jobjectArray *jobjectArray; + +#else + +struct _jobject; + +typedef struct _jobject *jobject; +typedef jobject jclass; +typedef jobject jthrowable; +typedef jobject jstring; +typedef jobject jarray; +typedef jarray jbooleanArray; +typedef jarray jbyteArray; +typedef jarray jcharArray; +typedef jarray jshortArray; +typedef jarray jintArray; +typedef jarray jlongArray; +typedef jarray jfloatArray; +typedef jarray jdoubleArray; +typedef jarray jobjectArray; + +#endif + +typedef jobject jweak; + +#if 0 /* moved to jri_md.h */ +typedef jobject jref; /* For transition---not meant to be part of public + API anymore.*/ +#endif + +typedef union jvalue { + jboolean z; + jbyte b; + jchar c; + jshort s; + jint i; + jlong j; + jfloat f; + jdouble d; + jobject l; +} jvalue; + +struct _jfieldID; +typedef struct _jfieldID *jfieldID; + +struct _jmethodID; +typedef struct _jmethodID *jmethodID; + +/* + * jboolean constants + */ + +#define JNI_FALSE 0 +#define JNI_TRUE 1 + +/* + * possible return values for JNI functions. + */ + +#define JNI_OK 0 /* success */ +#define JNI_ERR (-1) /* unknown error */ +#define JNI_EDETACHED (-2) /* thread detached from the VM */ +#define JNI_EVERSION (-3) /* JNI version error */ +#define JNI_ENOMEM (-4) /* not enough memory */ +#define JNI_EEXIST (-5) /* VM already created */ +#define JNI_EINVAL (-6) /* invalid arguments */ + +/* + * used in ReleaseScalarArrayElements + */ + +#define JNI_COMMIT 1 +#define JNI_ABORT 2 + +/* + * used in RegisterNatives to describe native method name, signature, + * and function pointer. + */ + +typedef struct { + char *name; + char *signature; + void *fnPtr; +} JNINativeMethod; + +/* + * JNI Native Method Interface. + */ + +struct JNINativeInterface_; + +struct JNIEnv_; + +#ifdef __cplusplus +typedef JNIEnv_ JNIEnv; +#else +typedef const struct JNINativeInterface_ *JNIEnv; +#endif + +/* + * JNI Invocation Interface. + */ + +struct JNIInvokeInterface_; + +struct JavaVM_; + +#ifdef __cplusplus +typedef JavaVM_ JavaVM; +#else +typedef const struct JNIInvokeInterface_ *JavaVM; +#endif + +struct JNINativeInterface_ { + void *reserved0; + void *reserved1; + void *reserved2; + + void *reserved3; + jint (JNICALL *GetVersion)(JNIEnv *env); + + jclass (JNICALL *DefineClass) + (JNIEnv *env, const char *name, jobject loader, const jbyte *buf, + jsize len); + jclass (JNICALL *FindClass) + (JNIEnv *env, const char *name); + + jmethodID (JNICALL *FromReflectedMethod) + (JNIEnv *env, jobject method); + jfieldID (JNICALL *FromReflectedField) + (JNIEnv *env, jobject field); + + jobject (JNICALL *ToReflectedMethod) + (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic); + + jclass (JNICALL *GetSuperclass) + (JNIEnv *env, jclass sub); + jboolean (JNICALL *IsAssignableFrom) + (JNIEnv *env, jclass sub, jclass sup); + + jobject (JNICALL *ToReflectedField) + (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic); + + jint (JNICALL *Throw) + (JNIEnv *env, jthrowable obj); + jint (JNICALL *ThrowNew) + (JNIEnv *env, jclass clazz, const char *msg); + jthrowable (JNICALL *ExceptionOccurred) + (JNIEnv *env); + void (JNICALL *ExceptionDescribe) + (JNIEnv *env); + void (JNICALL *ExceptionClear) + (JNIEnv *env); + void (JNICALL *FatalError) + (JNIEnv *env, const char *msg); + + jint (JNICALL *PushLocalFrame) + (JNIEnv *env, jint capacity); + jobject (JNICALL *PopLocalFrame) + (JNIEnv *env, jobject result); + + jobject (JNICALL *NewGlobalRef) + (JNIEnv *env, jobject lobj); + void (JNICALL *DeleteGlobalRef) + (JNIEnv *env, jobject gref); + void (JNICALL *DeleteLocalRef) + (JNIEnv *env, jobject obj); + jboolean (JNICALL *IsSameObject) + (JNIEnv *env, jobject obj1, jobject obj2); + jobject (JNICALL *NewLocalRef) + (JNIEnv *env, jobject ref); + jint (JNICALL *EnsureLocalCapacity) + (JNIEnv *env, jint capacity); + + jobject (JNICALL *AllocObject) + (JNIEnv *env, jclass clazz); + jobject (JNICALL *NewObject) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *NewObjectV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jobject (JNICALL *NewObjectA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jclass (JNICALL *GetObjectClass) + (JNIEnv *env, jobject obj); + jboolean (JNICALL *IsInstanceOf) + (JNIEnv *env, jobject obj, jclass clazz); + + jmethodID (JNICALL *GetMethodID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *CallObjectMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jobject (JNICALL *CallObjectMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jobject (JNICALL *CallObjectMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args); + + jboolean (JNICALL *CallBooleanMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jboolean (JNICALL *CallBooleanMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jboolean (JNICALL *CallBooleanMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args); + + jbyte (JNICALL *CallByteMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jbyte (JNICALL *CallByteMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jbyte (JNICALL *CallByteMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + jchar (JNICALL *CallCharMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jchar (JNICALL *CallCharMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jchar (JNICALL *CallCharMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + jshort (JNICALL *CallShortMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jshort (JNICALL *CallShortMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jshort (JNICALL *CallShortMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + jint (JNICALL *CallIntMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jint (JNICALL *CallIntMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jint (JNICALL *CallIntMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + jlong (JNICALL *CallLongMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jlong (JNICALL *CallLongMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jlong (JNICALL *CallLongMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + jfloat (JNICALL *CallFloatMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jfloat (JNICALL *CallFloatMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jfloat (JNICALL *CallFloatMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + jdouble (JNICALL *CallDoubleMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jdouble (JNICALL *CallDoubleMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jdouble (JNICALL *CallDoubleMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + void (JNICALL *CallVoidMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + void (JNICALL *CallVoidMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + void (JNICALL *CallVoidMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args); + + jobject (JNICALL *CallNonvirtualObjectMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *CallNonvirtualObjectMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jobject (JNICALL *CallNonvirtualObjectMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue * args); + + jboolean (JNICALL *CallNonvirtualBooleanMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jboolean (JNICALL *CallNonvirtualBooleanMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jboolean (JNICALL *CallNonvirtualBooleanMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue * args); + + jbyte (JNICALL *CallNonvirtualByteMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jbyte (JNICALL *CallNonvirtualByteMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jbyte (JNICALL *CallNonvirtualByteMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + jchar (JNICALL *CallNonvirtualCharMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jchar (JNICALL *CallNonvirtualCharMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jchar (JNICALL *CallNonvirtualCharMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + jshort (JNICALL *CallNonvirtualShortMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jshort (JNICALL *CallNonvirtualShortMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jshort (JNICALL *CallNonvirtualShortMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + jint (JNICALL *CallNonvirtualIntMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jint (JNICALL *CallNonvirtualIntMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jint (JNICALL *CallNonvirtualIntMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + jlong (JNICALL *CallNonvirtualLongMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jlong (JNICALL *CallNonvirtualLongMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jlong (JNICALL *CallNonvirtualLongMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + jfloat (JNICALL *CallNonvirtualFloatMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jfloat (JNICALL *CallNonvirtualFloatMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jfloat (JNICALL *CallNonvirtualFloatMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + jdouble (JNICALL *CallNonvirtualDoubleMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jdouble (JNICALL *CallNonvirtualDoubleMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jdouble (JNICALL *CallNonvirtualDoubleMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + void (JNICALL *CallNonvirtualVoidMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + void (JNICALL *CallNonvirtualVoidMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + void (JNICALL *CallNonvirtualVoidMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue * args); + + jfieldID (JNICALL *GetFieldID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *GetObjectField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jboolean (JNICALL *GetBooleanField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jbyte (JNICALL *GetByteField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jchar (JNICALL *GetCharField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jshort (JNICALL *GetShortField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jint (JNICALL *GetIntField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jlong (JNICALL *GetLongField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jfloat (JNICALL *GetFloatField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jdouble (JNICALL *GetDoubleField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + + void (JNICALL *SetObjectField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val); + void (JNICALL *SetBooleanField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val); + void (JNICALL *SetByteField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); + void (JNICALL *SetCharField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); + void (JNICALL *SetShortField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); + void (JNICALL *SetIntField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jint val); + void (JNICALL *SetLongField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); + void (JNICALL *SetFloatField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); + void (JNICALL *SetDoubleField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val); + + jmethodID (JNICALL *GetStaticMethodID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *CallStaticObjectMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *CallStaticObjectMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jobject (JNICALL *CallStaticObjectMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jboolean (JNICALL *CallStaticBooleanMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jboolean (JNICALL *CallStaticBooleanMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jboolean (JNICALL *CallStaticBooleanMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jbyte (JNICALL *CallStaticByteMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jbyte (JNICALL *CallStaticByteMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jbyte (JNICALL *CallStaticByteMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jchar (JNICALL *CallStaticCharMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jchar (JNICALL *CallStaticCharMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jchar (JNICALL *CallStaticCharMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jshort (JNICALL *CallStaticShortMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jshort (JNICALL *CallStaticShortMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jshort (JNICALL *CallStaticShortMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jint (JNICALL *CallStaticIntMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jint (JNICALL *CallStaticIntMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jint (JNICALL *CallStaticIntMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jlong (JNICALL *CallStaticLongMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jlong (JNICALL *CallStaticLongMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jlong (JNICALL *CallStaticLongMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jfloat (JNICALL *CallStaticFloatMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jfloat (JNICALL *CallStaticFloatMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jfloat (JNICALL *CallStaticFloatMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jdouble (JNICALL *CallStaticDoubleMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jdouble (JNICALL *CallStaticDoubleMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jdouble (JNICALL *CallStaticDoubleMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + void (JNICALL *CallStaticVoidMethod) + (JNIEnv *env, jclass cls, jmethodID methodID, ...); + void (JNICALL *CallStaticVoidMethodV) + (JNIEnv *env, jclass cls, jmethodID methodID, va_list args); + void (JNICALL *CallStaticVoidMethodA) + (JNIEnv *env, jclass cls, jmethodID methodID, jvalue * args); + + jfieldID (JNICALL *GetStaticFieldID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + jobject (JNICALL *GetStaticObjectField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jboolean (JNICALL *GetStaticBooleanField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jbyte (JNICALL *GetStaticByteField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jchar (JNICALL *GetStaticCharField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jshort (JNICALL *GetStaticShortField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jint (JNICALL *GetStaticIntField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jlong (JNICALL *GetStaticLongField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jfloat (JNICALL *GetStaticFloatField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jdouble (JNICALL *GetStaticDoubleField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + + void (JNICALL *SetStaticObjectField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value); + void (JNICALL *SetStaticBooleanField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value); + void (JNICALL *SetStaticByteField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value); + void (JNICALL *SetStaticCharField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value); + void (JNICALL *SetStaticShortField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value); + void (JNICALL *SetStaticIntField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value); + void (JNICALL *SetStaticLongField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value); + void (JNICALL *SetStaticFloatField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value); + void (JNICALL *SetStaticDoubleField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value); + + jstring (JNICALL *NewString) + (JNIEnv *env, const jchar *unicode, jsize len); + jsize (JNICALL *GetStringLength) + (JNIEnv *env, jstring str); + const jchar *(JNICALL *GetStringChars) + (JNIEnv *env, jstring str, jboolean *isCopy); + void (JNICALL *ReleaseStringChars) + (JNIEnv *env, jstring str, const jchar *chars); + + jstring (JNICALL *NewStringUTF) + (JNIEnv *env, const char *utf); + jsize (JNICALL *GetStringUTFLength) + (JNIEnv *env, jstring str); + const char* (JNICALL *GetStringUTFChars) + (JNIEnv *env, jstring str, jboolean *isCopy); + void (JNICALL *ReleaseStringUTFChars) + (JNIEnv *env, jstring str, const char* chars); + + + jsize (JNICALL *GetArrayLength) + (JNIEnv *env, jarray array); + + jobjectArray (JNICALL *NewObjectArray) + (JNIEnv *env, jsize len, jclass clazz, jobject init); + jobject (JNICALL *GetObjectArrayElement) + (JNIEnv *env, jobjectArray array, jsize index); + void (JNICALL *SetObjectArrayElement) + (JNIEnv *env, jobjectArray array, jsize index, jobject val); + + jbooleanArray (JNICALL *NewBooleanArray) + (JNIEnv *env, jsize len); + jbyteArray (JNICALL *NewByteArray) + (JNIEnv *env, jsize len); + jcharArray (JNICALL *NewCharArray) + (JNIEnv *env, jsize len); + jshortArray (JNICALL *NewShortArray) + (JNIEnv *env, jsize len); + jintArray (JNICALL *NewIntArray) + (JNIEnv *env, jsize len); + jlongArray (JNICALL *NewLongArray) + (JNIEnv *env, jsize len); + jfloatArray (JNICALL *NewFloatArray) + (JNIEnv *env, jsize len); + jdoubleArray (JNICALL *NewDoubleArray) + (JNIEnv *env, jsize len); + + jboolean * (JNICALL *GetBooleanArrayElements) + (JNIEnv *env, jbooleanArray array, jboolean *isCopy); + jbyte * (JNICALL *GetByteArrayElements) + (JNIEnv *env, jbyteArray array, jboolean *isCopy); + jchar * (JNICALL *GetCharArrayElements) + (JNIEnv *env, jcharArray array, jboolean *isCopy); + jshort * (JNICALL *GetShortArrayElements) + (JNIEnv *env, jshortArray array, jboolean *isCopy); + jint * (JNICALL *GetIntArrayElements) + (JNIEnv *env, jintArray array, jboolean *isCopy); + jlong * (JNICALL *GetLongArrayElements) + (JNIEnv *env, jlongArray array, jboolean *isCopy); + jfloat * (JNICALL *GetFloatArrayElements) + (JNIEnv *env, jfloatArray array, jboolean *isCopy); + jdouble * (JNICALL *GetDoubleArrayElements) + (JNIEnv *env, jdoubleArray array, jboolean *isCopy); + + void (JNICALL *ReleaseBooleanArrayElements) + (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode); + void (JNICALL *ReleaseByteArrayElements) + (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode); + void (JNICALL *ReleaseCharArrayElements) + (JNIEnv *env, jcharArray array, jchar *elems, jint mode); + void (JNICALL *ReleaseShortArrayElements) + (JNIEnv *env, jshortArray array, jshort *elems, jint mode); + void (JNICALL *ReleaseIntArrayElements) + (JNIEnv *env, jintArray array, jint *elems, jint mode); + void (JNICALL *ReleaseLongArrayElements) + (JNIEnv *env, jlongArray array, jlong *elems, jint mode); + void (JNICALL *ReleaseFloatArrayElements) + (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode); + void (JNICALL *ReleaseDoubleArrayElements) + (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode); + + void (JNICALL *GetBooleanArrayRegion) + (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); + void (JNICALL *GetByteArrayRegion) + (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); + void (JNICALL *GetCharArrayRegion) + (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); + void (JNICALL *GetShortArrayRegion) + (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); + void (JNICALL *GetIntArrayRegion) + (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); + void (JNICALL *GetLongArrayRegion) + (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); + void (JNICALL *GetFloatArrayRegion) + (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); + void (JNICALL *GetDoubleArrayRegion) + (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); + + void (JNICALL *SetBooleanArrayRegion) + (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf); + void (JNICALL *SetByteArrayRegion) + (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf); + void (JNICALL *SetCharArrayRegion) + (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf); + void (JNICALL *SetShortArrayRegion) + (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf); + void (JNICALL *SetIntArrayRegion) + (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf); + void (JNICALL *SetLongArrayRegion) + (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf); + void (JNICALL *SetFloatArrayRegion) + (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf); + void (JNICALL *SetDoubleArrayRegion) + (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf); + + jint (JNICALL *RegisterNatives) + (JNIEnv *env, jclass clazz, const JNINativeMethod *methods, + jint nMethods); + jint (JNICALL *UnregisterNatives) + (JNIEnv *env, jclass clazz); + + jint (JNICALL *MonitorEnter) + (JNIEnv *env, jobject obj); + jint (JNICALL *MonitorExit) + (JNIEnv *env, jobject obj); + + jint (JNICALL *GetJavaVM) + (JNIEnv *env, JavaVM **vm); + + void (JNICALL *GetStringRegion) + (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf); + void (JNICALL *GetStringUTFRegion) + (JNIEnv *env, jstring str, jsize start, jsize len, char *buf); + + void * (JNICALL *GetPrimitiveArrayCritical) + (JNIEnv *env, jarray array, jboolean *isCopy); + void (JNICALL *ReleasePrimitiveArrayCritical) + (JNIEnv *env, jarray array, void *carray, jint mode); + + const jchar * (JNICALL *GetStringCritical) + (JNIEnv *env, jstring string, jboolean *isCopy); + void (JNICALL *ReleaseStringCritical) + (JNIEnv *env, jstring string, const jchar *cstring); + + jweak (JNICALL *NewWeakGlobalRef) + (JNIEnv *env, jobject obj); + void (JNICALL *DeleteWeakGlobalRef) + (JNIEnv *env, jweak ref); + + jboolean (JNICALL *ExceptionCheck) + (JNIEnv *env); + + jobject (JNICALL *NewDirectByteBuffer) + (JNIEnv* env, void* address, jlong capacity); + void* (JNICALL *GetDirectBufferAddress) + (JNIEnv* env, jobject buf); + jlong (JNICALL *GetDirectBufferCapacity) + (JNIEnv* env, jobject buf); +}; + +/* + * We use inlined functions for C++ so that programmers can write: + * + * env->FindClass("java/lang/String") + * + * in C++ rather than: + * + * (*env)->FindClass(env, "java/lang/String") + * + * in C. + */ + +struct JNIEnv_ { + const struct JNINativeInterface_ *functions; +#ifdef __cplusplus + + jint GetVersion() { + return functions->GetVersion(this); + } + jclass DefineClass(const char *name, jobject loader, const jbyte *buf, + jsize len) { + return functions->DefineClass(this, name, loader, buf, len); + } + jclass FindClass(const char *name) { + return functions->FindClass(this, name); + } + jmethodID FromReflectedMethod(jobject method) { + return functions->FromReflectedMethod(this,method); + } + jfieldID FromReflectedField(jobject field) { + return functions->FromReflectedField(this,field); + } + + jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) { + return functions->ToReflectedMethod(this, cls, methodID, isStatic); + } + + jclass GetSuperclass(jclass sub) { + return functions->GetSuperclass(this, sub); + } + jboolean IsAssignableFrom(jclass sub, jclass sup) { + return functions->IsAssignableFrom(this, sub, sup); + } + + jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) { + return functions->ToReflectedField(this,cls,fieldID,isStatic); + } + + jint Throw(jthrowable obj) { + return functions->Throw(this, obj); + } + jint ThrowNew(jclass clazz, const char *msg) { + return functions->ThrowNew(this, clazz, msg); + } + jthrowable ExceptionOccurred() { + return functions->ExceptionOccurred(this); + } + void ExceptionDescribe() { + functions->ExceptionDescribe(this); + } + void ExceptionClear() { + functions->ExceptionClear(this); + } + void FatalError(const char *msg) { + functions->FatalError(this, msg); + } + + jint PushLocalFrame(jint capacity) { + return functions->PushLocalFrame(this,capacity); + } + jobject PopLocalFrame(jobject result) { + return functions->PopLocalFrame(this,result); + } + + jobject NewGlobalRef(jobject lobj) { + return functions->NewGlobalRef(this,lobj); + } + void DeleteGlobalRef(jobject gref) { + functions->DeleteGlobalRef(this,gref); + } + void DeleteLocalRef(jobject obj) { + functions->DeleteLocalRef(this, obj); + } + + jboolean IsSameObject(jobject obj1, jobject obj2) { + return functions->IsSameObject(this,obj1,obj2); + } + + jobject NewLocalRef(jobject ref) { + return functions->NewLocalRef(this,ref); + } + jint EnsureLocalCapacity(jint capacity) { + return functions->EnsureLocalCapacity(this,capacity); + } + + jobject AllocObject(jclass clazz) { + return functions->AllocObject(this,clazz); + } + jobject NewObject(jclass clazz, jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args, methodID); + result = functions->NewObjectV(this,clazz,methodID,args); + va_end(args); + return result; + } + jobject NewObjectV(jclass clazz, jmethodID methodID, + va_list args) { + return functions->NewObjectV(this,clazz,methodID,args); + } + jobject NewObjectA(jclass clazz, jmethodID methodID, + jvalue *args) { + return functions->NewObjectA(this,clazz,methodID,args); + } + + jclass GetObjectClass(jobject obj) { + return functions->GetObjectClass(this,obj); + } + jboolean IsInstanceOf(jobject obj, jclass clazz) { + return functions->IsInstanceOf(this,obj,clazz); + } + + jmethodID GetMethodID(jclass clazz, const char *name, + const char *sig) { + return functions->GetMethodID(this,clazz,name,sig); + } + + jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallObjectMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jobject CallObjectMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallObjectMethodV(this,obj,methodID,args); + } + jobject CallObjectMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallObjectMethodA(this,obj,methodID,args); + } + + jboolean CallBooleanMethod(jobject obj, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallBooleanMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jboolean CallBooleanMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallBooleanMethodV(this,obj,methodID,args); + } + jboolean CallBooleanMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallBooleanMethodA(this,obj,methodID, args); + } + + jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallByteMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jbyte CallByteMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallByteMethodV(this,obj,methodID,args); + } + jbyte CallByteMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallByteMethodA(this,obj,methodID,args); + } + + jchar CallCharMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallCharMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jchar CallCharMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallCharMethodV(this,obj,methodID,args); + } + jchar CallCharMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallCharMethodA(this,obj,methodID,args); + } + + jshort CallShortMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallShortMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jshort CallShortMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallShortMethodV(this,obj,methodID,args); + } + jshort CallShortMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallShortMethodA(this,obj,methodID,args); + } + + jint CallIntMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallIntMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jint CallIntMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallIntMethodV(this,obj,methodID,args); + } + jint CallIntMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallIntMethodA(this,obj,methodID,args); + } + + jlong CallLongMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallLongMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jlong CallLongMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallLongMethodV(this,obj,methodID,args); + } + jlong CallLongMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallLongMethodA(this,obj,methodID,args); + } + + jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallFloatMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jfloat CallFloatMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallFloatMethodV(this,obj,methodID,args); + } + jfloat CallFloatMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallFloatMethodA(this,obj,methodID,args); + } + + jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallDoubleMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jdouble CallDoubleMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallDoubleMethodV(this,obj,methodID,args); + } + jdouble CallDoubleMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallDoubleMethodA(this,obj,methodID,args); + } + + void CallVoidMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallVoidMethodV(this,obj,methodID,args); + va_end(args); + } + void CallVoidMethodV(jobject obj, jmethodID methodID, + va_list args) { + functions->CallVoidMethodV(this,obj,methodID,args); + } + void CallVoidMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + functions->CallVoidMethodA(this,obj,methodID,args); + } + + jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallNonvirtualObjectMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualObjectMethodV(this,obj,clazz, + methodID,args); + } + jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualObjectMethodA(this,obj,clazz, + methodID,args); + } + + jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualBooleanMethodV(this,obj,clazz, + methodID,args); + } + jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualBooleanMethodA(this,obj,clazz, + methodID, args); + } + + jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallNonvirtualByteMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualByteMethodV(this,obj,clazz, + methodID,args); + } + jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualByteMethodA(this,obj,clazz, + methodID,args); + } + + jchar CallNonvirtualCharMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallNonvirtualCharMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualCharMethodV(this,obj,clazz, + methodID,args); + } + jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualCharMethodA(this,obj,clazz, + methodID,args); + } + + jshort CallNonvirtualShortMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallNonvirtualShortMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualShortMethodV(this,obj,clazz, + methodID,args); + } + jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualShortMethodA(this,obj,clazz, + methodID,args); + } + + jint CallNonvirtualIntMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallNonvirtualIntMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jint CallNonvirtualIntMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualIntMethodV(this,obj,clazz, + methodID,args); + } + jint CallNonvirtualIntMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualIntMethodA(this,obj,clazz, + methodID,args); + } + + jlong CallNonvirtualLongMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallNonvirtualLongMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualLongMethodV(this,obj,clazz, + methodID,args); + } + jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualLongMethodA(this,obj,clazz, + methodID,args); + } + + jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallNonvirtualFloatMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + return functions->CallNonvirtualFloatMethodV(this,obj,clazz, + methodID,args); + } + jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz, + jmethodID methodID, + jvalue * args) { + return functions->CallNonvirtualFloatMethodA(this,obj,clazz, + methodID,args); + } + + jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + return functions->CallNonvirtualDoubleMethodV(this,obj,clazz, + methodID,args); + } + jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz, + jmethodID methodID, + jvalue * args) { + return functions->CallNonvirtualDoubleMethodA(this,obj,clazz, + methodID,args); + } + + void CallNonvirtualVoidMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); + va_end(args); + } + void CallNonvirtualVoidMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); + } + void CallNonvirtualVoidMethodA(jobject obj, jclass clazz, + jmethodID methodID, + jvalue * args) { + functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args); + } + + jfieldID GetFieldID(jclass clazz, const char *name, + const char *sig) { + return functions->GetFieldID(this,clazz,name,sig); + } + + jobject GetObjectField(jobject obj, jfieldID fieldID) { + return functions->GetObjectField(this,obj,fieldID); + } + jboolean GetBooleanField(jobject obj, jfieldID fieldID) { + return functions->GetBooleanField(this,obj,fieldID); + } + jbyte GetByteField(jobject obj, jfieldID fieldID) { + return functions->GetByteField(this,obj,fieldID); + } + jchar GetCharField(jobject obj, jfieldID fieldID) { + return functions->GetCharField(this,obj,fieldID); + } + jshort GetShortField(jobject obj, jfieldID fieldID) { + return functions->GetShortField(this,obj,fieldID); + } + jint GetIntField(jobject obj, jfieldID fieldID) { + return functions->GetIntField(this,obj,fieldID); + } + jlong GetLongField(jobject obj, jfieldID fieldID) { + return functions->GetLongField(this,obj,fieldID); + } + jfloat GetFloatField(jobject obj, jfieldID fieldID) { + return functions->GetFloatField(this,obj,fieldID); + } + jdouble GetDoubleField(jobject obj, jfieldID fieldID) { + return functions->GetDoubleField(this,obj,fieldID); + } + + void SetObjectField(jobject obj, jfieldID fieldID, jobject val) { + functions->SetObjectField(this,obj,fieldID,val); + } + void SetBooleanField(jobject obj, jfieldID fieldID, + jboolean val) { + functions->SetBooleanField(this,obj,fieldID,val); + } + void SetByteField(jobject obj, jfieldID fieldID, + jbyte val) { + functions->SetByteField(this,obj,fieldID,val); + } + void SetCharField(jobject obj, jfieldID fieldID, + jchar val) { + functions->SetCharField(this,obj,fieldID,val); + } + void SetShortField(jobject obj, jfieldID fieldID, + jshort val) { + functions->SetShortField(this,obj,fieldID,val); + } + void SetIntField(jobject obj, jfieldID fieldID, + jint val) { + functions->SetIntField(this,obj,fieldID,val); + } + void SetLongField(jobject obj, jfieldID fieldID, + jlong val) { + functions->SetLongField(this,obj,fieldID,val); + } + void SetFloatField(jobject obj, jfieldID fieldID, + jfloat val) { + functions->SetFloatField(this,obj,fieldID,val); + } + void SetDoubleField(jobject obj, jfieldID fieldID, + jdouble val) { + functions->SetDoubleField(this,obj,fieldID,val); + } + + jmethodID GetStaticMethodID(jclass clazz, const char *name, + const char *sig) { + return functions->GetStaticMethodID(this,clazz,name,sig); + } + + jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID, + ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallStaticObjectMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID, + va_list args) { + return functions->CallStaticObjectMethodV(this,clazz,methodID,args); + } + jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID, + jvalue *args) { + return functions->CallStaticObjectMethodA(this,clazz,methodID,args); + } + + jboolean CallStaticBooleanMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jboolean CallStaticBooleanMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticBooleanMethodV(this,clazz,methodID,args); + } + jboolean CallStaticBooleanMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticBooleanMethodA(this,clazz,methodID,args); + } + + jbyte CallStaticByteMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallStaticByteMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jbyte CallStaticByteMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticByteMethodV(this,clazz,methodID,args); + } + jbyte CallStaticByteMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticByteMethodA(this,clazz,methodID,args); + } + + jchar CallStaticCharMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallStaticCharMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jchar CallStaticCharMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticCharMethodV(this,clazz,methodID,args); + } + jchar CallStaticCharMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticCharMethodA(this,clazz,methodID,args); + } + + jshort CallStaticShortMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallStaticShortMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jshort CallStaticShortMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticShortMethodV(this,clazz,methodID,args); + } + jshort CallStaticShortMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticShortMethodA(this,clazz,methodID,args); + } + + jint CallStaticIntMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallStaticIntMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jint CallStaticIntMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticIntMethodV(this,clazz,methodID,args); + } + jint CallStaticIntMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticIntMethodA(this,clazz,methodID,args); + } + + jlong CallStaticLongMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallStaticLongMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jlong CallStaticLongMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticLongMethodV(this,clazz,methodID,args); + } + jlong CallStaticLongMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticLongMethodA(this,clazz,methodID,args); + } + + jfloat CallStaticFloatMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallStaticFloatMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jfloat CallStaticFloatMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticFloatMethodV(this,clazz,methodID,args); + } + jfloat CallStaticFloatMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticFloatMethodA(this,clazz,methodID,args); + } + + jdouble CallStaticDoubleMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jdouble CallStaticDoubleMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticDoubleMethodV(this,clazz,methodID,args); + } + jdouble CallStaticDoubleMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticDoubleMethodA(this,clazz,methodID,args); + } + + void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallStaticVoidMethodV(this,cls,methodID,args); + va_end(args); + } + void CallStaticVoidMethodV(jclass cls, jmethodID methodID, + va_list args) { + functions->CallStaticVoidMethodV(this,cls,methodID,args); + } + void CallStaticVoidMethodA(jclass cls, jmethodID methodID, + jvalue * args) { + functions->CallStaticVoidMethodA(this,cls,methodID,args); + } + + jfieldID GetStaticFieldID(jclass clazz, const char *name, + const char *sig) { + return functions->GetStaticFieldID(this,clazz,name,sig); + } + jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticObjectField(this,clazz,fieldID); + } + jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticBooleanField(this,clazz,fieldID); + } + jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticByteField(this,clazz,fieldID); + } + jchar GetStaticCharField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticCharField(this,clazz,fieldID); + } + jshort GetStaticShortField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticShortField(this,clazz,fieldID); + } + jint GetStaticIntField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticIntField(this,clazz,fieldID); + } + jlong GetStaticLongField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticLongField(this,clazz,fieldID); + } + jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticFloatField(this,clazz,fieldID); + } + jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticDoubleField(this,clazz,fieldID); + } + + void SetStaticObjectField(jclass clazz, jfieldID fieldID, + jobject value) { + functions->SetStaticObjectField(this,clazz,fieldID,value); + } + void SetStaticBooleanField(jclass clazz, jfieldID fieldID, + jboolean value) { + functions->SetStaticBooleanField(this,clazz,fieldID,value); + } + void SetStaticByteField(jclass clazz, jfieldID fieldID, + jbyte value) { + functions->SetStaticByteField(this,clazz,fieldID,value); + } + void SetStaticCharField(jclass clazz, jfieldID fieldID, + jchar value) { + functions->SetStaticCharField(this,clazz,fieldID,value); + } + void SetStaticShortField(jclass clazz, jfieldID fieldID, + jshort value) { + functions->SetStaticShortField(this,clazz,fieldID,value); + } + void SetStaticIntField(jclass clazz, jfieldID fieldID, + jint value) { + functions->SetStaticIntField(this,clazz,fieldID,value); + } + void SetStaticLongField(jclass clazz, jfieldID fieldID, + jlong value) { + functions->SetStaticLongField(this,clazz,fieldID,value); + } + void SetStaticFloatField(jclass clazz, jfieldID fieldID, + jfloat value) { + functions->SetStaticFloatField(this,clazz,fieldID,value); + } + void SetStaticDoubleField(jclass clazz, jfieldID fieldID, + jdouble value) { + functions->SetStaticDoubleField(this,clazz,fieldID,value); + } + + jstring NewString(const jchar *unicode, jsize len) { + return functions->NewString(this,unicode,len); + } + jsize GetStringLength(jstring str) { + return functions->GetStringLength(this,str); + } + const jchar *GetStringChars(jstring str, jboolean *isCopy) { + return functions->GetStringChars(this,str,isCopy); + } + void ReleaseStringChars(jstring str, const jchar *chars) { + functions->ReleaseStringChars(this,str,chars); + } + + jstring NewStringUTF(const char *utf) { + return functions->NewStringUTF(this,utf); + } + jsize GetStringUTFLength(jstring str) { + return functions->GetStringUTFLength(this,str); + } + const char* GetStringUTFChars(jstring str, jboolean *isCopy) { + return functions->GetStringUTFChars(this,str,isCopy); + } + void ReleaseStringUTFChars(jstring str, const char* chars) { + functions->ReleaseStringUTFChars(this,str,chars); + } + + jsize GetArrayLength(jarray array) { + return functions->GetArrayLength(this,array); + } + + jobjectArray NewObjectArray(jsize len, jclass clazz, + jobject init) { + return functions->NewObjectArray(this,len,clazz,init); + } + jobject GetObjectArrayElement(jobjectArray array, jsize index) { + return functions->GetObjectArrayElement(this,array,index); + } + void SetObjectArrayElement(jobjectArray array, jsize index, + jobject val) { + functions->SetObjectArrayElement(this,array,index,val); + } + + jbooleanArray NewBooleanArray(jsize len) { + return functions->NewBooleanArray(this,len); + } + jbyteArray NewByteArray(jsize len) { + return functions->NewByteArray(this,len); + } + jcharArray NewCharArray(jsize len) { + return functions->NewCharArray(this,len); + } + jshortArray NewShortArray(jsize len) { + return functions->NewShortArray(this,len); + } + jintArray NewIntArray(jsize len) { + return functions->NewIntArray(this,len); + } + jlongArray NewLongArray(jsize len) { + return functions->NewLongArray(this,len); + } + jfloatArray NewFloatArray(jsize len) { + return functions->NewFloatArray(this,len); + } + jdoubleArray NewDoubleArray(jsize len) { + return functions->NewDoubleArray(this,len); + } + + jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) { + return functions->GetBooleanArrayElements(this,array,isCopy); + } + jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) { + return functions->GetByteArrayElements(this,array,isCopy); + } + jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) { + return functions->GetCharArrayElements(this,array,isCopy); + } + jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) { + return functions->GetShortArrayElements(this,array,isCopy); + } + jint * GetIntArrayElements(jintArray array, jboolean *isCopy) { + return functions->GetIntArrayElements(this,array,isCopy); + } + jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) { + return functions->GetLongArrayElements(this,array,isCopy); + } + jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) { + return functions->GetFloatArrayElements(this,array,isCopy); + } + jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) { + return functions->GetDoubleArrayElements(this,array,isCopy); + } + + void ReleaseBooleanArrayElements(jbooleanArray array, + jboolean *elems, + jint mode) { + functions->ReleaseBooleanArrayElements(this,array,elems,mode); + } + void ReleaseByteArrayElements(jbyteArray array, + jbyte *elems, + jint mode) { + functions->ReleaseByteArrayElements(this,array,elems,mode); + } + void ReleaseCharArrayElements(jcharArray array, + jchar *elems, + jint mode) { + functions->ReleaseCharArrayElements(this,array,elems,mode); + } + void ReleaseShortArrayElements(jshortArray array, + jshort *elems, + jint mode) { + functions->ReleaseShortArrayElements(this,array,elems,mode); + } + void ReleaseIntArrayElements(jintArray array, + jint *elems, + jint mode) { + functions->ReleaseIntArrayElements(this,array,elems,mode); + } + void ReleaseLongArrayElements(jlongArray array, + jlong *elems, + jint mode) { + functions->ReleaseLongArrayElements(this,array,elems,mode); + } + void ReleaseFloatArrayElements(jfloatArray array, + jfloat *elems, + jint mode) { + functions->ReleaseFloatArrayElements(this,array,elems,mode); + } + void ReleaseDoubleArrayElements(jdoubleArray array, + jdouble *elems, + jint mode) { + functions->ReleaseDoubleArrayElements(this,array,elems,mode); + } + + void GetBooleanArrayRegion(jbooleanArray array, + jsize start, jsize len, jboolean *buf) { + functions->GetBooleanArrayRegion(this,array,start,len,buf); + } + void GetByteArrayRegion(jbyteArray array, + jsize start, jsize len, jbyte *buf) { + functions->GetByteArrayRegion(this,array,start,len,buf); + } + void GetCharArrayRegion(jcharArray array, + jsize start, jsize len, jchar *buf) { + functions->GetCharArrayRegion(this,array,start,len,buf); + } + void GetShortArrayRegion(jshortArray array, + jsize start, jsize len, jshort *buf) { + functions->GetShortArrayRegion(this,array,start,len,buf); + } + void GetIntArrayRegion(jintArray array, + jsize start, jsize len, jint *buf) { + functions->GetIntArrayRegion(this,array,start,len,buf); + } + void GetLongArrayRegion(jlongArray array, + jsize start, jsize len, jlong *buf) { + functions->GetLongArrayRegion(this,array,start,len,buf); + } + void GetFloatArrayRegion(jfloatArray array, + jsize start, jsize len, jfloat *buf) { + functions->GetFloatArrayRegion(this,array,start,len,buf); + } + void GetDoubleArrayRegion(jdoubleArray array, + jsize start, jsize len, jdouble *buf) { + functions->GetDoubleArrayRegion(this,array,start,len,buf); + } + + void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len, + jboolean *buf) { + functions->SetBooleanArrayRegion(this,array,start,len,buf); + } + void SetByteArrayRegion(jbyteArray array, jsize start, jsize len, + jbyte *buf) { + functions->SetByteArrayRegion(this,array,start,len,buf); + } + void SetCharArrayRegion(jcharArray array, jsize start, jsize len, + jchar *buf) { + functions->SetCharArrayRegion(this,array,start,len,buf); + } + void SetShortArrayRegion(jshortArray array, jsize start, jsize len, + jshort *buf) { + functions->SetShortArrayRegion(this,array,start,len,buf); + } + void SetIntArrayRegion(jintArray array, jsize start, jsize len, + jint *buf) { + functions->SetIntArrayRegion(this,array,start,len,buf); + } + void SetLongArrayRegion(jlongArray array, jsize start, jsize len, + jlong *buf) { + functions->SetLongArrayRegion(this,array,start,len,buf); + } + void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len, + jfloat *buf) { + functions->SetFloatArrayRegion(this,array,start,len,buf); + } + void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len, + jdouble *buf) { + functions->SetDoubleArrayRegion(this,array,start,len,buf); + } + + jint RegisterNatives(jclass clazz, const JNINativeMethod *methods, + jint nMethods) { + return functions->RegisterNatives(this,clazz,methods,nMethods); + } + jint UnregisterNatives(jclass clazz) { + return functions->UnregisterNatives(this,clazz); + } + + jint MonitorEnter(jobject obj) { + return functions->MonitorEnter(this,obj); + } + jint MonitorExit(jobject obj) { + return functions->MonitorExit(this,obj); + } + + jint GetJavaVM(JavaVM **vm) { + return functions->GetJavaVM(this,vm); + } + + void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) { + functions->GetStringRegion(this,str,start,len,buf); + } + void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) { + functions->GetStringUTFRegion(this,str,start,len,buf); + } + + void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) { + return functions->GetPrimitiveArrayCritical(this,array,isCopy); + } + void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) { + functions->ReleasePrimitiveArrayCritical(this,array,carray,mode); + } + + const jchar * GetStringCritical(jstring string, jboolean *isCopy) { + return functions->GetStringCritical(this,string,isCopy); + } + void ReleaseStringCritical(jstring string, const jchar *cstring) { + functions->ReleaseStringCritical(this,string,cstring); + } + + jweak NewWeakGlobalRef(jobject obj) { + return functions->NewWeakGlobalRef(this,obj); + } + void DeleteWeakGlobalRef(jweak ref) { + functions->DeleteWeakGlobalRef(this,ref); + } + + jboolean ExceptionCheck() { + return functions->ExceptionCheck(this); + } + + jobject NewDirectByteBuffer(void* address, jlong capacity) { + return functions->NewDirectByteBuffer(this, address, capacity); + } + void* GetDirectBufferAddress(jobject buf) { + return functions->GetDirectBufferAddress(this, buf); + } + jlong GetDirectBufferCapacity(jobject buf) { + return functions->GetDirectBufferCapacity(this, buf); + } + +#endif /* __cplusplus */ +}; + +typedef struct JavaVMOption { + char *optionString; + void *extraInfo; +} JavaVMOption; + +typedef struct JavaVMInitArgs { + jint version; + + jint nOptions; + JavaVMOption *options; + jboolean ignoreUnrecognized; +} JavaVMInitArgs; + +typedef struct JavaVMAttachArgs { + jint version; + + char *name; + jobject group; +} JavaVMAttachArgs; + +/* These structures will be VM-specific. */ + +typedef struct JDK1_1InitArgs { + jint version; + + char **properties; + jint checkSource; + jint nativeStackSize; + jint javaStackSize; + jint minHeapSize; + jint maxHeapSize; + jint verifyMode; + char *classpath; + + jint (JNICALL *vfprintf)(FILE *fp, const char *format, va_list args); + void (JNICALL *exit)(jint code); + void (JNICALL *abort)(void); + + jint enableClassGC; + jint enableVerboseGC; + jint disableAsyncGC; + jint verbose; + jboolean debugging; + jint debugPort; +} JDK1_1InitArgs; + +typedef struct JDK1_1AttachArgs { + void * __padding; /* C compilers don't allow empty structures. */ +} JDK1_1AttachArgs; + +#define JDK1_2 +#define JDK1_4 + +/* End VM-specific. */ + +struct JNIInvokeInterface_ { + void *reserved0; + void *reserved1; + void *reserved2; + + jint (JNICALL *DestroyJavaVM)(JavaVM *vm); + + jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args); + + jint (JNICALL *DetachCurrentThread)(JavaVM *vm); + + jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version); + + jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args); +}; + +struct JavaVM_ { + const struct JNIInvokeInterface_ *functions; +#ifdef __cplusplus + + jint DestroyJavaVM() { + return functions->DestroyJavaVM(this); + } + jint AttachCurrentThread(void **penv, void *args) { + return functions->AttachCurrentThread(this, penv, args); + } + jint DetachCurrentThread() { + return functions->DetachCurrentThread(this); + } + + jint GetEnv(void **penv, jint version) { + return functions->GetEnv(this, penv, version); + } + jint AttachCurrentThreadAsDaemon(void **penv, void *args) { + return functions->AttachCurrentThreadAsDaemon(this, penv, args); + } +#endif +}; + +#ifdef _JNI_IMPLEMENTATION_ +#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT +#else +#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT +#endif +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_GetDefaultJavaVMInitArgs(void *args); + +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args); + +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); + +/* Defined by native libraries. */ +JNIEXPORT jint JNICALL +JNI_OnLoad(JavaVM *vm, void *reserved); + +JNIEXPORT void JNICALL +JNI_OnUnload(JavaVM *vm, void *reserved); + +#define JNI_VERSION_1_1 0x00010001 +#define JNI_VERSION_1_2 0x00010002 +#define JNI_VERSION_1_4 0x00010004 + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* JNI_H */ + + diff -Nru libbluray-0.5.0/jni/linux/jni_md.h libbluray-0.6.2/jni/linux/jni_md.h --- libbluray-0.5.0/jni/linux/jni_md.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/jni/linux/jni_md.h 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Java Runtime Interface. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation and Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 1993-1996 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Jean-Baptiste Kempf + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef _JNI_MD_H_ +#define _JNI_MD_H_ + +#define JNIEXPORT +#define JNIIMPORT +#define JNICALL + +typedef int jint; +#ifdef __LP64__ +typedef long jlong; +#else +typedef long long jlong; +#endif + +typedef signed char jbyte; + +#endif /* !_JNI_MD_H_ */ diff -Nru libbluray-0.5.0/jni/win32/jni_md.h libbluray-0.6.2/jni/win32/jni_md.h --- libbluray-0.5.0/jni/win32/jni_md.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/jni/win32/jni_md.h 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Java Runtime Interface. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation and Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 1993-1996 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Jean-Baptiste Kempf + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef _JNI_MD_H_ +#define _JNI_MD_H_ + +#define JNIEXPORT __declspec(dllexport) +#define JNIIMPORT __declspec(dllimport) +#define JNICALL __stdcall + +typedef long jint; +typedef signed __int64 jlong; +typedef signed char jbyte; + +#endif /* !_JNI_MD_H_ */ diff -Nru libbluray-0.5.0/m4/libtool.m4 libbluray-0.6.2/m4/libtool.m4 --- libbluray-0.5.0/m4/libtool.m4 2013-12-21 08:35:37.000000000 +0000 +++ libbluray-0.6.2/m4/libtool.m4 2014-09-03 08:21:18.000000000 +0000 @@ -1312,7 +1312,7 @@ rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -1333,7 +1333,10 @@ ;; esac ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1352,7 +1355,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) diff -Nru libbluray-0.5.0/Makefile.am libbluray-0.6.2/Makefile.am --- libbluray-0.5.0/Makefile.am 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/Makefile.am 2014-09-01 12:06:01.000000000 +0000 @@ -6,6 +6,12 @@ EXTRA_DIST=bootstrap doc COPYING player_wrappers README.txt ChangeLog +noinst_HEADERS=\ + jni/jni.h \ + jni/linux/jni_md.h \ + jni/win32/jni_md.h \ + jni/darwin/jni_md.h + MOSTLYCLEANFILES = $(DX_CLEANFILES) DISTCHECK_CONFIGURE_FLAGS = --enable-bdjava diff -Nru libbluray-0.5.0/Makefile.in libbluray-0.6.2/Makefile.in --- libbluray-0.5.0/Makefile.in 2013-12-21 08:36:05.000000000 +0000 +++ libbluray-0.6.2/Makefile.in 2014-09-03 10:23:51.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -56,24 +55,53 @@ # DX_CLEANFILES = everything to clean. # # Then add this variable to MOSTLYCLEANFILES. + VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -92,13 +120,19 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure $(top_srcdir)/doxygen-include.am \ - $(top_srcdir)/src/libbluray/bluray-version.h.in COPYING \ - ChangeLog build-aux/compile build-aux/config.guess \ - build-aux/config.sub build-aux/depcomp build-aux/install-sh \ - build-aux/ltmain.sh build-aux/missing +DIST_COMMON = $(top_srcdir)/doxygen-include.am $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(srcdir)/config.h.in \ + $(top_srcdir)/src/libbluray/bluray-version.h.in \ + $(noinst_HEADERS) COPYING ChangeLog build-aux/compile \ + build-aux/config.guess build-aux/config.sub build-aux/depcomp \ + build-aux/install-sh build-aux/missing build-aux/ltmain.sh \ + $(top_srcdir)/build-aux/compile \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/ltmain.sh \ + $(top_srcdir)/build-aux/missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \ @@ -115,27 +149,63 @@ CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = src/libbluray/bluray-version.h CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) @@ -146,6 +216,7 @@ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi +am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -173,12 +244,14 @@ reldir="$$dir2" GZIP_ENV = --best DIST_ARCHIVES = $(distdir).tar.bz2 +DIST_TARGETS = dist-bzip2 distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -235,6 +308,7 @@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_LIBS = @FT2_LIBS@ GREP = @GREP@ +HAVE_ANT = @HAVE_ANT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -348,6 +422,12 @@ SUBDIRS = src ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = bootstrap doc COPYING player_wrappers README.txt ChangeLog +noinst_HEADERS = \ + jni/jni.h \ + jni/linux/jni_md.h \ + jni/win32/jni_md.h \ + jni/darwin/jni_md.h + MOSTLYCLEANFILES = $(DX_CLEANFILES) DISTCHECK_CONFIGURE_FLAGS = --enable-bdjava all: config.h @@ -391,8 +471,8 @@ $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -417,22 +497,25 @@ -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -447,57 +530,12 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -513,12 +551,7 @@ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -530,15 +563,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -547,9 +576,31 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) @@ -617,39 +668,41 @@ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) + $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -660,8 +713,6 @@ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ @@ -673,18 +724,19 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod u+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -707,7 +759,7 @@ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' @@ -739,7 +791,7 @@ exit 1; } >&2 check-am: all-am check: check-recursive -all-am: Makefile config.h +all-am: Makefile $(HEADERS) config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive @@ -843,24 +895,24 @@ uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ - ctags-recursive install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) all install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-generic \ - clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-generic distclean-hdr \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-recursive uninstall uninstall-am +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am @DX_COND_doc_TRUE@@DX_COND_ps_TRUE@doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps diff -Nru libbluray-0.5.0/src/examples/bd_info.c libbluray-0.6.2/src/examples/bd_info.c --- libbluray-0.5.0/src/examples/bd_info.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/examples/bd_info.c 2014-09-01 12:06:01.000000000 +0000 @@ -120,6 +120,31 @@ } } +static void _print_app_info(const BLURAY_DISC_INFO *info) +{ + static const char video_format_str[16][8] = { + "ignored", "480i", "576i", "480p", "1080i", "720p", "1080p", "576p" + }; + + static const char frame_rate_str[16][16] = { + "ignored", + "23.976 Hz", + "24 Hz", + "25 Hz", + "29.97 Hz", + "reserved", + "50 Hz", + "59.94 Hz" + }; + + printf("\nApplication info:\n"); + printf(" initial mode preference : %s\n", info->initial_output_mode_preference ? "3D" : "2D"); + printf(" 3D content exists : %s\n", info->content_exist_3D ? "Yes" : "No"); + printf(" video format : %s (0x%x)\n", video_format_str[info->video_format & 0xf], info->video_format); + printf(" frame rate : %s (0x%x)\n", frame_rate_str[info->frame_rate & 0xf], info->frame_rate); + printf(" provider data : \'%32s\'\n", info->provider_data); +} + int main(int argc, char *argv[]) { const char *disc_root = (argc > 1) ? argv[1] : NULL; @@ -192,6 +217,8 @@ } } + _print_app_info(info); + _print_meta(bd_get_meta(bd)); bd_close(bd); diff -Nru libbluray-0.5.0/src/examples/bdj_test.c libbluray-0.6.2/src/examples/bdj_test.c --- libbluray-0.5.0/src/examples/bdj_test.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/examples/bdj_test.c 2014-09-01 12:06:01.000000000 +0000 @@ -53,7 +53,6 @@ BLURAY* bd = bd_open(argv[1], NULL); bd_get_titles(bd, TITLES_ALL, 0); - bd_select_title(bd, 1); if (!bd_start_bdj(bd, argv[2])) { printf("Failed to start BD-J application.\n"); diff -Nru libbluray-0.5.0/src/examples/index_dump.c libbluray-0.6.2/src/examples/index_dump.c --- libbluray-0.5.0/src/examples/index_dump.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/examples/index_dump.c 2014-09-01 12:06:01.000000000 +0000 @@ -17,110 +17,76 @@ * . */ -#include "libbluray/bdnav/index_parse.h" +#include "libbluray/bluray.h" #include -static void _indx_print_app_info(INDX_APP_INFO *app_info) +static void _indx_print_title(const BLURAY_TITLE *title, int normal_title) { - const char video_format_str[16][8] = { - "ignored", "480i", "576i", "480p", "1080i", "720p", "1080p", "576p" - }; - - const char frame_rate_str[16][16] = { - "ignored", - "23.976 Hz", - "24 Hz", - "25 Hz", - "29.97 Hz", - "reserved", - "50 Hz", - "59.94 Hz" - }; - - printf(" initial mode : %s\n", app_info->initial_output_mode_preference ? "3D" : "2D"); - printf(" content exists: %s\n", app_info->content_exist_flag ? "Yes" : "No"); - printf(" video format : %s (0x%x)\n", video_format_str[app_info->video_format], app_info->video_format); - printf(" frame rate : %s (0x%x)\n", frame_rate_str[app_info->frame_rate], app_info->frame_rate); - printf(" provider data : %32s\n", app_info->user_data); -} - -static void _indx_print_hdmv_obj(INDX_HDMV_OBJ *hdmv) -{ - const char *const playback_types[] = {"Movie", "Interactive", "???", "???"}; - - printf(" object type : HDMV\n"); - printf(" playback type : %s\n", playback_types[hdmv->playback_type]); - printf(" id_ref : %u\n", hdmv->id_ref); -} - -static void _indx_print_bdj_obj(INDX_BDJ_OBJ *bdj) -{ - const char * const playback_types[] = {"???", "???", "Movie", "Interactive"}; + printf(" object type : %s\n", title->bdj ? "BD-J" : "HDMV"); + printf(" playback type : %s\n", title->interactive ? "Interactive" : "Movie"); + printf(title->bdj ? + " name : %05d.bdjo\n" : + " id_ref : %u\n", + title->id_ref); - printf(" object type : BD-J\n"); - printf(" playback type : %s\n", playback_types[bdj->playback_type]); - printf(" name : %s\n", bdj->name); -} - -static void _indx_print_play_item(INDX_PLAY_ITEM *title) -{ - if (title->object_type == 1) { - _indx_print_hdmv_obj(&title->hdmv); - } else { - _indx_print_bdj_obj(&title->bdj); + if (normal_title) { + printf(" access type : %s%s\n", title->accessible ? "Accessible" : "Prohibited", title->hidden ? ", Hidden" : ""); } } -static void _indx_print_title(INDX_TITLE *title) -{ - if (title->object_type == 1) { - _indx_print_hdmv_obj(&title->hdmv); - } else { - _indx_print_bdj_obj(&title->bdj); - } - printf(" access type : %d\n", title->access_type); -} - -static void _indx_print(INDX_ROOT *index) +static void _indx_print(const BLURAY_DISC_INFO *info) { uint32_t i; - printf("Application info:\n"); - _indx_print_app_info(&index->app_info); - printf("\nFirst playback:\n"); - _indx_print_play_item(&index->first_play); + if (info->first_play) { + _indx_print_title(info->first_play, 0); + } else { + printf(" (not present)\n"); + } printf("\nTop menu:\n"); - _indx_print_play_item(&index->top_menu); + if (info->top_menu) { + _indx_print_title(info->titles[0], 0); + } else { + printf(" (not present)\n"); + } - printf("\nTitles: %d\n", index->num_titles); - for (i = 0; i < index->num_titles; i++) { - printf("%02d", i); - _indx_print_title(&index->titles[i]); + printf("\nTitles: %d\n", info->num_titles); + for (i = 1; i <= info->num_titles; i++) { + printf("%02d %s\n", i, info->titles[i]->name ? info->titles[i]->name : ""); + _indx_print_title(info->titles[i], 1); } } int main(int argc, const char *argv[]) { - char file[1024]; - INDX_ROOT *index; + BLURAY *bd; + const BLURAY_DISC_INFO *info; if (argc != 2) { fprintf(stderr, "usage: %s \n", argv[0]); return 1; } - sprintf(file, "%s/BDMV/index.bdmv", argv[1]); - - index = indx_parse(file); + bd = bd_open(argv[1], NULL); + if (!bd) { + fprintf(stderr, "error opening BD disc %s\n", argv[1]); + return -1; + } - if (index) { - _indx_print(index); + info = bd_get_disc_info(bd); - indx_free(&index); + if (!info->bluray_detected) { + fprintf(stderr, "no BD disc detected in %s\n", argv[1]); + bd_close(bd); + return -1; } + _indx_print(info); + + bd_close(bd); + return 0; } diff -Nru libbluray-0.5.0/src/examples/mobj_dump.c libbluray-0.6.2/src/examples/mobj_dump.c --- libbluray-0.5.0/src/examples/mobj_dump.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/examples/mobj_dump.c 2014-09-01 12:06:01.000000000 +0000 @@ -53,7 +53,6 @@ int main(int argc, const char *argv[]) { - char file[1024]; int disasm = 0; MOBJ_OBJECTS *mobj = NULL; @@ -69,9 +68,7 @@ disasm = !strcmp(argv[1], "-d"); } - sprintf(file, "%s/BDMV/MovieObject.bdmv", argv[argc-1]); - - mobj = mobj_parse(file); + mobj = mobj_parse(argv[argc-1]); if (mobj) { _mobj_print(mobj, disasm); diff -Nru libbluray-0.5.0/src/examples/mpls_dump.c libbluray-0.6.2/src/examples/mpls_dump.c --- libbluray-0.5.0/src/examples/mpls_dump.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/examples/mpls_dump.c 2014-09-01 12:06:01.000000000 +0000 @@ -28,6 +28,7 @@ #include "util/strutl.h" #include "libbluray/bdnav/mpls_parse.h" +#include "libbluray/bluray.h" #include "util.h" @@ -126,6 +127,12 @@ {0, NULL} }; +const VALUE_MAP connection_type_map[] = { + {0, "Non-seamless"}, + {1, "Seamless"}, + {0, NULL} +}; + static const char* _lookup_str(const VALUE_MAP *map, int val) { @@ -222,8 +229,9 @@ pi = &pl->play_item[ii]; indent_printf(level, "Clip Id %s", pi->clip[0].clip_id); indent_printf(level+1, "Stc Id: %02x", pi->clip[0].stc_id); - indent_printf(level+1, "Connection Condition: %02x", - pi->connection_condition); + indent_printf(level+1, "Connection Condition: %s (%02x)", + _lookup_str(connection_type_map, pi->connection_condition), + pi->connection_condition); indent_printf(level+1, "In-Time: %d", pi->in_time); indent_printf(level+1, "Out-Time: %d", pi->out_time); if (pi->still_mode == 1) { @@ -368,7 +376,9 @@ indent_printf(level+2, "Clip Id %s", pi->clip[0].clip_id); indent_printf(level+2, "Multi clip: %d", pi->is_multi_clip); indent_printf(level+2, "Clip count: %d", pi->clip_count); - indent_printf(level+2, "Connection Condition: %02x", pi->connection_condition); + indent_printf(level+2, "Connection Condition: %s (%02x)", + _lookup_str(connection_type_map, pi->connection_condition), + pi->connection_condition); indent_printf(level+2, "In-Time: %d", pi->in_time); indent_printf(level+2, "Out-Time: %d", pi->out_time); indent_printf(level+2, "Sync playitem Id: %d", pi->sync_play_item_id); @@ -543,26 +553,26 @@ { MPLS_PL *pl; - pl = mpls_parse(name); + pl = bd_read_mpls(name); if (pl == NULL) { fprintf(stderr, "Parse failed: %s\n", name); return NULL; } if (seconds) { if (!_filter_short(pl, seconds)) { - mpls_free(pl); + bd_free_mpls(pl); return NULL; } } if (repeats) { if (!_filter_repeats(pl, repeats)) { - mpls_free(pl); + bd_free_mpls(pl); return NULL; } } if (dups) { if (!_filter_dup(pl_list, pl_count, pl)) { - mpls_free(pl); + bd_free_mpls(pl); return NULL; } } @@ -727,9 +737,7 @@ struct dirent *ent; int jj = 0; for (ent = readdir(dir); ent != NULL; ent = readdir(dir)) { - if (ent->d_name != NULL) { dirlist[jj++] = str_dup(ent->d_name); - } } qsort(dirlist, jj, sizeof(char*), _qsort_str_cmp); for (jj = 0; dirlist[jj] != NULL; jj++) { @@ -749,7 +757,7 @@ if (pl != NULL) { pl_list[pl_ii++] = pl; } - } while (ent != NULL); + } free(dirlist); free(path); } else { @@ -761,7 +769,7 @@ } // Cleanup for (ii = 0; ii < pl_ii; ii++) { - mpls_free(pl_list[ii]); + bd_free_mpls(pl_list[ii]); } return 0; } diff -Nru libbluray-0.5.0/src/examples/util.h libbluray-0.6.2/src/examples/util.h --- libbluray-0.5.0/src/examples/util.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/examples/util.h 2014-09-01 12:06:01.000000000 +0000 @@ -19,7 +19,7 @@ #include -#include "../util/attributes.h" +#include "util/attributes.h" #if defined( __MINGW32__ ) # undef lseek diff -Nru libbluray-0.5.0/src/file/dir_posix.c libbluray-0.6.2/src/file/dir_posix.c --- libbluray-0.5.0/src/file/dir_posix.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/file/dir_posix.c 2014-09-01 12:06:01.000000000 +0000 @@ -54,7 +54,8 @@ } else if (p_e == NULL) { return 1; } - strncpy(entry->d_name, e.d_name, 256); + strncpy(entry->d_name, e.d_name, sizeof(entry->d_name)); + entry->d_name[sizeof(entry->d_name) - 1] = 0; return 0; } diff -Nru libbluray-0.5.0/src/file/dirs.h libbluray-0.6.2/src/file/dirs.h --- libbluray-0.5.0/src/file/dirs.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/file/dirs.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #ifndef BLURAY_DIRS_H #define BLURAY_DIRS_H -#include +#include "util/attributes.h" #ifdef _WIN32 BD_PRIVATE int win32_mkdir(const char *dir); diff -Nru libbluray-0.5.0/src/file/dl.h libbluray-0.6.2/src/file/dl.h --- libbluray-0.5.0/src/file/dl.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/file/dl.h 2014-09-01 12:06:01.000000000 +0000 @@ -21,7 +21,7 @@ #ifndef DL_H_ #define DL_H_ -#include +#include "util/attributes.h" #include diff -Nru libbluray-0.5.0/src/file/file.c libbluray-0.6.2/src/file/file.c --- libbluray-0.5.0/src/file/file.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/file/file.c 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "file.h" + +#include + +int64_t file_size(BD_FILE_H *fp) +{ + int64_t pos = file_tell(fp); + int64_t res1 = file_seek(fp, 0, SEEK_END); + int64_t length = file_tell(fp); + int64_t res2 = file_seek(fp, pos, SEEK_SET); + + if (res1 < 0 || res2 < 0 || pos < 0 || length < 0) { + return -1; + } + + return length; +} diff -Nru libbluray-0.5.0/src/file/file.h libbluray-0.6.2/src/file/file.h --- libbluray-0.5.0/src/file/file.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/file/file.h 2014-09-01 12:06:01.000000000 +0000 @@ -23,13 +23,17 @@ #include "filesystem.h" -#include +#include "util/attributes.h" #include -//#ifdef __LINUX__ -#define DIR_SEP "/" -//#endif +#ifdef _WIN32 +# define DIR_SEP "\\" +# define DIR_SEP_CHAR '\\' +#else +# define DIR_SEP "/" +# define DIR_SEP_CHAR '/' +#endif /* * file access @@ -38,7 +42,7 @@ #define file_close(X) X->close(X) #define file_seek(X,Y,Z) X->seek(X,Y,Z) #define file_tell(X) X->tell(X) -#define file_eof(X) X->eof(X) +//#define file_eof(X) X->eof(X) #define file_read(X,Y,Z) (size_t)X->read(X,Y,Z) #define file_write(X,Y,Z) (size_t)X->write(X,Y,Z) BD_PRIVATE int64_t file_size(BD_FILE_H *fp); diff -Nru libbluray-0.5.0/src/file/file_posix.c libbluray-0.6.2/src/file/file_posix.c --- libbluray-0.5.0/src/file/file_posix.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/file/file_posix.c 2014-09-01 12:06:01.000000000 +0000 @@ -22,11 +22,6 @@ #include "config.h" #endif -#if defined(__MINGW32__) -/* ftello64() and fseeko64() prototypes from stdio.h */ -# undef __STRICT_ANSI__ -#endif - #include "file.h" #include "util/macro.h" #include "util/logging.h" @@ -35,10 +30,6 @@ #include #include -#ifdef _WIN32 -#include -#endif // #ifdef _WIN32 - static void file_close_linux(BD_FILE_H *file) { if (file) { @@ -52,24 +43,12 @@ static int64_t file_seek_linux(BD_FILE_H *file, int64_t offset, int32_t origin) { -#if defined(__MINGW32__) - return fseeko64((FILE *)file->internal, offset, origin); -#elif defined(_WIN32) - return _fseeki64((FILE *)file->internal, offset, origin); -#else return fseeko((FILE *)file->internal, offset, origin); -#endif } static int64_t file_tell_linux(BD_FILE_H *file) { -#if defined(__MINGW32__) - return ftello64((FILE *)file->internal); -#elif defined(_WIN32) - return _ftelli64((FILE *)file->internal); -#else return ftello((FILE *)file->internal); -#endif } static int file_eof_linux(BD_FILE_H *file) @@ -77,8 +56,6 @@ return feof((FILE *)file->internal); } -#define BD_MAX_SSIZE ((int64_t)(((size_t)-1)>>1)) - static int64_t file_read_linux(BD_FILE_H *file, uint8_t *buf, int64_t size) { if (size > 0 && size < BD_MAX_SSIZE) { @@ -112,14 +89,7 @@ file->tell = file_tell_linux; file->eof = file_eof_linux; -#ifdef _WIN32 - wchar_t wfilename[MAX_PATH], wmode[8]; - if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename, -1, wfilename, MAX_PATH) && - MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, mode, -1, wmode, 8) && - (fp = _wfopen(wfilename, wmode))) { -#else if ((fp = fopen(filename, mode))) { -#endif file->internal = fp; return file; @@ -138,21 +108,3 @@ { return file_open_linux; } - -/* - * - */ - -int64_t file_size(BD_FILE_H *fp) -{ - int64_t pos = file_tell(fp); - int64_t res1 = file_seek(fp, 0, SEEK_END); - int64_t length = file_tell(fp); - int64_t res2 = file_seek(fp, pos, SEEK_SET); - - if (res1 < 0 || res2 < 0 || pos < 0 || length < 0) { - return -1; - } - - return length; -} diff -Nru libbluray-0.5.0/src/file/file_win32.c libbluray-0.6.2/src/file/file_win32.c --- libbluray-0.5.0/src/file/file_win32.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/file/file_win32.c 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,125 @@ +/* + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#if defined(__MINGW32__) +/* ftello64() and fseeko64() prototypes from stdio.h */ +# undef __STRICT_ANSI__ +#endif + +#include "file.h" +#include "util/macro.h" +#include "util/logging.h" + +#include +#include +#include + +#include + +static void _file_close(BD_FILE_H *file) +{ + if (file) { + fclose((FILE *)file->internal); + + BD_DEBUG(DBG_FILE, "Closed WIN32 file (%p)\n", (void*)file); + + X_FREE(file); + } +} + +static int64_t _file_seek(BD_FILE_H *file, int64_t offset, int32_t origin) +{ +#if defined(__MINGW32__) + return fseeko64((FILE *)file->internal, offset, origin); +#else + return _fseeki64((FILE *)file->internal, offset, origin); +#endif +} + +static int64_t _file_tell(BD_FILE_H *file) +{ +#if defined(__MINGW32__) + return ftello64((FILE *)file->internal); +#else + return _ftelli64((FILE *)file->internal); +#endif +} + +static int _file_eof(BD_FILE_H *file) +{ + return feof((FILE *)file->internal); +} + +static int64_t _file_read(BD_FILE_H *file, uint8_t *buf, int64_t size) +{ + if (size > 0 && size < BD_MAX_SSIZE) { + return (int64_t)fread(buf, 1, (size_t)size, (FILE *)file->internal); + } + + BD_DEBUG(DBG_FILE | DBG_CRIT, "Ignoring invalid read of size %"PRId64" (%p)\n", size, (void*)file); + return 0; +} + +static int64_t _file_write(BD_FILE_H *file, const uint8_t *buf, int64_t size) +{ + if (size > 0 && size < BD_MAX_SSIZE) { + return (int64_t)fwrite(buf, 1, (size_t)size, (FILE *)file->internal); + } + + BD_DEBUG(DBG_FILE | DBG_CRIT, "Ignoring invalid write of size %"PRId64" (%p)\n", size, (void*)file); + return 0; +} + +static BD_FILE_H *_file_open(const char* filename, const char *mode) +{ + FILE *fp = NULL; + + wchar_t wfilename[MAX_PATH], wmode[8]; + if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename, -1, wfilename, MAX_PATH) && + MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, mode, -1, wmode, 8) && + (fp = _wfopen(wfilename, wmode))) { + + BD_FILE_H *file = malloc(sizeof(BD_FILE_H)); + file->internal = fp; + file->close = _file_close; + file->seek = _file_seek; + file->read = _file_read; + file->write = _file_write; + file->tell = _file_tell; + file->eof = _file_eof; + + BD_DEBUG(DBG_FILE, "Opened WIN32 file %s (%p)\n", filename, (void*)file); + return file; + } + + BD_DEBUG(DBG_FILE, "Error opening file %s\n", filename); + return NULL; +} + +BD_FILE_H* (*file_open)(const char* filename, const char *mode) = _file_open; + +BD_FILE_OPEN file_open_default(void) +{ + return _file_open; +} diff -Nru libbluray-0.5.0/src/file/libaacs.c libbluray-0.6.2/src/file/libaacs.c --- libbluray-0.5.0/src/file/libaacs.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/file/libaacs.c 2014-09-01 12:06:01.000000000 +0000 @@ -275,7 +275,7 @@ switch (type) { case BD_AACS_DISC_ID: - return p ? p->disc_id : NULL; + return p->disc_id; case BD_AACS_MEDIA_VID: return _get_vid(p); diff -Nru libbluray-0.5.0/src/file/libaacs.h libbluray-0.6.2/src/file/libaacs.h --- libbluray-0.5.0/src/file/libaacs.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/file/libaacs.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #ifndef _BD_LIBAACS_H_ #define _BD_LIBAACS_H_ -#include +#include "util/attributes.h" #include diff -Nru libbluray-0.5.0/src/file/libbdplus.h libbluray-0.6.2/src/file/libbdplus.h --- libbluray-0.5.0/src/file/libbdplus.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/file/libbdplus.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #ifndef _BD_LIBBDPLUS_H_ #define _BD_LIBBDPLUS_H_ -#include +#include "util/attributes.h" #include diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdj.c libbluray-0.6.2/src/libbluray/bdj/bdj.c --- libbluray-0.5.0/src/libbluray/bdj/bdj.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/bdj.c 2014-09-01 12:06:01.000000000 +0000 @@ -48,11 +48,12 @@ #endif typedef jint (JNICALL * fptr_JNI_CreateJavaVM) (JavaVM **pvm, void **penv,void *args); +typedef jint (JNICALL * fptr_JNI_GetCreatedJavaVMs) (JavaVM **vmBuf, jsize bufLen, jsize *nVMs); #if defined(_WIN32) && !defined(HAVE_BDJ_J2ME) static void *_load_jvm_win32(const char **p_java_home) { - static const char *java_home = NULL; + static char java_home[256] = ""; wchar_t buf_loc[4096] = L"SOFTWARE\\JavaSoft\\Java Runtime Environment\\"; wchar_t buf_vers[128]; @@ -94,9 +95,9 @@ if (r == ERROR_SUCCESS) { /* do not fail even if not found */ - WideCharToMultiByte(CP_UTF8, 0, buf_loc, -1, strbuf, sizeof(strbuf), NULL, NULL); - *p_java_home = java_home = str_dup(strbuf); - BD_DEBUG(DBG_BDJ, "JavaHome: %s\n", strbuf); + WideCharToMultiByte(CP_UTF8, 0, buf_loc, -1, java_home, sizeof(java_home), NULL, NULL); + *p_java_home = java_home; + BD_DEBUG(DBG_BDJ, "JavaHome: %s\n", java_home); } dSize = sizeof(buf_loc); @@ -125,12 +126,12 @@ { if (java_home) { char *path = str_printf("%s/%s/%s", java_home, jvm_dir, jvm_lib); - BD_DEBUG(DBG_BDJ|DBG_CRIT, "Opening %s ...\n", path); + BD_DEBUG(DBG_BDJ, "Opening %s ...\n", path); void *h = dl_dlopen(path, NULL); X_FREE(path); return h; } else { - BD_DEBUG(DBG_BDJ|DBG_CRIT, "Opening %s ...\n", jvm_lib); + BD_DEBUG(DBG_BDJ, "Opening %s ...\n", jvm_lib); return dl_dlopen(jvm_lib, NULL); } } @@ -153,7 +154,11 @@ static const char jvm_dir[] = "jre/bin/server"; static const char jvm_lib[] = "jvm"; # else - static const char *jvm_path[] = {NULL, JDK_HOME, "/usr/lib/jvm/default-java/"}; + static const char *jvm_path[] = {NULL, JDK_HOME, + "/usr/lib/jvm/default-java", + "/usr/lib/jvm/java-6-openjdk", + "/usr/lib/jvm/java-7-openjdk", + "/etc/java-config-2/current-system-vm"}; static const char jvm_dir[] = "jre/lib/" JAVA_ARCH "/server"; static const char jvm_lib[] = "libjvm"; # endif @@ -176,7 +181,7 @@ } #endif - BD_DEBUG(DBG_BDJ | DBG_CRIT, "JAVA_HOME not set, trying default locations\n"); + BD_DEBUG(DBG_BDJ, "JAVA_HOME not set, trying default locations\n"); /* try our pre-defined locations */ for (path_ind = 0; !handle && path_ind < sizeof(jvm_path) / sizeof(jvm_path[0]); path_ind++) { @@ -198,8 +203,7 @@ #ifdef _WIN32 "" BDJ_JARFILE, #else - "/usr/lib/libbluray/" BDJ_JARFILE, - "/usr/share/libbluray/" BDJ_JARFILE, + "/usr/share/java/" BDJ_JARFILE, #endif }; @@ -308,7 +312,7 @@ jclass init_class; jmethodID init_id; if (!bdj_get_method(env, &init_class, &init_id, - "org/videolan/Libbluray", "init", "(JLjava/lang/String;)V")) { + "org/videolan/Libbluray", "init", "(JLjava/lang/String;Ljava/lang/String;)V")) { return 0; } @@ -317,8 +321,9 @@ jlong param_bdjava_ptr = (jlong)(intptr_t) bdjava; jstring param_disc_id = (*env)->NewStringUTF(env, id ? id->disc_id : "00000000000000000000000000000000"); + jstring param_disc_root = (*env)->NewStringUTF(env, bdjava->path); (*env)->CallStaticVoidMethod(env, init_class, init_id, - param_bdjava_ptr, param_disc_id); + param_bdjava_ptr, param_disc_id, param_disc_root); if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionDescribe(env); @@ -327,8 +332,9 @@ (*env)->DeleteLocalRef(env, init_class); (*env)->DeleteLocalRef(env, param_disc_id); + (*env)->DeleteLocalRef(env, param_disc_root); - free(id_path); + X_FREE(id_path); bdid_free(&id); return 1; @@ -356,41 +362,40 @@ return 2; } -BDJAVA* bdj_open(const char *path, struct bluray *bd, - struct indx_root_s *index, - bdj_overlay_cb osd_cb, struct bd_argb_buffer_s *buf) +static int _find_jvm(void *jvm_lib, JNIEnv **env, JavaVM **jvm) { - BD_DEBUG(DBG_BDJ, "bdj_open()\n"); + fptr_JNI_GetCreatedJavaVMs JNI_GetCreatedJavaVMs_fp = (fptr_JNI_GetCreatedJavaVMs)(intptr_t)dl_dlsym(jvm_lib, "JNI_GetCreatedJavaVMs"); + if (JNI_GetCreatedJavaVMs_fp == NULL) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Couldn't find symbol JNI_GetCreatedJavaVMs.\n"); + return 0; + } - // first load the jvm using dlopen - const char *java_home = NULL; - void* jvm_lib = _load_jvm(&java_home); + jsize nVMs = 0; + JavaVM* javavm = NULL; - if (!jvm_lib) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Wasn't able to load JVM\n"); - return NULL; + int result = JNI_GetCreatedJavaVMs_fp(&javavm, 1, &nVMs); + if (result == JNI_OK && nVMs > 0) { + *jvm = javavm; + (**jvm)->AttachCurrentThread(*jvm, (void**)env, NULL); + return 1; } - fptr_JNI_CreateJavaVM JNI_CreateJavaVM_fp = (fptr_JNI_CreateJavaVM)(intptr_t)dl_dlsym(jvm_lib, "JNI_CreateJavaVM"); + return 0; +} + +static int _create_jvm(void *jvm_lib, const char *java_home, JNIEnv **env, JavaVM **jvm) +{ + (void)java_home; /* used only with J2ME */ + fptr_JNI_CreateJavaVM JNI_CreateJavaVM_fp = (fptr_JNI_CreateJavaVM)(intptr_t)dl_dlsym(jvm_lib, "JNI_CreateJavaVM"); if (JNI_CreateJavaVM_fp == NULL) { - dl_dlclose(jvm_lib); BD_DEBUG(DBG_BDJ | DBG_CRIT, "Couldn't find symbol JNI_CreateJavaVM.\n"); - return NULL; + return 0; } - BDJAVA* bdjava = calloc(1, sizeof(BDJAVA)); - bdjava->bd = bd; - bdjava->index = index; - bdjava->path = path; - bdjava->h_libjvm = jvm_lib; - bdjava->osd_cb = osd_cb; - bdjava->buf = buf; - JavaVMOption* option = calloc(1, sizeof(JavaVMOption) * 20); int n = 0; JavaVMInitArgs args; - option[n++].optionString = str_printf("-Dbluray.vfs.root=%s", path); option[n++].optionString = str_printf("-Ddvb.persistent.root=%s", _bdj_persistent_root()); option[n++].optionString = str_printf("-Dbluray.bindingunit.root=%s", _bdj_buda_root()); @@ -431,106 +436,64 @@ args.options = option; args.ignoreUnrecognized = JNI_FALSE; // don't ignore unrecognized options - JNIEnv* env = NULL; - int result = JNI_CreateJavaVM_fp(&bdjava->jvm, (void**) &env, &args); - -// while (n) { -// X_FREE(option[--n].optionString); -// } + int result = JNI_CreateJavaVM_fp(jvm, (void**) env, &args); + while (--n >= 0) { + X_FREE(option[n].optionString); + } X_FREE(option); - if (result != JNI_OK || !env) { - bdj_close(bdjava); + if (result != JNI_OK || !*env) { BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to create new Java VM.\n"); - return NULL; - } - - if (!_bdj_init(bdjava, env)) { - bdj_close(bdjava); - return NULL; + return 0; } - /* detach java main thread (CreateJavaVM attachs calling thread to JVM) */ - (*bdjava->jvm)->DetachCurrentThread(bdjava->jvm); - - return bdjava; + return 1; } -int bdj_start(BDJAVA *bdjava, unsigned title) +BDJAVA* bdj_open(const char *path, struct bluray *bd, + bdj_overlay_cb osd_cb, struct bd_argb_buffer_s *buf) { - JNIEnv* env; - int attach = 0; - jboolean status = JNI_FALSE; - jclass loader_class; - jmethodID load_id; - - if (!bdjava) { - return BDJ_ERROR; - } - - BD_DEBUG(DBG_BDJ, "bdj_start(%d)\n", title); - - if ((*bdjava->jvm)->GetEnv(bdjava->jvm, (void**)&env, JNI_VERSION_1_4) != JNI_OK) { - (*bdjava->jvm)->AttachCurrentThread(bdjava->jvm, (void**)&env, NULL); - attach = 1; - } - - if (bdj_get_method(env, &loader_class, &load_id, - "org/videolan/BDJLoader", "load", "(I)Z")) { - status = (*env)->CallStaticBooleanMethod(env, loader_class, load_id, (jint)title); - - if ((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - } + BD_DEBUG(DBG_BDJ, "bdj_open()\n"); - (*env)->DeleteLocalRef(env, loader_class); - } + // first load the jvm using dlopen + const char *java_home = NULL; + void* jvm_lib = _load_jvm(&java_home); - if (attach) { - (*bdjava->jvm)->DetachCurrentThread(bdjava->jvm); + if (!jvm_lib) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Wasn't able to load JVM\n"); + return 0; } - return (status == JNI_TRUE) ? BDJ_SUCCESS : BDJ_ERROR; -} - -int bdj_stop(BDJAVA *bdjava) -{ - JNIEnv *env; - int attach = 0; - jboolean status = JNI_FALSE; - jclass loader_class; - jmethodID unload_id; - - if (!bdjava) { - return BDJ_ERROR; + JNIEnv* env = NULL; + JavaVM *jvm = NULL; + if (!_find_jvm(jvm_lib, &env, &jvm) && !_create_jvm(jvm_lib, java_home, &env, &jvm)) { + dl_dlclose(jvm_lib); + return NULL; } - BD_DEBUG(DBG_BDJ, "bdj_stop()\n"); + BDJAVA* bdjava = calloc(1, sizeof(BDJAVA)); + bdjava->bd = bd; + bdjava->path = path; + bdjava->h_libjvm = jvm_lib; + bdjava->osd_cb = osd_cb; + bdjava->buf = buf; + bdjava->jvm = jvm; - if ((*bdjava->jvm)->GetEnv(bdjava->jvm, (void**)&env, JNI_VERSION_1_4) != JNI_OK) { - (*bdjava->jvm)->AttachCurrentThread(bdjava->jvm, (void**)&env, NULL); - attach = 1; + if (debug_mask & DBG_JNI) { + int version = (int)(*env)->GetVersion(env); + BD_DEBUG(DBG_BDJ, "Java version: %d.%d\n", version >> 16, version & 0xffff); } - if (bdj_get_method(env, &loader_class, &unload_id, - "org/videolan/BDJLoader", "unload", "()Z")) { - status = (*env)->CallStaticBooleanMethod(env, loader_class, unload_id); - - if ((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - } - - (*env)->DeleteLocalRef(env, loader_class); + if (!_bdj_init(bdjava, env)) { + bdj_close(bdjava); + return NULL; } - if (attach) { - (*bdjava->jvm)->DetachCurrentThread(bdjava->jvm); - } + /* detach java main thread (CreateJavaVM attachs calling thread to JVM) */ + (*bdjava->jvm)->DetachCurrentThread(bdjava->jvm); - return (status == JNI_TRUE) ? BDJ_SUCCESS : BDJ_ERROR; + return bdjava; } void bdj_close(BDJAVA *bdjava) @@ -564,17 +527,18 @@ (*env)->DeleteLocalRef(env, shutdown_class); } + bdj_unregister_native_methods(env); + if (attach) { (*bdjava->jvm)->DetachCurrentThread(bdjava->jvm); } - - (*bdjava->jvm)->DestroyJavaVM(bdjava->jvm); } if (bdjava->h_libjvm) { dl_dlclose(bdjava->h_libjvm); } + indx_free(&bdjava->index); X_FREE(bdjava); } @@ -592,6 +556,12 @@ "VK_KEY", "MARK", "PSR102", + "PLAYLIST", + + "START", + "STOP", + + "RATE", }; JNIEnv* env; diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdj.h libbluray-0.6.2/src/libbluray/bdj/bdj.h --- libbluray-0.5.0/src/libbluray/bdj/bdj.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/bdj.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,9 +20,7 @@ #ifndef BDJ_H_ #define BDJ_H_ -#include "common.h" - -#include +#include "util/attributes.h" typedef enum { BDJ_EVENT_NONE = 0, @@ -36,6 +34,12 @@ BDJ_EVENT_VK_KEY, BDJ_EVENT_MARK, BDJ_EVENT_PSR102, + BDJ_EVENT_PLAYLIST, + + BDJ_EVENT_START, /* param: title number */ + BDJ_EVENT_STOP, + + BDJ_EVENT_RATE, } BDJ_EVENT; /* bdj_get_uo_mask() */ @@ -45,17 +49,13 @@ typedef struct bdjava_s BDJAVA; struct bluray; -struct indx_root_s; struct bd_argb_buffer_s; typedef void (*bdj_overlay_cb)(struct bluray *, const unsigned *, int, int, int, int, int, int); BD_PRIVATE BDJAVA* bdj_open(const char *path, struct bluray *bd, - struct indx_root_s *index, bdj_overlay_cb osd_cb, struct bd_argb_buffer_s *buf); -BD_PRIVATE int bdj_start(BDJAVA *bdjava, unsigned title); -BD_PRIVATE int bdj_stop(BDJAVA *bdjava); BD_PRIVATE void bdj_close(BDJAVA *bdjava); BD_PRIVATE int bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param); BD_PRIVATE int bdj_get_uo_mask(BDJAVA *bdjava); diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdjo_parser.c libbluray-0.6.2/src/libbluray/bdj/bdjo_parser.c --- libbluray-0.5.0/src/libbluray/bdj/bdjo_parser.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/bdjo_parser.c 2014-09-01 12:06:01.000000000 +0000 @@ -69,7 +69,7 @@ char* str; _make_string(buf, &str, length); jstring jstr = (*env)->NewStringUTF(env, str); - free(str); + X_FREE(str); return jstr; } @@ -220,10 +220,10 @@ uint16_t name_data_length = bb_read(buf, 16); jobjectArray app_names = NULL; + int app_name_count = 0; if (name_data_length > 0) { // first scan for the number of app names - int app_name_count = 0; uint16_t name_bytes_read = 0; while (name_bytes_read < name_data_length) { bb_seek(buf, 24, SEEK_CUR); @@ -237,33 +237,34 @@ // seek back to beginning of names bb_seek(buf, -name_data_length*8, SEEK_CUR); + } - app_names = bdj_make_array(env, "[Ljava/lang/String;", app_name_count); - JNICHK(app_names); - - for (int j = 0; j < app_name_count; j++) { - char language[4]; - _get_string(buf, language, 3); - jstring jlanguage = (*env)->NewStringUTF(env, language); - JNICHK(jlanguage); + app_names = bdj_make_array(env, "[Ljava/lang/String;", app_name_count); + JNICHK(app_names); - uint8_t name_length = bb_read(buf, 8); - jstring jname = _read_jstring(env, buf, name_length); - JNICHK(jname); + for (int j = 0; j < app_name_count; j++) { + char language[4]; + _get_string(buf, language, 3); + jstring jlanguage = (*env)->NewStringUTF(env, language); + JNICHK(jlanguage); + + uint8_t name_length = bb_read(buf, 8); + jstring jname = _read_jstring(env, buf, name_length); + JNICHK(jname); - jobjectArray app_name = bdj_make_array(env, "java/lang/String", 2); - JNICHK(app_name); + jobjectArray app_name = bdj_make_array(env, "java/lang/String", 2); + JNICHK(app_name); - (*env)->SetObjectArrayElement(env, app_name, 0, jlanguage); - JNICHK(1); - (*env)->SetObjectArrayElement(env, app_name, 1, jname); - JNICHK(1); + (*env)->SetObjectArrayElement(env, app_name, 0, jlanguage); + JNICHK(1); + (*env)->SetObjectArrayElement(env, app_name, 1, jname); + JNICHK(1); - (*env)->SetObjectArrayElement(env, app_names, j, app_name); - JNICHK(1); - } + (*env)->SetObjectArrayElement(env, app_names, j, app_name); + JNICHK(1); } + // skip padding to word boundary if ((name_data_length & 0x1) != 0) { bb_seek(buf, 8, SEEK_CUR); @@ -309,9 +310,9 @@ uint8_t param_data_length = bb_read(buf, 8); jobjectArray params = NULL; + int param_count = 0; if (param_data_length > 0) { // first scan for the number of params - int param_count = 0; uint16_t param_bytes_read = 0; while (param_bytes_read < param_data_length) { uint8_t param_length = bb_read(buf, 8); @@ -323,19 +324,20 @@ // seek back to beginning of params bb_seek(buf, -param_data_length*8, SEEK_CUR); + } - params = bdj_make_array(env, "java/lang/String", param_count); + params = bdj_make_array(env, "java/lang/String", param_count); - for (int j = 0; j < param_count; j++) { - uint8_t param_length = bb_read(buf, 8); - jstring param = _read_jstring(env, buf, param_length); - JNICHK(param); + for (int j = 0; j < param_count; j++) { + uint8_t param_length = bb_read(buf, 8); + jstring param = _read_jstring(env, buf, param_length); + JNICHK(param); - (*env)->SetObjectArrayElement(env, params, j, param); - JNICHK(1); - } + (*env)->SetObjectArrayElement(env, params, j, param); + JNICHK(1); } + // skip padding to word boundary if ((param_data_length & 0x1) == 0) { bb_seek(buf, 8, SEEK_CUR); @@ -429,10 +431,10 @@ result = _parse_bdjo(env, buf); - free(buf); + X_FREE(buf); } - free(data); + X_FREE(data); } file_close(handle); diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdjo_parser.h libbluray-0.6.2/src/libbluray/bdj/bdjo_parser.h --- libbluray-0.5.0/src/libbluray/bdj/bdjo_parser.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/bdjo_parser.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #ifndef BDJO_PARSER_H_ #define BDJO_PARSER_H_ -#include +#include "util/attributes.h" #include diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdj_util.c libbluray-0.6.2/src/libbluray/bdj/bdj_util.c --- libbluray-0.5.0/src/libbluray/bdj/bdj_util.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/bdj_util.c 2014-09-01 12:06:01.000000000 +0000 @@ -104,3 +104,35 @@ return !error; } + +int bdj_unregister_methods(JNIEnv *env, const char *class_name) +{ + jclass cls; + int error; + + (*env)->ExceptionClear(env); + + cls = (*env)->FindClass(env, class_name); + + if (!cls) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to locate class %s\n", class_name); + (*env)->ExceptionDescribe(env); + (*env)->ExceptionClear(env); + return 0; + } + + error = (*env)->UnregisterNatives(env, cls); + + if ((*env)->ExceptionOccurred(env)) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to unregister native methods for class %s\n", class_name); + (*env)->ExceptionDescribe(env); + (*env)->ExceptionClear(env); + return 0; + } + + if (error) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to runegister native methods for class %s\n", class_name); + } + + return !error; +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdj_util.h libbluray-0.6.2/src/libbluray/bdj/bdj_util.h --- libbluray-0.5.0/src/libbluray/bdj/bdj_util.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/bdj_util.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #ifndef JNIUTIL_H_ #define JNIUTIL_H_ -#include +#include "util/attributes.h" #include #include @@ -38,5 +38,6 @@ // register native methods for class BD_PRIVATE int bdj_register_methods(JNIEnv *env, const char *class_name, const JNINativeMethod *methods, int methods_count); +BD_PRIVATE int bdj_unregister_methods(JNIEnv *env, const char *class_name); #endif diff -Nru libbluray-0.5.0/src/libbluray/bdj/build.xml libbluray-0.6.2/src/libbluray/bdj/build.xml --- libbluray-0.5.0/src/libbluray/bdj/build.xml 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/build.xml 2014-09-01 12:06:01.000000000 +0000 @@ -8,6 +8,7 @@ + @@ -23,12 +24,12 @@ - + - + diff -Nru libbluray-0.5.0/src/libbluray/bdj/common.h libbluray-0.6.2/src/libbluray/bdj/common.h --- libbluray-0.5.0/src/libbluray/bdj/common.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/common.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,13 @@ #ifndef BDJ_COMMON_H_ #define BDJ_COMMON_H_ -#define BDJ_JARFILE "libbluray.jar" +#include "config.h" + +#ifdef HAVE_BDJ_J2ME +#define BDJ_JARFILE "libbluray-j2me-" VERSION ".jar" +#else +#define BDJ_JARFILE "libbluray-j2se-" VERSION ".jar" +#endif #define BDJ_CLASSPATH BDJ_JARFILE #define BDJ_BDJO_PATH "/BDMV/BDJO" #define BDJ_JAR_PATH "/BDMV/JAR" diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/com/aacsla/bluray/online/ContentAttribute.java libbluray-0.6.2/src/libbluray/bdj/java/com/aacsla/bluray/online/ContentAttribute.java --- libbluray-0.5.0/src/libbluray/bdj/java/com/aacsla/bluray/online/ContentAttribute.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/com/aacsla/bluray/online/ContentAttribute.java 2014-09-01 12:06:17.000000000 +0000 @@ -27,17 +27,27 @@ } public byte[] getContentCertID() { + FileInputStream is = null; try { - FileInputStream is = new FileInputStream( + is = new FileInputStream( System.getProperty("bluray.vfs.root") + File.separator + "AACS/Content000.cer"); - is.skip(14); + if (is.skip(14) != 14) + return null; byte[] bytes = new byte[6]; - is.read(bytes, 0, 6); - is.close(); + if (is.read(bytes, 0, 6) != 6) + return null; return bytes; } catch (Throwable e) { e.printStackTrace(); return null; + } finally { + if (is != null) { + try { + is.close(); + } catch (Throwable e) { + e.printStackTrace(); + } + } } } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDFontMetrics.java libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDFontMetrics.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDFontMetrics.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDFontMetrics.java 2014-09-01 12:06:01.000000000 +0000 @@ -32,7 +32,7 @@ private static native long initN(); private static native void destroyN(long ftLib); - public static void init() { + public synchronized static void init() { //System.loadLibrary("bluray"); if (ftLib != 0) @@ -45,24 +45,6 @@ throw new AWTError("freetype lib not loaded"); } - Runtime.getRuntime().addShutdownHook( - new Thread() { - public void run() { - Iterator it = fontMetricsMap.values().iterator(); - while (it.hasNext()) { - try { - BDFontMetrics fm = (BDFontMetrics)it.next(); - it.remove(); - fm.destroy(); - } catch (Throwable e) { - e.printStackTrace(); - } - } - BDFontMetrics.destroyN(BDFontMetrics.ftLib); - } - } - ); - String javaHome = (String) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return System.getProperty("java.home"); @@ -99,6 +81,21 @@ fontNameMap.put("default.3", dir + "LucidaSansDemiOblique.ttf"); } + public synchronized static void shutdown() { + Iterator it = fontMetricsMap.values().iterator(); + while (it.hasNext()) { + try { + BDFontMetrics fm = (BDFontMetrics)it.next(); + it.remove(); + fm.destroy(); + } catch (Throwable e) { + e.printStackTrace(); + } + } + destroyN(BDFontMetrics.ftLib); + ftLib = 0; + } + /** A map which maps a native font name and size to a font metrics object. This is used as a cache to prevent loading the same fonts multiple times. */ private static Map fontMetricsMap = new HashMap(); @@ -124,7 +121,7 @@ return fm; } - static String[] getFontList() { + static synchronized String[] getFontList() { init(); ArrayList fontNames = new ArrayList(); @@ -142,7 +139,7 @@ return (String[])fontNames.toArray(new String[fontNames.size()]); } - public static void registerFont(String name, int style, String path) { + public synchronized static void registerFont(String name, int style, String path) { File f = new File(path); path = f.getAbsolutePath(); if (path != null) { @@ -151,18 +148,18 @@ } } - public static boolean registerFont(File f) { + public synchronized static boolean registerFont(File f) { //TODO org.videolan.Logger.unimplemented("BDFontMetrics", "registerFont"); return false; } - public static void unregisterFont(String name, int style) { + public synchronized static void unregisterFont(String name, int style) { name = name.toLowerCase() + "." + style; fontNameMap.remove(name); } - long ftFace; + private long ftFace; private int ascent; private int descent; private int leading; @@ -195,6 +192,10 @@ private native int stringWidthN(long ftFace, String string); private native int charsWidthN(long ftFace, char chars[], int offset, int len); + protected synchronized void drawString(BDGraphics g, String string, int x, int y, int rgb) { + g.drawStringN(ftFace, string, x, y, rgb); + } + public int getAscent() { return ascent; } @@ -214,7 +215,7 @@ /** * Fast lookup of first 256 chars as these are always the same eg. ASCII charset. */ - public int charWidth(char c) { + public synchronized int charWidth(char c) { if (c < 256) return widths[c]; return charWidthN(ftFace, c); @@ -223,14 +224,14 @@ /** * Return the width of the specified string in this Font. */ - public int stringWidth(String string) { + public synchronized int stringWidth(String string) { return stringWidthN(ftFace, string); } /** * Return the width of the specified char[] in this Font. */ - public int charsWidth(char chars[], int offset, int length) { + public synchronized int charsWidth(char chars[], int offset, int length) { return charsWidthN(ftFace, chars, offset, length); } @@ -243,7 +244,7 @@ return newWidths; } - public void destroy() { + private void destroy() { if (ftFace != 0) { destroyFontN(ftFace); ftFace = 0; @@ -251,7 +252,12 @@ } protected void finalize() throws Throwable { - destroy(); - super.finalize(); + try { + destroy(); + } catch (Throwable t) { + throw t; + } finally { + super.finalize(); + } } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java 2014-09-03 09:14:08.000000000 +0000 @@ -0,0 +1,1258 @@ +/* + * This file is part of libbluray + * Copyright (C) 2012-2014 libbluray + * + * 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 + * . + */ + +package java.awt; + +import java.lang.reflect.Field; +import java.text.AttributedCharacterIterator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.awt.image.AreaAveragingScaleFilter; +import java.awt.image.BufferedImage; +import java.awt.image.ImageConsumer; +import java.awt.image.ImageObserver; + +import org.dvb.ui.DVBBufferedImage; + +import sun.awt.ConstrainableGraphics; + +import org.videolan.Logger; + +abstract class BDGraphicsBase extends Graphics2D implements ConstrainableGraphics { + private static final Color DEFAULT_COLOR = Color.BLACK; + private static final Font DEFAULT_FONT = new Font("Dialog", Font.PLAIN, 12); + + private int width; + private int height; + private int[] backBuffer; + private Area dirty; + private GraphicsConfiguration gc; + private Color foreground; + protected Color background; + private Font font; + private BDFontMetrics fontMetrics; + private AlphaComposite composite; + + /** The current xor color. If null then we are in paint mode. */ + private Color xorColor; + + /** Translated X, Y offset from native offset. */ + private int originX; + private int originY; + + /** The actual clip rectangle that is intersection of user clip and constrained rectangle. */ + private Rectangle actualClip; + + /** The current user clip rectangle or null if no clip has been set. This is stored in the + native coordinate system and not the (possibly) translated Java coordinate system. */ + private Rectangle clip = null; + + /** The rectangle this graphics object has been constrained too. This is stored in the + native coordinate system and not the (possibly) translated Java coordinate system. + If it is null then this graphics has not been constrained. The constrained rectangle + is another layer of clipping independant of the user clip. */ + private Rectangle constrainedRect = null; + + BDGraphicsBase(BDGraphicsBase g) { + backBuffer = g.backBuffer; + dirty = g.dirty; + width = g.width; + height = g.height; + gc = g.gc; + foreground = g.foreground; + background = g.background; + composite = g.composite; + font = g.font; + fontMetrics = g.fontMetrics; + originX = g.originX; + originY = g.originY; + if (g.clip != null) { + clip = new Rectangle(g.clip); + } + setupClip(); + } + + BDGraphicsBase(BDRootWindow window) { + width = window.getWidth(); + height = window.getHeight(); + backBuffer = window.getBdBackBuffer(); + dirty = window.getDirtyArea(); + gc = window.getGraphicsConfiguration(); + foreground = window.getForeground(); + background = window.getBackground(); + font = window.getFont(); + if (foreground == null) + foreground = DEFAULT_COLOR; + if (background == null) + background = DEFAULT_COLOR; + if (font == null) + font = DEFAULT_FONT; + fontMetrics = BDFontMetrics.getFontMetrics(font); + composite = AlphaComposite.SrcOver; + setupClip(); + } + + BDGraphicsBase(BDImage image) { + width = image.getWidth(); + height = image.getHeight(); + backBuffer = image.getBdBackBuffer(); + dirty = image.getDirtyArea(); + + gc = image.getGraphicsConfiguration(); + Component component = image.getComponent(); + if (component != null) { + foreground = component.getForeground(); + background = component.getBackground(); + font = component.getFont(); + } + if (foreground == null) + foreground = DEFAULT_COLOR; + if (background == null) + background = new Color(0, 0, 0, 0); + if (font == null) + font = DEFAULT_FONT; + fontMetrics = BDFontMetrics.getFontMetrics(font); + composite = AlphaComposite.SrcOver; + setupClip(); + } + + public Graphics create() { + return new BDGraphics((BDGraphics)this); + } + + public void translate(int x, int y) { + originX += x; + originY += y; + } + + public void setFont(Font font) { + if (font != null && !font.equals(this.font)) { + this.font = font; + fontMetrics = BDFontMetrics.getFontMetrics(font); + } + } + + public Font getFont() { + return font; + } + + public FontMetrics getFontMetrics() { + return fontMetrics; + } + + public FontMetrics getFontMetrics(Font font) { + return BDFontMetrics.getFontMetrics(font); + } + + public void setColor(Color c) { + if ((c != null) && (c != foreground)) + foreground = c; + } + + public Color getColor() { + return foreground; + } + + public Composite getComposite() { + return composite; + } + + public GraphicsConfiguration getDeviceConfiguration() { + return gc; + } + + public void setComposite(Composite comp) { + if ((comp != null) && (comp != composite)) { + if (!(comp instanceof AlphaComposite)) + throw new IllegalArgumentException("Only AlphaComposite is supported"); + composite = (AlphaComposite) comp; + } + } + + public void setPaintMode() { + xorColor = null; + composite = AlphaComposite.SrcOver; + } + + public void setXORMode(Color color) { + xorColor = color; + } + + /** Gets the current clipping area. */ + public Rectangle getClipBounds() { + if (clip != null) + return new Rectangle (clip.x - originX, clip.y - originY, clip.width, clip.height); + return null; + } + + public void constrain(int x, int y, int w, int h) { + Rectangle rect; + if (constrainedRect != null) + rect = constrainedRect; + else + rect = new Rectangle(0, 0, width, height); + constrainedRect = rect.intersection(new Rectangle(rect.x + x, rect.y + y, w, h)); + originX = constrainedRect.x; + originY = constrainedRect.y; + setupClip(); + } + + /** Returns a Shape object representing the clip. */ + public Shape getClip() { + return getClipBounds(); + } + + /** Crops the clipping rectangle. */ + public void clipRect(int x, int y, int w, int h) { + Rectangle rect = new Rectangle(x + originX, y + originY, w, h); + if (clip != null) + clip = clip.intersection(rect); + else + clip = rect; + setupClip(); + } + + /** Sets the clipping rectangle. */ + public void setClip(int x, int y, int w, int h) { + clip = new Rectangle (x + originX, y + originY, w, h); + setupClip(); + } + + /** Sets the clip to a Shape (only Rectangle allowed). */ + public void setClip(Shape clip) { + if (clip == null) { + this.clip = null; + setupClip(); + } else if (clip instanceof Rectangle) { + Rectangle rect = (Rectangle) clip; + setClip(rect.x, rect.y, rect.width, rect.height); + } else + throw new IllegalArgumentException("setClip(Shape) only supports Rectangle objects"); + } + + private void setupClip() { + Rectangle rect; + if (constrainedRect != null) + rect = constrainedRect; + else + rect = new Rectangle(0, 0, width, height); + if (clip != null) + actualClip = clip.intersection(rect); + else + actualClip = rect; + } + + private int alphaBlend(int dest, int src) { + int As = src >>> 24; + if (As == 0) + return dest; + if (As == 255) + return src; + int Ad = (dest >>> 24); + if (Ad == 0) + return src; + int R, G, B; + R = ((src >>> 16) & 255) * As * 255; + G = ((src >>> 8) & 255) * As * 255; + B = (src & 255) * As * 255; + Ad = Ad * (255 - As); + As = As * 255 + Ad; + R = (R + ((dest >>> 16) & 255) * Ad) / As; + G = (G + ((dest >>> 8) & 255) * Ad) / As; + B = (B + (dest & 255) * Ad) / As; + R = Math.min(255, R); + G = Math.min(255, G); + B = Math.min(255, B); + Ad = As / 255; + Ad = Math.min(255, Ad); + return (Ad << 24) | (R << 16) | (G << 8) | B; + } + + private int applyComposite(int rgb) { + return ((int)((rgb >>> 24) * composite.getAlpha()) << 24) | (rgb & 0x00FFFFFF); + } + + private void drawSpanN(int x, int y, int length, int rgb) { + + Rectangle rect = new Rectangle(x, y, length, 1); + rect = actualClip.intersection(rect); + + if (rect.width <= 0 || rect.height <= 0 || rect.x < 0 || rect.y < 0) { + return; + } + + x = rect.x; + length = rect.width; + + if (xorColor != null) { + for (int i = 0; i < length; i++) { + backBuffer[y * width + x + i] ^= xorColor.getRGB() ^ rgb; + } + + dirty.add(rect); + return; + } + + switch (composite.getRule()) { + case AlphaComposite.CLEAR: + for (int i = 0; i < length; i++) { + backBuffer[y * width + x + i] = 0; + } + break; + case AlphaComposite.SRC: + rgb = applyComposite(rgb); + for (int i = 0; i < length; i++) { + backBuffer[y * width + x + i] = rgb; + } + break; + case AlphaComposite.SRC_OVER: + rgb = applyComposite(rgb); + for (int i = 0; i < length; i++) { + backBuffer[y * width + x + i] = alphaBlend(backBuffer[y * width + x + i], rgb); + } + break; + } + + dirty.add(rect); + } + + private void drawSpanN(int x, int y, int length, int src[], int srcOffset, boolean flipX) { + + /* avoid overreading source */ + if (srcOffset + length > src.length) { + length -= srcOffset + length - src.length; + } + if (length <= 0) { + return; + } + + Rectangle rect = new Rectangle(x, y, length, 1); + rect = actualClip.intersection(rect); + + if (rect.width <= 0 || rect.height <= 0 || rect.x < 0 || rect.y < 0) { + return; + } + + int dstOffset; + + srcOffset += rect.x - x; + x = rect.x; + length = rect.width; + dstOffset = y * width + x; + + if (xorColor != null) { + + if (flipX) { + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + length -1 - i] ^= xorColor.getRGB() ^ src[srcOffset + i]; + } + } else { + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + i] ^= xorColor.getRGB() ^ src[srcOffset + i]; + } + } + + dirty.add(rect); + return; + } + + switch (composite.getRule()) { + case AlphaComposite.CLEAR: + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + i] = 0; + } + break; + case AlphaComposite.SRC: + if (flipX) { + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + length -1 - i] = applyComposite(src[srcOffset + i]); + } + } else { + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + i] = applyComposite(src[srcOffset + i]); + } + } + break; + case AlphaComposite.SRC_OVER: + if (flipX) { + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + length -1 - i] = alphaBlend(backBuffer[dstOffset + length -1 - i], applyComposite(src[srcOffset + i])); + } + } else { + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + i] = alphaBlend(backBuffer[dstOffset + i], applyComposite(src[srcOffset + i])); + } + } + break; + } + + dirty.add(rect); + } + + private void drawSpan(int x, int y, int length, int rgb) { + x += originX; + y += originY; + drawSpanN(x, y, length, rgb); + } + + private void drawSpan(int x, int y, int length, int src[], int srcOffset, boolean flipX) { + x += originX; + y += originY; + drawSpanN(x, y, length, src, srcOffset, flipX); + } + + private void drawPointN(int x, int y, int rgb) { + drawSpanN(x, y, 1, rgb); + } + + private void drawGlyph(int[] rgbArray, int x0, int y0, int w, int h) { + for (int y = 0; y < h; y++) + for (int x = 0; x < w; x++) + drawPoint(x + x0, y + y0, rgbArray[y * w + x]); + } + + private void drawPoint(int x, int y, int rgb) { + x += originX; + y += originY; + if (actualClip.contains(x, y)) + drawPointN(x, y, rgb); + } + + public void clearRect(int x, int y, int w, int h) { + x += originX; + y += originY; + Rectangle rect = new Rectangle(x, y, w, h); + rect = actualClip.intersection(rect); + if (rect.isEmpty()) { + return; + } + x = rect.x; + y = rect.y; + w = rect.width; + h = rect.height; + int rgb = background.getRGB(); + for (int i = 0; i < h; i++) + Arrays.fill(backBuffer, (y + i) * width + x, (y + i) * width + x + w, rgb); + + dirty.add(rect); + } + + public void fillRect(int x, int y, int w, int h) { + x += originX; + y += originY; + Rectangle rect = new Rectangle(x, y, w, h); + rect = actualClip.intersection(rect); + x = rect.x; + y = rect.y; + w = rect.width; + h = rect.height; + int rgb = foreground.getRGB(); + for (int Y = y; Y < (y + h); Y++) + drawSpanN(x, Y, w, rgb); + } + + public void drawRect(int x, int y, int w, int h) { + x += originX; + y += originY; + + drawLineN(x, y, x + w, y); + drawLineN(x, y + h, x + w, y + h); + drawLineN(x, y, x, y + h); + drawLineN(x + w, y, x + w, y + h); + } + + private void drawLineN(int x1, int y1, int x2, int y2) { + int rgb = foreground.getRGB(); + int dy = y2 - y1; + int dx = x2 - x1; + int stepx, stepy; + int fraction; + if (dy < 0) { + dy = -dy; + stepy = -1; + } else { + stepy = 1; + } + if (dx < 0) { + dx = -dx; + stepx = -1; + } else { + stepx = 1; + } + dy <<= 1; + dx <<= 1; + + drawPointN(x1, y1, rgb); + + if (dx > dy) { + fraction = dy - (dx >> 1); + while (x1 != x2) { + if (fraction >= 0) { + y1 += stepy; + fraction -= dx; + } + x1 += stepx; + fraction += dy; + drawPointN(x1, y1, rgb); + } + } else { + fraction = dx - (dy >> 1); + while (y1 != y2) { + if (fraction >= 0) { + x1 += stepx; + fraction -= dy; + } + y1 += stepy; + fraction += dx; + drawPointN(x1, y1, rgb); + } + } + } + + public void drawLine(int x1, int y1, int x2, int y2) { + + x1 += originX; + y1 += originY; + + x2 += originX; + y2 += originY; + + drawLineN(x1, y1, x2, y2); + } + + /** + * Copies an area of the canvas that this graphics context paints to. + * @param X the x-coordinate of the source. + * @param Y the y-coordinate of the source. + * @param W the width. + * @param H the height. + * @param dx the horizontal distance to copy the pixels. + * @param dy the vertical distance to copy the pixels. + */ + public void copyArea(int x, int y, int w, int h, int dx, int dy) { + + x += originX; + y += originY; + + Rectangle rect = new Rectangle(x, y, w, h); + rect = actualClip.intersection(rect); + + if (rect.width <= 0 || rect.height <= 0) { + return; + } + + x = rect.x; + y = rect.y; + w = rect.width; + h = rect.height; + + int subImage[] = new int[w * h]; + + // copy back buffer + for (int i = 0; i < h; i++) { + System.arraycopy(backBuffer, ((y + i) * width) + x, subImage, w * i, w); + } + + // draw sub image + for (int i = 0; i < h; i++) { + drawSpanN(x + dx, y + i + dy, w, subImage, w * i, false); + } + } + + /** Draws lines defined by an array of x points and y points */ + public void drawPolyline(int xPoints[], int yPoints[], int nPoints) { + if (nPoints == 1) { + drawPoint(xPoints[0], yPoints[0], foreground.getRGB()); + } else { + for (int i = 0; i < (nPoints - 1); i++) + drawLine(xPoints[i], xPoints[i], xPoints[i + 1], xPoints[i + 1]); + } + } + + /** Draws a polygon defined by an array of x points and y points */ + public void drawPolygon(int xPoints[], int yPoints[], int nPoints) { + if (nPoints == 1) { + drawPoint(xPoints[0], yPoints[0], foreground.getRGB()); + } else { + for (int i = 0; i < (nPoints - 1); i++) + drawLine(xPoints[i], xPoints[i], xPoints[i + 1], xPoints[i + 1]); + if (nPoints > 2) + drawLine(xPoints[0], xPoints[0], xPoints[nPoints - 1], xPoints[nPoints - 1]); + } + } + + /** Fills a polygon with the current fill mask */ + public void fillPolygon(int xPoints[], int yPoints[], int nPoints) { + + int minY = Integer.MAX_VALUE; + int maxY = Integer.MIN_VALUE; + int colour = foreground.getRGB(); + + if (nPoints < 3) { + return; + } + + for (int i = 0; i < nPoints; i++) { + if (yPoints[i] > maxY) { + maxY = yPoints[i]; + } + if (yPoints[i] < minY) { + minY = yPoints[i]; + } + } + + // check the last point to see if its the same as the first + if (xPoints[0] == xPoints[nPoints - 1] && yPoints[0] == yPoints[nPoints - 1]) { + nPoints--; + } + + PolyEdge[] polyEdges = new PolyEdge[nPoints]; + + for (int i = 0; i < nPoints - 1; i++) { + polyEdges[i] = new PolyEdge(xPoints[i], yPoints[i], xPoints[i + 1], yPoints[i + 1]); + } + + // add the last one + polyEdges[nPoints - 1] = new PolyEdge(xPoints[nPoints - 1], yPoints[nPoints - 1], xPoints[0], yPoints[0]); + ArrayList xList = new ArrayList(); + for (int i = minY; i <= maxY; i++) { + for (int j = 0; j < nPoints; j++) { + if (polyEdges[j].intersects(i)) { + int x = polyEdges[j].intersectionX(i); + xList.add(new Integer(x)); + } + } + + // probably a better way of doing this (removing duplicates); + HashSet hs = new HashSet(); + hs.addAll(xList); + xList.clear(); + xList.addAll(hs); + + if (xList.size() % 2 > 0) { + xList.clear(); + continue; // this should be impossible unless the poly is open somewhere + } + + Collections.sort(xList); + + for (int j = 0; j < xList.size(); j +=2 ) { + int x1 = ((Integer)xList.get(j)).intValue(); + int x2 = ((Integer)xList.get(j + 1)).intValue(); + + drawSpan(x1, i, x2 - x1, colour); + } + + xList.clear(); + } + } + + /** Draws an oval to fit in the given rectangle */ + public void drawOval(int x, int y, int w, int h) { + + int startX; + int endX; + int offset; + int[] xList; + int[] yList; + int numPoints; + int count; + float as; + float bs; + + if (w <= 0 || h <=0 ) { + return; + } + + count = 0; + numPoints = ((h/2) + (h/2) + 1) * 2; + numPoints += 1; // to close + xList = new int[numPoints]; + yList = new int[numPoints]; + + as = (w/2.0f) * (w/2.0f); + bs = (h/2.0f) * (h/2.0f); + + for (int i = -h/2; i <= h/2; i++) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + w/2; + + xList[count] = startX; + yList[count] = y + i + h/2; + count++; + } + + for (int i = h/2; i >= -h/2; i--) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + endX = x + offset + w/2; + + xList[count] = endX; + yList[count] = y + i + h/2; + count++; + } + + xList[count] = xList[0]; // close the loop + yList[count] = yList[0]; // close the loop + + drawPolyline(xList, yList, numPoints); + } + + /** Fills an oval to fit in the given rectangle */ + public void fillOval(int x, int y, int w, int h) { + + int startX; + int endX; + int offset; + int colour; + float as; + float bs; + + if (w <= 0 || h <= 0) { + return; + } + + as = (w/2.0f) * (w/2.0f); + bs = (h/2.0f) * (h/2.0f); + colour = foreground.getRGB(); + + for(int i=-h/2; i<=h/2; i++) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + w/2; + endX = x + offset + w/2; + + drawSpan(startX, y + i + h/2, endX - startX + 1, colour); + } + } + + /** + * Draws an arc bounded by the given rectangle from startAngle to + * endAngle. 0 degrees is a vertical line straight up from the + * center of the rectangle. Positive start angle indicate clockwise + * rotations, negative angle are counter-clockwise. + */ + public void drawArc(int x, int y, int w, int h, int startAngle, int endAngle) { + logger.unimplemented("drawArc"); + } + + /** fills an arc. arguments are the same as drawArc. */ + public void fillArc(int x, int y, int w, int h, int startAngle, int endAngle) { + logger.unimplemented("fillArc"); + } + + /** Draws a rounded rectangle. */ + public void drawRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) { + + int[] xList; + int[] yList; + int numPoints; + int count; + int startX; + int endX; + int offset; + + if (w <= 0 || h <= 0) { + return; + } + + if (arcWidth == 0 || arcHeight == 0) { + drawRect(x, y, w, h); + return; + } + + if (arcWidth < 0) { // matches behaviour of normal java version + arcWidth *= -1; + } + + if (arcHeight < 0) { + arcHeight *= -1; + } + + count = 0; + numPoints = ((arcHeight/2) + 1) * 2; + numPoints += ((arcHeight/2) + 1) * 2; + numPoints += 1; // last point to close the loop + + xList = new int[numPoints]; + yList = new int[numPoints]; + + float as = (arcWidth/2.0f) * (arcWidth/2.0f); + float bs = (arcHeight/2.0f) * (arcHeight/2.0f); + + // draw top curved half of box + + for (int i = 0; -arcHeight/2 <= i; i--) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + arcWidth/2; + + xList[count] = startX; + yList[count] = y+i+(arcHeight/2); + count++; + } + + for (int i = -arcHeight / 2; i <= 0; i++) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + endX = x + offset + (w-arcWidth) + arcWidth/2; + + xList[count] = endX; + yList[count] = y + i + (arcHeight/2); + count++; + } + + // draw bottom box + for (int i = 0; i <= arcHeight / 2; i++) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + arcWidth/2; + endX = x + offset + (w - arcWidth) + arcWidth/2; + + xList[count] = endX; + yList[count] = y + i + h - arcHeight/2; + count++; + } + + // draw bottom box + for (int i = arcHeight / 2; i >= 0; i--) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + arcWidth/2; + endX = x + offset + (w-arcWidth) + arcWidth/2; + + xList[count] = startX; + yList[count] = y+i+h-arcHeight/2; + count++; + } + + xList[count] = xList[0]; + yList[count] = yList[0]; + + drawPolyline(xList, yList, numPoints); + } + + /** Draws a filled rounded rectangle. */ + public void fillRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) { + + int startX; + int endX; + int offset; + int colour; + + if (w <= 0 || h <= 0) { + return; + } + + if (arcWidth == 0 || arcHeight == 0) { + fillRect(x,y,w,h); + return; + } + + if (arcWidth < 0) { // matches behaviour of normal java version + arcWidth *= -1; + } + + if (arcHeight < 0) { + arcHeight *= -1; + } + + float as = (arcWidth/2.0f) * (arcWidth/2.0f); + float bs = (arcHeight/2.0f) * (arcHeight/2.0f); + + colour = foreground.getRGB(); + + // draw top curved half of box + for (int i = -arcHeight/2; i < 0; i++) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + arcWidth/2; + endX = x + offset + (w - arcWidth) + arcWidth/2; + + drawSpan(startX, y + i + (arcHeight/2), endX - startX + 1, colour); + } + + // draw middle section + for (int i = 0; i < h - arcHeight; i++) { + drawSpan(x, y + i + arcHeight/2, w, colour); + } + + // draw bottom box + for (int i = 0; i <= arcHeight/2; i++) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + arcWidth/2; + endX = x + offset + (w - arcWidth) + arcWidth/2; + + drawSpan(startX, y + i + h - 1 - arcHeight/2, endX - startX + 1, colour); + } + } + + protected native void drawStringN(long ftFace, String string, int x, int y, int rgb); + + /** Draws the given string. */ + public void drawString(String string, int x, int y) { + if (fontMetrics != null) { + fontMetrics.drawString((BDGraphics)this, string, x, y, foreground.getRGB()); + } + } + + /** Draws the given character array. */ + public void drawChars(char chars[], int offset, int length, int x, int y) { + drawString(new String(chars, offset, length), x, y); + } + + public void drawString(AttributedCharacterIterator arg0, int arg1, int arg2) { + logger.unimplemented("drawString"); + } + + /** + * Draws an image at x,y in nonblocking mode with a callback object. + */ + public boolean drawImage(Image img, int x, int y, ImageObserver observer) { + return drawImage(img, x, y, null, observer); + } + + /** + * Draws an image at x,y in nonblocking mode with a solid background + * color and a callback object. + */ + public boolean drawImage(Image img, int x, int y, Color bg, + ImageObserver observer) { + return drawImageN(img, x, y, -1, -1, 0, 0, -1, -1, false, false, bg, observer); + } + + /** + * Draws an image scaled to x,y,w,h in nonblocking mode with a + * callback object. + */ + public boolean drawImage(Image img, int x, int y, int w, int h, + ImageObserver observer) { + return drawImage(img, x, y, w, h, null, observer); + } + + /** + * Draws an image scaled to x,y,w,h in nonblocking mode with a + * solid background color and a callback object. + */ + public boolean drawImage(Image img, int x, int y, int w, int h, + Color bg, ImageObserver observer) { + return drawImageN(img, x, y, w, h, 0, 0, -1, -1, false, false, bg, observer); + } + + /** + * Draws a subrectangle of an image scaled to a destination rectangle + * in nonblocking mode with a callback object. + */ + public boolean drawImage(Image img, + int dx1, int dy1, int dx2, int dy2, + int sx1, int sy1, int sx2, int sy2, + ImageObserver observer) { + return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null, observer); + } + + /** + * Draws a subrectangle of an image scaled to a destination rectangle in + * nonblocking mode with a solid background color and a callback object. + */ + public boolean drawImage(Image img, + int dx1, int dy1, int dx2, int dy2, + int sx1, int sy1, int sx2, int sy2, + Color bg, ImageObserver observer) { + + boolean flipX = false; + boolean flipY = false; + + if (dx1 > dx2) { + int swap = dx1; + dx1 = dx2; + dx2 = swap; + flipX = !flipX; + } + + if (dy1 > dy2) { + int swap = dy1; + dy1 = dy2; + dy2 = swap; + flipY = !flipY; + } + + if (sx1 > sx2) { + int swap = sx1; + sx1 = sx2; + sx2 = swap; + flipX = !flipX; + } + + if (sy1 > sy2) { + int swap = sy1; + sy1 = sy2; + sy2 = swap; + flipY = !flipY; + } + + return drawImageN(img, dx1, dy1, dx2 - dx1, dy2 - dy1, + sx1, sy1, sx2 - sx1, sy2 - sy1, + flipX, flipY, bg, observer); + } + + /** + * Draws a subrectangle of an image scaled to a destination rectangle in + * nonblocking mode with a solid background color and a callback object. + */ + protected boolean drawImageN(Image img, + int dx, int dy, int dw, int dh, + int sx, int sy, int sw, int sh, + boolean flipX, boolean flipY, + Color bg, ImageObserver observer) { + + if ((sx < 0) || (sy < 0) || + (sw == 0) || (sh == 0) || (dw == 0) || (dh == 0)) + return false; + + BDImage bdImage; + if (img instanceof BDImage) { + bdImage = (BDImage)img; + } else if (img instanceof DVBBufferedImage) { + bdImage = (BDImage)getBufferedImagePeer( + (BufferedImage)(((DVBBufferedImage)img).getImage())); + } else if (img instanceof BufferedImage) { + bdImage = (BDImage)getBufferedImagePeer((BufferedImage)img); + } else { + logger.unimplemented("drawImageN: unsupported image type " + img.getClass().getName()); + return false; + } + + if (bdImage instanceof BDImageConsumer) { + BDImageConsumer consumer = (BDImageConsumer)bdImage; + if (!consumer.isComplete(observer)) { + return false; + } + } + + if (sw < 0) sw = bdImage.width; + if (sh < 0) sh = bdImage.height; + if (dw < 0) dw = bdImage.width; + if (dh < 0) dh = bdImage.height; + + int stride = bdImage.width; + int[] rgbArray = bdImage.getBdBackBuffer(); + int bgColor = 0; + + if (bg != null) { + bgColor = bg.getRGB(); + } + + // draw background colour + for (int i = 0; i < dh && bg != null; i++) { + drawSpan(dx, dy + i, dw, bgColor); + } + + // resize if needed + if (dw != sw || dh != sh) { + drawResizeBilinear(rgbArray, (sy * stride) + sx, stride, sw, sh, + dx, dy, dw, dh, flipX, flipY); + return true; + } + + // draw actual colour array + if (flipY) { + for (int i = 0; i < dh; i++) { + drawSpan(dx, dy + dh - 1 - i, dw, rgbArray, (stride * (i + sy)) + sx, flipX); + } + } else { + for (int i = 0; i < dh; i++) { + drawSpan(dx, dy + i, dw, rgbArray, (stride * (i + sy)) + sx, flipX); + } + } + + return true; + } + + /** + * Bilinear resize ARGB image. + * + * @param pixels Source image pixels. + * @param sw Source image width. + * @param sh Source image height. + * @param dw New width. + * @param dh New height. + * @return New array with size dw * dh. + */ + private int[] tmpLine = null; + private void drawResizeBilinear(int[] pixels, int offset, int scansize, int sw, int sh, + int dx, int dy, int dw, int dh, boolean flipX, boolean flipY) { + + if (sw == 1 && sh == 1) { + for (int Y = dy; Y < (dy + dh); Y++) + drawSpan(dx, Y, dw, pixels[offset]); + return; + } + + // a quick hack for 1D arrays, stretch them to make them 2D + if (sw == 1) { + int[] temp = new int[2 * sh]; + + for (int i = 0; i < sw * sh; i++) { + temp[(i * 2) + 0] = pixels[offset + i]; + temp[(i * 2) + 1] = pixels[offset + i]; + } + + scansize = 2; + pixels = temp; + offset = 0; + sw = 2; + + } else if (sh == 1) { + int[] temp = new int[sw * 2]; + + System.arraycopy(pixels, offset, temp, 0, sw); + System.arraycopy(pixels, offset, temp, sw, sw); + + scansize = sw; + pixels = temp; + offset = 0; + sh = 2; + } + + if (tmpLine == null || tmpLine.length < dw + 1) { + tmpLine = new int[Math.max(1920, dw + 1)]; + } + + int a, b, c, d, x, y, index; + float x_ratio = ((float)(sw - 1)) / dw; + float y_ratio = ((float)(sh - 1)) / dh; + float x_diff, y_diff, blue, red, green, alpha; + int position = 0; + for (int i = 0; i < dh; i++) { + for (int j = 0; j < dw; j++) { + x = (int)(x_ratio * j); + y = (int)(y_ratio * i); + x_diff = (x_ratio * j) - x; + y_diff = (y_ratio * i) - y; + index = (y * scansize + x); + index += offset; + + a = pixels[index]; + b = pixels[index + 1]; + c = pixels[index + scansize]; + d = pixels[index + scansize + 1]; + + int aA = a >>> 24; + int bA = b >>> 24; + int cA = c >>> 24; + int dA = d >>> 24; + + if (aA + bA + cA + dA < 1) { + tmpLine[position++] = 0; + continue; + } + + /* calculate areas, weighted with alpha */ + float aFactor = (1-x_diff) * (1-y_diff) * aA; + float bFactor = x_diff * (1-y_diff) * bA; + float cFactor = (1-x_diff) * y_diff * cA; + float dFactor = x_diff * y_diff * dA; + + // alpha element + // Yr = Ar(1-w)(1-h) + Br(w)(1-h) + Cr(h)(1-w) + Dr(wh) + alpha = aFactor + bFactor + cFactor + dFactor; + + // blue element + // Yb = Ab(1-w)(1-h) + Bb(w)(1-h) + Cb(h)(1-w) + Db(wh) + blue = (a & 0xff) * aFactor + + (b & 0xff) * bFactor + + (c & 0xff) * cFactor + + (d & 0xff) * dFactor; + + // green element + // Yg = Ag(1-w)(1-h) + Bg(w)(1-h) + Cg(h)(1-w) + Dg(wh) + green = ((a >> 8) & 0xff) * aFactor + + ((b >> 8) & 0xff) * bFactor + + ((c >> 8) & 0xff) * cFactor + + ((d >> 8) & 0xff) * dFactor; + + // red element + // Yr = Ar(1-w)(1-h) + Br(w)(1-h) + Cr(h)(1-w) + Dr(wh) + red = ((a >> 16) & 0xff) * aFactor + + ((b >> 16) & 0xff) * bFactor + + ((c >> 16) & 0xff) * cFactor + + ((d >> 16) & 0xff) * dFactor; + + blue /= alpha; + green /= alpha; + red /= alpha; + + tmpLine[position++] = + ((((int)alpha) << 24) & 0xff000000) | + ((((int)red ) << 16) & 0x00ff0000) | + ((((int)green) << 8 ) & 0x0000ff00) | + ((((int)blue ) ) & 0x000000ff); + } + + if (flipY) { + drawSpan(dx, dy + dh - 1 - i, dw, tmpLine, 0, flipX); + } else { + drawSpan(dx, dy + i, dw, tmpLine, 0, flipX); + } + + position = 0; + } + } + + public Stroke getStroke() { + logger.unimplemented("getStroke"); + throw new Error(); + } + + public void setStroke(Stroke stroke) { + logger.unimplemented("setStroke"); + } + + public void dispose() { + tmpLine = null; + } + + public String toString() { + return getClass().getName() + "[" + originX + "," + originY + "]"; + } + + private static Image getBufferedImagePeer(BufferedImage image) { + try { + return (Image)bufferedImagePeer.get(image); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + return null; + } + + private static Field bufferedImagePeer; + + static { + try { + Class c = Class.forName("java.awt.image.BufferedImage"); + bufferedImagePeer = c.getDeclaredField("peer"); + bufferedImagePeer.setAccessible(true); + } catch (ClassNotFoundException e) { + throw new AWTError("java.awt.image.BufferedImage not found"); + } catch (SecurityException e) { + throw new AWTError("java.awt.image.BufferedImage.peer not accessible"); + } catch (NoSuchFieldException e) { + throw new AWTError("java.awt.image.BufferedImage.peer not found"); + } + } + + private static final Logger logger = Logger.getLogger(BDGraphics.class.getName()); +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDGraphicsConfigurationBase.java libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDGraphicsConfigurationBase.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDGraphicsConfigurationBase.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDGraphicsConfigurationBase.java 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * This file is part of libbluray + * Copyright (C) 2012 Libbluray + * + * 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 + * . + */ + +package java.awt; + +import java.awt.color.ColorSpace; +import java.awt.image.BufferedImage; +import java.awt.image.ColorModel; +import java.awt.image.DataBuffer; +import java.awt.image.DirectColorModel; +import java.awt.image.VolatileImage; + +abstract class BDGraphicsConfigurationBase extends GraphicsConfiguration { + private BDGraphicsDevice device; + + BDGraphicsConfigurationBase(BDGraphicsDevice device) { + this.device = device; + } + + public GraphicsDevice getDevice() { + return device; + } + + public Rectangle getBounds() { + return device.getBounds(); + } + + int getCompatibleImageType() { + return BufferedImage.TYPE_INT_ARGB; + } + + public synchronized ColorModel getColorModel() { + return new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), + 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000, true, + DataBuffer.TYPE_INT); + } + + public BufferedImage createCompatibleImage(int width, int height) { + if (width <= 0 || height <= 0) + return null; + return BDImage.getBuffededImage(width, height, this); + } + + public BufferedImage createCompatibleImage(int width, int height, int trans) { + if (width <= 0 || height <= 0) + return null; + return BDImage.getBuffededImage(width, height, this); + } + + public VolatileImage createCompatibleVolatileImage(int width, int height) { + org.videolan.Logger.unimplemented("BDGraphicsConfiguration", "createCompatibleVolatileImage"); + return null; + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDImageBase.java libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDImageBase.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDImageBase.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDImageBase.java 2014-09-01 12:06:01.000000000 +0000 @@ -142,16 +142,16 @@ return component; } - public int[] getBdBackBuffer() { + protected int[] getBdBackBuffer() { return backBuffer; } - public int[] getBackBuffer() { + protected int[] getBackBuffer() { System.err.println("**** BDIMAGE GETBACKBUFFER ****"); return backBuffer; } - public Area getDirtyArea() { + protected Area getDirtyArea() { return dirty; } @@ -218,7 +218,7 @@ return rgbArray; } - public synchronized void setRGB(int x, int y, int rgb) { + public void setRGB(int x, int y, int rgb) { backBuffer[y * width + x] = rgb; dirty.add(x, y); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDJHelper.java libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDJHelper.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDJHelper.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDJHelper.java 2014-09-01 12:06:17.000000000 +0000 @@ -78,8 +78,12 @@ event = new KeyEvent(focusOwner, id, when, modifiers, KeyEvent.VK_UNDEFINED, (char)keyCode); else event = new KeyEvent(focusOwner, id, when, modifiers, keyCode, KeyEvent.CHAR_UNDEFINED); - BDToolkit.getEventQueue(focusOwner).postEvent(event); - return true; + + EventQueue eq = BDToolkit.getEventQueue(focusOwner); + if (eq != null) { + eq.postEvent(event); + return true; + } } catch (Throwable e) { org.videolan.Logger.getLogger("BDJHelper").error("postKeyEvent failed: " + e); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDRootWindow.java libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDRootWindow.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDRootWindow.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDRootWindow.java 2014-09-01 12:06:36.000000000 +0000 @@ -140,11 +140,13 @@ /* called when new title starts (window is "created" again) */ public void clearOverlay() { - if (overlay_open) { - logger.error("clearOverlay() ignored (overlay is visible)"); - } else { - Arrays.fill(backBuffer, 0); - dirty.clear(); + synchronized (this) { + if (overlay_open) { + logger.error("clearOverlay() ignored (overlay is visible)"); + } else { + Arrays.fill(backBuffer, 0); + dirty.clear(); + } } } @@ -168,6 +170,8 @@ BDToolkit.setFocusedWindow(null); super.dispose(); + + backBuffer = null; } private int[] backBuffer = null; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDToolkitBase.java libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDToolkitBase.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDToolkitBase.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDToolkitBase.java 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,245 @@ +/* + * This file is part of libbluray + * Copyright (C) 2012 libbluray + * Copyright (C) 2012-2014 Petri Hintukainen + * + * 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 + * . + */ + +package java.awt; + +import java.awt.image.ColorModel; +import java.awt.image.ImageObserver; +import java.awt.image.ImageProducer; +import java.io.File; +import java.net.URL; +import java.util.Collections; +import java.util.Hashtable; +import java.util.WeakHashMap; +import java.util.Map; +import java.util.Iterator; + +import sun.awt.image.ByteArrayImageSource; +import sun.awt.image.FileImageSource; +import sun.awt.image.URLImageSource; + +import org.videolan.BDJXletContext; +import org.videolan.Logger; + +abstract class BDToolkitBase extends Toolkit { + private EventQueue eventQueue = new EventQueue(); + private BDGraphicsEnvironment localEnv = new BDGraphicsEnvironment(); + private BDGraphicsConfiguration defaultGC = (BDGraphicsConfiguration)localEnv.getDefaultScreenDevice().getDefaultConfiguration(); + private static Hashtable cachedImages = new Hashtable(); + private static final Logger logger = Logger.getLogger(BDToolkit.class.getName()); + + // mapping of Components to AppContexts, WeakHashMap + private static final Map contextMap = Collections.synchronizedMap(new WeakHashMap()); + + + public BDToolkitBase () { + } + + public static void setFocusedWindow(Window window) { + } + + public static void shutdownDisc() { + try { + Toolkit toolkit = getDefaultToolkit(); + if (toolkit instanceof BDToolkit) { + ((BDToolkit)toolkit).shutdown(); + } + } catch (Throwable t) { + logger.error("shutdownDisc() failed: " + t); + t.printStackTrace(); + } + } + + protected void shutdown() { + /* + if (eventQueue != null) { + BDJHelper.stopEventQueue(eventQueue); + eventQueue = null; + } + */ + cachedImages.clear(); + contextMap.clear(); + } + + public Dimension getScreenSize() { + Rectangle dims = defaultGC.getBounds(); + return new Dimension(dims.width, dims.height); + } + + Graphics getGraphics(Window window) { + if (!(window instanceof BDRootWindow)) { + System.err.println("getGraphics(): not BDRootWindow"); + throw new Error("Not implemented"); + } + return new BDWindowGraphics((BDRootWindow)window); + } + + GraphicsEnvironment getLocalGraphicsEnvironment() { + return localEnv; + } + + public int getScreenResolution() { + return 72; + } + + public ColorModel getColorModel() { + return defaultGC.getColorModel(); + } + + public String[] getFontList() { + return BDFontMetrics.getFontList(); + } + + public FontMetrics getFontMetrics(Font font) { + return BDFontMetrics.getFontMetrics(font); + } + + static void clearCache(BDImage image) { + synchronized (cachedImages) { + Iterator i = cachedImages.entrySet().iterator(); + while (i.hasNext()) { + Map.Entry entry = (Map.Entry) i.next(); + if (entry.getValue() == image) { + i.remove(); + return; + } + } + } + } + + public Image getImage(String filename) { + if (cachedImages.containsKey(filename)) + return (Image)cachedImages.get(filename); + Image newImage = createImage(filename); + if (newImage != null) + cachedImages.put(filename, newImage); + return newImage; + } + + public Image getImage(URL url) { + if (cachedImages.containsKey(url)) + return (Image)cachedImages.get(url); + Image newImage = createImage(url); + if (newImage != null) + cachedImages.put(url, newImage); + return newImage; + } + + public Image createImage(String filename) { + if (!new File(filename).isAbsolute()) { + URL url = BDJXletContext.getCurrentResource(filename); + if (url != null) { + logger.warning("" + filename + " translated to " + url); + return createImage(url); + } + } + + ImageProducer ip = new FileImageSource(filename); + Image newImage = createImage(ip); + return newImage; + } + + public Image createImage(URL url) { + ImageProducer ip = new URLImageSource(url); + Image newImage = createImage(ip); + return newImage; + } + + public Image createImage(byte[] imagedata, + int imageoffset, + int imagelength) { + ImageProducer ip = new ByteArrayImageSource(imagedata, imageoffset, imagelength); + Image newImage = createImage(ip); + return newImage; + } + + public Image createImage(ImageProducer producer) { + return new BDImageConsumer(producer); + } + + public Image createImage(Component component, int width, int height) { + return new BDImage(component, width, height, defaultGC); + } + + public boolean prepareImage(Image image, int width, int height, ImageObserver observer) { + if (!(image instanceof BDImageConsumer)) + return true; + BDImageConsumer img = (BDImageConsumer)image; + return img.prepareImage(observer); + } + + public int checkImage(Image image, int width, int height, + ImageObserver observer) { + if (!(image instanceof BDImageConsumer)) { + return ImageObserver.ALLBITS; + } + BDImageConsumer img = (BDImageConsumer)image; + return img.checkImage(observer); + } + + public void beep() { + } + + public static void addComponent(Component component) { + + BDJXletContext context = BDJXletContext.getCurrentContext(); + if (context == null) { + logger.warning("addComponent() outside of app context"); + return; + } + contextMap.put(component, context); + } + + public static EventQueue getEventQueue(Component component) { + if (component != null) { + do { + BDJXletContext ctx = (BDJXletContext)contextMap.get(component); + if (ctx != null) { + EventQueue eq = ctx.getEventQueue(); + if (eq == null) { + logger.warning("getEventQueue() failed: no context event queue"); + } + return eq; + } + + component = component.getParent(); + } while (component != null); + + logger.warning("getEventQueue() failed: no context"); + return null; + } + + logger.warning("getEventQueue() failed: no component"); + return null; + } + + protected EventQueue getSystemEventQueueImpl() { + BDJXletContext ctx = BDJXletContext.getCurrentContext(); + if (ctx != null) { + EventQueue eq = ctx.getEventQueue(); + if (eq != null) { + return eq; + } + } + + logger.warning("getSystemEventQueue(): no context"); + return eventQueue; + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDWindowGraphics.java libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDWindowGraphics.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDWindowGraphics.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/java/awt/BDWindowGraphics.java 2014-09-01 12:06:01.000000000 +0000 @@ -136,7 +136,7 @@ } } - public void drawStringN(long ftFace, String string, int x, int y, int rgb) { + protected void drawStringN(long ftFace, String string, int x, int y, int rgb) { synchronized (window) { super.drawStringN(ftFace, string, x, y, rgb); window.notifyChanged(); @@ -151,11 +151,13 @@ public boolean drawImageN(Image img, int dx, int dy, int dw, int dh, int sx, int sy, int sw, int sh, + boolean flipX, boolean flipY, Color bg, ImageObserver observer) { synchronized (window) { boolean complete = super.drawImageN( img, dx, dy, dw, dh, sx, sy, sw, sh, + flipX, flipY, bg, observer); if (complete) { window.notifyChanged(); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/PolyEdge.java libbluray-0.6.2/src/libbluray/bdj/java/java/awt/PolyEdge.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/PolyEdge.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/java/awt/PolyEdge.java 2014-09-01 12:06:17.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 libbluray + * + * 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 + * . + */ + +package java.awt; + +class PolyEdge { + + private int x1; + private int y1; + //private int x2; + private int y2; + private float m; + private float c; + private boolean vertical; + + PolyEdge(int x1, int y1, int x2, int y2) { + + // sort lowest to highest + if (y2 < y1) { + int swap; + swap = x1; x1 = x2; x2 = swap; + swap = y1; y1 = y2; y2 = swap; + } + + this.x1 = x1; + this.y1 = y1; + //this.x2 = x2; + this.y2 = y2; + + if (x1 == x2) { + vertical = true; + m = 0; + } else { + m = (float)(y2 - y1) / (float)(x2 - x1); + c = (-x1 * m) + y1; + vertical = false; + } + } + + public boolean intersects(int y) { + + if (y <= y2 && y >= y1 && y1 != y2) { + return true; + } + + return false; + } + + public int intersectionX(int y) { + + if (vertical) { + return x1; + } + + return (int)(((y - c) / m) + 0.5f); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/io/BDFileSystem.java libbluray-0.6.2/src/libbluray/bdj/java/java/io/BDFileSystem.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/io/BDFileSystem.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/java/io/BDFileSystem.java 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,239 @@ +/* + * This file is part of libbluray + * + * 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 + * . + */ + +/* + * Wrapper for java.io.FileSystem class. + * + * - replace getBooleanAttributes() for relative paths. + * Pretend files exist, if those are in xlet home directory (inside .jar). + * No other relative paths are allowed. + */ + +package java.io; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + +import java.net.URL; + +import org.videolan.BDJXletContext; +import org.videolan.Logger; + +public abstract class BDFileSystem extends FileSystem { + + private static final Logger logger = Logger.getLogger(BDFileSystem.class.getName()); + + protected final FileSystem fs; + + public static void init(Class c) { + Field filesystem; + try { + filesystem = c.getDeclaredField("fs"); + filesystem.setAccessible(true); + + /* Java 8: remove "final" modifier from the field */ + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(filesystem, filesystem.getModifiers() & ~Modifier.FINAL); + + FileSystem fs = (FileSystem)filesystem.get(null); + if (fs instanceof BDFileSystemImpl) { + //System.err.print("FileSystem already wrapped"); + } else { + filesystem.set(null, new BDFileSystemImpl(fs)); + } + } catch (Throwable t) { + System.err.print("Hooking FileSystem class failed: " + t); + } + } + + public BDFileSystem(FileSystem fs) { + this.fs = fs; + } + + public char getSeparator() { + return fs.getSeparator(); + } + + public char getPathSeparator() { + return fs.getPathSeparator(); + } + + public String normalize(String pathname) { + return fs.normalize(pathname); + } + + public int prefixLength(String pathname) { + return fs.prefixLength(pathname); + } + + public String resolve(String parent, String child) { + return fs.resolve(parent, child); + } + + public String getDefaultParent() { + return fs.getDefaultParent(); + } + + public String fromURIPath(String path) { + return fs.fromURIPath(path); + } + + public boolean isAbsolute(File f) { + return fs.isAbsolute(f); + } + + public String resolve(File f) { + if (!f.isAbsolute()) { + System.err.println("***** resolve " + f + " -> " + fs.resolve(f)); + } + return fs.resolve(f); + } + + public String canonicalize(String path) throws IOException { + return fs.canonicalize(path); + } + + public int getBooleanAttributes(File f) { + if (f.isAbsolute()) { + return fs.getBooleanAttributes(f); + } + + /* try to locate file in Xlet home directory (inside JAR file) */ + URL url = BDJXletContext.getCurrentResource(f.getPath()); + if (url == null) { + return 0; + } + + logger.info("Relative path " + f.getPath() + " translated to " + url); + + return FileSystem.BA_EXISTS; //|BA_REGULAR + } + + /* + ME: public abstract boolean checkAccess(File f, boolean write); + SE: public abstract boolean checkAccess(File f, int access); + */ + + public long getLastModifiedTime(File f) { + return fs.getLastModifiedTime(f); + } + + public long getLength(File f) { + return fs.getLength(f); + } + + /* + SE only + public abstract boolean setPermission(File f, int access, boolean enable, boolean owneronly); + */ + + /* this version exists in some java6 versions. + * Use reflection to make sure build succees and right method is called. + */ + public boolean createFileExclusively(String path, boolean restrictive) throws IOException { + return createFileExclusivelyImpl(path, restrictive); + } + /* this version exists in most java versions (1.4, 1.7, some 1.6 versions) */ + public boolean createFileExclusively(String path) throws IOException { + return createFileExclusivelyImpl(path, false); + } + + private boolean createFileExclusivelyImpl(String path, boolean restrictive) throws IOException { + Method m; + Object[] args; + + /* resolve method and set up arguments */ + try { + try { + m = fs.getClass().getDeclaredMethod("createFileExclusively", new Class[] { String.class }); + args = new Object[] {(Object)path}; + } catch (NoSuchMethodException e) { + m = fs.getClass().getDeclaredMethod("createFileExclusively", new Class[] { String.class, boolean.class }); + args = new Object[] {(Object)path, (Object)new Boolean(restrictive)}; + } + } catch (NoSuchMethodException e) { + logger.error("no matching FileSystem.createFileExclusively found !"); + throw new IOException(); + } + + /* call */ + try { + Boolean result = (Boolean)m.invoke(fs, args); + return result.booleanValue(); + } catch (IllegalAccessException e) { + logger.error("" + e); + throw new IOException(); + } catch (InvocationTargetException e) { + Throwable t = e.getTargetException(); + if (t instanceof IOException) { + throw (IOException)t; + } + logger.error("" + t); + throw new IOException(); + } + } + + /* + ME only + public abstract boolean deleteOnExit(File f); + */ + + /* + SE only + public abstract long getSpace(File f, int t); + */ + + public boolean delete(File f) { + return fs.delete(f); + } + + public String[] list(File f) { + return fs.list(f); + } + + public boolean createDirectory(File f) { + return fs.createDirectory(f); + } + + public boolean rename(File f1, File f2) { + return fs.rename(f1, f2); + } + + public boolean setLastModifiedTime(File f, long time) { + return fs.setLastModifiedTime(f, time); + } + + public boolean setReadOnly(File f) { + return fs.setReadOnly(f); + } + + public File[] listRoots() { + return fs.listRoots(); + } + + public int compare(File f1, File f2) { + return fs.compare(f1, f2); + } + + public int hashCode(File f) { + return fs.hashCode(f); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/io/FileDescriptor.java libbluray-0.6.2/src/libbluray/bdj/java/java/io/FileDescriptor.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/io/FileDescriptor.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/java/io/FileDescriptor.java 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * This file is part of libbluray + * + * 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 + * . + */ + +package java.io; + +public final class FileDescriptor { + + /* for files used by JVM */ + private int fd; + private long handle; + + /* for files in BD VFS */ + private long fp; + + /* for files inside .jar */ + protected InputStream slave; + + private int useCount; + + public FileDescriptor() { + fd = -1; + handle = -1; + fp = 0; + slave = null; + useCount = 0; + } + + private FileDescriptor(int fd) { + this(); + this.fd = fd; + } + + public static final FileDescriptor in = new FileDescriptor(0); + public static final FileDescriptor out = new FileDescriptor(1); + public static final FileDescriptor err = new FileDescriptor(2); + + public boolean valid() { + return (fd != -1) || (handle != -1) || (fp != 0) || (slave != null); + } + + public native void sync() throws SyncFailedException; + + private static native void initIDs(); + + static { + initIDs(); + } + + int incrementAndGetUseCount() { + synchronized (this) { + useCount = useCount + 1; + return useCount; + } + } + + int decrementAndGetUseCount() { + synchronized (this) { + useCount = useCount - 1; + return useCount; + } + } + + /* Java 8 */ + void attach(Closeable c) { + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/io/FileInputStream.java libbluray-0.6.2/src/libbluray/bdj/java/java/io/FileInputStream.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/io/FileInputStream.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/java/io/FileInputStream.java 2014-09-01 12:06:36.000000000 +0000 @@ -0,0 +1,219 @@ +/* + * This file is part of libbluray + * + * 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 + * . + */ + +package java.io; + +import java.net.URL; +//import java.nio.channels.FileChannel; + +import org.videolan.BDJXletContext; +import org.videolan.Logger; + +public class FileInputStream extends InputStream +{ + private FileDescriptor fd; + + private final Object closeLock = new Object(); + private volatile boolean closed = false; + + private static Logger logger = null; + + private int available = 0; + + public FileInputStream(File file) throws FileNotFoundException { + String name = file != null ? file.getPath() : null; + + SecurityManager security = System.getSecurityManager(); + if (security != null) { + security.checkRead(name); + } + if (name == null) { + throw new NullPointerException(); + } + + fd = new FileDescriptor(); + fd.incrementAndGetUseCount(); + + if (file.isAbsolute()) { + open(name); + } else { + /* relative paths are problematic ... */ + /* Those should be mapped to xlet home directory, which is inside .jar file. */ + openResource(name); + } + + available = 1024; + } + + public FileInputStream(String name) throws FileNotFoundException { + this(name != null ? new File(name) : null); + } + + public FileInputStream(FileDescriptor fdObj) { + SecurityManager security = System.getSecurityManager(); + if (fdObj == null) { + throw new NullPointerException(); + } + if (security != null) { + security.checkRead(fdObj); + } + fdObj.incrementAndGetUseCount(); + fd = fdObj; + available = 1024; + } + + private void openResource(String name) throws FileNotFoundException { + if (logger == null) { + logger = Logger.getLogger(FileInputStream.class.getName()); + } + + /* J2SE URL.getPath() returns file:/xxx.jar!/... for jar resource urls ... */ + if (name.indexOf("file:/") == 0 && name.indexOf(".jar!/") > 0) { + logger.error("Fixing invalid resource url: " + name); + name = name.substring(name.indexOf(".jar!") + 6); + } + + /* try to locate file in Xlet home directory (inside JAR file) */ + + ClassLoader cldr = (ClassLoader)BDJXletContext.getCurrentClassLoader(); + if (cldr == null) { + throw new FileNotFoundException(name); + } + + if (name.startsWith("./") || name.startsWith(".\\")) { + name = name.substring(2); + } + + URL url = cldr.getResource(name); + if (url == null) { + logger.error("Resource not found: " + name); + throw new FileNotFoundException(name); + } + logger.info(name + " translated to " + url); + + fd.slave = cldr.getResourceAsStream(name); + if (fd.slave == null) { + logger.error("Error getting resource as stream"); + throw new FileNotFoundException(name); + } + } + + + private native void open(String name) throws FileNotFoundException; + private native int readBytes(byte b[], int off, int len) throws IOException; + private native int close0(); + + //public native int read() throws IOException; + //public native long skip(long n) throws IOException; + //public native int available() throws IOException; + + public int available() throws IOException { + if (fd != null && fd.slave != null) { + return fd.slave.available(); + } + return available; + } + + public int read() throws IOException { + byte b[] = new byte[1]; + if (read(b) == 1) + return b[0]; + return -1; + } + + public int read(byte b[]) throws IOException { + return read(b, 0, b.length); + } + + public int read(byte b[], int off, int len) throws IOException { + if (b == null) { + throw new NullPointerException(); + } + if (off < 0 || len < 0 || off > b.length || (off + len) > b.length || (off + len) < 0) { + throw new IndexOutOfBoundsException(); + } + + if (fd != null && fd.slave != null) { + return fd.slave.read(b, off, len); + } + + int r = readBytes(b, off, len); + if (r != len) { + available = 0; + } + return r; + } + + public long skip(long n) throws IOException { + return super.skip(n); + } + + public void close() throws IOException { + close(true); + } + + public void close(boolean force) throws IOException { + synchronized (closeLock) { + if (closed) { + return; + } + closed = true; + } + + available = 0; + + if (fd != null) { + if (fd.slave != null) { + fd.slave.close(); + return; + } + + int n = fd.decrementAndGetUseCount(); + if (n > 0 && !force) { + return; + } + } + + close0(); + } + + public final FileDescriptor getFD() throws IOException { + if (fd == null) { + throw new IOException(); + } + return fd; + } + + /* not in J2SE + public FileChannel getChannel() {} + */ + + private static native void initIDs(); + + static { + initIDs(); + } + + protected void finalize() throws IOException { + if (fd != null) { + if (fd != fd.in) { + close(false); + } + } + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Clock.java libbluray-0.6.2/src/libbluray/bdj/java/javax/media/Clock.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Clock.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/javax/media/Clock.java 2014-09-01 12:06:01.000000000 +0000 @@ -47,5 +47,5 @@ public float setRate(float factor); - public static final Time RESET = null; + public static final Time RESET = new Time(Long.MAX_VALUE); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Controller.java libbluray-0.6.2/src/libbluray/bdj/java/javax/media/Controller.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Controller.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/javax/media/Controller.java 2014-09-01 12:06:01.000000000 +0000 @@ -42,7 +42,7 @@ public void removeControllerListener(ControllerListener listener); - public static final Time LATENCY_UNKNOWN = null; + public static final Time LATENCY_UNKNOWN = new Time(Long.MAX_VALUE); public static final int Unrealized = 100; public static final int Realizing = 200; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Duration.java libbluray-0.6.2/src/libbluray/bdj/java/javax/media/Duration.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Duration.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/javax/media/Duration.java 2014-09-01 12:06:01.000000000 +0000 @@ -22,6 +22,6 @@ public interface Duration { public Time getDuration(); - public static final Time DURATION_UNBOUNDED = null; - public static final Time DURATION_UNKNOWN = null; + public static final Time DURATION_UNBOUNDED = new Time(Long.MAX_VALUE); + public static final Time DURATION_UNKNOWN = new Time(Long.MAX_VALUE - 1); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/SIManagerImpl.java libbluray-0.6.2/src/libbluray/bdj/java/javax/tv/service/SIManagerImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/SIManagerImpl.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/javax/tv/service/SIManagerImpl.java 2014-09-01 12:06:01.000000000 +0000 @@ -41,6 +41,12 @@ } } + public static void shutdown() { + synchronized (SIManagerImpl.class) { + instance = null; + } + } + protected SIManagerImpl() { int ntitles = Libbluray.getTitles(); LinkedList list = new LinkedList(); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/bdplus/Status.java libbluray-0.6.2/src/libbluray/bdj/java/org/bluray/bdplus/Status.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/bdplus/Status.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/bluray/bdplus/Status.java 2014-09-01 12:06:01.000000000 +0000 @@ -32,13 +32,25 @@ return instance; } + public static void shutdown() { + Status s; + synchronized (Status.class) { + s = instance; + instance = null; + } + if (s != null) { + s.listeners.clear(); + } + } + public void addListener(StatusListener listener) { listeners.add(listener); } public int get() { - logger.trace("get()"); - return Libbluray.readPSR(104); + int val = Libbluray.readPSR(104); + logger.trace("get(): 0x" + Integer.toHexString(val)); + return val; } public void removeListener(StatusListener listener) { @@ -46,17 +58,17 @@ } public void send(int data) { - logger.trace("send(" + data + ")"); + logger.trace("send(0x" + Integer.toHexString(data) + ")"); Libbluray.writePSR(103, data); } public void set(int data) { - logger.trace("set(" + data + ")"); + logger.trace("set(0x" + Integer.toHexString(data) + ")"); Libbluray.writePSR(104, data); } public void receive(int data) { - logger.trace("receive(" + data + ")"); + logger.trace("receive(0x" + Integer.toHexString(data) + ")"); listeners.putPSR102Callback(data); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java libbluray-0.6.2/src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java 2014-09-01 12:06:01.000000000 +0000 @@ -35,8 +35,6 @@ import org.bluray.ti.Title; import org.bluray.ti.TitleImpl; import org.videolan.BDJLoader; -import org.videolan.BDJAction; -import org.videolan.BDJActionManager; import org.videolan.BDJLoaderCallback; import org.videolan.BDJListeners; import org.videolan.media.content.playlist.Handler; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/TitleImpl.java libbluray-0.6.2/src/libbluray/bdj/java/org/bluray/ti/TitleImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/TitleImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/bluray/ti/TitleImpl.java 2014-09-01 12:06:36.000000000 +0000 @@ -65,7 +65,7 @@ case TitleInfo.BDJ_PLAYBACK_TYPE_INTERACTIVE: return TitleType.BDJ_INTERACTIVE; } - return null; + return TitleType.UNKNOWN; } public boolean hasMultipleInstances() { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java libbluray-0.6.2/src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java 2014-09-01 12:06:01.000000000 +0000 @@ -70,6 +70,7 @@ boolean initBackupRegs) throws PreparingFailedException { logger.unimplemented("requestUpdating(" + manifestfile + ")"); + throw new PreparingFailedException(); } private int state; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/AsynchronousLoadingEvent.java libbluray-0.6.2/src/libbluray/bdj/java/org/dvb/dsmcc/AsynchronousLoadingEvent.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/AsynchronousLoadingEvent.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/dvb/dsmcc/AsynchronousLoadingEvent.java 2014-09-01 12:06:01.000000000 +0000 @@ -29,9 +29,8 @@ public Object getSource() { - return source; + return super.getSource(); } - private DSMCCObject source; private static final long serialVersionUID = -688613909871281279L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/event/EventManager.java libbluray-0.6.2/src/libbluray/bdj/java/org/dvb/event/EventManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/event/EventManager.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/dvb/event/EventManager.java 2014-09-01 12:06:01.000000000 +0000 @@ -31,7 +31,6 @@ import org.davic.resources.ResourceStatusListener; import org.havi.ui.HScene; import org.videolan.BDJAction; -import org.videolan.BDJActionManager; import org.videolan.BDJXletContext; import org.videolan.GUIManager; import org.videolan.Logger; @@ -45,14 +44,29 @@ return instance; } + public static void shutdown() { + EventManager e; + synchronized (EventManager.class) { + e = instance; + instance = null; + } + if (e != null) { + e.exclusiveUserEventListener.clear(); + e.sharedUserEventListener.clear(); + e.exclusiveAWTEventListener.clear(); + e.resourceStatusEventListeners.clear(); + } + } + public boolean addUserEventListener(UserEventListener listener, ResourceClient client, UserEventRepository userEvents) throws IllegalArgumentException { if (client == null) throw new IllegalArgumentException(); + BDJXletContext context = BDJXletContext.getCurrentContext(); synchronized (this) { if (!cleanupReservedEvents(userEvents)) return false; - exclusiveUserEventListener.add(new UserEventItem(BDJXletContext.getCurrentContext(), listener, client, userEvents)); + exclusiveUserEventListener.add(new UserEventItem(context, listener, client, userEvents)); sendResourceStatusEvent(new UserEventUnavailableEvent(userEvents)); return true; } @@ -61,8 +75,9 @@ public void addUserEventListener(UserEventListener listener, UserEventRepository userEvents) { if (listener == null || userEvents == null) throw new NullPointerException(); + BDJXletContext context = BDJXletContext.getCurrentContext(); synchronized (this) { - sharedUserEventListener.add(new UserEventItem(BDJXletContext.getCurrentContext(), listener, null, userEvents)); + sharedUserEventListener.add(new UserEventItem(context, listener, null, userEvents)); } } @@ -88,10 +103,11 @@ throws IllegalArgumentException { if (client == null) throw new IllegalArgumentException(); + BDJXletContext context = BDJXletContext.getCurrentContext(); synchronized (this) { if (!cleanupReservedEvents(userEvents)) return false; - exclusiveAWTEventListener.add(new UserEventItem(BDJXletContext.getCurrentContext(), null, client, userEvents)); + exclusiveAWTEventListener.add(new UserEventItem(context, null, client, userEvents)); sendResourceStatusEvent(new UserEventUnavailableEvent(userEvents)); return true; } @@ -140,7 +156,8 @@ BDJXletContext context = focusHScene.getXletContext(); for (Iterator it = exclusiveAWTEventListener.iterator(); it.hasNext(); ) { UserEventItem item = (UserEventItem)it.next(); - if (item.context == null) { + if (item.context == null || item.context.isReleased()) { + logger.error("Removing exclusive AWT event listener for " + item.context); it.remove(); continue; } @@ -155,7 +172,8 @@ for (Iterator it = exclusiveUserEventListener.iterator(); it.hasNext(); ) { UserEventItem item = (UserEventItem)it.next(); - if (item.context == null) { + if (item.context == null || item.context.isReleased()) { + logger.error("Removing exclusive UserEvent listener for " + item.context); it.remove(); continue; } @@ -169,7 +187,8 @@ for (Iterator it = sharedUserEventListener.iterator(); it.hasNext(); ) { UserEventItem item = (UserEventItem)it.next(); - if (item.context == null) { + if (item.context == null || item.context.isReleased()) { + logger.error("Removing UserEvent listener for " + item.context); it.remove(); continue; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/event/UserEventAvailableEvent.java libbluray-0.6.2/src/libbluray/bdj/java/org/dvb/event/UserEventAvailableEvent.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/event/UserEventAvailableEvent.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/dvb/event/UserEventAvailableEvent.java 2014-09-01 12:06:01.000000000 +0000 @@ -29,9 +29,8 @@ public Object getSource() { - return source; + return super.getSource(); } - private Object source; private static final long serialVersionUID = 1747902573730814730L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/io/ixc/IxcRegistry.java libbluray-0.6.2/src/libbluray/bdj/java/org/dvb/io/ixc/IxcRegistry.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/io/ixc/IxcRegistry.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/dvb/io/ixc/IxcRegistry.java 2014-09-01 12:06:01.000000000 +0000 @@ -33,10 +33,23 @@ private static IxcRegistryImpl registry = null; private static IxcRegistryImpl getIxcRegistry() { - if (registry == null) { - registry = new IxcRegistryImpl(); + synchronized (IxcRegistry.class) { + if (registry == null) { + registry = new IxcRegistryImpl(); + } + return registry; + } + } + + public static void shutdown() { + IxcRegistryImpl r; + synchronized (IxcRegistry.class) { + r = registry; + registry = null; + } + if (r != null) { + r.unbindAll(); } - return registry; } public static Remote lookup(XletContext xc, String path) throws NotBoundException, RemoteException { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/event/HEventGroup.java libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/event/HEventGroup.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/event/HEventGroup.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/event/HEventGroup.java 2014-09-01 12:06:01.000000000 +0000 @@ -96,5 +96,5 @@ return arr; } - private LinkedList keys; + private LinkedList keys = new LinkedList(); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HContainer.java libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HContainer.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HContainer.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HContainer.java 2014-09-01 12:06:01.000000000 +0000 @@ -23,92 +23,292 @@ import java.awt.Container; import org.dvb.ui.TestOpacity; +//https://www.jinahya.com/mvn/site/com.googlecode.jinahya/ocap-api/1.3.1/apidocs/org/havi/ui/HContainer.html + public class HContainer extends Container implements HMatteLayer, HComponentOrdering, TestOpacity { public HContainer() { - org.videolan.Logger.unimplemented(HContainer.class.getName(), ""); + this(0,0,0,0); } public HContainer(int x, int y, int width, int height) { - org.videolan.Logger.unimplemented(HContainer.class.getName(), ""); + setBounds(x,y,width,height); } public void setMatte(HMatte m) throws HMatteException { - throw new Error("Not implemented"); + throw new HMatteException("Matte is not supported"); } public HMatte getMatte() { - throw new Error("Not implemented"); + return hMatte; } public boolean isDoubleBuffered() { - throw new Error("Not implemented"); + return false; // can this be true ? } public boolean isOpaque() { - throw new Error("Not implemented"); + return false; // can this be true ? + } + + private int getOffset(java.awt.Component c) throws ArrayIndexOutOfBoundsException + { + Component cs[] = getComponents(); + for (int i = 0; i < cs.length; ++i) + if (cs[i] == c) return i; + + throw new ArrayIndexOutOfBoundsException("Component not contained within"); + } + + private void checkLineage(java.awt.Component c) + { + if (c.getParent() != this) throw new ArrayIndexOutOfBoundsException("Component not contained within"); } public Component addBefore(Component component, Component behind) { - throw new Error("Not implemented"); + // check to see if behind is an element of this container + try + { + getOffset(behind); + } + catch (Exception e) + { + return null; + } + + if (component == behind) return component; + synchronized (getTreeLock()) + { + try + { + // Explicitly remove component if in this container. + // Should have no effect if not in this container. + // This must be done so that problems don't occur + // when componentIndex < frontIndex. + remove(component); + + int offset = getOffset(behind); + + return add(component, offset); + } + catch (Exception e) + { + return null; + } + } } public Component addAfter(Component component, Component front) { - throw new Error("Not implemented"); + // check to see if front is an element of this container + try + { + getOffset(front); + } + catch (Exception e) + { + return null; + } + + if (component == front) return component; + synchronized (getTreeLock()) + { + try + { + // Explicitly remove component if in this container. + // Should have no effect if not in this container. + // This must be done so that problems don't occur + // when componentIndex < frontIndex. + remove(component); + + int offset = getOffset(front); + + return add(component, offset + 1); + } + catch (Exception e) + { + return null; + } + } } public boolean popToFront(Component component) { - throw new Error("Not implemented"); + synchronized (getTreeLock()) + { + try + { + // Ensure it is there + checkLineage(component); + + // explicitly remove component + // (even if reparenting is implicit) + remove(component); + add(component, 0); + return true; + } + catch (Exception e) + { + return false; + } + } } public boolean pushToBack(Component component) { - throw new Error("Not implemented"); + synchronized (getTreeLock()) + { + try + { + // Ensure it is there + checkLineage(component); + + // explicitly remove component + // (even if reparenting is implicit) + remove(component); + add(component, -1); + return true; + } + catch (Exception e) + { + return false; + } + } } public boolean pop(Component component) { - throw new Error("Not implemented"); + synchronized (getTreeLock()) + { + try + { + int offset = getOffset(component); + + if (offset > 0) + { + // explicitly remove component + // (even if reparenting is implicit) + remove(component); + add(component, offset - 1); + return true; + } + } + catch (Exception e) + { + } + return false; + } } public boolean push(Component component) { - throw new Error("Not implemented"); + synchronized (getTreeLock()) + { + try + { + int offset = getOffset(component); + int count = getComponentCount(); + + if (offset == (count - 1)) + { + return true; + } + + if (offset < (count - 1)) + { + // explicitly remove component + // (even if reparenting is implicit) + remove(component); + add(component, offset + 1); + return true; + } + } + catch (Exception e) + { + } + + return false; + } } public boolean popInFrontOf(Component move, Component behind) { - throw new Error("Not implemented"); + synchronized (getTreeLock()) + { + try + { + if (move != behind) + { + // Ensure they are present + checkLineage(move); + checkLineage(behind); + + // explicitly remove component + // (even if reparenting is implicit) + remove(move); + // Re-add + addBefore(move, behind); + } + return true; + } + catch (Exception e) + { + return false; + } + } } public boolean pushBehind(Component move, Component front) { - throw new Error("Not implemented"); + synchronized (getTreeLock()) + { + try + { + if (move != front) + { + // Ensure they are present + checkLineage(move); + checkLineage(front); + + // explicitly remove component + // (even if reparenting is implicit) + remove(move); + // re-add in proper location + addAfter(move, front); + } + return true; + } + catch (Exception e) + { + return false; + } + } } public void group() { - throw new Error("Not implemented"); + grouped = true; } public void ungroup() { - throw new Error("Not implemented"); + grouped = false; } public boolean isGrouped() { - throw new Error("Not implemented"); + return grouped; } + private HMatte hMatte = null; + private boolean grouped = false; + private static final long serialVersionUID = 263606166411114032L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HGraphicLook.java libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HGraphicLook.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HGraphicLook.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HGraphicLook.java 2014-09-01 12:06:01.000000000 +0000 @@ -52,7 +52,7 @@ public void widgetChanged (HVisible visible, HChangeData[] changes) { - throw new Error("Not implemented"); + if (visible.isVisible()) visible.repaint(); } public Dimension getMinimumSize(HVisible hvisible) diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HGraphicsDevice.java libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HGraphicsDevice.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HGraphicsDevice.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HGraphicsDevice.java 2014-09-01 12:06:01.000000000 +0000 @@ -19,6 +19,8 @@ package org.havi.ui; +import org.videolan.Logger; + public class HGraphicsDevice extends HScreenDevice { protected HGraphicsDevice() { int length = HScreenConfigTemplate.defaultConfig.length; @@ -66,9 +68,17 @@ throws SecurityException, HPermissionDeniedException, HConfigurationException { this.hgc = hgc; + + logger.unimplemented("setGraphicsConfiguration"); + + //org.videolan.GUIManager.getInstance().setBounds(0, 0, 960, 540); + // -- not enough ... + return true; } private HGraphicsConfiguration[] hgcArray; private HGraphicsConfiguration hgc; + + private static final Logger logger = Logger.getLogger(HGraphicsDevice.class.getName()); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HScene.java libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HScene.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HScene.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HScene.java 2014-09-01 12:06:01.000000000 +0000 @@ -181,15 +181,11 @@ } public void addWindowListener(WindowListener listener) { - synchronized (windowListener) { - windowListener = HEventMulticaster.add(windowListener, listener); - } + windowListener = HEventMulticaster.add(windowListener, listener); } public void removeWindowListener(WindowListener listener) { - synchronized (windowListener) { - windowListener = HEventMulticaster.remove(windowListener, listener); - } + windowListener = HEventMulticaster.remove(windowListener, listener); } protected void processWindowEvent(WindowEvent event) { @@ -256,6 +252,7 @@ Graphics g = GUIManager.getInstance().getGraphics(); Rectangle r = getBounds(); g.clearRect(r.x, r.y, r.width, r.height); + g.dispose(); if (image != null) { image.flush(); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HScreenConfigTemplate.java libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HScreenConfigTemplate.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HScreenConfigTemplate.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HScreenConfigTemplate.java 2014-09-01 12:06:01.000000000 +0000 @@ -166,5 +166,7 @@ { 720, 480, 16, 9 }, { 720, 576, 4, 3 }, { 720, 576, 16, 9 }, + + { 960, 540, 16, 9 }, }; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HStaticIcon.java libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HStaticIcon.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HStaticIcon.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HStaticIcon.java 2014-09-01 12:06:01.000000000 +0000 @@ -20,41 +20,45 @@ package org.havi.ui; import java.awt.Image; +import org.videolan.BDJXletContext; public class HStaticIcon extends HVisible implements HNoInputPreferred { public HStaticIcon() { - org.videolan.Logger.unimplemented(HStaticIcon.class.getName(), ""); + super(getDefaultLook()); } public HStaticIcon(Image imageNormal, int x, int y, int width, int height) { - org.videolan.Logger.unimplemented(HStaticIcon.class.getName(), ""); + super(getDefaultLook(), x, y, width, height); + setGraphicContent(imageNormal, NORMAL_STATE); } public HStaticIcon(Image imageNormal) { - org.videolan.Logger.unimplemented(HStaticIcon.class.getName(), ""); + super(getDefaultLook()); + setGraphicContent(imageNormal, NORMAL_STATE); } public void setLook(HLook hlook) throws HInvalidLookException { - throw new Error("Not implemented"); + if ((hlook != null) && !(hlook instanceof HGraphicLook)) { + throw new HInvalidLookException(); + } + super.setLook(hlook); } public static void setDefaultLook(HGraphicLook hlook) { - DefaultLook = hlook; + BDJXletContext.setXletDefaultLook(PROPERTY_LOOK,hlook); } public static HGraphicLook getDefaultLook() { - if (DefaultLook == null) - org.videolan.Logger.unimplemented("", "getDefaultLook"); - return DefaultLook; + return (HGraphicLook) BDJXletContext.getXletDefaultLook(PROPERTY_LOOK,DEFAULT_LOOK); } - private static HGraphicLook DefaultLook = null; - + private static final String PROPERTY_LOOK = "HStaticIcon"; + static final Class DEFAULT_LOOK = HGraphicLook.class; private static final long serialVersionUID = 2015589998794748072L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HStaticText.java libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HStaticText.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HStaticText.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HStaticText.java 2014-09-01 12:06:01.000000000 +0000 @@ -23,6 +23,7 @@ import java.awt.Color; import java.awt.Font; +import org.videolan.BDJXletContext; import org.videolan.Logger; public class HStaticText extends HVisible implements HNoInputPreferred { @@ -74,19 +75,16 @@ public static void setDefaultLook(HTextLook hlook) { - DefaultLook = hlook; + BDJXletContext.setXletDefaultLook(PROPERTY_LOOK,hlook); } public static HTextLook getDefaultLook() { - if (DefaultLook == null) - DefaultLook = new HTextLook(); - return DefaultLook; + return (HTextLook) BDJXletContext.getXletDefaultLook(PROPERTY_LOOK,DEFAULT_LOOK); } - private static HTextLook DefaultLook = null; - + static final Class DEFAULT_LOOK = HTextLook.class; + private static final String PROPERTY_LOOK = HStaticText.class.getName(); private static final Logger logger = Logger.getLogger(HStaticText.class.getName()); - private static final long serialVersionUID = 4352450387189482885L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HToggleButton.java libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HToggleButton.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HToggleButton.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HToggleButton.java 2014-09-01 12:06:01.000000000 +0000 @@ -21,74 +21,110 @@ import java.awt.Image; +import org.videolan.BDJXletContext; + public class HToggleButton extends HGraphicButton implements HSwitchable { public HToggleButton() { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); + super(); + iniz(); } public HToggleButton(Image image, int x, int y, int width, int height) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); + super(image, x, y, width, height); + iniz(); } public HToggleButton(Image image) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); + super(image); + iniz(); } public HToggleButton(Image image, int x, int y, int width, int height, boolean state) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); + this(image, x, y, width, height); + setSwitchableState(state); } public HToggleButton(Image imageNormal, Image imageFocused, Image imageActioned, Image imageNormalActioned, int x, int y, int width, int height, boolean state) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); + super(imageNormal, imageFocused, imageActioned, x, y, width, height); + setGraphicContent(imageNormalActioned, ACTIONED_STATE); + setSwitchableState(state); + iniz(); } public HToggleButton(Image imageNormal, Image imageFocused, Image imageActioned, Image imageNormalActioned, boolean state) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); + super(imageNormal, imageFocused, imageActioned); + setGraphicContent(imageNormalActioned, ACTIONED_STATE); + setSwitchableState(state); + iniz(); } public HToggleButton(Image image, int x, int y, int width, int height, boolean state, HToggleGroup group) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); - toggleGroup = group; + this(image, x, y, width, height, state); + setToggleGroup(group); } public HToggleButton(Image image, boolean state, HToggleGroup group) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); - toggleGroup = group; + this(image); + setSwitchableState(state); + setToggleGroup(group); } public HToggleButton(Image imageNormal, Image imageFocused, Image imageActioned, Image imageNormalActioned, int x, int y, int width, int height, boolean state, HToggleGroup group) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); - toggleGroup = group; + this(imageNormal, imageFocused, imageActioned, imageNormalActioned, x, y, width, height, state); + setToggleGroup(group); } public HToggleButton(Image imageNormal, Image imageFocused, Image imageActioned, Image imageNormalActioned, boolean state, HToggleGroup group) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); - toggleGroup = group; + this(imageNormal, imageFocused, imageActioned, imageNormalActioned, state); + setToggleGroup(group); + } + + private void iniz() + { + try { + setLook(getDefaultLook()); + } catch (HInvalidLookException ignored) { + } } public void setToggleGroup(HToggleGroup group) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), "setToggleGroup"); + HToggleGroup oldGroup = toggleGroup; + + // Remove ourselves if already a member of a group + if (oldGroup != null) { + // If it is the same, don't do anything. + if (oldGroup == group) + return; + + // Remove ourselves + oldGroup.remove(this); + } + + // Assign the new toggle group toggleGroup = group; + if (group != null) { + group.add(this); + } } public HToggleGroup getToggleGroup() @@ -98,30 +134,28 @@ public void removeToggleGroup() { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), "removeToggleGroup"); + setToggleGroup(null); } public static void setDefaultLook(HGraphicLook hlook) { - DefaultLook = hlook; + BDJXletContext.setXletDefaultLook(PROPERTY_LOOK, hlook); } public static HGraphicLook getDefaultLook() { - if (DefaultLook == null) - org.videolan.Logger.unimplemented("", "getDefaultLook"); - return DefaultLook; + return (HGraphicLook) BDJXletContext.getXletDefaultLook(PROPERTY_LOOK, DEFAULT_LOOK); } public boolean getSwitchableState() { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), "getSwitchableState"); - return true; + return (getInteractionState() & ACTIONED_STATE_BIT) != 0; } public void setSwitchableState(boolean state) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), "setSwitchableState"); + int old = getInteractionState(); + setInteractionState(state ? (old | ACTIONED_STATE_BIT) : (old & ~ACTIONED_STATE_BIT)); } public void setUnsetActionSound(HSound sound) @@ -134,8 +168,7 @@ return unsetActionSound; } - private static HGraphicLook DefaultLook = null; - + private static final String PROPERTY_LOOK = "HToggleButton"; private HToggleGroup toggleGroup = null; private HSound unsetActionSound = null; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HToggleGroup.java libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HToggleGroup.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HToggleGroup.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/havi/ui/HToggleGroup.java 2014-09-01 12:06:01.000000000 +0000 @@ -19,55 +19,147 @@ package org.havi.ui; +import java.util.Enumeration; +import java.util.Vector; + public class HToggleGroup { - private HToggleButton current = null; public HToggleGroup() { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), ""); } public HToggleButton getCurrent() { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "getCurrent"); return current; } public void setCurrent(HToggleButton selection) { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "setCurrent"); - current = selection; + // Treat null as unselection + if (selection == null) { + HToggleButton tmp = getCurrent(); + if (tmp != null && getForcedSelection() && buttons.size() > 0) { + // Enforce forced selection (reselect button!) + tmp.setSwitchableState(true); + } else { + // General behavior + current = null; + if (tmp != null) tmp.setSwitchableState(false); + } + } + // Set current only if part of this group + // And isn't the current selection (stops infinite loop) + else if (buttons.contains(selection) && getCurrent() != selection) { + current = selection; + selection.setSwitchableState(true); + unswitch(selection); // Enforce single selection + } } public void setForcedSelection(boolean forceSelection) { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "setForcedSelection"); + this.forceSelection = forceSelection; + + // Enforce new setting + if (forceSelection && getCurrent() == null && buttons.size() > 0) { + forceSelect(); + } } public boolean getForcedSelection() { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "getForcedSelection"); - return false; + return forceSelection; } public void setEnabled(boolean enable) { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "setEnabled"); + enabled = enable; + for (Enumeration e = buttons.elements(); e.hasMoreElements();) { + setEnabled((HToggleButton) e.nextElement(), enable); + } } public boolean isEnabled() { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "isEnabled"); - return false; + return enabled; } protected void add(HToggleButton button) { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "add"); + // Only add if not already added + if (!buttons.contains(button)) { + buttons.addElement(button); + setEnabled(button, isEnabled()); // Enforce enabled state + + // Enforce forced selection (if first addition) + if (getForcedSelection() && buttons.size() == 1 && getCurrent() != button) { + button.setSwitchableState(true); + current = button; + // Assume that if size()>=1 that it's already enforced! + } + // If currently selected, unselect all others! + else if (button.getSwitchableState()) { + current = button; + if (buttons.size() > 1) unswitch(button); // Enforce single + // selection + } + } } protected void remove(HToggleButton button) { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "remove"); + if (!buttons.removeElement(button)) { + throw new IllegalArgumentException("Not a member of this HToggleGroup"); + } else { + if (button == getCurrent()) { + current = null; + if (getForcedSelection() && buttons.size() > 0) { + current = null; + forceSelect(); + } + } + } + } + + + private void unswitch(HToggleButton button) + { + for (Enumeration e = buttons.elements(); e.hasMoreElements();) { + HToggleButton b = (HToggleButton) e.nextElement(); + if (b != button) b.setSwitchableState(false); + } + } + + private void forceSelect() + { + // assert(getCurrent() == null); + if (buttons.size() > 0) { + HToggleButton b = (HToggleButton) buttons.elementAt(0); + b.setSwitchableState(true); + current = b; + } } + + private void setEnabled(HToggleButton tb, boolean enable) + { + if (false) { // If HAVi 1.1 + tb.setEnabled(enable); + } else { + // HAVI 1.01beta + int state = tb.getInteractionState(); + tb.setInteractionState(enable ? (state & ~HState.DISABLED_STATE_BIT) : (state | HState.DISABLED_STATE_BIT)); + } + } + + /** Whether the buttons in this group are enabled or now. */ + private boolean enabled = true; + + /** Controls whether a selection must always be made or not. */ + private boolean forceSelection = false; + + /** The currently selected {@link HToggleButton}. */ + private HToggleButton current = null; + + /** The buttons currently added to this group. */ + private Vector buttons = new Vector(); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJAction.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJAction.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJAction.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJAction.java 2014-09-01 12:06:01.000000000 +0000 @@ -66,6 +66,13 @@ } } + public void abort() { + synchronized (this) { + state = PROCESSED; + this.notifyAll(); + } + } + protected abstract void doAction(); private int state = NOT_PROCESSED; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJActionManager.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJActionManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJActionManager.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJActionManager.java 2014-09-01 12:06:01.000000000 +0000 @@ -19,24 +19,29 @@ package org.videolan; public class BDJActionManager { - public static BDJActionManager getInstance() { - synchronized (BDJActionManager.class) { - if (instance == null) - instance = new BDJActionManager(); + protected static void createInstance() { + if (running) { + System.err.println("BDJActionManager: manager already running! " + Logger.dumpStack()); + return; } + instance = new BDJActionManager(); + } + + public static BDJActionManager getInstance() { return instance; } public BDJActionManager() { - commandQueue = new BDJActionQueue(); + commandQueue = new BDJActionQueue("BDJActionManager"); } - protected void finalize() throws Throwable { - commandQueue.finalize(); - synchronized (BDJActionManager.class) { - instance = null; + protected static void shutdown() { + try { + instance.commandQueue.shutdown(); + } catch (Throwable t) { + } finally { + running = false; } - super.finalize(); } public void putCommand(BDJAction action) { @@ -46,4 +51,5 @@ private BDJActionQueue commandQueue; private static BDJActionManager instance = null; + private static boolean running = false; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java 2014-09-01 12:06:01.000000000 +0000 @@ -20,25 +20,35 @@ import java.util.LinkedList; -class BDJActionQueue implements Runnable { - public BDJActionQueue() { - this(null); +public class BDJActionQueue implements Runnable { + public BDJActionQueue(String name) { + this(null, name); } - public BDJActionQueue(BDJThreadGroup threadGroup) { + public BDJActionQueue(BDJThreadGroup threadGroup, String name) { + if (threadGroup == null) { + if (BDJXletContext.getCurrentContext() != null) { + Logger.getLogger(BDJActionQueue.class.getName()).error("BDJActionQueue created from wrong context: " + Logger.dumpStack()); + } + } + /* run all actions in given thread group / xlet context */ - thread = new Thread(threadGroup, this); + thread = new Thread(threadGroup, this, name + ".BDJActionQueue"); thread.setDaemon(true); thread.start(); } - protected void finalize() throws Throwable { + public void shutdown() { synchronized (actions) { + terminated = true; actions.addLast(null); actions.notifyAll(); } - thread.join(); - super.finalize(); + try { + thread.join(); + } catch (Throwable t) { + Logger.getLogger(BDJActionQueue.class.getName()).error("Error joining thread: " + t); + } } public void run() { @@ -66,12 +76,18 @@ public void put(BDJAction action) { if (action != null) { synchronized (actions) { - actions.addLast(action); - actions.notifyAll(); + if (!terminated) { + actions.addLast(action); + actions.notifyAll(); + } else { + Logger.getLogger(BDJActionQueue.class.getName()).error("Action skipped (queue stopped): " + action); + action.abort(); + } } } } + private boolean terminated = false; private Thread thread; private LinkedList actions = new LinkedList(); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java 2014-09-01 12:06:01.000000000 +0000 @@ -33,7 +33,7 @@ public BDJAppProxy(BDJXletContext context) { this.context = context; state = NOT_LOADED; - thread = new Thread(context.getThreadGroup(), this); + thread = new Thread(context.getThreadGroup(), this, "BDJAppProxy"); thread.setDaemon(true); thread.start(); @@ -291,7 +291,8 @@ } public void run() { - context.setEventQueue(new EventQueue()); + if (context.getEventQueue() == null) + context.setEventQueue(new EventQueue()); for (;;) { AppCommand cmd; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java 2014-09-01 12:06:01.000000000 +0000 @@ -20,9 +20,13 @@ package org.videolan; import java.net.MalformedURLException; + +import java.io.InputStream; +import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; +import java.util.Enumeration; import javax.tv.xlet.Xlet; @@ -110,5 +114,44 @@ this.xletClass = xletClass; } + public Class loadClass(String name) throws java.lang.ClassNotFoundException { + /* hook FileSystem in java.io.File */ + if (name.equals("java.io.File")) { + Class c = super.loadClass(name); + if (c != null) { + java.io.BDFileSystem.init(c); + } + return c; + } + return super.loadClass(name); + } + + public URL getResource(String name) { + name = name.replace('\\', '/'); + return super.getResource(name); + } + + /* final in J2ME + public Enumeration getResources(String name) throws IOException { + name = name.replace('\\', '/'); + return super.getResources(name); + } + */ + + public URL findResource(String name) { + name = name.replace('\\', '/'); + return super.findResource(name); + } + + public Enumeration findResources(String name) throws IOException { + name = name.replace('\\', '/'); + return super.findResources(name); + } + + public InputStream getResourceAsStream(String name) { + name = name.replace('\\', '/'); + return super.getResourceAsStream(name); + } + private String xletClass; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJListeners.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJListeners.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJListeners.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJListeners.java 2014-09-01 12:06:01.000000000 +0000 @@ -23,7 +23,8 @@ import javax.media.ControllerEvent; import javax.media.ControllerListener; - +import javax.tv.media.MediaSelectEvent; +import javax.tv.media.MediaSelectListener; import javax.tv.service.selection.ServiceContextEvent; import javax.tv.service.selection.ServiceContextListener; @@ -40,6 +41,9 @@ import org.bluray.media.UOMaskTableChangedEvent; import org.bluray.media.UOMaskedEvent; +import org.davic.resources.ResourceStatusEvent; +import org.davic.resources.ResourceStatusListener; + import org.dvb.media.SubtitleListener; import java.util.EventObject; @@ -71,15 +75,22 @@ } } + public void clear() { + if (null != BDJXletContext.getCurrentContext()) { + logger.error("clear() from wrong thread: " + Logger.dumpStack()); + return; + } + synchronized (listeners) { + listeners.clear(); + } + } + public void putCallback(Object event) { synchronized (listeners) { for (Iterator it = listeners.iterator(); it.hasNext(); ) { BDJListener item = (BDJListener)it.next(); - if (item.ctx == null) { - logger.error("Listener callback: no context: " + item.listener); - it.remove(); - } else if (item.ctx.isDestroyed()) { - logger.error("Listener terminated: " + item.ctx); + if (item.ctx == null || item.ctx.isReleased()) { + logger.info("Listener terminated: " + item.ctx); it.remove(); } else { item.ctx.putCallback(new Callback(event, item.listener)); @@ -130,10 +141,15 @@ ((PiPStatusListener)listener).piPStatusChange((PiPStatusEvent)event); } else if (event instanceof AngleChangeEvent) { ((AngleChangeListener)listener).angleChange((AngleChangeEvent)event); + } else if (event instanceof MediaSelectEvent) { + ((MediaSelectListener)listener).selectionComplete((MediaSelectEvent)event); } else if (event instanceof ControllerEvent) { ((ControllerListener)listener).controllerUpdate((ControllerEvent)event); + } else if (event instanceof ResourceStatusEvent) { + ((ResourceStatusListener)listener).statusChanged((ResourceStatusEvent)event); + /* need to use wrapper if some other callback uses EventObject */ } else if (event instanceof EventObject && listener instanceof SubtitleListener) { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJLoader.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJLoader.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJLoader.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJLoader.java 2014-09-01 12:06:01.000000000 +0000 @@ -39,6 +39,7 @@ import org.videolan.bdjo.GraphicsResolution; import org.videolan.bdjo.PlayListTable; import org.videolan.bdjo.TerminalInfo; +import org.videolan.media.content.PlayerManager; public class BDJLoader { public static boolean load(int title) { @@ -71,7 +72,7 @@ return false; synchronized (BDJLoader.class) { if (queue == null) - queue = new BDJActionQueue(); + queue = new BDJActionQueue(null, "BDJLoader"); } queue.put(new BDJLoaderAction(title, restart, callback)); return true; @@ -84,7 +85,7 @@ public static boolean unload(BDJLoaderCallback callback) { synchronized (BDJLoader.class) { if (queue == null) - queue = new BDJActionQueue(); + queue = new BDJActionQueue(null, "BDJLoader"); } queue.put(new BDJLoaderAction(null, false, callback)); return true; @@ -93,11 +94,12 @@ public static void shutdown() { unload(); try { - queue.finalize(); + queue.shutdown(); } catch (Throwable e) { logger.error("shutdown() failed: " + e); e.printStackTrace(); } + queue = null; } private static boolean loadN(TitleImpl title, boolean restart) { @@ -126,16 +128,22 @@ for (int i = 0; i < appTable.length; i++) { if (id.equals(appTable[i].getIdentifier()) && entry.getInitialClass().equals(appTable[i].getInitialClass())) { - if (restart && appTable[i].getIsServiceBound()) + if (restart && appTable[i].getIsServiceBound()) { + logger.info("Stopping xlet " + appTable[i].getInitialClass() + " (for restart)"); proxy.stop(true); - proxy.getXletContext().update(appTable[i], bdjo.getAppCaches()); - proxys[i] = proxy; - proxy = null; + } else { + logger.info("Keeping xlet " + appTable[i].getInitialClass()); + proxy.getXletContext().update(appTable[i], bdjo.getAppCaches()); + proxys[i] = proxy; + proxy = null; + } break; } } - if (proxy != null) + if (proxy != null) { + logger.info("Terminating xlet " + entry.getInitialClass()); proxy.release(); + } } // start bdj window @@ -156,15 +164,16 @@ appTable[i], bdjo.getAppCaches(), gui)); + /* log startup class, startup parameters and jar file */ + String[] params = appTable[i].getParams(); + String p = ""; + if (params != null && params.length > 0) { + p = "(" + StrUtil.Join(params, ",") + ")"; + } + logger.info("Loaded class: " + appTable[i].getInitialClass() + p + " from " + appTable[i].getBasePath() + ".jar"); + } else { + logger.info("Reused class: " + appTable[i].getInitialClass() + " from " + appTable[i].getBasePath() + ".jar"); } - - /* log startup calss, startup parameters and jar file */ - String[] params = appTable[i].getParams(); - String p = ""; - if (params != null && params.length > 0) { - p = "(" + StrUtil.Join(params, ",") + ")"; - } - logger.info("Loaded class: " + appTable[i].getInitialClass() + p + " from " + appTable[i].getBasePath() + ".jar"); } // change psr @@ -210,17 +219,28 @@ private static boolean unloadN() { try { + GUIManager.getInstance().setVisible(false); + AppsDatabase db = AppsDatabase.getAppsDatabase(); + + /* stop xlets first */ Enumeration ids = db.getAppIDs(new CurrentServiceFilter()); while (ids.hasMoreElements()) { AppID id = (AppID)ids.nextElement(); BDJAppProxy proxy = (BDJAppProxy)db.getAppProxy(id); + proxy.stop(true); + } + + ids = db.getAppIDs(new CurrentServiceFilter()); + while (ids.hasMoreElements()) { + AppID id = (AppID)ids.nextElement(); + BDJAppProxy proxy = (BDJAppProxy)db.getAppProxy(id); proxy.release(); } + ((BDJAppsDatabase)db).newDatabase(null, null); - //GUIManager.shutdown() does not work with J2ME (window can't be opened again) - GUIManager.getInstance().setVisible(false); + PlayerManager.getInstance().releaseAllPlayers(true); return true; } catch (Throwable e) { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java 2014-09-01 12:06:01.000000000 +0000 @@ -157,6 +157,10 @@ this.classpathExt = classpathExt; this.initialClass = initialClass; this.params = params; + + if ((binding & (DISC_BOUND | TITLE_BOUND)) == 0) { + System.err.println("Disc unbound application: " + initialClass); + } } public int getControlCode() { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java 2014-09-01 12:06:01.000000000 +0000 @@ -27,6 +27,24 @@ this.context = context; } + public void uncaughtException(Thread t, Throwable e) { + + String stack = ""; + if (e != null) { + StackTraceElement elems[] = e.getStackTrace(); + if (elems != null) { + for (int i = 0; i < elems.length; i++) + stack += "\n\t" + elems[i].toString(); + } + } + + if (e instanceof ThreadDeath) { + logger.error("Thread " + t + " killed" + stack); + } else { + logger.error("Unhandled exception in thread " + t + ": " + e + stack); + } + } + public BDJXletContext getContext() { return context; } @@ -35,9 +53,15 @@ this.context = context; } - public boolean waitForShutdown(int maxThreads, int timeout) { + public boolean waitForShutdown(int timeout, int maxThreads) { + + if (parentOf(Thread.currentThread().getThreadGroup()) && maxThreads < 1) { + logger.error("Current Thread is contained within ThreadGroup to be disposed."); + throw new IllegalThreadStateException("Current Thread is contained within ThreadGroup to be disposed."); + } + long startTime = System.currentTimeMillis(); - long endTime = startTime + 1000; + long endTime = startTime + timeout; while ((activeCount() > maxThreads) && (System.currentTimeMillis() < endTime)) { try { @@ -47,7 +71,7 @@ boolean result = (activeCount() <= maxThreads); if (!result) { - logger.error("waitForShutdown timeout"); + logger.error("waitForShutdown timeout (have " + activeCount() + " threads, expected " + maxThreads + ")"); } return result; } @@ -55,14 +79,14 @@ protected void stopAll(int timeout) { interrupt(); - waitForShutdown(0, timeout); + waitForShutdown(timeout, 0); if (activeCount() > 0) { logger.error("stopAll(): killing threads"); dumpThreads(); PortingHelper.stopThreadGroup(this); - waitForShutdown(0, 500); + waitForShutdown(500, 0); } try { @@ -84,6 +108,10 @@ if (threads[i] == null) continue; logger.info(" " + threads[i]); + /* no getState() in J2ME + logger.info(" state " + threads[i].getState().toString()); + */ + logger.info(" at " + PortingHelper.dumpStack(threads[i])); } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJXletContext.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJXletContext.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJXletContext.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/BDJXletContext.java 2014-09-01 12:06:01.000000000 +0000 @@ -21,7 +21,9 @@ import java.awt.Container; import java.awt.EventQueue; +import java.net.URL; import java.util.LinkedList; +import java.util.HashMap; import java.security.AccessController; import java.security.PrivilegedAction; @@ -51,7 +53,7 @@ entry.getInitialClass(), this); - callbackQueue = new BDJActionQueue(this.threadGroup); + callbackQueue = new BDJActionQueue(this.threadGroup, "CallbackQueue"); } public Object getXletProperty(String key) { @@ -93,22 +95,79 @@ return container; } + /* + * Class loader + */ + public ClassLoader getClassLoader() { return loader; } + public static ClassLoader getCurrentClassLoader() { + BDJXletContext ctx = BDJXletContext.getCurrentContext(); + if (ctx == null) { + logger.error("getCurrentClassLoader(): no context: " + Logger.dumpStack()); + return null; + } + + ClassLoader cldr = (ClassLoader)ctx.getClassLoader(); + if (cldr == null) { + logger.error("getCurrentClassLoader(): no class loader: " + Logger.dumpStack()); + return null; + } + + return cldr; + } + + public static URL getCurrentResource(String path) + { + ClassLoader cldr = (ClassLoader)BDJXletContext.getCurrentClassLoader(); + if (cldr == null) { + return null; + } + + if (path.startsWith("./") || path.startsWith(".\\")) { + path = path.substring(2); + } + + URL url = cldr.getResource(path); + if (url == null) { + logger.error("getCurrentResource(): " + path + " not found: " + Logger.dumpStack()); + return null; + } + + return url; + } + + /* + * + */ + protected AppProxy getAppProxy() { return AppsDatabase.getAppsDatabase().getAppProxy(appid); } + public boolean isReleased() { + return released; + } + + /* public boolean isDestroyed() { - return AppsDatabase.getAppsDatabase().getAppProxy(appid).getState() == AppProxy.DESTROYED; + if (released) + return true; + AppProxy proxy = AppsDatabase.getAppsDatabase().getAppProxy(appid); + return proxy == null || proxy.getState() == AppProxy.DESTROYED; } + */ public BDJThreadGroup getThreadGroup() { return threadGroup; } + /* + * Event queues + */ + protected void setEventQueue(EventQueue eq) { eventQueue = eq; } @@ -119,11 +178,18 @@ public boolean putCallback(BDJAction cb) { - if (!isDestroyed()) { + synchronized (this) { + if (isReleased()) { + logger.error("callback ignored (xlet destroyed)"); + return false; + } + if (callbackQueue == null) { + logger.error("callback ignored (no queue)"); + return false; + } callbackQueue.put(cb); return true; } - return false; } protected int numEventQueueThreads() { @@ -134,9 +200,17 @@ cnt++; } } + if (!released) { + // callbackQueue + cnt++; + } return cnt; } + /* + * HAVI + */ + public void setSceneFactory(HSceneFactory f) { sceneFactory = f; } @@ -145,6 +219,53 @@ return sceneFactory; } + public static Object getXletDefaultLook(String key, Class defClass) { + BDJXletContext ctx = BDJXletContext.getCurrentContext(); + if (ctx == null) { + logger.error("getDefaultLook(): no context: " + Logger.dumpStack()); + return null; + } + return ctx.getDefaultLook(key, defClass); + } + + public static void setXletDefaultLook(String key, Object look) { + BDJXletContext ctx = BDJXletContext.getCurrentContext(); + if (ctx == null) { + logger.error("setDefaultLook(): no context: " + Logger.dumpStack()); + return; + } + ctx.setDefaultLook(key, look); + } + + private Object getDefaultLook(String key, Class defClass) { + Object look = null; + synchronized (defaultLooks) { + look = defaultLooks.get(key); + if (look == null) { + try { + look = defClass.newInstance(); + setDefaultLook(key, look); + } catch (Throwable t) { + logger.error("Error creating default look " + defClass.getName() + " for " + key + ": " + t); + } + } + } + return look; + } + + private void setDefaultLook(String key, Object look) { + synchronized (defaultLooks) { + defaultLooks.remove(key); + if (look != null) { + defaultLooks.put(key, look); + } + } + } + + /* + * Ixc + */ + protected void addIxcThread(Thread thread) { synchronized (ixcThreads) { ixcThreads.addLast(thread); @@ -155,26 +276,55 @@ ixcThreads.remove(thread); } } + + private static boolean waitThread(Thread thread, int timeout) { + long startTime = System.currentTimeMillis(); + long endTime = startTime + timeout; + while (thread.isAlive() && (System.currentTimeMillis() < endTime)) { + try { + Thread.sleep(10); + } catch (InterruptedException e) { } + } + + boolean result = !thread.isAlive(); + if (!result) { + logger.error("waitThread timeout: " + thread); + } + return result; + } + + public static void stopThread(Thread thread, int timeout, String type) { + if (!waitThread(thread, timeout)) { + thread.interrupt(); + if (!waitThread(thread, 200)) { + PortingHelper.stopThread(thread); + logger.error("killing " + type + " thread " + thread); + } + } + try { + thread.join(); + } catch (Throwable t) { } + } + protected void stopIxcThreads() { - synchronized (ixcThreads) { - while (!ixcThreads.isEmpty()) { - Thread thread = (Thread)ixcThreads.removeFirst(); - logger.info("Stopping remote thread " + thread); - thread.interrupt(); - try { - thread.join(500); - } catch (Throwable t) { - } - if (thread.isAlive()) { - PortingHelper.stopThread(thread); - } - if (thread.isAlive()) { - logger.error("Error stopping remote thread " + thread); + while (true) { + Thread thread; + synchronized (ixcThreads) { + if (ixcThreads.isEmpty()) { + break; } + thread = (Thread)ixcThreads.removeFirst(); } + logger.info("Stopping remote thread " + thread); + stopThread(thread, 1000, "Ixc"); + removeIxcThread(thread); } } + /* + * Frame-accurate animations + */ + public void addFAA(FrameAccurateAnimation faa) { synchronized (faaList) { faaList.add(faa); @@ -198,6 +348,10 @@ } } + /* + * + */ + public static BDJXletContext getCurrentContext() { Object obj = AccessController.doPrivileged( new PrivilegedAction() { @@ -231,6 +385,7 @@ removeAllFAA(); stopIxcThreads(); + defaultLooks.clear(); org.dvb.io.ixc.IxcRegistry.unbindAll(this); @@ -239,12 +394,7 @@ sceneFactory = null; } - try { - callbackQueue.finalize(); - } catch (Throwable t) { - } finally { - //callbackQueue = null; - } + callbackQueue.shutdown(); EventQueue eq = eventQueue; eventQueue = null; @@ -254,11 +404,17 @@ threadGroup.stopAll(1000); - threadGroup = null; - loader = null; - container = null; + synchronized (this) { + threadGroup = null; + loader = null; + container = null; + callbackQueue = null; + defaultLooks = null; + released = true; + } } + private boolean released = false; private String[] args; private AppID appid; private BDJClassLoader loader; @@ -268,6 +424,7 @@ private BDJThreadGroup threadGroup = null; private LinkedList ixcThreads = new LinkedList(); private LinkedList faaList = new LinkedList(); + private HashMap defaultLooks = new HashMap(); private BDJActionQueue callbackQueue; private static final Logger logger = Logger.getLogger(BDJXletContext.class.getName()); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/FontIndex.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/FontIndex.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/FontIndex.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/FontIndex.java 2014-09-01 12:06:01.000000000 +0000 @@ -36,8 +36,9 @@ } private FontIndex(String path) { + FileInputStream stream = null; try { - FileInputStream stream = new FileInputStream(path); + stream = new FileInputStream(path); SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); parser.parse(stream, this); } catch (FileNotFoundException e) { @@ -46,6 +47,12 @@ e.printStackTrace(); } finally { fontData = null; + if (stream != null) { + try { + stream.close(); + } catch (Exception e) { + } + } } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/GUIManager.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/GUIManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/GUIManager.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/GUIManager.java 2014-09-01 12:06:01.000000000 +0000 @@ -80,8 +80,11 @@ } public void dispose() { - super.dispose(); - instance = null; + try { + super.dispose(); + } finally { + instance = null; + } } private static GUIManager instance = null; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/IxcRegistryImpl.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/IxcRegistryImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/IxcRegistryImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/IxcRegistryImpl.java 2014-09-01 12:06:01.000000000 +0000 @@ -208,7 +208,7 @@ } public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - if (null == remoteObj.context || remoteObj.context.isDestroyed()) { + if (null == remoteObj.context || remoteObj.context.isReleased()) { Debug("invoke(): callee has been destroyed"); throw new RemoteException("callee has been destroyed"); } @@ -226,7 +226,7 @@ RemoteMethod remoteMethod = new RemoteMethod(method, remoteObj.context, args); - if (remoteMethod.callerContext.isDestroyed()) { + if (remoteMethod.callerContext.isReleased()) { Debug("invoke(): caller has been destroyed"); throw new RemoteException("caller has been destroyed"); } @@ -393,7 +393,7 @@ Debug("bind(): xc not current BDJXletContext"); throw new IllegalArgumentException("xc not current BDJXletContext"); } - if (((BDJXletContext)xc).isDestroyed()) { + if (((BDJXletContext)xc).isReleased()) { Debug("bind(): xc is destroyed"); return; } @@ -473,8 +473,24 @@ return result; } + public void unbindAll() { + if (null != BDJXletContext.getCurrentContext()) { + logger.error("unbindAll() from wrong thread: " + Logger.dumpStack()); + return; + } + + synchronized (remoteObjects) { + remoteObjects.clear(); + } + } + public void unbindAll(XletContext xc) { + if (null != BDJXletContext.getCurrentContext()) { + logger.error("unbindAll(ctx) from wrong thread: " + Logger.dumpStack()); + return; + } + Debug("IxcRegistry.removeBinding(" + xc + ")"); String prefix = "/" + (String)xc.getXletProperty("dvb.org.id") + "/" + (String)xc.getXletProperty("dvb.app.id") + "/"; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/Libbluray.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/Libbluray.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/Libbluray.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/Libbluray.java 2014-09-01 12:06:01.000000000 +0000 @@ -1,6 +1,7 @@ /* * This file is part of libbluray - * Copyright (C) 2010 William Hahne + * Copyright (C) 2010 William Hahne + * Copyright (C) 2012-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,26 +25,33 @@ import java.util.Vector; import javax.media.PackageManager; +import javax.tv.service.SIManagerImpl; import javax.tv.service.selection.ServiceContextFactory; +import org.bluray.bdplus.Status; import org.bluray.ti.DiscManager; import org.bluray.ti.TitleImpl; import org.bluray.ti.selection.TitleContext; import org.bluray.ui.event.HRcEvent; import org.dvb.event.EventManager; +import org.dvb.io.ixc.IxcRegistry; import org.dvb.ui.FontFactory; import org.videolan.bdjo.Bdjo; -import org.videolan.media.content.BDHandler; +import org.videolan.media.content.PlayerManager; /** * This class allows BDJ to call various libbluray functions. */ public class Libbluray { - protected static void init(long nativePointer, String discID) { + protected static void init(long nativePointer, String discID, String discRoot) { + + System.setProperty("bluray.vfs.root", discRoot); Libbluray.nativePointer = nativePointer; DiscManager.getDiscManager().setCurrentDisc(discID); + BDJActionManager.createInstance(); + Vector prefix = new Vector(); prefix.add("org.videolan"); PackageManager.setContentPrefixList(prefix); @@ -124,10 +132,15 @@ public static void shutdown() { try { BDJLoader.shutdown(); - BDJActionManager.getInstance().finalize(); + BDJActionManager.shutdown(); MountManager.unmountAll(); GUIManager.shutdown(); - BDToolkit.shutdown(); + BDToolkit.shutdownDisc(); + java.awt.BDFontMetrics.shutdown(); + SIManagerImpl.shutdown(); + IxcRegistry.shutdown(); + EventManager.shutdown(); + Status.shutdown(); } catch (Throwable e) { e.printStackTrace(); } @@ -199,11 +212,19 @@ return result; } - public static boolean selectPlaylist(int playlist) { + public static boolean selectPlaylist(int playlist, int playitem, int playmark, long time) { if (playlist < 0) throw new IllegalArgumentException("Playlist cannot be negative"); - return selectPlaylistN(nativePointer, playlist) == 1 ? true : false; + return selectPlaylistN(nativePointer, playlist, playitem, playmark, time) == 1 ? true : false; + } + + public static boolean selectPlaylist(int playlist) { + return selectPlaylist(playlist, -1, -1, -1); + } + + public static void stopPlaylist() { + selectPlaylistN(nativePointer, -1, -1, -1, -1); } public static boolean selectTitle(TitleImpl title) { @@ -260,7 +281,10 @@ } public static boolean selectRate(float rate) { - return selectRateN(nativePointer, rate) == 1 ? true : false; + return selectRateN(nativePointer, rate, 0) == 1 ? true : false; + } + public static boolean selectRate(float rate, boolean start) { + return selectRateN(nativePointer, rate, start ? 1 : 2) == 1 ? true : false; } public static void writeGPR(int num, int value) { @@ -271,7 +295,11 @@ } public static void writePSR(int num, int value) { - int ret = writePSRN(nativePointer, num, value); + writePSR(num, value, 0xffffffff); + } + + public static void writePSR(int num, int value, int psr_value_mask) { + int ret = writePSRN(nativePointer, num, value, psr_value_mask); if (ret == -1) throw new IllegalArgumentException("Invalid PSR"); @@ -311,32 +339,48 @@ int key = 0; switch (event) { + + case BDJ_EVENT_START: + return BDJLoader.load(param); + case BDJ_EVENT_STOP: + return BDJLoader.unload(); + case BDJ_EVENT_CHAPTER: - BDHandler.onChapterReach(param); + PlayerManager.getInstance().onChapterReach(param); break; case BDJ_EVENT_MARK: - BDHandler.onMarkReach(param); + PlayerManager.getInstance().onMarkReach(param); break; case BDJ_EVENT_PLAYITEM: - BDHandler.onPlayItemReach(param); + PlayerManager.getInstance().onPlayItemReach(param); + break; + case BDJ_EVENT_PLAYLIST: + PlayerManager.getInstance().onPlaylistStart(param); break; case BDJ_EVENT_ANGLE: - BDHandler.onAngleChange(param); + PlayerManager.getInstance().onAngleChange(param); break; case BDJ_EVENT_SUBTITLE: - BDHandler.onSubtitleChange(param); + PlayerManager.getInstance().onSubtitleChange(param); break; case BDJ_EVENT_PIP: - BDHandler.onPiPChange(param); + PlayerManager.getInstance().onPiPChange(param); + break; + case BDJ_EVENT_RATE: + float rate = (float)param / 90000.0f; + if (rate < 0.0f) rate = -rate; + if (rate < 0.01f) rate = 0.0f; + if (rate > 0.99f && rate < 1.01f) rate = 1.0f; + PlayerManager.getInstance().onRateChange(rate); break; case BDJ_EVENT_END_OF_PLAYLIST: - BDHandler.activePlayerEndOfMedia(); + PlayerManager.getInstance().onPlaylistEnd(param); break; case BDJ_EVENT_PSR102: org.bluray.bdplus.Status.getInstance().receive(param); break; case BDJ_EVENT_PTS: - BDHandler.activePlayerUpdateTime(param); + PlayerManager.getInstance().onPlaylistTime(param); break; case BDJ_EVENT_VK_KEY: //case KeyEvent.KEY_TYPED: @@ -359,6 +403,10 @@ case 14: key = KeyEvent.VK_LEFT; break; case 15: key = KeyEvent.VK_RIGHT; break; case 16: key = KeyEvent.VK_ENTER; break; + case 403: key = HRcEvent.VK_COLORED_KEY_0; break; + case 404: key = HRcEvent.VK_COLORED_KEY_1; break; + case 405: key = HRcEvent.VK_COLORED_KEY_2; break; + case 406: key = HRcEvent.VK_COLORED_KEY_3; break; default: key = -1; result = false; @@ -392,6 +440,12 @@ private static final int BDJ_EVENT_VK_KEY = 8; private static final int BDJ_EVENT_MARK = 9; private static final int BDJ_EVENT_PSR102 = 10; + private static final int BDJ_EVENT_PLAYLIST = 11; + + private static final int BDJ_EVENT_START = 12; + private static final int BDJ_EVENT_STOP = 13; + + private static final int BDJ_EVENT_RATE = 14; /* TODO: use org/bluray/system/RegisterAccess instead */ public static final int PSR_IG_STREAM_ID = 0; @@ -444,7 +498,7 @@ private static native int getCurrentChapterN(long np); private static native long seekMarkN(long np, int mark); private static native long seekPlayItemN(long np, int clip); - private static native int selectPlaylistN(long np, int playlist); + private static native int selectPlaylistN(long np, int playlist, int playitem, int playmark, long time); private static native int selectTitleN(long np, int title); private static native int selectAngleN(long np, int angle); private static native void seamlessAngleChangeN(long np, int angle); @@ -454,9 +508,9 @@ private static native int getCurrentAngleN(long np); private static native long tellN(long np); private static native long tellTimeN(long np); - private static native int selectRateN(long np, float rate); + private static native int selectRateN(long np, float rate, int reason); private static native int writeGPRN(long np, int num, int value); - private static native int writePSRN(long np, int num, int value); + private static native int writePSRN(long np, int num, int value, int psr_value_mask); private static native int readGPRN(long np, int num); private static native int readPSRN(long np, int num); private static native Bdjo getBdjoN(long np, String name); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java 2014-09-01 12:06:01.000000000 +0000 @@ -40,7 +40,9 @@ import javax.media.NotRealizedError; import javax.media.Player; import javax.media.PrefetchCompleteEvent; +import javax.media.RateChangeEvent; import javax.media.RealizeCompleteEvent; +import javax.media.ResourceUnavailableEvent; import javax.media.StartEvent; import javax.media.StopByRequestEvent; import javax.media.Time; @@ -56,12 +58,28 @@ import org.videolan.BDJAction; import org.videolan.BDJActionManager; +import org.videolan.BDJActionQueue; import org.videolan.BDJListeners; import org.videolan.BDJXletContext; import org.videolan.Logger; public abstract class BDHandler implements Player, ServiceContentHandler { + public BDHandler() { + ownerContext = BDJXletContext.getCurrentContext(); + + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_INIT, null); + BDJActionManager.getInstance().putCommand(action); + action.waitEnd(); + } + + private void doInitAction() { + commandQueue = new BDJActionQueue("MediaPlayer"); + PlayerManager.getInstance().registerPlayer(this); + } + + protected BDJXletContext getOwnerContext() { + return ownerContext; } private void checkUnrealized() { @@ -187,8 +205,11 @@ public void setMediaTime(Time now) { checkUnrealized(); + + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_SEEK_TIME, now); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); action.waitEnd(); } @@ -205,14 +226,23 @@ baseTime = getTimeBase().getNanoseconds(); } + /* notification from app */ + protected void updateRate(float rate) { + if (this.rate != rate) { + this.rate = rate; + notifyListeners(new RateChangeEvent(this, rate)); + } + } + public float getRate() { return rate; } public float setRate(float factor) { checkUnrealized(); + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_SET_RATE, new Float(factor)); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); action.waitEnd(); return rate; } @@ -226,13 +256,17 @@ } public void realize() { + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_REALIZE, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); } public void prefetch() { + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_PREFETCH, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); } public void syncStart(Time at) { @@ -240,36 +274,58 @@ if (state != Prefetched) throw new NotPrefetchedError("syncStart"); } + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_START, at); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); } public void start() { + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_START, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); } public void stop() { + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_STOP, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); action.waitEnd(); } public void deallocate() { + if (isClosed) return; + + if (state == Started) { + } PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_DEALLOCATE, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); action.waitEnd(); + + PlayerManager.getInstance().releaseResource(this); } public void close() { + if (isClosed) return; + + stop(); + deallocate(); + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_CLOSE, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); action.waitEnd(); + + isClosed = true; + commandQueue.shutdown(); } - protected void endOfMedia() { + protected void endOfMedia(int playlist) { + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_END_OF_MEDIA, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); } protected void updateTime(int time) { @@ -277,68 +333,13 @@ //currentTime = new Time(time * TO_SECONDS); } - public static void activePlayerEndOfMedia() { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.endOfMedia(); - } - } - - public static void activePlayerUpdateTime(int pts) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.updateTime(pts); - } - } - - public static void onChapterReach(int param) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doChapterReach(param); - } - } - - public static void onMarkReach(int param) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doMarkReach(param); - } - } - - public static void onPlayItemReach(int param) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doPlayItemReach(param); - } - } - - public static void onAngleChange(int param) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doAngleChange(param); - } - } - - public static void onSubtitleChange(int param) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doSubtitleChange(param); - } - } - - public static void onPiPChange(int param) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doPiPChange(param); - } - } - - protected abstract void doChapterReach(int param); - protected abstract void doMarkReach(int param); - protected abstract void doPlayItemReach(int param); - protected abstract void doAngleChange(int param); - protected abstract void doSubtitleChange(int param); - protected abstract void doPiPChange(int param); + protected void doPlaylistStart(int param) {}; + protected void doChapterReach(int param) {}; + protected void doMarkReach(int param) {}; + protected void doPlayItemReach(int param) {}; + protected void doAngleChange(int param) {}; + protected void doSubtitleChange(int param) {}; + protected void doPiPChange(int param) {}; protected ControllerErrorEvent doRealize() { return null; @@ -373,7 +374,10 @@ } protected void doSetRate(Float factor) { - rate = factor.floatValue(); + if (rate != factor.floatValue()) { + rate = factor.floatValue(); + notifyListeners(new RateChangeEvent(this, rate)); + } } private void notifyListeners(ControllerEvent event) { @@ -412,10 +416,10 @@ state = Prefetching; notifyListeners(new TransitionEvent(this, Realized, Prefetching, Prefetched)); case Prefetching: - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doDeallocateAction(); - activePlayer = this; + + if (!PlayerManager.getInstance().allocateResource(this)) { + notifyListeners(new ResourceUnavailableEvent(this)); + return false; } ControllerErrorEvent error = doPrefetch(); if (error == null) { @@ -499,10 +503,6 @@ default: error = doDeallocate(); if (error == null) { - synchronized (BDHandler.class) { - if (activePlayer == this) - activePlayer = null; - } int previous = state; state = Realized; notifyListeners(new DeallocateEvent(this, previous, Realized, Realized, getMediaTime())); @@ -518,6 +518,7 @@ private void doCloseAction() { doClose(); notifyListeners(new ControllerClosedEvent(this)); + PlayerManager.getInstance().unregisterPlayer(this); } private void doEndOfMediaAction() { @@ -541,6 +542,9 @@ protected void doAction() { switch (action) { + case ACTION_INIT: + player.doInitAction(); + break; case ACTION_REALIZE: player.doRealizeAction(); break; @@ -584,6 +588,7 @@ public static final int ACTION_END_OF_MEDIA = 7; public static final int ACTION_SEEK_TIME = 8; public static final int ACTION_SET_RATE = 9; + public static final int ACTION_INIT = 10; } protected int state = Unrealized; @@ -595,10 +600,13 @@ protected Control[] controls = null; protected BDLocator locator = null; private BDJListeners listeners = new BDJListeners(); + private BDJXletContext ownerContext; + boolean isClosed = false; + + protected BDJActionQueue commandQueue; public static final double TO_SECONDS = 1 / 90000.0d; public static final double FROM_SECONDS = 90000.0d; public static final double TO_NAROSECONDS = 1000000 / 90.0d; public static final double FROM_NAROSECONDS = 0.00009d; - public static BDHandler activePlayer = null; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/PlayerManager.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/PlayerManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/PlayerManager.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/PlayerManager.java 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,186 @@ +/* + * This file is part of libbluray + * + * 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 + * . + */ + +package org.videolan.media.content; + +import java.util.ArrayList; + +public class PlayerManager { + + private static PlayerManager instance = new PlayerManager(); + + public static PlayerManager getInstance() { + return instance; + } + + /* + * + */ + + private ArrayList registeredPlayers = new ArrayList(1); + + private BDHandler playlistPlayer = null; + private BDHandler videoDripPlayer = null; + private ArrayList audioPlayerList = new ArrayList(8); + + private Object playlistPlayerLock = new Object(); + private Object videoDripPlayerLock = new Object(); + private Object audioPlayerLock = new Object(); + + public void releaseAllPlayers(boolean unconditional) { + BDHandler[] players = null; + synchronized (registeredPlayers) { + players = (BDHandler[])registeredPlayers.toArray(new BDHandler[0]); + } + + for (int i = 0; i < players.length; i++) { + if (unconditional) { + players[i].close(); + } else if (players[i].getOwnerContext() != null && players[i].getOwnerContext().isReleased()) { + players[i].close(); + } + } + } + + protected void releaseResource(BDHandler player) { + if (player instanceof org.videolan.media.content.playlist.Handler) { + synchronized (playlistPlayerLock) { + if (player == playlistPlayer) { + playlistPlayer = null; + } + } + return; + } + if (player instanceof org.videolan.media.content.sound.Handler) { + return; + } + + System.err.println("unknown player type: " + player.getClass().getName()); + } + + protected boolean allocateResource(BDHandler player) { + if (player instanceof org.videolan.media.content.playlist.Handler) { + synchronized (playlistPlayerLock) { + if (playlistPlayer != null && player != playlistPlayer) { + playlistPlayer.stop(); + playlistPlayer.deallocate(); + } + playlistPlayer = player; + } + return true; + } + if (player instanceof org.videolan.media.content.sound.Handler) { + return true; + } + + System.err.println("unknown player type: " + player.getClass().getName()); + return false; + } + + protected void unregisterPlayer(BDHandler player) + { + synchronized (registeredPlayers) { + if (registeredPlayers.contains(player)) { + registeredPlayers.remove(player); + } + } + } + + protected void registerPlayer(BDHandler player) + { + synchronized (registeredPlayers) { + if (!registeredPlayers.contains(player)) { + registeredPlayers.add(player); + } + } + } + + /* + * + */ + + public void onPlaylistEnd(int playlist) { + synchronized (playlistPlayerLock) { + if (playlistPlayer != null) + playlistPlayer.endOfMedia(playlist); + } + } + + public void onPlaylistTime(int pts) { + synchronized (playlistPlayerLock) { + if (playlistPlayer != null) + playlistPlayer.updateTime(pts); + } + } + + public void onChapterReach(int param) { + synchronized (playlistPlayerLock) { + if (playlistPlayer != null) + playlistPlayer.doChapterReach(param); + } + } + + public void onMarkReach(int param) { + synchronized (playlistPlayerLock) { + if (playlistPlayer != null) + playlistPlayer.doMarkReach(param); + } + } + + public void onPlaylistStart(int param) { + synchronized (playlistPlayerLock) { + if (playlistPlayer != null) + playlistPlayer.doPlaylistStart(param); + } + } + + public void onPlayItemReach(int param) { + synchronized (playlistPlayerLock) { + if (playlistPlayer != null) + playlistPlayer.doPlayItemReach(param); + } + } + + public void onAngleChange(int param) { + synchronized (playlistPlayerLock) { + if (playlistPlayer != null) + playlistPlayer.doAngleChange(param); + } + } + + public void onRateChange(float rate) { + synchronized (playlistPlayerLock) { + if (playlistPlayer != null) + playlistPlayer.updateRate(rate); + } + } + + public void onSubtitleChange(int param) { + synchronized (playlistPlayerLock) { + if (playlistPlayer != null) + playlistPlayer.doSubtitleChange(param); + } + } + + public void onPiPChange(int param) { + synchronized (playlistPlayerLock) { + if (playlistPlayer != null) + playlistPlayer.doPiPChange(param); + } + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java 2014-09-01 12:06:01.000000000 +0000 @@ -1,6 +1,7 @@ /* * This file is part of libbluray - * Copyright (C) 2010 William Hahne + * Copyright (C) 2010 William Hahne + * Copyright (C) 2012-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -89,36 +90,40 @@ protected ControllerErrorEvent doPrefetch() { synchronized (this) { try { - if (!Libbluray.selectPlaylist(locator.getPlayListId())) - return new ConnectionErrorEvent(this); - - if (baseMediaTime != 0) { - Libbluray.seekTime((long)(baseMediaTime * FROM_NAROSECONDS)); - } else if (locator.getMarkId() >= 0) { - ((PlaybackControlImpl)controls[9]).skipToMark(locator.getMarkId()); - } else if (locator.getPlayItemId() >= 0) { - ((PlaybackControlImpl)controls[9]).skipToPlayItem(locator.getPlayItemId()); - } - int stream; stream = locator.getPrimaryAudioStreamNumber(); if (stream > 0) Libbluray.writePSR(Libbluray.PSR_PRIMARY_AUDIO_ID, stream); stream = locator.getPGTextStreamNumber(); if (stream > 0) { - int psr = Libbluray.readPSR(Libbluray.PSR_PG_STREAM) & 0xFFFFF000; - Libbluray.writePSR(Libbluray.PSR_PG_STREAM, psr | stream); + Libbluray.writePSR(Libbluray.PSR_PG_STREAM, stream, 0x00000fff); } stream = locator.getSecondaryVideoStreamNumber(); if (stream > 0) { - int psr = Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO) & 0xFFFF00FF; - Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, psr | (stream << 8)); + Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, stream << 8, 0x0000ff00); } stream = locator.getSecondaryAudioStreamNumber(); if (stream > 0) { - int psr = Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO) & 0xFFFFFF00; - Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, psr | stream); + Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, stream, 0x000000ff); + } + + int pl = locator.getPlayListId(); + long time = -1; + int pi = -1, mark = -1; + if (baseMediaTime != 0) { + time = (long)(baseMediaTime * FROM_NAROSECONDS); + } /*else*/ if (locator.getMarkId() > 0) { + mark = locator.getMarkId(); + } /*else*/ if (locator.getPlayItemId() > 0) { + pi = locator.getPlayItemId(); + } + + if (!Libbluray.selectPlaylist(pl, pi, mark, time)) { + return new ConnectionErrorEvent(this); } + + updateTime(new Time(Libbluray.tellTime() * TO_SECONDS)); + } catch (Throwable e) { return new ConnectionErrorEvent(this); } @@ -137,7 +142,7 @@ } try { - Libbluray.selectRate(rate); + Libbluray.selectRate(rate, true); } catch (Throwable e) { return new ConnectionErrorEvent(this); } @@ -148,7 +153,7 @@ } protected ControllerErrorEvent doStop() { - Libbluray.selectRate(0.0f); + Libbluray.selectRate(0.0f, false); return super.doStop(); } @@ -183,6 +188,17 @@ } } + /* notification from app */ + protected void updateRate(float rate) { + synchronized (this) { + if (state == Started) { + baseMediaTime = getMediaNanoseconds(); + baseTime = getTimeBase().getNanoseconds(); + } + super.updateRate(rate); + } + } + protected void doChapterReach(int param) { ((PlaybackControlImpl)controls[9]).onChapterReach(param); } @@ -190,6 +206,9 @@ ((PlaybackControlImpl)controls[9]).onMarkReach(param); } + protected void doPlaylistStart(int param) { + } + protected void doPlayItemReach(int param) { ((PlaybackControlImpl)controls[9]).onPlayItemReach(param); ((UOMaskTableControlImpl)controls[16]).onPlayItemReach(param); @@ -207,6 +226,17 @@ ((PiPControlImpl)controls[8]).onPiPChange(param); } + protected void endOfMedia(int playlist) { + synchronized (this) { + if (locator == null || locator.getPlayListId() != playlist) { + System.err.println("endOfMedia ignored: playlist does not match (" + playlist + " != " + locator.getPlayListId()); + return; + } + } + + super.endOfMedia(playlist); + } + protected BDLocator getLocator() { return locator; } @@ -251,7 +281,8 @@ throw new IllegalArgumentException(); PlaylistPlayerAction action = new PlaylistPlayerAction( this, PlaylistPlayerAction.ACTION_SEEK_MARK, mark); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); + action.waitEnd(); } protected void seekPlayItem(int item) throws IllegalArgumentException { @@ -259,7 +290,8 @@ throw new IllegalArgumentException(); PlaylistPlayerAction action = new PlaylistPlayerAction( this, PlaylistPlayerAction.ACTION_SEEK_PLAYITEM, item); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); + action.waitEnd(); } private class PlaylistPlayerAction extends BDJAction { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/PiPControlImpl.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/playlist/PiPControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/PiPControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/playlist/PiPControlImpl.java 2014-09-01 12:06:01.000000000 +0000 @@ -48,8 +48,7 @@ } protected void setStreamNumber(int num) { - int psr = Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO)& 0xFFFF00FF; - Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, psr | (num << 8)); + Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, num << 8, 0x0000ff00); } public int getCurrentStreamNumber() { @@ -57,10 +56,7 @@ } public void setDisplay(boolean value) { - int psr = Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO) & 0x7FFFFFFF; - if (value) - psr |= 0x80000000; - Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, psr); + Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, value ? 0x80000000 : 0, 0x80000000); } public boolean getDisplay() { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryAudioControlImpl.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryAudioControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryAudioControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryAudioControlImpl.java 2014-09-01 12:06:01.000000000 +0000 @@ -45,7 +45,6 @@ } protected void setStreamNumber(int num) { - int psr = Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO); - Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, (psr & 0xFFFFFF00) | num); + Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, num, 0x000000ff); } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/SubtitlingControlImpl.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/playlist/SubtitlingControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/SubtitlingControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/playlist/SubtitlingControlImpl.java 2014-09-01 12:06:01.000000000 +0000 @@ -53,8 +53,7 @@ } protected void setStreamNumber(int num) { - int psr = Libbluray.readPSR(Libbluray.PSR_PG_STREAM); - Libbluray.writePSR(Libbluray.PSR_PG_STREAM, (psr & 0xFFFFF000) | num); + Libbluray.writePSR(Libbluray.PSR_PG_STREAM, num, 0x00000fff); } public boolean isSubtitlingOn() { @@ -62,14 +61,8 @@ } public boolean setSubtitling(boolean mode) { - int psr = Libbluray.readPSR(Libbluray.PSR_PG_STREAM); - boolean oldMode = (psr & 0x80000000) != 0; - if (mode != oldMode) { - if (mode) - Libbluray.writePSR(Libbluray.PSR_PG_STREAM, psr | 0x80000000); - else - Libbluray.writePSR(Libbluray.PSR_PG_STREAM, psr & ~0x80000000); - } + boolean oldMode = (Libbluray.readPSR(Libbluray.PSR_PG_STREAM) & 0x80000000) != 0; + Libbluray.writePSR(Libbluray.PSR_PG_STREAM, mode ? 0x80000000 : 0, 0x80000000); return oldMode; } @@ -82,14 +75,8 @@ } public boolean setPipSubtitleMode(boolean mode) { - int psr = Libbluray.readPSR(Libbluray.PSR_PG_STREAM); - boolean oldMode = (psr & 0x40000000) != 0; - if (mode != oldMode) { - if (mode) - Libbluray.writePSR(Libbluray.PSR_PG_STREAM, psr | 0x40000000); - else - Libbluray.writePSR(Libbluray.PSR_PG_STREAM, psr & ~0x40000000); - } + boolean oldMode = (Libbluray.readPSR(Libbluray.PSR_PG_STREAM) & 0x40000000) != 0; + Libbluray.writePSR(Libbluray.PSR_PG_STREAM, mode ? 0x40000000 : 0, 0x40000000); return oldMode; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoControl.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoControl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoControl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoControl.java 2014-09-01 12:06:01.000000000 +0000 @@ -37,10 +37,10 @@ protected HScreenRectangle getNormalizedRectangle(Dimension dimension, Rectangle rectangle) { if ((dimension.width == 0) || (dimension.height == 0)) return new HScreenRectangle(0, 0, 0, 0); - float x = rectangle.x / dimension.width; - float y = rectangle.y / dimension.height; - float w = rectangle.width / dimension.width; - float h = rectangle.height / dimension.height; + float x = (float)rectangle.x / dimension.width; + float y = (float)rectangle.y / dimension.height; + float w = (float)rectangle.width / dimension.width; + float h = (float)rectangle.height / dimension.height; return new HScreenRectangle(x, y, w, h); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/sound/Handler.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/sound/Handler.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/sound/Handler.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/media/content/sound/Handler.java 2014-09-01 12:06:01.000000000 +0000 @@ -37,11 +37,17 @@ import javax.media.TimeBase; import javax.media.protocol.DataSource; +import org.bluray.net.BDLocator; + //import org.videolan.media.content.playlist.MediaTimePositionControlImpl; import org.videolan.media.content.playlist.OverallGainControlImpl; import org.videolan.media.content.playlist.PanningControlImpl; -public class Handler implements Player { +import org.videolan.media.content.BDHandler; + +import org.videolan.BDJListeners; + +public class Handler extends BDHandler { public Handler() { controls = new Control[3]; controls[0] = new MediaTimePositionControlImpl(this); @@ -53,150 +59,36 @@ this.source = new org.videolan.media.protocol.dripfeed.DataSource(source.getLocator()); if (source.getLocator() == null) throw new IncompatibleSourceException(); - } - - public int getState() { - synchronized (this) { - return state; - } - } - - public int getTargetState() { - synchronized (this) { - return targetState; - } - } - - public Time getStartLatency() { - return null; - } - public Control[] getControls() { - return controls; - } - - public Control getControl(String forName) { - try { - Class cls = Class.forName(forName); - for (int i = 0; i < controls.length; i++) { - if (cls.isInstance(controls[i])) - return controls[i]; + try { + locator = new BDLocator(source.getLocator().toExternalForm()); + } catch (org.davic.net.InvalidLocatorException e) { + throw new IncompatibleSourceException(); } - return null; - } catch (ClassNotFoundException e) { - return null; - } - } - - public void addControllerListener(ControllerListener listener) { - synchronized (listeners) { - listeners.add(listener); - } - } - - public void removeControllerListener(ControllerListener listener) { - synchronized (listeners) { - listeners.remove(listener); - } - } - - public void setTimeBase(TimeBase master) - throws IncompatibleTimeBaseException { - throw new IncompatibleTimeBaseException(); - } - - public void realize() { - // TODO Auto-generated method stub - } - - public void prefetch() { - // TODO Auto-generated method stub - } - - public void start() { - // TODO Auto-generated method stub - } - - public void syncStart(Time at) { - // TODO Auto-generated method stub - } - - public void deallocate() { - // TODO Auto-generated method stub } - public void close() { - // TODO Auto-generated method stub - } - - public void stop() { - // TODO Auto-generated method stub - } - - public void setStopTime(Time stopTime) { - } - - public Time getStopTime() { - return null; - } - - public void setMediaTime(Time now) { - } - - public Time getMediaTime() { - return new Time(0); - } - - public long getMediaNanoseconds() { - return 0; - } - - public Time getSyncTime() { - return null; - } - - public TimeBase getTimeBase() { - return null; - } - - public Time mapToTimeBase(Time t) throws ClockStoppedException { - return null; - } - - public float getRate() { - return 1.0f; - } - - public float setRate(float factor) { - return 1.0f; - } - - public Component getVisualComponent() { - return null; - } - - public GainControl getGainControl() { - return null; + public Time getDuration() { + org.videolan.Logger.unimplemented("Handler", "getDuration"); + long duration = 1; // pi.getDuration() ; + return new Time(duration * TO_SECONDS); } - public Component getControlPanelComponent() { - return null; + protected ControllerErrorEvent doPrefetch() { + return super.doPrefetch(); } - public void addController(Controller newController) - throws IncompatibleTimeBaseException { + protected ControllerErrorEvent doStart(Time at) { + return super.doStart(at); } - public void removeController(Controller oldController) { + protected ControllerErrorEvent doStop() { + return super.doStop(); } - public Time getDuration() { - return null; + protected BDLocator getLocator() { + return locator; } - protected int state = Unrealized; - protected int targetState = Unrealized; - protected Control[] controls = null; + private BDLocator locator; private org.videolan.media.protocol.dripfeed.DataSource source = null; - private ArrayList listeners = new ArrayList(); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/MountManager.java libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/MountManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/MountManager.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java/org/videolan/MountManager.java 2014-09-01 12:06:01.000000000 +0000 @@ -48,6 +48,7 @@ if (jarStr == null) throw new IllegalArgumentException(); + synchronized (mountPoints) { String oldPath = getMount(jarId); if (oldPath != null) { logger.error("JAR " + jarId + " already mounted"); @@ -107,31 +108,54 @@ mountPoints.put(new Integer(jarId), tmpDir); return tmpDir.getAbsolutePath(); + } } public static void unmount(int jarId) { logger.info("Unmounting JAR: " + jarId); + Integer id = new Integer(jarId); - File mountPoint = (File)mountPoints.get(id); + File mountPoint; + + synchronized (mountPoints) { + mountPoint = (File)mountPoints.remove(id); + } if (mountPoint != null) { recursiveDelete(mountPoint); - mountPoints.remove(id); + } else { + logger.info("JAR " + jarId + " not mounted"); } } public static void unmountAll() { - Iterator iterator = mountPoints.keySet().iterator(); - while (iterator.hasNext()) - unmount(((Integer)iterator.next()).intValue()); + logger.info("Unmounting all JARs"); + + Object[] dirs; + + synchronized (mountPoints) { + dirs = mountPoints.values().toArray(); + mountPoints.clear(); + } + if (dirs != null) { + for (int i = 0; i < dirs.length; i++) { + recursiveDelete((File)dirs[i]); + } + } } public static String getMount(int jarId) { Integer id = new Integer(jarId); - if (mountPoints.containsKey(id)) { - return ((File)mountPoints.get(id)).getAbsolutePath(); + File mountPoint; + + synchronized (mountPoints) { + mountPoint = (File)mountPoints.get(id); + } + if (mountPoint != null) { + return mountPoint.getAbsolutePath(); } else { - return null; + logger.info("JAR " + jarId + " not mounted"); } + return null; } private static String jarIdToString(int jarId) { @@ -154,6 +178,6 @@ dir.delete(); } - private static Map mountPoints = Collections.synchronizedMap(new HashMap()); + private static Map mountPoints = new HashMap(); private static final Logger logger = Logger.getLogger(MountManager.class.getName()); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/awt/BDGraphicsConfiguration.java libbluray-0.6.2/src/libbluray/bdj/java-j2me/java/awt/BDGraphicsConfiguration.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/awt/BDGraphicsConfiguration.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2me/java/awt/BDGraphicsConfiguration.java 2014-09-01 12:06:01.000000000 +0000 @@ -19,46 +19,8 @@ package java.awt; -import java.awt.color.ColorSpace; -import java.awt.image.BufferedImage; -import java.awt.image.ColorModel; -import java.awt.image.DataBuffer; -import java.awt.image.DirectColorModel; -import java.awt.image.VolatileImage; - -class BDGraphicsConfiguration extends GraphicsConfiguration { - private BDGraphicsDevice device; - +class BDGraphicsConfiguration extends BDGraphicsConfigurationBase { BDGraphicsConfiguration(BDGraphicsDevice device) { - this.device = device; - } - - public GraphicsDevice getDevice() { - return device; - } - - public Rectangle getBounds() { - return device.getBounds(); - } - - int getCompatibleImageType() { - return BufferedImage.TYPE_INT_ARGB; - } - - public synchronized ColorModel getColorModel() { - return new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), - 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000, true, - DataBuffer.TYPE_INT); - } - - public BufferedImage createCompatibleImage(int width, int height) { - if (width <= 0 || height <= 0) - return null; - return BDImage.getBuffededImage(width, height, this); - } - - public VolatileImage createCompatibleVolatileImage(int width, int height) { - org.videolan.Logger.unimplemented("BDGraphicsConfiguration", "createCompatibleVolatileImage"); - return null; + super(device); } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java libbluray-0.6.2/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java 2014-09-01 12:06:01.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2012 libbluray + * Copyright (C) 2014 libbluray * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,671 +19,17 @@ package java.awt; -import java.lang.reflect.Field; -import java.text.AttributedCharacterIterator; -import java.util.Arrays; -import java.awt.image.AreaAveragingScaleFilter; -import java.awt.image.BufferedImage; -import java.awt.image.ImageConsumer; -import java.awt.image.ImageObserver; - -import org.dvb.ui.DVBBufferedImage; - -import sun.awt.ConstrainableGraphics; - -import org.videolan.Logger; - -class BDGraphics extends Graphics2D implements ConstrainableGraphics { - private static final Color DEFAULT_COLOR = Color.BLACK; - private static final Font DEFAULT_FONT = new Font("Dialog", Font.PLAIN, 12); - - private int width; - private int height; - private int[] backBuffer; - private Area dirty; - private GraphicsConfiguration gc; - private Color foreground; - private Color background; - private Font font; - private BDFontMetrics fontMetrics; - private AlphaComposite composite; - - /** The current xor color. If null then we are in paint mode. */ - private Color xorColor; - - /** Translated X, Y offset from native offset. */ - private int originX; - private int originY; - - /** The actual clip rectangle that is intersection of user clip and constrained rectangle. */ - private Rectangle actualClip; - - /** The current user clip rectangle or null if no clip has been set. This is stored in the - native coordinate system and not the (possibly) translated Java coordinate system. */ - private Rectangle clip; - - /** The rectangle this graphics object has been constrained too. This is stored in the - native coordinate system and not the (possibly) translated Java coordinate system. - If it is null then this graphics has not been constrained. The constrained rectangle - is another layer of clipping independant of the user clip. */ - private Rectangle constrainedRect; - +class BDGraphics extends BDGraphicsBase { BDGraphics(BDGraphics g) { - backBuffer = g.backBuffer; - dirty = g.dirty; - width = g.width; - height = g.height; - gc = g.gc; - foreground = g.foreground; - background = g.background; - composite = g.composite; - font = g.font; - fontMetrics = g.fontMetrics; - originX = g.originX; - originY = g.originY; - actualClip = g.clip; - clip = g.clip; - constrainedRect = g.constrainedRect; + super(g); } BDGraphics(BDRootWindow window) { - width = window.getWidth(); - height = window.getHeight(); - backBuffer = window.getBdBackBuffer(); - dirty = window.getDirtyArea(); - gc = window.getGraphicsConfiguration(); - foreground = window.getForeground(); - background = window.getBackground(); - font = window.getFont(); - if (foreground == null) - foreground = DEFAULT_COLOR; - if (background == null) - background = DEFAULT_COLOR; - if (font == null) - font = DEFAULT_FONT; - fontMetrics = BDFontMetrics.getFontMetrics(font); - composite = AlphaComposite.SrcOver; - setupClip(); + super(window); } BDGraphics(BDImage image) { - width = image.getWidth(); - height = image.getHeight(); - backBuffer = image.getBdBackBuffer(); - dirty = image.getDirtyArea(); - gc = image.getGraphicsConfiguration(); - Component component = image.getComponent(); - if (component != null) { - foreground = component.getForeground(); - background = component.getBackground(); - font = component.getFont(); - } - if (foreground == null) - foreground = DEFAULT_COLOR; - if (background == null) - background = new Color(0, 0, 0, 0); - if (font == null) - font = DEFAULT_FONT; - fontMetrics = BDFontMetrics.getFontMetrics(font); - composite = AlphaComposite.SrcOver; - setupClip(); - } - - public Graphics create() { - return new BDGraphics(this); - } - - public void translate(int x, int y) { - originX += x; - originY += y; - } - - public void setFont(Font font) { - if (font != null && !font.equals(this.font)) { - this.font = font; - fontMetrics = BDFontMetrics.getFontMetrics(font); - } - } - - public Font getFont() { - return font; - } - - public FontMetrics getFontMetrics() { - return fontMetrics; - } - - public FontMetrics getFontMetrics(Font font) { - return BDFontMetrics.getFontMetrics(font); - } - - public void setColor(Color c) { - if ((c != null) && (c != foreground)) - foreground = c; - } - - public Color getColor() { - return foreground; - } - - public Composite getComposite() { - return composite; - } - - public GraphicsConfiguration getDeviceConfiguration() { - return gc; - } - - public void setComposite(Composite comp) { - if ((comp != null) && (comp != composite)) { - if (!(comp instanceof AlphaComposite)) - throw new IllegalArgumentException("Only AlphaComposite is supported"); - composite = (AlphaComposite) comp; - } - } - - public void setPaintMode() { - xorColor = null; - } - - public void setXORMode(Color color) { - xorColor = color; - } - - /** Gets the current clipping area. */ - public Rectangle getClipBounds() { - if (clip != null) - return new Rectangle (clip.x - originX, clip.y - originY, clip.width, clip.height); - return null; - } - - public void constrain(int x, int y, int w, int h) { - Rectangle rect; - if (constrainedRect != null) - rect = constrainedRect; - else - rect = new Rectangle(0, 0, width, height); - constrainedRect = rect.intersection(new Rectangle(rect.x + x, rect.y + y, w, h)); - originX = constrainedRect.x; - originY = constrainedRect.y; - setupClip(); - } - - /** Returns a Shape object representing the clip. */ - public Shape getClip() { - return getClipBounds(); - } - - /** Crops the clipping rectangle. */ - public void clipRect(int x, int y, int w, int h) { - Rectangle rect = new Rectangle(x + originX, y + originY, w, h); - if (clip != null) - clip = clip.intersection(rect); - else - clip = rect; - setupClip(); - } - - /** Sets the clipping rectangle. */ - public void setClip(int x, int y, int w, int h) { - clip = new Rectangle (x + originX, y + originY, w, h); - setupClip(); - } - - /** Sets the clip to a Shape (only Rectangle allowed). */ - public void setClip(Shape clip) { - if (clip == null) { - this.clip = null; - setupClip(); - } else if (clip instanceof Rectangle) { - Rectangle rect = (Rectangle) clip; - setClip(rect.x, rect.y, rect.width, rect.height); - } else - throw new IllegalArgumentException("setClip(Shape) only supports Rectangle objects"); - } - - private void setupClip() { - Rectangle rect; - if (constrainedRect != null) - rect = constrainedRect; - else - rect = new Rectangle(0, 0, width, height); - if (clip != null) - actualClip = clip.intersection(rect); - else - actualClip = rect; - } - - private int alphaBlend(int dest, int src) { - int As = src >>> 24; - if (As == 0) - return dest; - if (As == 255) - return src; - int Ad = (dest >>> 24); - if (Ad == 0) - return src; - int R, G, B; - R = ((src >>> 16) & 255) * As * 255; - G = ((src >>> 8) & 255) * As * 255; - B = (src & 255) * As * 255; - Ad = Ad * (255 - As); - As = As * 255 + Ad; - R = (R + ((dest >>> 16) & 255) * Ad) / As; - G = (G + ((dest >>> 8) & 255) * Ad) / As; - B = (B + (dest & 255) * Ad) / As; - R = Math.min(255, R); - G = Math.min(255, G); - B = Math.min(255, B); - Ad = As / 255; - Ad = Math.min(255, Ad); - return (Ad << 24) | (R << 16) | (G << 8) | B; - } - - private void drawPointN(int x, int y, int rgb) { - - dirty.add(x, y); - - if (xorColor != null) { - backBuffer[y * width + x] ^= xorColor.getRGB() ^ rgb; - return; - } - int rule; - if (composite != null) { - rule = composite.getRule(); - rgb = ((int)((rgb >>> 24) * composite.getAlpha()) << 24) | (rgb & 0x00FFFFFF); - } else { - rule = AlphaComposite.SRC_OVER; - } - switch (rule) { - case AlphaComposite.CLEAR: - backBuffer[y * width + x] = 0; - break; - case AlphaComposite.SRC: - backBuffer[y * width + x] = rgb; - break; - case AlphaComposite.SRC_OVER: - backBuffer[y * width + x] = alphaBlend(backBuffer[y * width + x], rgb); - break; - } - } - - private void drawGlyph(int[] rgbArray, int x0, int y0, int w, int h) { - for (int y = 0; y < h; y++) - for (int x = 0; x < w; x++) - drawPoint(x + x0, y + y0, rgbArray[y * w + x]); - } - - private void drawPoint(int x, int y, int rgb) { - x += originX; - y += originY; - if (actualClip.contains(x, y)) - drawPointN(x, y, rgb); - } - - public void clearRect(int x, int y, int w, int h) { - x += originX; - y += originY; - Rectangle rect = new Rectangle(x, y, w, h); - rect = actualClip.intersection(rect); - x = rect.x; - y = rect.y; - w = rect.width; - h = rect.height; - int rgb = background.getRGB(); - for (int i = 0; i < h; i++) - Arrays.fill(backBuffer, (y + i) * width + x, (y + i) * width + x + w, rgb); - - dirty.add(rect); - } - - public void fillRect(int x, int y, int w, int h) { - x += originX; - y += originY; - Rectangle rect = new Rectangle(x, y, w, h); - rect = actualClip.intersection(rect); - x = rect.x; - y = rect.y; - w = rect.width; - h = rect.height; - int rgb = foreground.getRGB(); - for (int Y = y; Y < (y + h); Y++) - for (int X = x; X < (x + w); X++) - drawPointN(X, Y, rgb); - } - - public void drawRect(int x, int y, int w, int h) { - drawLineN(x, y, x + w, y); - drawLineN(x, y + h, x + w, y + h); - drawLineN(x, y, x, y + h); - drawLineN(x + w, y, x + w, y + h); + super(image); } - - public void drawLineN(int x1, int y1, int x2, int y2) { - int rgb = foreground.getRGB(); - int dy = y2 - y1; - int dx = x2 - x1; - int stepx, stepy; - int fraction; - if (dy < 0) { - dy = -dy; - stepy = -1; - } else { - stepy = 1; - } - if (dx < 0) { - dx = -dx; - stepx = -1; - } else { - stepx = 1; - } - dy <<= 1; - dx <<= 1; - - drawPointN(x1, y1, rgb); - - if (dx > dy) { - fraction = dy - (dx >> 1); - while (x1 != x2) { - if (fraction >= 0) { - y1 += stepy; - fraction -= dx; - } - x1 += stepx; - fraction += dy; - drawPointN(x1, y1, rgb); - } - } else { - fraction = dx - (dy >> 1); - while (y1 != y2) { - if (fraction >= 0) { - x1 += stepx; - fraction -= dy; - } - y1 += stepy; - fraction += dx; - drawPointN(x1, y1, rgb); - } - } - } - - public void drawLine(int x1, int y1, int x2, int y2) { - drawLineN(x1, y1, x2, y2); - } - - /** - * Copies an area of the canvas that this graphics context paints to. - * @param X the x-coordinate of the source. - * @param Y the y-coordinate of the source. - * @param W the width. - * @param H the height. - * @param dx the horizontal distance to copy the pixels. - * @param dy the vertical distance to copy the pixels. - */ - public void copyArea(int X, int Y, int W, int H, int dx, int dy) { - X += originX; - Y += originY; - logger.unimplemented("copyArea"); - } - - /** Draws lines defined by an array of x points and y points */ - public void drawPolyline(int xPoints[], int yPoints[], int nPoints) { - if (nPoints == 1) { - drawPointN(xPoints[0], yPoints[0], foreground.getRGB()); - } else { - for (int i = 0; i < (nPoints - 1); i++) - drawLineN(xPoints[i], xPoints[i], xPoints[i + 1], xPoints[i + 1]); - } - } - - /** Draws a polygon defined by an array of x points and y points */ - public void drawPolygon(int xPoints[], int yPoints[], int nPoints) { - if (nPoints == 1) { - drawPointN(xPoints[0], yPoints[0], foreground.getRGB()); - } else { - for (int i = 0; i < (nPoints - 1); i++) - drawLineN(xPoints[i], xPoints[i], xPoints[i + 1], xPoints[i + 1]); - if (nPoints > 2) - drawLineN(xPoints[0], xPoints[0], xPoints[nPoints - 1], xPoints[nPoints - 1]); - } - } - - /** Fills a polygon with the current fill mask */ - public void fillPolygon(int xPoints[], int yPoints[], int nPoints) { - logger.unimplemented("fillPolygon"); - } - - /** Draws an oval to fit in the given rectangle */ - public void drawOval(int x, int y, int w, int h) { - logger.unimplemented("drawOval"); - } - - /** Fills an oval to fit in the given rectangle */ - public void fillOval(int x, int y, int w, int h) { - logger.unimplemented("fillOval"); - } - - /** - * Draws an arc bounded by the given rectangle from startAngle to - * endAngle. 0 degrees is a vertical line straight up from the - * center of the rectangle. Positive start angle indicate clockwise - * rotations, negative angle are counter-clockwise. - */ - public void drawArc(int x, int y, int w, int h, int startAngle, int endAngle) { - logger.unimplemented("drawArc"); - } - - /** fills an arc. arguments are the same as drawArc. */ - public void fillArc(int x, int y, int w, int h, int startAngle, int endAngle) { - logger.unimplemented("fillArc"); - } - - /** Draws a rounded rectangle. */ - public void drawRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) { - logger.unimplemented("drawRoundRect"); - } - - /** Draws a filled rounded rectangle. */ - public void fillRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) { - logger.unimplemented("fillRoundRect"); - } - - protected native void drawStringN(long ftFace, String string, int x, int y, int rgb); - - /** Draws the given string. */ - public void drawString(String string, int x, int y) { - drawStringN(fontMetrics.ftFace, string, x, y, foreground.getRGB()); - } - - /** Draws the given character array. */ - public void drawChars(char chars[], int offset, int length, int x, int y) { - drawStringN(fontMetrics.ftFace, new String(chars, offset, length), x, y, foreground.getRGB()); - } - - public void drawString(AttributedCharacterIterator arg0, int arg1, int arg2) { - logger.unimplemented("drawString"); - } - - /** - * Draws an image at x,y in nonblocking mode with a callback object. - */ - public boolean drawImage(Image img, int x, int y, ImageObserver observer) { - return drawImage(img, x, y, null, observer); - } - - /** - * Draws an image at x,y in nonblocking mode with a solid background - * color and a callback object. - */ - public boolean drawImage(Image img, int x, int y, Color bg, - ImageObserver observer) { - return drawImageN(img, x, y, -1, -1, 0, 0, -1, -1, bg, observer); - } - - /** - * Draws an image scaled to x,y,w,h in nonblocking mode with a - * callback object. - */ - public boolean drawImage(Image img, int x, int y, int w, int h, - ImageObserver observer) { - return drawImage(img, x, y, w, h, null, observer); - } - - /** - * Draws an image scaled to x,y,w,h in nonblocking mode with a - * solid background color and a callback object. - */ - public boolean drawImage(Image img, int x, int y, int w, int h, - Color bg, ImageObserver observer) { - return drawImageN(img, x, y, w, h, 0, 0, -1, -1, bg, observer); - } - - /** - * Draws a subrectangle of an image scaled to a destination rectangle - * in nonblocking mode with a callback object. - */ - public boolean drawImage(Image img, - int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2, - ImageObserver observer) { - return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null, observer); - } - - /** - * Draws a subrectangle of an image scaled to a destination rectangle in - * nonblocking mode with a solid background color and a callback object. - */ - public boolean drawImage(Image img, - int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2, - Color bg, ImageObserver observer) { - if ((dx1 >= dx2) || (dy1 >= dy2)) - return false; - return drawImageN(img, dx1, dy1, dx2 - dx1, dy2 - dy1, - sx1, sy1, sx2 - sx1, sy2 - sy1, bg, observer); - } - - /** - * Draws a subrectangle of an image scaled to a destination rectangle in - * nonblocking mode with a solid background color and a callback object. - */ - protected boolean drawImageN(Image img, - int dx, int dy, int dw, int dh, - int sx, int sy, int sw, int sh, - Color bg, ImageObserver observer) { - if ((sx < 0) || (sy < 0) || - (sw == 0) || (sh == 0) || (dw == 0) || (dh == 0)) - return false; - - BDImage bdImage; - if (img instanceof BDImage) { - bdImage = (BDImage)img; - } else if (img instanceof DVBBufferedImage) { - bdImage = (BDImage)getBufferedImagePeer( - (BufferedImage)(((DVBBufferedImage)img).getImage())); - } else if (img instanceof BufferedImage) { - bdImage = (BDImage)getBufferedImagePeer((BufferedImage)img); - } else { - logger.unimplemented("drawImageN: unsupported image type " + img.getClass().getName()); - return false; - } - - if (bdImage instanceof BDImageConsumer) { - BDImageConsumer consumer = (BDImageConsumer)bdImage; - if (!consumer.isComplete(observer)) { - return false; - } - } - - if(sx + sw > bdImage.width) { - int n = sx + sw - bdImage.width; - dw -= dw * n / sw; - sw -= n; - } - - if(sy + sh > bdImage.height) { - int n = sy + sh - bdImage.height; - dh -= dh * n / sh; - sh -= n; - } - - if ((sw > 0) && (sh > 0) && - ((sx != 0) || (sy != 0) || (sw != bdImage.width) || (sh != bdImage.height))) { - BDImage subImage = new BDImage(null, sw, sh, null); - bdImage.getRGB(sx, sy, sw, sh, subImage.getBdBackBuffer(), 0, sw); - bdImage = subImage; - } - if ((dw > 0) && (dh > 0) && - ((dw != bdImage.width) || (dh != bdImage.height))) { - BDImageConsumer scaledImage = new BDImageConsumer(null); - AreaAveragingScaleFilter scaleFilter = - new AreaAveragingScaleFilter(dw, dh); - scaleFilter = (AreaAveragingScaleFilter)scaleFilter.getFilterInstance(scaledImage); - scaleFilter.setDimensions(bdImage.width, bdImage.height); - scaleFilter.setPixels(0, 0, bdImage.width, bdImage.height, - bdImage.getColorModel(), bdImage.getBdBackBuffer(), - 0, bdImage.width); - scaleFilter.imageComplete(ImageConsumer.STATICIMAGEDONE); - bdImage = scaledImage; - } - int[] rgbArray = bdImage.getBdBackBuffer(); - int bgColor; - if (bg != null) - bgColor = bg.getRGB(); - else - bgColor = 0; - // TODO: optimize this - for (int y = dy; y < (dy + bdImage.height); y++) - for (int x = dx; x < (dx + bdImage.width); x++) { - if (bg != null) - drawPoint(x, y, bgColor); - drawPoint(x, y, rgbArray[(y - dy) * bdImage.width + (x - dx)]); - } - return true; - } - - public Stroke getStroke() { - logger.unimplemented("getStroke"); - throw new Error(); - } - - public void setStroke(Stroke stroke) { - logger.unimplemented("setStroke"); - } - - public void dispose() { - } - - public String toString() { - return getClass().getName() + "[" + originX + "," + originY + "]"; - } - - private static Image getBufferedImagePeer(BufferedImage image) { - try { - return (Image)bufferedImagePeer.get(image); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - return null; - } - - private static Field bufferedImagePeer; - - static { - try { - Class c = Class.forName("java.awt.image.BufferedImage"); - bufferedImagePeer = c.getDeclaredField("peer"); - bufferedImagePeer.setAccessible(true); - } catch (ClassNotFoundException e) { - throw new AWTError("java.awt.image.BufferedImage not found"); - } catch (SecurityException e) { - throw new AWTError("java.awt.image.BufferedImage.peer not accessible"); - } catch (NoSuchFieldException e) { - throw new AWTError("java.awt.image.BufferedImage.peer not found"); - } - } - - private static final Logger logger = Logger.getLogger(BDGraphics.class.getName()); } + diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java libbluray-0.6.2/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java 2014-09-01 12:06:01.000000000 +0000 @@ -19,226 +19,23 @@ package java.awt; -import java.awt.image.ColorModel; -import java.awt.image.ImageObserver; -import java.awt.image.ImageProducer; -import java.io.File; -import java.net.URL; -import java.util.Collections; -import java.util.Hashtable; -import java.util.WeakHashMap; -import java.util.Map; -import java.util.Iterator; - import sun.awt.NullGraphics; -import sun.awt.image.ByteArrayImageSource; -import sun.awt.image.FileImageSource; -import sun.awt.image.URLImageSource; - -import org.videolan.BDJXletContext; -import org.videolan.Logger; - -public class BDToolkit extends Toolkit { - private EventQueue eventQueue = new EventQueue(); - private BDGraphicsEnvironment localEnv = new BDGraphicsEnvironment(); - private BDGraphicsConfiguration defaultGC = (BDGraphicsConfiguration)localEnv.getDefaultScreenDevice().getDefaultConfiguration(); - private static Hashtable cachedImages = new Hashtable(); - private static final Logger logger = Logger.getLogger(BDToolkit.class.getName()); - - public BDToolkit () {} - - public static void setFocusedWindow(Window window) { - /* nothing to do */ - } - public static void shutdown() { - Toolkit toolkit = getDefaultToolkit(); - if (toolkit instanceof BDToolkit) { - ((BDToolkit)toolkit).dispose(); - } - } +public class BDToolkit extends BDToolkitBase { - public void dispose() { - if (eventQueue != null) { - BDJHelper.stopEventQueue(eventQueue); - eventQueue = null; - } - cachedImages = null; - } - - public Dimension getScreenSize() { - Rectangle dims = defaultGC.getBounds(); - return new Dimension(dims.width, dims.height); + public BDToolkit () { } Graphics getGraphics(Window window) { - if (!(window instanceof BDRootWindow)) + if (!(window instanceof BDRootWindow)) { return new NullGraphics(window); + } return new BDWindowGraphics((BDRootWindow)window); } - GraphicsEnvironment getLocalGraphicsEnvironment() { - return localEnv; - } - - public int getScreenResolution() { - return 72; - } - - public ColorModel getColorModel() { - return defaultGC.getColorModel(); - } - - public String[] getFontList() { - return BDFontMetrics.getFontList(); - } - - public FontMetrics getFontMetrics(Font font) { - return BDFontMetrics.getFontMetrics(font); - } - public void sync() { - Window window = ((BDGraphicsDevice)localEnv.getDefaultScreenDevice()).getWindow(); + Window window = ((BDGraphicsDevice)getLocalGraphicsEnvironment().getDefaultScreenDevice()).getWindow(); if (window instanceof BDRootWindow) ((BDRootWindow)window).sync(); } - - static void clearCache(BDImage image) { - synchronized (cachedImages) { - Iterator i = cachedImages.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry entry = (Map.Entry) i.next(); - if (entry.getValue() == image) { - i.remove(); - return; - } - } - } - } - - public Image getImage(String filename) { - if (cachedImages.containsKey(filename)) - return (Image)cachedImages.get(filename); - Image newImage = createImage(filename); - if (newImage != null) - cachedImages.put(filename, newImage); - return newImage; - } - - public Image getImage(URL url) { - if (cachedImages.containsKey(url)) - return (Image)cachedImages.get(url); - Image newImage = createImage(url); - if (newImage != null) - cachedImages.put(url, newImage); - return newImage; - } - - public Image createImage(String filename) { - if (!new File(filename).exists()) { - BDJXletContext ctx = BDJXletContext.getCurrentContext(); - if (ctx != null) { - ClassLoader cldr = (ClassLoader)ctx.getClassLoader(); - URL url = cldr.getResource(filename); - if (url != null) { - logger.warning("" + filename + " translated to " + url); - return createImage(url); - } else { - logger.error("ClassLoader failed to translate " + filename); - } - } else { - logger.error("createImage(" + filename + "): no XletContext available!\n" + logger.dumpStack()); - } - } - - ImageProducer ip = new FileImageSource(filename); - Image newImage = createImage(ip); - return newImage; - } - - public Image createImage(URL url) { - ImageProducer ip = new URLImageSource(url); - Image newImage = createImage(ip); - return newImage; - } - - public Image createImage(byte[] imagedata, - int imageoffset, - int imagelength) { - ImageProducer ip = new ByteArrayImageSource(imagedata, imageoffset, imagelength); - Image newImage = createImage(ip); - return newImage; - } - - public Image createImage(ImageProducer producer) { - return new BDImageConsumer(producer); - } - - public Image createImage(Component component, int width, int height) { - return new BDImage(component, width, height, defaultGC); - } - - public boolean prepareImage(Image image, int width, int height, ImageObserver observer) { - if (!(image instanceof BDImageConsumer)) - return true; - BDImageConsumer img = (BDImageConsumer)image; - return img.prepareImage(observer); - } - - public int checkImage(Image image, int width, int height, - ImageObserver observer) { - if (!(image instanceof BDImageConsumer)) { - return ImageObserver.ALLBITS; - } - BDImageConsumer img = (BDImageConsumer)image; - return img.checkImage(observer); - } - - public void beep() { - } - - // mapping of Components to AppContexts, WeakHashMap - private static final Map contextMap = - Collections.synchronizedMap(new WeakHashMap()); - - public static void addComponent(Component component) { - - BDJXletContext context = BDJXletContext.getCurrentContext(); - if (context == null) { - logger.warning("addComponent() outside of app context"); - return; - } - contextMap.put(component, context); - } - - public static EventQueue getEventQueue(Component component) { - if (component != null) { - do { - BDJXletContext ctx = (BDJXletContext)contextMap.get(component); - if (ctx != null) { - EventQueue eq = ctx.getEventQueue(); - if (eq == null) { - logger.warning("getEventQueue() failed: no context event queue"); - } - return eq; - } - - component = component.getParent(); - } while (component != null); - - logger.warning("getEventQueue() failed: no context"); - } - return null; - } - - protected EventQueue getSystemEventQueueImpl() { - BDJXletContext ctx = BDJXletContext.getCurrentContext(); - if (ctx != null) { - EventQueue eq = ctx.getEventQueue(); - if (eq != null) { - return eq; - } - } - return eventQueue; - } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/io/BDFileSystemImpl.java libbluray-0.6.2/src/libbluray/bdj/java-j2me/java/io/BDFileSystemImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/io/BDFileSystemImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2me/java/io/BDFileSystemImpl.java 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,36 @@ +/* + * This file is part of libbluray + * + * 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 + * . + */ + +package java.io; + +class BDFileSystemImpl extends BDFileSystem { + + public BDFileSystemImpl(FileSystem fs) { + super(fs); + } + + /* Different in SE */ + public boolean checkAccess(File f, boolean write) { + return fs.checkAccess(f, write); + } + + /* Not in SE */ + public boolean deleteOnExit(File f) { + return fs.deleteOnExit(f); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/io/Closeable.java libbluray-0.6.2/src/libbluray/bdj/java-j2me/java/io/Closeable.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/io/Closeable.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2me/java/io/Closeable.java 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,23 @@ +/* + * This file is part of libbluray + * + * 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 + * . + */ + +package java.io; + +public interface Closeable { + public abstract void close() throws IOException; +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java libbluray-0.6.2/src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java 2014-09-01 12:06:01.000000000 +0000 @@ -26,4 +26,8 @@ public static void stopThreadGroup(ThreadGroup t) { } + + public static String dumpStack(Thread t) { + return ""; + } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/BDGraphicsConfiguration.java libbluray-0.6.2/src/libbluray/bdj/java-j2se/java/awt/BDGraphicsConfiguration.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/BDGraphicsConfiguration.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2se/java/awt/BDGraphicsConfiguration.java 2014-09-01 12:06:01.000000000 +0000 @@ -19,30 +19,11 @@ package java.awt; -import java.awt.color.ColorSpace; -import java.awt.image.BufferedImage; -import java.awt.image.ColorModel; -import java.awt.image.DataBuffer; -import java.awt.image.DirectColorModel; import java.awt.image.VolatileImage; -class BDGraphicsConfiguration extends GraphicsConfiguration { - private BDGraphicsDevice device; - +class BDGraphicsConfiguration extends BDGraphicsConfigurationBase { BDGraphicsConfiguration(BDGraphicsDevice device) { - this.device = device; - } - - public GraphicsDevice getDevice() { - return device; - } - - public Rectangle getBounds() { - return device.getBounds(); - } - - int getCompatibleImageType() { - return BufferedImage.TYPE_INT_ARGB; + super(device); } public java.awt.geom.AffineTransform getNormalizingTransform() { @@ -58,28 +39,6 @@ return null; } - public synchronized ColorModel getColorModel() { - return new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), - 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000, true, - DataBuffer.TYPE_INT); - } - - public BufferedImage createCompatibleImage(int width, int height, int trans) { - org.videolan.Logger.unimplemented("BDGraphicsConfiguration", "createCompatibleImage"); - return null; - } - - public BufferedImage createCompatibleImage(int width, int height) { - if (width <= 0 || height <= 0) - return null; - return BDImage.getBuffededImage(width, height, this); - } - - public VolatileImage createCompatibleVolatileImage(int width, int height) { - org.videolan.Logger.unimplemented("BDGraphicsConfiguration", "createCompatibleVolatileImage"); - return null; - } - public VolatileImage createCompatibleVolatileImage(int width, int height, int trans) { org.videolan.Logger.unimplemented("BDGraphicsConfiguration", "createCompatibleVolatileImage"); return null; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java libbluray-0.6.2/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java 2014-09-01 12:06:01.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2012 libbluray + * Copyright (C) 2012-2014 libbluray * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,98 +19,23 @@ package java.awt; -import java.lang.reflect.Field; -import java.text.AttributedCharacterIterator; -import java.util.Arrays; -import java.awt.image.AreaAveragingScaleFilter; -import java.awt.image.BufferedImage; -import java.awt.image.ImageConsumer; -import java.awt.image.ImageObserver; import java.awt.font.*; import java.awt.image.renderable.RenderableImage; import java.awt.image.RenderedImage; import java.awt.geom.AffineTransform; - -import org.dvb.ui.DVBBufferedImage; - -import sun.awt.ConstrainableGraphics; +import java.text.AttributedCharacterIterator; import org.videolan.Logger; -class BDGraphics extends Graphics2D implements ConstrainableGraphics { - private static final Color DEFAULT_COLOR = Color.BLACK; - private static final Font DEFAULT_FONT = new Font("Dialog", Font.PLAIN, 12); - - private int width; - private int height; - private int[] backBuffer; - private Area dirty; - private GraphicsConfiguration gc; - private Color foreground; - private Color background; +class BDGraphics extends BDGraphicsBase { private Paint paint; - private Font font; - private BDFontMetrics fontMetrics; - private AlphaComposite composite; - - /** The current xor color. If null then we are in paint mode. */ - private Color xorColor; - - /** Translated X, Y offset from native offset. */ - private int originX; - private int originY; - - /** The actual clip rectangle that is intersection of user clip and constrained rectangle. */ - private Rectangle actualClip; - - /** The current user clip rectangle or null if no clip has been set. This is stored in the - native coordinate system and not the (possibly) translated Java coordinate system. */ - private Rectangle clip; - - /** The rectangle this graphics object has been constrained too. This is stored in the - native coordinate system and not the (possibly) translated Java coordinate system. - If it is null then this graphics has not been constrained. The constrained rectangle - is another layer of clipping independant of the user clip. */ - private Rectangle constrainedRect; BDGraphics(BDGraphics g) { - backBuffer = g.backBuffer; - dirty = g.dirty; - width = g.width; - height = g.height; - gc = g.gc; - foreground = g.foreground; - background = g.background; - composite = g.composite; - font = g.font; - fontMetrics = g.fontMetrics; - originX = g.originX; - originY = g.originY; - actualClip = g.actualClip; - clip = g.clip; - constrainedRect = g.constrainedRect; - if (clip == null) - setupClip(); + super(g); } BDGraphics(BDRootWindow window) { - width = window.getWidth(); - height = window.getHeight(); - backBuffer = window.getBdBackBuffer(); - dirty = window.getDirtyArea(); - gc = window.getGraphicsConfiguration(); - foreground = window.getForeground(); - background = window.getBackground(); - font = window.getFont(); - if (foreground == null) - foreground = DEFAULT_COLOR; - if (background == null) - background = DEFAULT_COLOR; - if (font == null) - font = DEFAULT_FONT; - fontMetrics = BDFontMetrics.getFontMetrics(font); - composite = AlphaComposite.SrcOver; - setupClip(); + super(window); } public Color getBackground() { @@ -123,72 +48,15 @@ } BDGraphics(BDImage image) { - width = image.getWidth(); - height = image.getHeight(); - backBuffer = image.getBdBackBuffer(); - dirty = image.getDirtyArea(); - - gc = image.getGraphicsConfiguration(); - Component component = image.getComponent(); - if (component != null) { - foreground = component.getForeground(); - background = component.getBackground(); - font = component.getFont(); - } - if (foreground == null) - foreground = DEFAULT_COLOR; - if (background == null) - background = new Color(0, 0, 0, 0); - if (font == null) - font = DEFAULT_FONT; - fontMetrics = BDFontMetrics.getFontMetrics(font); - composite = AlphaComposite.SrcOver; - setupClip(); - } - - public Graphics create() { - return new BDGraphics(this); + super(image); } public java.awt.font.FontRenderContext getFontRenderContext() { return null; } - - public void translate(int x, int y) { - originX += x; - originY += y; - } - - public void setFont(Font font) { - if (font != null && !font.equals(this.font)) { - this.font = font; - fontMetrics = BDFontMetrics.getFontMetrics(font); - } - } - - public Font getFont() { - return font; - } - - public FontMetrics getFontMetrics() { - return fontMetrics; - } - - public FontMetrics getFontMetrics(Font font) { - return BDFontMetrics.getFontMetrics(font); - } - - public void setColor(Color c) { - if ((c != null) && (c != foreground)) - foreground = c; - } - - public Color getColor() { - return foreground; - } - public void setPaint(Paint p) { + logger.unimplemented("setPaint"); paint = p; } public Paint getPaint() { @@ -249,336 +117,15 @@ logger.unimplemented("getRenderingHints"); return null; } - public Composite getComposite() { - return composite; - } - - public GraphicsConfiguration getDeviceConfiguration() { - return gc; - } - - public void setComposite(Composite comp) { - if ((comp != null) && (comp != composite)) { - if (!(comp instanceof AlphaComposite)) - throw new IllegalArgumentException("Only AlphaComposite is supported"); - composite = (AlphaComposite) comp; - } - } - - public void setPaintMode() { - xorColor = null; - composite = AlphaComposite.SrcOver; - } - - public void setXORMode(Color color) { - xorColor = color; - } - - /** Gets the current clipping area. */ - public Rectangle getClipBounds() { - if (clip != null) - return new Rectangle (clip.x - originX, clip.y - originY, clip.width, clip.height); - return null; - } - public void constrain(int x, int y, int w, int h) { - Rectangle rect; - if (constrainedRect != null) - rect = constrainedRect; - else - rect = new Rectangle(0, 0, width, height); - constrainedRect = rect.intersection(new Rectangle(rect.x + x, rect.y + y, w, h)); - originX = constrainedRect.x; - originY = constrainedRect.y; - setupClip(); - } - - /** Returns a Shape object representing the clip. */ - public Shape getClip() { - return getClipBounds(); - } - - /** Crops the clipping rectangle. */ - public void clipRect(int x, int y, int w, int h) { - Rectangle rect = new Rectangle(x + originX, y + originY, w, h); - if (clip != null) - clip = clip.intersection(rect); - else - clip = rect; - setupClip(); - } - - /** Sets the clipping rectangle. */ - public void setClip(int x, int y, int w, int h) { - clip = new Rectangle (x + originX, y + originY, w, h); - setupClip(); - } public void clip(Shape s) { setClip(s); } - /** Sets the clip to a Shape (only Rectangle allowed). */ - public void setClip(Shape clip) { - if (clip == null) { - this.clip = null; - setupClip(); - } else if (clip instanceof Rectangle) { - Rectangle rect = (Rectangle) clip; - setClip(rect.x, rect.y, rect.width, rect.height); - } else - throw new IllegalArgumentException("setClip(Shape) only supports Rectangle objects"); - } - - private void setupClip() { - Rectangle rect; - if (constrainedRect != null) - rect = constrainedRect; - else - rect = new Rectangle(0, 0, width, height); - if (clip != null) - actualClip = clip.intersection(rect); - else - actualClip = rect; - } - - private int alphaBlend(int dest, int src) { - int As = src >>> 24; - if (As == 0) - return dest; - if (As == 255) - return src; - int Ad = (dest >>> 24); - if (Ad == 0) - return src; - int R, G, B; - R = ((src >>> 16) & 255) * As * 255; - G = ((src >>> 8) & 255) * As * 255; - B = (src & 255) * As * 255; - Ad = Ad * (255 - As); - As = As * 255 + Ad; - R = (R + ((dest >>> 16) & 255) * Ad) / As; - G = (G + ((dest >>> 8) & 255) * Ad) / As; - B = (B + (dest & 255) * Ad) / As; - R = Math.min(255, R); - G = Math.min(255, G); - B = Math.min(255, B); - Ad = As / 255; - Ad = Math.min(255, Ad); - return (Ad << 24) | (R << 16) | (G << 8) | B; - } - - private void drawPointN(int x, int y, int rgb) { - - dirty.add(x, y); - - if (xorColor != null) { - backBuffer[y * width + x] ^= xorColor.getRGB() ^ rgb; - return; - } - int rule; - if (composite != null) { - rule = composite.getRule(); - rgb = ((int)((rgb >>> 24) * composite.getAlpha()) << 24) | (rgb & 0x00FFFFFF); - } else { - rule = AlphaComposite.SRC_OVER; - } - switch (rule) { - case AlphaComposite.CLEAR: - backBuffer[y * width + x] = 0; - break; - case AlphaComposite.SRC: - backBuffer[y * width + x] = rgb; - break; - case AlphaComposite.SRC_OVER: - backBuffer[y * width + x] = alphaBlend(backBuffer[y * width + x], rgb); - break; - } - } - - private void drawPoint(int x, int y, int rgb) { - x += originX; - y += originY; - if (actualClip.contains(x, y)) - drawPointN(x, y, rgb); - } - - public void clearRect(int x, int y, int w, int h) { - x += originX; - y += originY; - Rectangle rect = new Rectangle(x, y, w, h); - rect = actualClip.intersection(rect); - x = rect.x; - y = rect.y; - w = rect.width; - h = rect.height; - int rgb = background.getRGB(); - for (int i = 0; i < h; i++) - Arrays.fill(backBuffer, (y + i) * width + x, (y + i) * width + x + w, rgb); - - dirty.add(rect); - } - - public void fillRect(int x, int y, int w, int h) { - x += originX; - y += originY; - Rectangle rect = new Rectangle(x, y, w, h); - rect = actualClip.intersection(rect); - x = rect.x; - y = rect.y; - w = rect.width; - h = rect.height; - int rgb = foreground.getRGB(); - for (int Y = y; Y < (y + h); Y++) - for (int X = x; X < (x + w); X++) - drawPointN(X, Y, rgb); - } - - public void drawRect(int x, int y, int w, int h) { - drawLineN(x, y, x + w, y); - drawLineN(x, y + h, x + w, y + h); - drawLineN(x, y, x, y + h); - drawLineN(x + w, y, x + w, y + h); - } - - public void drawLineN(int x1, int y1, int x2, int y2) { - int rgb = foreground.getRGB(); - int dy = y2 - y1; - int dx = x2 - x1; - int stepx, stepy; - int fraction; - if (dy < 0) { - dy = -dy; - stepy = -1; - } else { - stepy = 1; - } - if (dx < 0) { - dx = -dx; - stepx = -1; - } else { - stepx = 1; - } - dy <<= 1; - dx <<= 1; - - drawPointN(x1, y1, rgb); - - if (dx > dy) { - fraction = dy - (dx >> 1); - while (x1 != x2) { - if (fraction >= 0) { - y1 += stepy; - fraction -= dx; - } - x1 += stepx; - fraction += dy; - drawPointN(x1, y1, rgb); - } - } else { - fraction = dx - (dy >> 1); - while (y1 != y2) { - if (fraction >= 0) { - x1 += stepx; - fraction -= dy; - } - y1 += stepy; - fraction += dx; - drawPointN(x1, y1, rgb); - } - } - } - - public void drawLine(int x1, int y1, int x2, int y2) { - drawLineN(x1, y1, x2, y2); - } - - /** - * Copies an area of the canvas that this graphics context paints to. - * @param X the x-coordinate of the source. - * @param Y the y-coordinate of the source. - * @param W the width. - * @param H the height. - * @param dx the horizontal distance to copy the pixels. - * @param dy the vertical distance to copy the pixels. - */ - public void copyArea(int X, int Y, int W, int H, int dx, int dy) { - X += originX; - Y += originY; - logger.unimplemented("copyArea"); - } - - /** Draws lines defined by an array of x points and y points */ - public void drawPolyline(int xPoints[], int yPoints[], int nPoints) { - if (nPoints == 1) { - drawPointN(xPoints[0], yPoints[0], foreground.getRGB()); - } else { - for (int i = 0; i < (nPoints - 1); i++) - drawLineN(xPoints[i], xPoints[i], xPoints[i + 1], xPoints[i + 1]); - } - } - - /** Draws a polygon defined by an array of x points and y points */ - public void drawPolygon(int xPoints[], int yPoints[], int nPoints) { - if (nPoints == 1) { - drawPointN(xPoints[0], yPoints[0], foreground.getRGB()); - } else { - for (int i = 0; i < (nPoints - 1); i++) - drawLineN(xPoints[i], xPoints[i], xPoints[i + 1], xPoints[i + 1]); - if (nPoints > 2) - drawLineN(xPoints[0], xPoints[0], xPoints[nPoints - 1], xPoints[nPoints - 1]); - } - } - - /** Fills a polygon with the current fill mask */ - public void fillPolygon(int xPoints[], int yPoints[], int nPoints) { - logger.unimplemented("fillPolygon"); - } - - /** Draws an oval to fit in the given rectangle */ - public void drawOval(int x, int y, int w, int h) { - logger.unimplemented("drawOval"); - } - - /** Fills an oval to fit in the given rectangle */ - public void fillOval(int x, int y, int w, int h) { - logger.unimplemented("fillOval"); - } - - /** - * Draws an arc bounded by the given rectangle from startAngle to - * endAngle. 0 degrees is a vertical line straight up from the - * center of the rectangle. Positive start angle indicate clockwise - * rotations, negative angle are counter-clockwise. - */ - public void drawArc(int x, int y, int w, int h, int startAngle, int endAngle) { - logger.unimplemented("drawArc"); - } - - /** fills an arc. arguments are the same as drawArc. */ - public void fillArc(int x, int y, int w, int h, int startAngle, int endAngle) { - logger.unimplemented("fillArc"); - } - - /** Draws a rounded rectangle. */ - public void drawRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) { - logger.unimplemented("drawRoundRect"); - } - - /** Draws a filled rounded rectangle. */ - public void fillRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) { - logger.unimplemented("fillRoundRect"); - } - - protected native void drawStringN(long ftFace, String string, int x, int y, int rgb); - - /** Draws the given string. */ - public void drawString(String string, int x, int y) { - drawStringN(fontMetrics.ftFace, string, x, y, foreground.getRGB()); - } public void drawString(String string, float x, float y) { - drawStringN(fontMetrics.ftFace, string, (int)x, (int)y, foreground.getRGB()); + drawString(string, (int)x, (int)y); } public void drawRenderableImage(RenderableImage img, AffineTransform xform) { @@ -589,11 +136,6 @@ logger.unimplemented("drawRenaeredImage"); } - /** Draws the given character array. */ - public void drawChars(char chars[], int offset, int length, int x, int y) { - drawStringN(fontMetrics.ftFace, new String(chars, offset, length), x, y, foreground.getRGB()); - } - public void drawString(AttributedCharacterIterator arg0, int arg1, int arg2) { logger.unimplemented("drawString"); } @@ -611,184 +153,5 @@ return true; } - /** - * Draws an image at x,y in nonblocking mode with a callback object. - */ - public boolean drawImage(Image img, int x, int y, ImageObserver observer) { - return drawImage(img, x, y, null, observer); - } - - /** - * Draws an image at x,y in nonblocking mode with a solid background - * color and a callback object. - */ - public boolean drawImage(Image img, int x, int y, Color bg, - ImageObserver observer) { - return drawImageN(img, x, y, -1, -1, 0, 0, -1, -1, bg, observer); - } - - /** - * Draws an image scaled to x,y,w,h in nonblocking mode with a - * callback object. - */ - public boolean drawImage(Image img, int x, int y, int w, int h, - ImageObserver observer) { - return drawImage(img, x, y, w, h, null, observer); - } - - /** - * Draws an image scaled to x,y,w,h in nonblocking mode with a - * solid background color and a callback object. - */ - public boolean drawImage(Image img, int x, int y, int w, int h, - Color bg, ImageObserver observer) { - return drawImageN(img, x, y, w, h, 0, 0, -1, -1, bg, observer); - } - - /** - * Draws a subrectangle of an image scaled to a destination rectangle - * in nonblocking mode with a callback object. - */ - public boolean drawImage(Image img, - int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2, - ImageObserver observer) { - return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null, observer); - } - - /** - * Draws a subrectangle of an image scaled to a destination rectangle in - * nonblocking mode with a solid background color and a callback object. - */ - public boolean drawImage(Image img, - int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2, - Color bg, ImageObserver observer) { - if ((dx1 >= dx2) || (dy1 >= dy2)) - return false; - return drawImageN(img, dx1, dy1, dx2 - dx1, dy2 - dy1, - sx1, sy1, sx2 - sx1, sy2 - sy1, bg, observer); - } - - /** - * Draws a subrectangle of an image scaled to a destination rectangle in - * nonblocking mode with a solid background color and a callback object. - */ - protected boolean drawImageN(Image img, - int dx, int dy, int dw, int dh, - int sx, int sy, int sw, int sh, - Color bg, ImageObserver observer) { - if ((sx < 0) || (sy < 0) || - (sw == 0) || (sh == 0) || (dw == 0) || (dh == 0)) - return false; - - BDImage bdImage; - if (img instanceof BDImage) { - bdImage = (BDImage)img; - } else if (img instanceof DVBBufferedImage) { - bdImage = (BDImage)getBufferedImagePeer( - (BufferedImage)(((DVBBufferedImage)img).getImage())); - } else if (img instanceof BufferedImage) { - bdImage = (BDImage)getBufferedImagePeer((BufferedImage)img); - } else { - logger.unimplemented("drawImageN: unsupported image type " + img.getClass().getName()); - return false; - } - if (bdImage instanceof BDImageConsumer) { - BDImageConsumer consumer = (BDImageConsumer)bdImage; - if (!consumer.isComplete(observer)) { - return false; - } - } - - if(sx + sw > bdImage.width) { - int n = sx + sw - bdImage.width; - dw -= dw * n / sw; - sw -= n; - } - - if(sy + sh > bdImage.height) { - int n = sy + sh - bdImage.height; - dh -= dh * n / sh; - sh -= n; - } - - if ((sw > 0) && (sh > 0) && - ((sx != 0) || (sy != 0) || (sw != bdImage.width) || (sh != bdImage.height))) { - BDImage subImage = new BDImage(null, sw, sh, null); - bdImage.getRGB(sx, sy, sw, sh, subImage.getBdBackBuffer(), 0, sw); - bdImage = subImage; - } - if ((dw > 0) && (dh > 0) && - ((dw != bdImage.width) || (dh != bdImage.height))) { - BDImageConsumer scaledImage = new BDImageConsumer(null); - AreaAveragingScaleFilter scaleFilter = - new AreaAveragingScaleFilter(dw, dh); - scaleFilter = (AreaAveragingScaleFilter)scaleFilter.getFilterInstance(scaledImage); - scaleFilter.setDimensions(bdImage.width, bdImage.height); - scaleFilter.setPixels(0, 0, bdImage.width, bdImage.height, - bdImage.getColorModel(), bdImage.getBdBackBuffer(), - 0, bdImage.width); - scaleFilter.imageComplete(ImageConsumer.STATICIMAGEDONE); - bdImage = scaledImage; - } - int[] rgbArray = bdImage.getBdBackBuffer(); - int bgColor; - if (bg != null) - bgColor = bg.getRGB(); - else - bgColor = 0; - for (int y = dy; y < (dy + bdImage.height); y++) - for (int x = dx; x < (dx + bdImage.width); x++) { - if (bg != null) - drawPoint(x, y, bgColor); - drawPoint(x, y, rgbArray[(y - dy) * bdImage.width + (x - dx)]); - } - return true; - } - - public Stroke getStroke() { - logger.unimplemented("getStroke"); - throw new Error(); - } - - public void setStroke(Stroke stroke) { - logger.unimplemented("setStroke"); - } - - public void dispose() { - } - - public String toString() { - return getClass().getName() + "[" + originX + "," + originY + "]"; - } - - private static Image getBufferedImagePeer(BufferedImage image) { - try { - return (Image)bufferedImagePeer.get(image); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - return null; - } - - private static Field bufferedImagePeer; - - static { - try { - Class c = Class.forName("java.awt.image.BufferedImage"); - bufferedImagePeer = c.getDeclaredField("peer"); - bufferedImagePeer.setAccessible(true); - } catch (ClassNotFoundException e) { - throw new AWTError("java.awt.image.BufferedImage not found"); - } catch (SecurityException e) { - throw new AWTError("java.awt.image.BufferedImage.peer not accessible"); - } catch (NoSuchFieldException e) { - throw new AWTError("java.awt.image.BufferedImage.peer not found"); - } - } - private static final Logger logger = Logger.getLogger(BDGraphics.class.getName()); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java libbluray-0.6.2/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java 2014-09-01 12:06:01.000000000 +0000 @@ -20,51 +20,19 @@ package java.awt; -import java.awt.image.ColorModel; -import java.awt.image.ImageObserver; -import java.awt.image.ImageProducer; import java.awt.peer.KeyboardFocusManagerPeer; -import java.io.File; -import java.net.URL; -import java.util.Collections; -import java.util.Hashtable; -import java.util.WeakHashMap; -import java.util.Map; -import java.util.Iterator; - -import sun.awt.image.ByteArrayImageSource; -import sun.awt.image.FileImageSource; -import sun.awt.image.URLImageSource; + import sun.awt.KeyboardFocusManagerPeerProvider; import java.awt.peer.BDFramePeer; import java.awt.peer.BDKeyboardFocusManagerPeer; -import org.videolan.BDJXletContext; -import org.videolan.Logger; - -public class BDToolkit extends Toolkit implements KeyboardFocusManagerPeerProvider { - private EventQueue eventQueue = new EventQueue(); - private BDGraphicsEnvironment localEnv = new BDGraphicsEnvironment(); - private BDGraphicsConfiguration defaultGC = (BDGraphicsConfiguration)localEnv.getDefaultScreenDevice().getDefaultConfiguration(); - private static Hashtable cachedImages = new Hashtable(); - private static final Logger logger = Logger.getLogger(BDToolkit.class.getName()); - +public class BDToolkit extends BDToolkitBase implements KeyboardFocusManagerPeerProvider { public BDToolkit () { } - public static void shutdown() { - Toolkit toolkit = getDefaultToolkit(); - if (toolkit instanceof BDToolkit) { - ((BDToolkit)toolkit).dispose(); - } - } - - public void dispose() { - if (eventQueue != null) { - BDJHelper.stopEventQueue(eventQueue); - eventQueue = null; - } + protected void shutdown() { + super.shutdown(); KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner(); KeyboardFocusManager.getCurrentKeyboardFocusManager().setGlobalCurrentFocusCycleRoot(null); @@ -82,192 +50,22 @@ BDKeyboardFocusManagerPeer.init(window); } + // required by older Java 7 versions public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager kfm) { - return BDKeyboardFocusManagerPeer.getInstance(); - } - - public Dimension getScreenSize() { - Rectangle dims = defaultGC.getBounds(); - return new Dimension(dims.width, dims.height); - } - - Graphics getGraphics(Window window) { - if (!(window instanceof BDRootWindow)) { - System.err.println("getGraphics(): not BDRootWindow"); - throw new Error("Not implemented"); - } - return new BDWindowGraphics((BDRootWindow)window); - } - - GraphicsEnvironment getLocalGraphicsEnvironment() { - return localEnv; + return getKeyboardFocusManagerPeer(); } - public int getScreenResolution() { - return 72; - } - - public ColorModel getColorModel() { - return defaultGC.getColorModel(); - } - - public String[] getFontList() { - return BDFontMetrics.getFontList(); - } - - public FontMetrics getFontMetrics(Font font) { - return BDFontMetrics.getFontMetrics(font); + public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() + { + return BDKeyboardFocusManagerPeer.getInstance(); } public void sync() { org.videolan.GUIManager.getInstance().sync(); } - static void clearCache(BDImage image) { - synchronized (cachedImages) { - Iterator i = cachedImages.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry entry = (Map.Entry) i.next(); - if (entry.getValue() == image) { - i.remove(); - return; - } - } - } - } - - public Image getImage(String filename) { - if (cachedImages.containsKey(filename)) - return (Image)cachedImages.get(filename); - Image newImage = createImage(filename); - if (newImage != null) - cachedImages.put(filename, newImage); - return newImage; - } - - public Image getImage(URL url) { - if (cachedImages.containsKey(url)) - return (Image)cachedImages.get(url); - Image newImage = createImage(url); - if (newImage != null) - cachedImages.put(url, newImage); - return newImage; - } - - public Image createImage(String filename) { - if (!new File(filename).exists()) { - BDJXletContext ctx = BDJXletContext.getCurrentContext(); - if (ctx != null) { - ClassLoader cldr = (ClassLoader)ctx.getClassLoader(); - URL url = cldr.getResource(filename); - if (url != null) { - logger.warning("" + filename + " translated to " + url); - return createImage(url); - } else { - logger.error("ClassLoader failed to translate " + filename); - } - } else { - logger.error("createImage(" + filename + "): no XletContext available!\n" + logger.dumpStack()); - } - } - - ImageProducer ip = new FileImageSource(filename); - Image newImage = createImage(ip); - return newImage; - } - - public Image createImage(URL url) { - ImageProducer ip = new URLImageSource(url); - Image newImage = createImage(ip); - return newImage; - } - - public Image createImage(byte[] imagedata, - int imageoffset, - int imagelength) { - ImageProducer ip = new ByteArrayImageSource(imagedata, imageoffset, imagelength); - Image newImage = createImage(ip); - return newImage; - } - - public Image createImage(ImageProducer producer) { - return new BDImageConsumer(producer); - } - - public Image createImage(Component component, int width, int height) { - return new BDImage(component, width, height, defaultGC); - } - - public boolean prepareImage(Image image, int width, int height, ImageObserver observer) { - if (!(image instanceof BDImageConsumer)) - return true; - BDImageConsumer img = (BDImageConsumer)image; - return img.prepareImage(observer); - } - - public int checkImage(Image image, int width, int height, - ImageObserver observer) { - if (!(image instanceof BDImageConsumer)) { - return ImageObserver.ALLBITS; - } - BDImageConsumer img = (BDImageConsumer)image; - return img.checkImage(observer); - } - - public void beep() { - } - - // mapping of Components to AppContexts, WeakHashMap - private static final Map contextMap = - Collections.synchronizedMap(new WeakHashMap()); - - public static void addComponent(Component component) { - - BDJXletContext context = BDJXletContext.getCurrentContext(); - if (context == null) { - logger.warning("addComponent() outside of app context"); - return; - } - contextMap.put(component, context); - } - - public static EventQueue getEventQueue(Component component) { - if (component != null) { - do { - BDJXletContext ctx = (BDJXletContext)contextMap.get(component); - if (ctx != null) { - EventQueue eq = ctx.getEventQueue(); - if (eq == null) { - logger.warning("getEventQueue() failed: no context event queue"); - } - return eq; - } - - component = component.getParent(); - } while (component != null); - - logger.warning("getEventQueue() failed: no context"); - } - - logger.warning("getEventQueue() failed: no component"); - return null; - } - - protected EventQueue getSystemEventQueueImpl() { - BDJXletContext ctx = BDJXletContext.getCurrentContext(); - if (ctx != null) { - EventQueue eq = ctx.getEventQueue(); - if (eq != null) { - return eq; - } - } - - logger.warning("getSystemEventQueue(): no context"); - return eventQueue; - } - - public Map mapInputMethodHighlight(java.awt.im.InputMethodHighlight h) { + public java.util.Map mapInputMethodHighlight(java.awt.im.InputMethodHighlight h) { throw new Error("Not implemented"); } public boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType modalExclusionType) { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/image/BufferedImage.java libbluray-0.6.2/src/libbluray/bdj/java-j2se/java/awt/image/BufferedImage.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/image/BufferedImage.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2se/java/awt/image/BufferedImage.java 2014-09-01 12:06:01.000000000 +0000 @@ -96,7 +96,7 @@ return peer.getWidth(observer); } - public synchronized void setRGB(int x, int y, int rgb) { + public void setRGB(int x, int y, int rgb) { peer.setRGB(x, y, rgb); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java libbluray-0.6.2/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java 2014-09-01 12:06:01.000000000 +0000 @@ -58,6 +58,10 @@ public void setTitle(String title) { } + /* Java 8 */ + public void emulateActivation(boolean doActivate) { + } + // // ContainerPeer // @@ -177,7 +181,9 @@ public void setVisible(boolean b) { //Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new WindowEvent((Frame)component, WindowEvent.WINDOW_ACTIVATED)); if (b == true) { - component.paint(getGraphics()); + Graphics g = getGraphics(); + component.paint(g); + g.dispose(); } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java libbluray-0.6.2/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * This file is part of libbluray + * + * 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 + * . + */ + +package java.io; + +class BDFileSystemImpl extends BDFileSystem { + + public BDFileSystemImpl(FileSystem fs) { + super(fs); + } + + /* different in ME */ + public boolean checkAccess(File f, int access) { + return fs.checkAccess(f, access); + } + + /* Not in ME */ + public boolean setPermission(File f, int access, boolean enable, boolean owneronly) { + return fs.setPermission(f, access, enable, owneronly); + } + + /* Not in ME */ + public long getSpace(File f, int t) { + return fs.getSpace(f, t); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java libbluray-0.6.2/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java 2014-09-01 12:06:01.000000000 +0000 @@ -50,19 +50,35 @@ fonts = new HashMap(fontIndexData.length); for (int i = 0; i < fontIndexData.length; i++) { FontIndexData data = fontIndexData[i]; - FileInputStream inStream = new FileInputStream(BDJUtil.discRootToFilesystem("/BDMV/AUXDATA/" + data.getFileName())); + FileInputStream inStream = null; - Font font = Font.createFont(Font.TRUETYPE_FONT, inStream); - font = font.deriveFont(data.getStyle(), data.getMaxSize()); - - fonts.put(data.getName(), font); + try { + inStream = new FileInputStream(BDJUtil.discRootToFilesystem("/BDMV/AUXDATA/" + data.getFileName())); + Font font = Font.createFont(Font.TRUETYPE_FONT, inStream); + font = font.deriveFont(data.getStyle(), data.getMaxSize()); + + fonts.put(data.getName(), font); + + } finally { + if (inStream != null) { + inStream.close(); + } + } } } public FontFactory(URL u) throws IOException, FontFormatException { - FileInputStream inStream = new FileInputStream(u.getPath()); + FileInputStream inStream = null; - urlFont = Font.createFont(Font.TRUETYPE_FONT, inStream); + try { + inStream = new FileInputStream(u.getPath()); + urlFont = Font.createFont(Font.TRUETYPE_FONT, inStream); + + } finally { + if (inStream != null) { + inStream.close(); + } + } } public Font createFont(String name, int style, int size) @@ -76,8 +92,10 @@ Font font = (Font)fonts.get(name); - if (font == null) + if (font == null) { + logger.info("Failed creating font: " + name + " " + style + " " + size); throw new FontNotAvailableException(); + } return font.deriveFont(style, size); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java libbluray-0.6.2/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java 2014-09-01 12:06:01.000000000 +0000 @@ -28,4 +28,14 @@ public static void stopThreadGroup(ThreadGroup t) { t.stop(); } + + public static String dumpStack(Thread t) { + String dump = ""; + StackTraceElement e[] = t.getStackTrace(); + if (e != null) { + for (int i = 0; i < e.length; i++) + dump += "\n\t" + e[i].toString(); + } + return dump; + } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/sun/awt/KeyboardFocusManagerPeerProvider.java libbluray-0.6.2/src/libbluray/bdj/java-j2se/sun/awt/KeyboardFocusManagerPeerProvider.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/sun/awt/KeyboardFocusManagerPeerProvider.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/java-j2se/sun/awt/KeyboardFocusManagerPeerProvider.java 2014-09-01 12:06:01.000000000 +0000 @@ -23,5 +23,8 @@ import java.awt.peer.KeyboardFocusManagerPeer; public abstract interface KeyboardFocusManagerPeerProvider { + // required by older Java 7 versions public abstract KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager kfm); + + public abstract KeyboardFocusManagerPeer getKeyboardFocusManagerPeer(); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/org_videolan_Libbluray.c libbluray-0.6.2/src/libbluray/bdj/native/org_videolan_Libbluray.c --- libbluray-0.5.0/src/libbluray/bdj/native/org_videolan_Libbluray.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/native/org_videolan_Libbluray.c 2014-09-01 12:06:01.000000000 +0000 @@ -1,7 +1,7 @@ /* * This file is part of libbluray - * Copyright (C) 2010 William Hahne - * Copyright (C) 2012 Petri Hintukainen + * Copyright (C) 2010 William Hahne + * Copyright (C) 2012-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,6 +22,7 @@ #include "libbluray/bdj/bdj_private.h" #include "libbluray/bdj/bdj_util.h" #include "libbluray/bdj/bdjo_parser.h" +#include "libbluray/bdj/common.h" // BDJ_BDJO_PATH #include "libbluray/bluray.h" #include "libbluray/bluray_internal.h" @@ -121,6 +122,18 @@ ti->playlist, ti->duration, ti->angle_count, marks, clips); } +static int _read_index(BDJAVA *bdj) +{ + if (!bdj) { + return 0; + } + + if (!bdj->index) { + bdj->index = indx_parse(bdj->path); + } + + return !!bdj->index; +} JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getTitleInfoN (JNIEnv * env, jclass cls, jlong np, jint title) @@ -129,6 +142,10 @@ BD_DEBUG(DBG_JNI, "getTitleInfoN(%d)\n", (int)title); + if (!_read_index(bdj)) { + return NULL; + } + if (title == 65535) { if (bdj->index->first_play.object_type == indx_object_type_hdmv) return _make_title_info(env, 65535, indx_object_type_hdmv, @@ -163,7 +180,7 @@ bdj->index->titles[title - 1].bdj.name, -1); } - return NULL; + return NULL; } JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getPlaylistInfoN @@ -214,6 +231,11 @@ JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_getTitlesN(JNIEnv * env, jclass cls, jlong np) { BDJAVA* bdj = (BDJAVA*)(intptr_t)np; + + if (!_read_index(bdj)) { + return 0; + } + return bdj->index->num_titles; } @@ -275,12 +297,17 @@ } JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectPlaylistN( - JNIEnv * env, jclass cls, jlong np, jint playlist) { + JNIEnv * env, jclass cls, jlong np, jint playlist, jint playitem, jint playmark, jlong time) { BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - BD_DEBUG(DBG_JNI, "selectPlaylistN(%05d.mpls)\n", (int)playlist); + if (!bdj || !bdj->bd) { + return 0; + } + + BD_DEBUG(DBG_JNI, "selectPlaylistN(pl=%d, pi=%d, pm=%d, time=%ld)\n", + (int)playlist, (int)playitem, (int)playmark, (long)time); - return bd_select_playlist(bdj->bd, playlist); + return bd_play_playlist_at(bdj->bd, playlist, playitem, playmark, time); } JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectTitleN(JNIEnv * env, @@ -329,7 +356,12 @@ } JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectRateN(JNIEnv * env, - jclass cls, jlong np, jfloat rate) { + jclass cls, jlong np, jfloat rate, jint reason) { + BDJAVA* bdj = (BDJAVA*)(intptr_t)np; + + BD_DEBUG(DBG_JNI, "selectRateN(%1.1f, %d)\n", (float)rate, (int)reason); + + bd_select_rate(bdj->bd, (float)rate, reason); return 1; } @@ -339,7 +371,7 @@ BD_DEBUG(DBG_JNI, "writeGPRN(%d,%d)\n", (int)num, (int)value); - return bd_reg_write(bdj->bd, 0, num, value); + return bd_reg_write(bdj->bd, 0, num, value, ~0); } JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readGPRN(JNIEnv * env, @@ -353,12 +385,16 @@ } JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writePSRN(JNIEnv * env, - jclass cls, jlong np, jint num, jint value) { + jclass cls, jlong np, jint num, jint value, jint mask) { BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - BD_DEBUG(DBG_JNI, "writePSRN(%d,%d)\n", (int)num, (int)value); + if ((uint32_t)mask == 0xffffffff) { + BD_DEBUG(DBG_JNI, "writePSRN(%d,%d)\n", (int)num, (int)value); + } else { + BD_DEBUG(DBG_JNI, "writePSRN(%d,0x%x,0x%08x)\n", (int)num, (int)value, (int)mask); + } - return bd_reg_write(bdj->bd, 1, num, value); + return bd_reg_write(bdj->bd, 1, num, value, mask); } JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readPSRN(JNIEnv * env, @@ -390,7 +426,7 @@ BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - BD_DEBUG(DBG_JNI, "updateGraphicN(%d,%d-%d,%d)\n", x0, y0, x1, y1); + BD_DEBUG(DBG_JNI, "updateGraphicN(%ld,%ld-%ld,%ld)\n", (long)x0, (long)y0, (long)x1, (long)y1); /* app callback not initialized ? */ if (!bdj || !bdj->osd_cb) { @@ -437,8 +473,8 @@ if (bdj->buf->width < width || bdj->buf->height < height) { /* assume buffer is only for the dirty arrea */ - BD_DEBUG(DBG_BDJ, "ARGB frame buffer size is smaller than BD-J frame buffer size (app: %dx%d BD-J: %dx%d)\n", - bdj->buf->width, bdj->buf->height, width, height); + BD_DEBUG(DBG_BDJ, "ARGB frame buffer size is smaller than BD-J frame buffer size (app: %dx%d BD-J: %ldx%ld)\n", + bdj->buf->width, bdj->buf->height, (long)width, (long)height); if (bdj->buf->width < (x1 - x0 + 1) || bdj->buf->height < (y1 - y0 + 1)) { BD_DEBUG(DBG_BDJ | DBG_CRIT, "ARGB frame buffer size is smaller than dirty area\n"); @@ -456,11 +492,11 @@ /* clip */ if (y1 >= bdj->buf->height) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Cropping %d rows from bottom\n", y1 - bdj->buf->height); + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Cropping %ld rows from bottom\n", (long)(y1 - bdj->buf->height)); y1 = bdj->buf->height - 1; } if (x1 >= bdj->buf->width) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Cropping %d pixels from right\n", x1 - bdj->buf->width); + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Cropping %ld pixels from right\n", (long)(x1 - bdj->buf->width)); x1 = bdj->buf->width - 1; } } @@ -477,7 +513,7 @@ /* check for errors */ if ((*env)->ExceptionOccurred(env)) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Array access error at %d (+%d)\n", offset, x1 - x0 + 1); + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Array access error at %ld (+%ld)\n", (long)offset, (long)(x1 - x0 + 1)); (*env)->ExceptionDescribe(env); (*env)->ExceptionClear(env); } @@ -577,7 +613,7 @@ }, { CC("selectPlaylistN"), - CC("(JI)I"), + CC("(JIIIJ)I"), VC(Java_org_videolan_Libbluray_selectPlaylistN), }, { @@ -617,7 +653,7 @@ }, { CC("selectRateN"), - CC("(JF)I"), + CC("(JFI)I"), VC(Java_org_videolan_Libbluray_selectRateN), }, { @@ -627,7 +663,7 @@ }, { CC("writePSRN"), - CC("(JII)I"), + CC("(JIII)I"), VC(Java_org_videolan_Libbluray_writePSRN), }, { diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/org_videolan_Libbluray.h libbluray-0.6.2/src/libbluray/bdj/native/org_videolan_Libbluray.h --- libbluray-0.5.0/src/libbluray/bdj/native/org_videolan_Libbluray.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/native/org_videolan_Libbluray.h 2014-09-01 12:06:01.000000000 +0000 @@ -199,10 +199,10 @@ /* * Class: org_videolan_Libbluray * Method: selectPlaylistN - * Signature: (JI)I + * Signature: (JIIIJ)I */ JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectPlaylistN - (JNIEnv *, jclass, jlong, jint); + (JNIEnv *, jclass, jlong, jint, jint, jint, jlong); /* * Class: org_videolan_Libbluray @@ -263,10 +263,10 @@ /* * Class: org_videolan_Libbluray * Method: selectRateN - * Signature: (JF)I + * Signature: (JFI)I */ JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectRateN - (JNIEnv *, jclass, jlong, jfloat); + (JNIEnv *, jclass, jlong, jfloat, jint); /* * Class: org_videolan_Libbluray @@ -279,10 +279,10 @@ /* * Class: org_videolan_Libbluray * Method: writePSRN - * Signature: (JII)I + * Signature: (JIII)I */ JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writePSRN - (JNIEnv *, jclass, jlong, jint, jint); + (JNIEnv *, jclass, jlong, jint, jint, jint); /* * Class: org_videolan_Libbluray diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/register_native.c libbluray-0.6.2/src/libbluray/bdj/native/register_native.c --- libbluray-0.5.0/src/libbluray/bdj/native/register_native.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/native/register_native.c 2014-09-01 12:06:01.000000000 +0000 @@ -46,8 +46,16 @@ Java_java_awt_BDFontMetrics_methods, Java_java_awt_BDFontMetrics_methods_count) * - bdj_register_methods(env, "java/awt/BDGraphics", + bdj_register_methods(env, "java/awt/BDGraphicsBase", Java_java_awt_BDGraphics_methods, Java_java_awt_BDGraphics_methods_count) ; } + +void bdj_unregister_native_methods(JNIEnv *env) +{ + bdj_unregister_methods(env, "java/awt/BDGraphicsBase"); + bdj_unregister_methods(env, "java/awt/BDFontMetrics"); + bdj_unregister_methods(env, "org/videolan/Libbluray"); + bdj_unregister_methods(env, "org/videolan/Logger"); +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/register_native.h libbluray-0.6.2/src/libbluray/bdj/native/register_native.h --- libbluray-0.5.0/src/libbluray/bdj/native/register_native.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdj/native/register_native.h 2014-09-01 12:06:01.000000000 +0000 @@ -25,5 +25,6 @@ #include BD_PRIVATE int bdj_register_native_methods(JNIEnv *env); +BD_PRIVATE void bdj_unregister_native_methods(JNIEnv *env); #endif /* _REGISTER_NATIVE_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/bdnav/bdid_parse.h libbluray-0.6.2/src/libbluray/bdnav/bdid_parse.h --- libbluray-0.5.0/src/libbluray/bdnav/bdid_parse.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/bdid_parse.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_BDID_PARSE_H_) #define _BDID_PARSE_H_ -#include +#include "util/attributes.h" #include diff -Nru libbluray-0.5.0/src/libbluray/bdnav/clpi_parse.c libbluray-0.6.2/src/libbluray/bdnav/clpi_parse.c --- libbluray-0.5.0/src/libbluray/bdnav/clpi_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/clpi_parse.c 2014-09-01 12:06:01.000000000 +0000 @@ -18,11 +18,14 @@ * . */ -#include "util/macro.h" +#include "clpi_parse.h" + +#include "extdata_parse.h" + #include "file/file.h" #include "util/bits.h" -#include "extdata_parse.h" -#include "clpi_parse.h" +#include "util/macro.h" +#include "util/logging.h" #include #include @@ -583,6 +586,14 @@ { CLPI_CL *cl = (CLPI_CL*)handle; + if (id1 == 1) { + if (id2 == 2) { + // LPCM down mix coefficient + //_parse_lpcm_down_mix_coeff(bits, &cl->lpcm_down_mix_coeff); + return 0; + } + } + if (id1 == 2) { if (id2 == 4) { // Extent start point @@ -598,6 +609,7 @@ } } + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_clpi_extension(): unhandled extension %d.%d\n", id1, id2); return 0; } diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/index_dump-index_parse.Po libbluray-0.6.2/src/libbluray/bdnav/.deps/index_dump-index_parse.Po --- libbluray-0.5.0/src/libbluray/bdnav/.deps/index_dump-index_parse.Po 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/.deps/index_dump-index_parse.Po 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_dump-clpi_parse.Po libbluray-0.6.2/src/libbluray/bdnav/.deps/mpls_dump-clpi_parse.Po --- libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_dump-clpi_parse.Po 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/.deps/mpls_dump-clpi_parse.Po 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_dump-extdata_parse.Po libbluray-0.6.2/src/libbluray/bdnav/.deps/mpls_dump-extdata_parse.Po --- libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_dump-extdata_parse.Po 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/.deps/mpls_dump-extdata_parse.Po 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_dump-mpls_parse.Po libbluray-0.6.2/src/libbluray/bdnav/.deps/mpls_dump-mpls_parse.Po --- libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_dump-mpls_parse.Po 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/.deps/mpls_dump-mpls_parse.Po 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/index_parse.c libbluray-0.6.2/src/libbluray/bdnav/index_parse.c --- libbluray-0.5.0/src/libbluray/bdnav/index_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/index_parse.c 2014-09-01 12:06:01.000000000 +0000 @@ -17,11 +17,13 @@ * . */ +#include "index_parse.h" + #include "file/file.h" #include "util/bits.h" #include "util/logging.h" #include "util/macro.h" -#include "index_parse.h" +#include "util/strutl.h" #include #include @@ -34,6 +36,12 @@ hdmv->id_ref = bs_read(bs, 16); bs_skip(bs, 32); + if (hdmv->playback_type != indx_hdmv_playback_type_movie && + hdmv->playback_type != indx_hdmv_playback_type_interactive) { + + BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: invalid HDMV playback type %d\n", hdmv->playback_type); + } + return 1; } @@ -45,6 +53,12 @@ bdj->name[5] = 0; bs_skip(bs, 8); + if (bdj->playback_type != indx_bdj_playback_type_movie && + bdj->playback_type != indx_bdj_playback_type_interactive) { + + BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: invalid BD-J playback type %d\n", bdj->playback_type); + } + return 1; } @@ -53,11 +67,16 @@ obj->object_type = bs_read(bs, 2); bs_skip(bs, 30); - if (obj->object_type == 1) { - return _parse_hdmv_obj(bs, &obj->hdmv); - } else { - return _parse_bdj_obj(bs, &obj->bdj); + switch (obj->object_type) { + case indx_object_type_hdmv: + return _parse_hdmv_obj(bs, &obj->hdmv); + + case indx_object_type_bdj: + return _parse_bdj_obj(bs, &obj->bdj); } + + BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: unknown object type %d\n", obj->object_type); + return 0; } static int _parse_index(BITSTREAM *bs, INDX_ROOT *index) @@ -88,10 +107,20 @@ index->titles[i].access_type = bs_read(bs, 2); bs_skip(bs, 28); - if (index->titles[i].object_type == 1) { - _parse_hdmv_obj(bs, &index->titles[i].hdmv); - } else { - _parse_bdj_obj(bs, &index->titles[i].bdj); + switch (index->titles[i].object_type) { + case indx_object_type_hdmv: + if (!_parse_hdmv_obj(bs, &index->titles[i].hdmv)) + return 0; + break; + + case indx_object_type_bdj: + if (!_parse_bdj_obj(bs, &index->titles[i].bdj)) + return 0; + break; + + default: + BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: unknown object type %d (#%d)\n", index->titles[i].object_type, i); + return 0; } } @@ -139,8 +168,8 @@ if (sig1 != INDX_SIG1 || (sig2 != INDX_SIG2A && sig2 != INDX_SIG2B)) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv failed signature match: expected INDX0100 got %8.8s\n", bs->buf); - return 0; + BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv failed signature match: expected INDX0100 got %8.8s\n", bs->buf); + return 0; } *index_start = bs_read(bs, 32); @@ -171,6 +200,10 @@ goto error; } + if (extension_data_start) { + BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: unknown extension data at %d\n", extension_data_start); + } + if (!_parse_app_info(&bs, &index->app_info)) { BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: error parsing app info\n"); goto error; @@ -193,24 +226,23 @@ return NULL; } -INDX_ROOT *indx_parse(const char *file_name) +INDX_ROOT *indx_parse(const char *disc_root) { - INDX_ROOT *indx = _indx_parse(file_name); - - /* if failed, try backup file */ - if (!indx) { - size_t len = strlen(file_name); - char *backup = malloc(len + 8); - - strcpy(backup, file_name); - strcpy(backup + len - 10, "BACKUP/index.bdmv"); + INDX_ROOT *index; + char *file; - indx = _indx_parse(backup); - - X_FREE(backup); - } - - return indx; + file = str_printf("%s/BDMV/index.bdmv", disc_root); + index = _indx_parse(file); + X_FREE(file); + if (index) { + return index; + } + + /* try backup */ + file = str_printf("%s/BDMV/BACKUP/index.bdmv", disc_root); + index = _indx_parse(file); + X_FREE(file); + return index; } void indx_free(INDX_ROOT **p) diff -Nru libbluray-0.5.0/src/libbluray/bdnav/index_parse.h libbluray-0.6.2/src/libbluray/bdnav/index_parse.h --- libbluray-0.5.0/src/libbluray/bdnav/index_parse.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/index_parse.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_INDX_PARSE_H_) #define _INDX_PARSE_H_ -#include +#include "util/attributes.h" #include @@ -61,6 +61,15 @@ indx_bdj_playback_type_interactive = 3, } indx_bdj_playback_type; +typedef enum { + indx_access_permitted = 0, /* jump into this title is permitted. title number may be shown on UI. */ + indx_access_prohibited = 1, /* jump into this title is prohibited. title number may be shown on UI. */ + indx_access_hidden = 3, /* jump into this title is prohibited. title number shall not be shown on UI. */ +} indx_access_type; + +#define INDX_ACCESS_PROHIBITED_MASK 0x01 /* if set, jump to this title is not allowed */ +#define INDX_ACCESS_HIDDEN_MASK 0x02 /* if set, title number shall not be displayed on UI */ + typedef struct { unsigned int initial_output_mode_preference : 1; /* 0 - 2D, 1 - 3D */ unsigned int content_exist_flag : 1; @@ -106,7 +115,7 @@ } INDX_ROOT; -BD_PRIVATE INDX_ROOT* indx_parse(const char *path); /* parse index.bdmv */ +BD_PRIVATE INDX_ROOT* indx_parse(const char *disc_root) BD_ATTR_MALLOC; /* parse index.bdmv */ BD_PRIVATE void indx_free(INDX_ROOT **index); #endif // _INDX_PARSE_H_ diff -Nru libbluray-0.5.0/src/libbluray/bdnav/meta_parse.c libbluray-0.6.2/src/libbluray/bdnav/meta_parse.c --- libbluray-0.5.0/src/libbluray/bdnav/meta_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/meta_parse.c 2014-09-01 12:06:01.000000000 +0000 @@ -44,6 +44,7 @@ #endif #define BAD_CAST_CONST (const xmlChar *) +#define XML_FREE(p) (xmlFree(p), p = NULL) #define MAX_META_FILE_SIZE 0xfffff @@ -64,11 +65,11 @@ } if (xmlStrEqual(cur_node->name, BAD_CAST_CONST "numSets")) { disclib->di_num_sets = atoi((char*)(tmp = xmlNodeGetContent(cur_node))); - xmlFree(tmp); + XML_FREE(tmp); } if (xmlStrEqual(cur_node->name, BAD_CAST_CONST "setNumber")) { disclib->di_set_number = atoi((char*)(tmp = xmlNodeGetContent(cur_node))); - xmlFree(tmp); + XML_FREE(tmp); } } else if (xmlStrEqual(cur_node->parent->name, BAD_CAST_CONST "tableOfContents")) { @@ -78,7 +79,7 @@ disclib->toc_entries = realloc(disclib->toc_entries, (disclib->toc_count*sizeof(META_TITLE))); disclib->toc_entries[i].title_number = atoi((const char*)tmp); disclib->toc_entries[i].title_name = (char*)xmlNodeGetContent(cur_node); - X_FREE(tmp); + XML_FREE(tmp); } } else if (xmlStrEqual(cur_node->parent->name, BAD_CAST_CONST "description")) { @@ -92,7 +93,7 @@ sscanf((const char*)tmp, "%ix%i", &x, &y); disclib->thumbnails[i].xres = x; disclib->thumbnails[i].yres = y; - X_FREE(tmp); + XML_FREE(tmp); } else { disclib->thumbnails[i].xres = disclib->thumbnails[i].yres = -1; @@ -120,10 +121,12 @@ for (res = dir_read(dir, &ent); !res; res = dir_read(dir, &ent)) { if (ent.d_name[0] == '.') continue; - else if (ent.d_name != NULL && strncasecmp(ent.d_name, "bdmt_", 5) == 0) { + else if (strncasecmp(ent.d_name, "bdmt_", 5) == 0) { uint8_t i = meta->dl_count; meta->dl_count++; meta->dl_entries = realloc(meta->dl_entries, (meta->dl_count*sizeof(META_DL))); + memset(&meta->dl_entries[i], 0, sizeof(meta->dl_entries[i])); + meta->dl_entries[i].filename = str_dup(ent.d_name); strncpy(meta->dl_entries[i].language_code, ent.d_name+5,3); meta->dl_entries[i].language_code[3] = '\0'; @@ -180,7 +183,7 @@ root->dl_entries[i].toc_entries = NULL; root->dl_entries[i].thumbnails = NULL; _parseManifestNode(root_element, &root->dl_entries[i]); - xmlFreeDoc(doc); + XML_FREE(doc); } } X_FREE(data); @@ -199,6 +202,7 @@ const META_DL *meta_get(const META_ROOT *meta_root, const char *language_code) { +#ifdef HAVE_LIBXML2 unsigned i; if (meta_root == NULL || meta_root->dl_count == 0) { @@ -224,28 +228,33 @@ BD_DEBUG(DBG_DIR, "requested disclib language '%s' or default '"DEFAULT_LANGUAGE"' not found, using '%s' instead\n", language_code, meta_root->dl_entries[0].language_code); return &meta_root->dl_entries[0]; +#else + return NULL; +#endif } void meta_free(META_ROOT **p) { +#ifdef HAVE_LIBXML2 if (p && *p) { uint8_t i; for (i = 0; i < (*p)->dl_count; i++) { uint32_t t; for (t = 0; t < (*p)->dl_entries[i].toc_count; t++) { - X_FREE((*p)->dl_entries[i].toc_entries[t].title_name); + XML_FREE((*p)->dl_entries[i].toc_entries[t].title_name); } for (t = 0; t < (*p)->dl_entries[i].thumb_count; t++) { - X_FREE((*p)->dl_entries[i].thumbnails[t].path); + XML_FREE((*p)->dl_entries[i].thumbnails[t].path); } X_FREE((*p)->dl_entries[i].toc_entries); X_FREE((*p)->dl_entries[i].thumbnails); X_FREE((*p)->dl_entries[i].filename); - X_FREE((*p)->dl_entries[i].di_name); - X_FREE((*p)->dl_entries[i].di_alternative); + XML_FREE((*p)->dl_entries[i].di_name); + XML_FREE((*p)->dl_entries[i].di_alternative); } X_FREE((*p)->dl_entries); X_FREE(*p); } +#endif } diff -Nru libbluray-0.5.0/src/libbluray/bdnav/mpls_parse.c libbluray-0.6.2/src/libbluray/bdnav/mpls_parse.c --- libbluray-0.5.0/src/libbluray/bdnav/mpls_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/mpls_parse.c 2014-09-01 12:06:01.000000000 +0000 @@ -18,11 +18,14 @@ * . */ -#include "util/macro.h" +#include "mpls_parse.h" + +#include "extdata_parse.h" + #include "file/file.h" #include "util/bits.h" -#include "extdata_parse.h" -#include "mpls_parse.h" +#include "util/logging.h" +#include "util/macro.h" #include #include @@ -61,7 +64,7 @@ uo->stop = bb_read(&bb, 1); uo->pause_on = bb_read(&bb, 1); uo->pause_off = bb_read(&bb, 1); - uo->still = bb_read(&bb, 1); + uo->still_off = bb_read(&bb, 1); uo->forward = bb_read(&bb, 1); uo->backward = bb_read(&bb, 1); uo->resume = bb_read(&bb, 1); @@ -100,8 +103,7 @@ static int _parse_appinfo(BITSTREAM *bits, MPLS_AI *ai) { - int len; - off_t pos; + off_t pos, len; if (!bs_is_align(bits, 0x07)) { fprintf(stderr, "_parse_appinfo: alignment error\n"); @@ -109,6 +111,11 @@ pos = bs_pos(bits) >> 3; len = bs_read(bits, 32); + if (bs_avail(bits) < len * 8) { + fprintf(stderr, "_parse_appinfo: unexpected end of file\n"); + return 0; + } + // Reserved bs_skip(bits, 8); ai->playback_type = bs_read(bits, 8); @@ -131,6 +138,11 @@ static int _parse_header(BITSTREAM *bits, MPLS_PL *pl) { + if (bs_avail(bits) < 5 * 32 + 160) { + fprintf(stderr, "_parse_header: unexpected end of file\n"); + return 0; + } + pl->type_indicator = bs_read(bits, 32); pl->type_indicator2 = bs_read(bits, 32); if (pl->type_indicator != MPLS_SIG1 || @@ -641,12 +653,19 @@ static int _parse_playlistmark(BITSTREAM *bits, MPLS_PL *pl) { + off_t len; int ii; MPLS_PLM *plm = NULL; bs_seek_byte(bits, pl->mark_pos); - // Skip the length field, I don't use it - bs_skip(bits, 32); + // length field + len = bs_read(bits, 32); + + if (bs_avail(bits) < len * 8) { + fprintf(stderr, "_parse_playlistmark: unexpected end of file\n"); + return 0; + } + // Then get the number of marks pl->mark_count = bs_read(bits, 16); @@ -666,13 +685,20 @@ static int _parse_playlist(BITSTREAM *bits, MPLS_PL *pl) { + off_t len; int ii; MPLS_PI *pi = NULL; MPLS_SUB *sub_path = NULL; bs_seek_byte(bits, pl->list_pos); - // Skip playlist length - bs_skip(bits, 32); + // playlist length + len = bs_read(bits, 32); + + if (bs_avail(bits) < len * 8) { + fprintf(stderr, "_parse_playlist: unexpected end of file\n"); + return 0; + } + // Skip reserved bytes bs_skip(bits, 16); @@ -868,12 +894,17 @@ } if (id1 == 2) { + if (id2 == 1) { + return 0; + } if (id2 == 2) { // SubPath entries extension return _parse_subpath_extension(bits, pl); } } + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_mpls_extension(): unhandled extension %d.%d\n", id1, id2); + return 0; } diff -Nru libbluray-0.5.0/src/libbluray/bdnav/mpls_parse.h libbluray-0.6.2/src/libbluray/bdnav/mpls_parse.h --- libbluray-0.5.0/src/libbluray/bdnav/mpls_parse.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/mpls_parse.h 2014-09-01 12:06:01.000000000 +0000 @@ -23,7 +23,7 @@ #include "uo_mask_table.h" -#include +#include "util/attributes.h" #include diff -Nru libbluray-0.5.0/src/libbluray/bdnav/navigation.c libbluray-0.6.2/src/libbluray/bdnav/navigation.c --- libbluray-0.5.0/src/libbluray/bdnav/navigation.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/navigation.c 2014-09-01 12:06:01.000000000 +0000 @@ -32,33 +32,90 @@ #include #include -static int _filter_dup(MPLS_PL *pl_list[], unsigned count, MPLS_PL *pl) +static int _stream_cmp(MPLS_STREAM *a, MPLS_STREAM *b) { - unsigned ii, jj; + if (a->stream_type == b->stream_type && + a->coding_type == b->coding_type && + a->pid == b->pid && + a->subpath_id == b->subpath_id && + a->subclip_id == b->subclip_id && + a->format == b->format && + a->rate == b->rate && + a->char_code == b->char_code && + memcmp(a->lang, b->lang, 4) == 0) { + return 0; + } + return 1; +} +static int _streams_cmp(MPLS_STREAM *s1, MPLS_STREAM *s2, unsigned count) +{ + unsigned ii; for (ii = 0; ii < count; ii++) { - if (pl->list_count != pl_list[ii]->list_count) { - continue; - } - if (pl->mark_count != pl_list[ii]->mark_count) { - continue; + if (_stream_cmp(&s1[ii], &s2[ii])) { + return 1; } - for (jj = 0; jj < pl->list_count; jj++) { - MPLS_PI *pi1, *pi2; + } + return 0; +} - pi1 = &pl->play_item[jj]; - pi2 = &pl_list[ii]->play_item[jj]; +static int _pi_cmp(MPLS_PI *pi1, MPLS_PI *pi2) +{ + if (memcmp(pi1->clip[0].clip_id, pi2->clip[0].clip_id, 5) != 0 || + pi1->in_time != pi2->in_time || + pi1->out_time != pi2->out_time) { + return 1; + } + + if (pi1->stn.num_video != pi2->stn.num_video || + pi1->stn.num_audio != pi2->stn.num_audio || + pi1->stn.num_pg != pi2->stn.num_pg || + pi1->stn.num_ig != pi2->stn.num_ig || + pi1->stn.num_secondary_audio != pi2->stn.num_secondary_audio || + pi1->stn.num_secondary_video != pi2->stn.num_secondary_video) { + return 1; + } + + if (_streams_cmp(pi1->stn.video, pi2->stn.video, pi1->stn.num_video) || + _streams_cmp(pi1->stn.audio, pi2->stn.audio, pi1->stn.num_audio) || + _streams_cmp(pi1->stn.pg, pi2->stn.pg, pi1->stn.num_pg) || + _streams_cmp(pi1->stn.ig, pi2->stn.ig, pi1->stn.num_ig) || + _streams_cmp(pi1->stn.secondary_audio, pi2->stn.secondary_audio, pi1->stn.num_secondary_audio) || + _streams_cmp(pi1->stn.secondary_video, pi2->stn.secondary_video, pi1->stn.num_secondary_video)) { + return 1; + } - if (memcmp(pi1->clip[0].clip_id, pi2->clip[0].clip_id, 5) != 0 || - pi1->in_time != pi2->in_time || - pi1->out_time != pi2->out_time) { - break; - } + return 0; +} + +static int _pl_cmp(MPLS_PL *pl1, MPLS_PL *pl2) +{ + unsigned ii; + + if (pl1->list_count != pl2->list_count) { + return 1; + } + if (pl1->mark_count != pl2->mark_count) { + return 1; + } + for (ii = 0; ii < pl1->list_count; ii++) { + if (_pi_cmp(&pl1->play_item[ii], &pl2->play_item[ii])) { + return 1; } - if (jj != pl->list_count) { - continue; + } + + return 0; +} + +/* return 0 if duplicate playlist */ +static int _filter_dup(MPLS_PL *pl_list[], unsigned count, MPLS_PL *pl) +{ + unsigned ii; + + for (ii = 0; ii < count; ii++) { + if (!_pl_cmp(pl, pl_list[ii])) { + return 0; } - return 0; } return 1; } @@ -386,9 +443,9 @@ mpls_clip[clip->angle].stc_id); clip->in_time = in_time; clip->out_time = out_time; - clip->pos = *pos; + clip->title_pkt = *pos; *pos += clip->end_pkt - clip->start_pkt; - clip->start_time = *time; + clip->title_time = *time; *time += clip->out_time - clip->in_time; } @@ -512,16 +569,16 @@ if (chapter > title->chap_list.count) { clip = &title->clip_list.clip[0]; *clip_pkt = clip->start_pkt; - *out_pkt = clip->pos + *clip_pkt - clip->start_pkt; + *out_pkt = clip->title_pkt; return clip; } clip = &title->clip_list.clip[title->chap_list.mark[chapter].clip_ref]; *clip_pkt = title->chap_list.mark[chapter].clip_pkt; - *out_pkt = clip->pos + *clip_pkt - clip->start_pkt; + *out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt; return clip; } -uint32_t nav_chapter_get_current(NAV_CLIP *clip, uint32_t pkt) +uint32_t nav_chapter_get_current(NAV_CLIP *clip, uint32_t clip_pkt) { NAV_MARK * mark; NAV_TITLE *title; @@ -541,12 +598,12 @@ else return 0; } - if (mark->clip_ref == clip->ref && mark->clip_pkt <= pkt) { + if (mark->clip_ref == clip->ref && mark->clip_pkt <= clip_pkt) { if ( ii == title->chap_list.count - 1 ) { return ii; } mark = &title->chap_list.mark[ii+1]; - if (mark->clip_ref != clip->ref || mark->clip_pkt > pkt) { + if (mark->clip_ref != clip->ref || mark->clip_pkt > clip_pkt) { return ii; } } @@ -563,12 +620,12 @@ if (mark > title->mark_list.count) { clip = &title->clip_list.clip[0]; *clip_pkt = clip->start_pkt; - *out_pkt = clip->pos; + *out_pkt = clip->title_pkt; return clip; } clip = &title->clip_list.clip[title->mark_list.mark[mark].clip_ref]; *clip_pkt = title->mark_list.mark[mark].clip_pkt; - *out_pkt = clip->pos + *clip_pkt - clip->start_pkt; + *out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt; return clip; } @@ -582,6 +639,7 @@ NAV_CLIP *clip; unsigned ii; + *out_time = 0; pos = 0; for (ii = 0; ii < title->pl->list_count; ii++) { clip = &title->clip_list.clip[ii]; @@ -598,6 +656,9 @@ clip = &title->clip_list.clip[ii]; if (clip->cl != NULL) { *clip_pkt = clpi_access_point(clip->cl, pkt - pos + clip->start_pkt, 0, 0, out_time); + if (*clip_pkt < clip->start_pkt) { + *clip_pkt = clip->start_pkt; + } } else { *clip_pkt = clip->start_pkt; } @@ -606,7 +667,7 @@ *out_time = 0; else *out_time -= clip->in_time; - *out_pkt = clip->pos + *clip_pkt - clip->start_pkt; + *out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt; return clip; } @@ -673,11 +734,14 @@ if (clip->cl != NULL) { *clip_pkt = clpi_lookup_spn(clip->cl, tick - pos + pi->in_time, 1, title->pl->play_item[clip->ref].clip[clip->angle].stc_id); + if (*clip_pkt < clip->start_pkt) { + *clip_pkt = clip->start_pkt; + } } else { *clip_pkt = clip->start_pkt; } } - *out_pkt = clip->pos + *clip_pkt - clip->start_pkt; + *out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt; return clip; } @@ -695,7 +759,7 @@ *clip_pkt = clip->start_pkt; } } - *out_pkt = clip->pos + *clip_pkt - clip->start_pkt; + *out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt; } /* diff -Nru libbluray-0.5.0/src/libbluray/bdnav/navigation.h libbluray-0.6.2/src/libbluray/bdnav/navigation.h --- libbluray-0.5.0/src/libbluray/bdnav/navigation.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/navigation.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_NAVIGATION_H_) #define _NAVIGATION_H_ -#include +#include "util/attributes.h" #include "mpls_parse.h" #include "clpi_parse.h" @@ -66,13 +66,11 @@ char name[11]; uint32_t clip_id; unsigned ref; - uint32_t pos; uint32_t start_pkt; uint32_t end_pkt; uint8_t connection; uint8_t angle; - uint32_t start_time; uint32_t duration; uint32_t in_time; @@ -146,7 +144,7 @@ BD_PRIVATE NAV_CLIP* nav_time_search(NAV_TITLE *title, uint32_t tick, uint32_t *clip_pkt, uint32_t *out_pkt); BD_PRIVATE void nav_clip_time_search(NAV_CLIP *clip, uint32_t tick, uint32_t *clip_pkt, uint32_t *out_pkt); BD_PRIVATE NAV_CLIP* nav_chapter_search(NAV_TITLE *title, unsigned chapter, uint32_t *clip_pkt, uint32_t *out_pkt); -BD_PRIVATE uint32_t nav_chapter_get_current(NAV_CLIP *clip, uint32_t pkt); +BD_PRIVATE uint32_t nav_chapter_get_current(NAV_CLIP *clip, uint32_t clip_pkt); BD_PRIVATE NAV_CLIP* nav_mark_search(NAV_TITLE *title, unsigned mark, uint32_t *clip_pkt, uint32_t *out_pkt); BD_PRIVATE uint32_t nav_angle_change_search(NAV_CLIP *clip, uint32_t pkt, uint32_t *time); BD_PRIVATE NAV_CLIP* nav_set_angle(NAV_TITLE *title, NAV_CLIP *clip, unsigned angle); diff -Nru libbluray-0.5.0/src/libbluray/bdnav/sound_parse.h libbluray-0.6.2/src/libbluray/bdnav/sound_parse.h --- libbluray-0.5.0/src/libbluray/bdnav/sound_parse.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/sound_parse.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_SOUND_PARSE_H_) #define _SOUND_PARSE_H_ -#include +#include "util/attributes.h" #include diff -Nru libbluray-0.5.0/src/libbluray/bdnav/uo_mask_table.h libbluray-0.6.2/src/libbluray/bdnav/uo_mask_table.h --- libbluray-0.5.0/src/libbluray/bdnav/uo_mask_table.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bdnav/uo_mask_table.h 2014-09-01 12:06:01.000000000 +0000 @@ -34,7 +34,7 @@ unsigned int stop : 1; unsigned int pause_on : 1; unsigned int pause_off : 1; - unsigned int still : 1; + unsigned int still_off : 1; unsigned int forward : 1; unsigned int backward : 1; unsigned int resume : 1; @@ -62,17 +62,25 @@ static inline BD_UO_MASK bd_uo_mask_combine(BD_UO_MASK a, BD_UO_MASK b) { - BD_UO_MASK o; - unsigned int *pa = (unsigned int*)&a; - unsigned int *pb = (unsigned int*)&b; - unsigned int *po = (unsigned int*)&o; - unsigned i; - - for (i = 0; i < sizeof(BD_UO_MASK) / sizeof(unsigned int); i++) { - po[i] = pa[i] | pb[i]; - } + union { + BD_UO_MASK mask; + uint64_t u64; + } mask_a, mask_b, result; - return o; + mask_a.mask = a; + mask_b.mask = b; + result.u64 = mask_a.u64 | mask_b.u64; + + return result.mask; +} + +#define EMPTY_UO_MASK {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0} + +static inline BD_UO_MASK bd_empty_uo_mask(void) +{ + const BD_UO_MASK empty = EMPTY_UO_MASK; + return empty; } + #endif // _BD_UO_MASK_TABLE_H_ diff -Nru libbluray-0.5.0/src/libbluray/bluray.c libbluray-0.6.2/src/libbluray/bluray.c --- libbluray-0.5.0/src/libbluray/bluray.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bluray.c 2014-09-01 12:06:01.000000000 +0000 @@ -27,6 +27,7 @@ #include "bluray.h" #include "bluray_internal.h" #include "register.h" +#include "util/array.h" #include "util/macro.h" #include "util/logging.h" #include "util/strutl.h" @@ -116,7 +117,7 @@ /* current disc */ char *device_path; BLURAY_DISC_INFO disc_info; - INDX_ROOT *index; + BLURAY_TITLE **titles; /* titles from disc index */ META_ROOT *meta; NAV_TITLE_LIST *title_list; @@ -279,7 +280,6 @@ MPLS_STREAM *streams, unsigned num_streams, uint32_t *lang, uint32_t blacklist) { - uint32_t psr_val; uint32_t preferred_lang; int stream_idx = -1; unsigned ii; @@ -321,13 +321,9 @@ BD_DEBUG(DBG_BLURAY, "Selected stream %d (language %s)\n", stream_idx, streams[stream_idx].lang); - bd_psr_lock(regs); - - psr_val = bd_psr_read(regs, psr_stream) & 0x7fff0000; - psr_val |= (stream_idx + 1) | enable_flag; - bd_psr_write(regs, psr_stream, psr_val); - - bd_psr_unlock(regs); + bd_psr_write_bits(regs, psr_stream, + (stream_idx + 1) | enable_flag, + 0x80000fff); } static void _update_clip_psrs(BLURAY *bd, NAV_CLIP *clip) @@ -357,11 +353,12 @@ NULL, audio_lang); } - /* Validate selected audio and subtitle stream PSRs when using menus */ + /* Validate selected audio, subtitle and IG stream PSRs when using menus */ } else { uint32_t psr_val; if (stn->num_audio) { + bd_psr_lock(bd->regs); psr_val = bd_psr_read(bd->regs, PSR_PRIMARY_AUDIO_ID); if (psr_val == 0 || psr_val > stn->num_audio) { _update_stream_psr_by_lang(bd->regs, @@ -371,8 +368,10 @@ } else { audio_lang = str_to_uint32((const char *)stn->audio[psr_val - 1].lang, 3); } + bd_psr_unlock(bd->regs); } if (stn->num_pg) { + bd_psr_lock(bd->regs); psr_val = bd_psr_read(bd->regs, PSR_PG_STREAM) & 0xfff; if ((psr_val == 0) || (psr_val > stn->num_pg)) { _update_stream_psr_by_lang(bd->regs, @@ -380,14 +379,40 @@ stn->pg, stn->num_pg, NULL, audio_lang); } + bd_psr_unlock(bd->regs); + } + if (stn->num_ig) { + bd_psr_lock(bd->regs); + psr_val = bd_psr_read(bd->regs, PSR_IG_STREAM_ID); + if ((psr_val == 0) || (psr_val > stn->num_ig)) { + bd_psr_write(bd->regs, PSR_IG_STREAM_ID, 1); + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Selected IG stream 1 (stream %d not available)\n", psr_val); + } + bd_psr_unlock(bd->regs); + } + } +} + +static int _is_interactive_title(BLURAY *bd) +{ + if (bd->title && bd->title_type != title_undef) { + unsigned title = bd_psr_read(bd->regs, PSR_TITLE_NUMBER); + if (title == 0xffff && bd->disc_info.first_play->interactive) { + return 1; + } + if (title <= bd->disc_info.num_titles && bd->titles[title]) { + return bd->titles[title]->interactive; } } + return 0; } static void _update_chapter_psr(BLURAY *bd) { - uint32_t current_chapter = bd_get_current_chapter(bd); - bd_psr_write(bd->regs, PSR_CHAPTER, current_chapter + 1); + if (!_is_interactive_title(bd)) { + uint32_t current_chapter = bd_get_current_chapter(bd); + bd_psr_write(bd->regs, PSR_CHAPTER, current_chapter + 1); + } } /* @@ -396,7 +421,8 @@ static int _find_pg_stream(BLURAY *bd, uint16_t *pid, int *sub_path_idx, unsigned *sub_clip_idx, uint8_t *char_code) { - MPLS_PI *pi = &bd->title->pl->play_item[0]; + unsigned main_clip_idx = bd->st0.clip ? bd->st0.clip->ref : 0; + MPLS_PI *pi = &bd->title->pl->play_item[main_clip_idx]; unsigned pg_stream = bd_psr_read(bd->regs, PSR_PG_STREAM); #if 0 @@ -464,7 +490,7 @@ { if (bd->st_textst.clip) { if (bd->st0.clip_block_pos >= bd->gc_wakeup_pos) { - GC_NAV_CMDS cmds = {-1, NULL, -1, 0, 0}; + GC_NAV_CMDS cmds = {-1, NULL, -1, 0, 0, EMPTY_UO_MASK}; gc_run(bd->graphics_controller, GC_CTRL_PG_UPDATE, bd->gc_wakeup_time, &cmds); @@ -478,7 +504,7 @@ uint32_t spn = clpi_lookup_spn(clip->cl, cmds.wakeup_time, /*before=*/1, bd->title->pl->play_item[clip->ref].clip[clip->angle].stc_id); if (spn) { - bd->gc_wakeup_pos = spn * 192; + bd->gc_wakeup_pos = (uint64_t)spn * 192L; } } } @@ -554,7 +580,8 @@ st->m2ts_filter = m2ts_filter_init((int64_t)st->clip->in_time << 1, (int64_t)st->clip->out_time << 1, - stn->num_video, stn->num_audio); + stn->num_video, stn->num_audio, + stn->num_ig, stn->num_pg); _update_clip_psrs(bd, st->clip); @@ -760,8 +787,12 @@ { int result = -1; - if (bd && bd->graphics_controller && bd->hdmv_vm) { - GC_NAV_CMDS cmds = {-1, NULL, -1, 0, 0}; + if (!bd) { + return -1; + } + + if (bd->graphics_controller && bd->hdmv_vm) { + GC_NAV_CMDS cmds = {-1, NULL, -1, 0, 0, EMPTY_UO_MASK}; result = gc_run(bd->graphics_controller, msg, param, &cmds); @@ -895,23 +926,6 @@ } /* - * index open - */ - -static int _index_open(BLURAY *bd) -{ - if (!bd->index) { - char *file; - - file = str_printf("%s/BDMV/index.bdmv", bd->device_path); - bd->index = indx_parse(file); - X_FREE(file); - } - - return !!bd->index; -} - -/* * meta open */ @@ -947,33 +961,82 @@ bd->disc_info.libjvm_detected = 0; bd->disc_info.bdj_handled = 0; - if (bd->index) { + bd->disc_info.num_titles = 0; + bd->disc_info.titles = NULL; + bd->disc_info.top_menu = NULL; + bd->disc_info.first_play = NULL; + + array_free((void**)&bd->titles); + + INDX_ROOT *index = indx_parse(bd->device_path); + if (index) { INDX_PLAY_ITEM *pi; unsigned ii; bd->disc_info.bluray_detected = 1; - /* count titles */ + /* application info */ + bd->disc_info.video_format = index->app_info.video_format; + bd->disc_info.frame_rate = index->app_info.frame_rate; + bd->disc_info.content_exist_3D = index->app_info.content_exist_flag; + bd->disc_info.initial_output_mode_preference = index->app_info.initial_output_mode_preference; + memcpy(bd->disc_info.provider_data, index->app_info.user_data, sizeof(bd->disc_info.provider_data)); + + /* allocate array for title info */ + BLURAY_TITLE **titles = (BLURAY_TITLE**)array_alloc(index->num_titles + 2, sizeof(BLURAY_TITLE)); + if (!titles) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Can't allocate memory\n"); + return; + } + bd->titles = titles; + bd->disc_info.titles = (const BLURAY_TITLE * const *)titles; + bd->disc_info.num_titles = index->num_titles; + + /* count titles and fill title info */ - for (ii = 0; ii < bd->index->num_titles; ii++) { - if (bd->index->titles[ii].object_type == indx_object_type_hdmv) { + for (ii = 0; ii < index->num_titles; ii++) { + if (index->titles[ii].object_type == indx_object_type_hdmv) { bd->disc_info.num_hdmv_titles++; + titles[ii + 1]->interactive = (index->titles[ii].hdmv.playback_type == indx_hdmv_playback_type_interactive); + titles[ii + 1]->id_ref = index->titles[ii].hdmv.id_ref; } - if (bd->index->titles[ii].object_type == indx_object_type_bdj) { + if (index->titles[ii].object_type == indx_object_type_bdj) { bd->disc_info.num_bdj_titles++; - bd->disc_info.num_unsupported_titles++; bd->disc_info.bdj_detected = 1; + titles[ii + 1]->bdj = 1; + titles[ii + 1]->interactive = (index->titles[ii].bdj.playback_type == indx_bdj_playback_type_interactive); + titles[ii + 1]->id_ref = atoi(index->titles[ii].bdj.name); } + + titles[ii + 1]->accessible = !(index->titles[ii].access_type & INDX_ACCESS_PROHIBITED_MASK); + titles[ii + 1]->hidden = !!(index->titles[ii].access_type & INDX_ACCESS_HIDDEN_MASK); } - if (bd->index->first_play.object_type == indx_object_type_bdj) { + pi = &index->first_play; + if (pi->object_type == indx_object_type_bdj) { bd->disc_info.bdj_detected = 1; + titles[index->num_titles + 1]->bdj = 1; + titles[index->num_titles + 1]->interactive = (pi->bdj.playback_type == indx_bdj_playback_type_interactive); + titles[index->num_titles + 1]->id_ref = atoi(pi->bdj.name); + } + if (pi->object_type == indx_object_type_hdmv && pi->hdmv.id_ref != 0xffff) { + titles[index->num_titles + 1]->interactive = (pi->hdmv.playback_type == indx_hdmv_playback_type_interactive); + titles[index->num_titles + 1]->id_ref = pi->hdmv.id_ref; } - if (bd->index->top_menu.object_type == indx_object_type_bdj) { + + pi = &index->top_menu; + if (pi->object_type == indx_object_type_bdj) { bd->disc_info.bdj_detected = 1; + titles[0]->bdj = 1; + titles[0]->interactive = (pi->bdj.playback_type == indx_bdj_playback_type_interactive); + titles[0]->id_ref = atoi(pi->bdj.name); + } + if (pi->object_type == indx_object_type_hdmv && pi->hdmv.id_ref != 0xffff) { + titles[0]->interactive = (pi->hdmv.playback_type == indx_hdmv_playback_type_interactive); + titles[0]->id_ref = pi->hdmv.id_ref; } - /* BD-J capability */ + /* check for BD-J capability */ #ifdef USING_BDJAVA if (bd->disc_info.bdj_detected) { @@ -987,15 +1050,43 @@ } #endif /* USING_BDJAVA */ - pi = &bd->index->first_play; + /* mark supported titles */ + + if (bd->disc_info.bdj_detected && !bd->disc_info.bdj_handled) { + bd->disc_info.num_unsupported_titles = bd->disc_info.num_bdj_titles; + } + + pi = &index->first_play; if (pi->object_type == indx_object_type_hdmv && pi->hdmv.id_ref != 0xffff) { bd->disc_info.first_play_supported = 1; } + if (pi->object_type == indx_object_type_bdj) { + bd->disc_info.first_play_supported = bd->disc_info.bdj_handled; + } - pi = &bd->index->top_menu; + pi = &index->top_menu; if (pi->object_type == indx_object_type_hdmv && pi->hdmv.id_ref != 0xffff) { bd->disc_info.top_menu_supported = 1; } + if (pi->object_type == indx_object_type_bdj) { + bd->disc_info.top_menu_supported = bd->disc_info.bdj_handled; + } + + /* */ + + if (bd->disc_info.first_play_supported) { + titles[index->num_titles + 1]->accessible = 1; + bd->disc_info.first_play = titles[index->num_titles + 1]; + } + if (bd->disc_info.top_menu_supported) { + titles[0]->accessible = 1; + bd->disc_info.top_menu = titles[0]; + } + + /* populate title names */ + bd_get_meta(bd); + + indx_free(&index); } } @@ -1018,6 +1109,20 @@ return mask.u64; } + +void bd_select_rate(BLURAY *bd, float rate, int reason) +{ + if (reason == 2) { + /* playback stop. Might want to wait for buffers empty here. */ + return; + } + if (rate < 0.5) { + _queue_event(bd, BD_EVENT_STILL, 1); + } else { + _queue_event(bd, BD_EVENT_STILL, 0); + } +} + #endif #ifdef USING_BDJAVA @@ -1032,14 +1137,14 @@ #endif #ifdef USING_BDJAVA -int bd_reg_write(BLURAY *bd, int psr, int reg, uint32_t value) +int bd_reg_write(BLURAY *bd, int psr, int reg, uint32_t value, uint32_t psr_value_mask) { if (psr) { if (psr < 102) { /* avoid deadlocks (psr_write triggers callbacks that may lock this mutex) */ bd_mutex_lock(&bd->mutex); } - int res = bd_psr_write(bd->regs, reg, value); + int res = bd_psr_write_bits(bd->regs, reg, value, psr_value_mask); if (psr < 102) { bd_mutex_unlock(&bd->mutex); } @@ -1131,12 +1236,12 @@ { #ifdef USING_BDJAVA if (bd->bdjava == NULL) { - bd->bdjava = bdj_open(bd->device_path, bd, bd->index, _bdj_osd_cb, bd->argb_buffer); + bd->bdjava = bdj_open(bd->device_path, bd, _bdj_osd_cb, bd->argb_buffer); if (!bd->bdjava) { return 0; } } - return bdj_start(bd->bdjava, title); + return !bdj_process_event(bd->bdjava, BDJ_EVENT_START, title); #else BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Title %d: BD-J not compiled in\n", title); return 0; @@ -1159,7 +1264,7 @@ static void _stop_bdj(BLURAY *bd) { if (bd->bdjava != NULL) { - bdj_stop(bd->bdjava); + bdj_process_event(bd->bdjava, BDJ_EVENT_STOP, 0); } } #else @@ -1263,6 +1368,13 @@ return NULL; } + bd->regs = bd_registers_init(); + if (!bd->regs) { + BD_DEBUG(DBG_BLURAY, "bd_registers_init() failed\n"); + X_FREE(bd); + return NULL; + } + bd->device_path = str_dup(device_path); #if (defined HAVE_MNTENT_H || defined __APPLE__) @@ -1271,12 +1383,8 @@ _libaacs_init(bd, keyfile_path); - bd->regs = bd_registers_init(); - _libbdplus_init(bd); - _index_open(bd); - _fill_disc_info(bd); bd_mutex_init(&bd->mutex); @@ -1308,13 +1416,13 @@ hdmv_vm_free(&bd->hdmv_vm); gc_free(&bd->graphics_controller); - indx_free(&bd->index); meta_free(&bd->meta); sound_free(&bd->sound_effects); bd_registers_free(bd->regs); _free_event_queue(bd); X_FREE(bd->device_path); + array_free((void**)&bd->titles); bd_mutex_destroy(&bd->mutex); @@ -1426,6 +1534,9 @@ clip = nav_time_search(bd->title, tick, &clip_pkt, &out_pkt); _seek_internal(bd, clip, out_pkt, clip_pkt); + + } else { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_seek_time(%u) failed\n", (unsigned int)tick); } bd_mutex_unlock(&bd->mutex); @@ -1438,12 +1549,16 @@ uint32_t clip_pkt = 0, out_pkt = 0, out_time = 0; NAV_CLIP *clip; + if (!bd) { + return 0; + } + bd_mutex_lock(&bd->mutex); - if (bd && bd->title) { + if (bd->title) { clip = nav_packet_search(bd->title, SPN(bd->s_pos), &clip_pkt, &out_pkt, &out_time); if (clip) { - out_time += clip->start_time; + out_time += clip->title_time; } } @@ -1468,6 +1583,9 @@ clip = nav_chapter_search(bd->title, chapter, &clip_pkt, &out_pkt); _seek_internal(bd, clip, out_pkt, clip_pkt); + + } else { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_seek_chapter(%u) failed\n", chapter); } bd_mutex_unlock(&bd->mutex); @@ -1524,9 +1642,12 @@ clip = &bd->title->clip_list.clip[clip_ref]; clip_pkt = clip->start_pkt; - out_pkt = clip->pos; + out_pkt = clip->title_pkt; _seek_internal(bd, clip, out_pkt, clip_pkt); + + } else { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_seek_playitem(%u) failed\n", clip_ref); } bd_mutex_unlock(&bd->mutex); @@ -1550,6 +1671,9 @@ clip = nav_mark_search(bd->title, mark, &clip_pkt, &out_pkt); _seek_internal(bd, clip, out_pkt, clip_pkt); + + } else { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_seek_mark(%u) failed\n", mark); } bd_mutex_unlock(&bd->mutex); @@ -1586,9 +1710,13 @@ { uint64_t ret = 0; + if (!bd) { + return 0; + } + bd_mutex_lock(&bd->mutex); - if (bd && bd->title) { + if (bd->title) { ret = (uint64_t)bd->title->packets * 192; } @@ -1601,11 +1729,13 @@ { uint64_t ret = 0; + if (!bd) { + return 0; + } + bd_mutex_lock(&bd->mutex); - if (bd) { - ret = bd->s_pos; - } + ret = bd->s_pos; bd_mutex_unlock(&bd->mutex); @@ -1653,7 +1783,7 @@ if (!_open_m2ts(bd, st)) { return -1; } - bd->s_pos = st->clip->pos; + bd->s_pos = (uint64_t)st->clip->title_pkt * 192L; } else { _change_angle(bd); _clip_seek_time(bd, bd->angle_change_time); @@ -1662,7 +1792,7 @@ } else { uint64_t angle_pos; - angle_pos = bd->angle_change_pkt * 192; + angle_pos = (uint64_t)bd->angle_change_pkt * 192L; if (angle_pos - st->clip_pos < size) { size = angle_pos - st->clip_pos; @@ -1884,7 +2014,8 @@ static int _find_ig_stream(BLURAY *bd, uint16_t *pid, int *sub_path_idx, unsigned *sub_clip_idx) { - MPLS_PI *pi = &bd->title->pl->play_item[0]; + unsigned main_clip_idx = bd->st0.clip ? bd->st0.clip->ref : 0; + MPLS_PI *pi = &bd->title->pl->play_item[main_clip_idx]; unsigned ig_stream = bd_psr_read(bd->regs, PSR_IG_STREAM_ID); if (ig_stream > 0 && ig_stream <= pi->stn.num_ig) { @@ -2020,7 +2151,12 @@ bd_psr_write(bd->regs, PSR_PLAYLIST, atoi(bd->title->name)); bd_psr_write(bd->regs, PSR_ANGLE_NUMBER, bd->title->angle + 1); - bd_psr_write(bd->regs, PSR_CHAPTER, 1); + + if (_is_interactive_title(bd)) { + bd_psr_write(bd->regs, PSR_CHAPTER, 0xffff); + } else { + bd_psr_write(bd->regs, PSR_CHAPTER, 1); + } // Get the initial clip of the playlist bd->st0.clip = nav_next_clip(bd->title, NULL); @@ -2062,6 +2198,44 @@ return result; } +#ifdef USING_BDJAVA +static int _play_playlist_at(BLURAY *bd, int playlist, int playitem, int playmark, int64_t time) +{ + if (playlist < 0) { + _close_playlist(bd); + return 1; + } + + if (!bd_select_playlist(bd, playlist)) { + return 0; + } + + if (playitem > 0) { + bd_seek_playitem(bd, playitem); + } + if (playmark >= 0) { + bd_seek_mark(bd, playmark); + } + if (time >= 0) { + bd_seek_time(bd, time); + } + + return 1; +} + +int bd_play_playlist_at(BLURAY *bd, int playlist, int playitem, int playmark, int64_t time) +{ + int result; + + /* select + seek should be atomic (= player can't read data between select and seek to start position) */ + bd_mutex_lock(&bd->mutex); + result = _play_playlist_at(bd, playlist, playitem, playmark, time); + bd_mutex_unlock(&bd->mutex); + + return result; +} +#endif /* USING_BDJAVA */ + // Select a title for playback // The title index is an index into the list // established by bd_get_titles() @@ -2185,7 +2359,7 @@ /* start BD+. No real title info will be passed to BD+ VM ... */ if (bd->libbdplus) { - libbdplus_event(bd->libbdplus, 0xffffffff, bd->index->num_titles, 0); + libbdplus_event(bd->libbdplus, 0xffffffff, bd->disc_info.num_titles, 0); } return bd->title_list->count; @@ -2247,11 +2421,11 @@ title_info->marks = calloc(title_info->mark_count, sizeof(BLURAY_TITLE_MARK)); for (ii = 0; ii < title_info->mark_count; ii++) { title_info->marks[ii].idx = ii; - title_info->marks[ii].type = title->mark_list.mark[ii].mark_type; + title_info->marks[ii].type = title->mark_list.mark[ii].mark_type; title_info->marks[ii].start = (uint64_t)title->mark_list.mark[ii].title_time * 2; title_info->marks[ii].duration = (uint64_t)title->mark_list.mark[ii].duration * 2; title_info->marks[ii].offset = (uint64_t)title->mark_list.mark[ii].title_pkt * 192L; - title_info->marks[ii].clip_ref = title->mark_list.mark[ii].clip_ref; + title_info->marks[ii].clip_ref = title->mark_list.mark[ii].clip_ref; } title_info->clip_count = title->clip_list.count; title_info->clips = calloc(title_info->clip_count, sizeof(BLURAY_CLIP_INFO)); @@ -2261,7 +2435,7 @@ NAV_CLIP *nc = &title->clip_list.clip[ii]; ci->pkt_count = nc->end_pkt - nc->start_pkt; - ci->start_time = (uint64_t)nc->start_time * 2; + ci->start_time = (uint64_t)nc->title_time * 2; ci->in_time = (uint64_t)pi->in_time * 2; ci->out_time = (uint64_t)pi->out_time * 2; ci->still_mode = pi->still_mode; @@ -2381,12 +2555,11 @@ if (idx == BLURAY_PLAYER_SETTING_DECODE_PG) { bd_mutex_lock(&bd->mutex); - bd->decode_pg = !!value; - bd_psr_lock(bd->regs); - value = (bd_psr_read(bd->regs, PSR_PG_STREAM) & (0x7fffffff)) | ((!!value)<<31); - result = !bd_psr_setting_write(bd->regs, PSR_PG_STREAM, value); - bd_psr_unlock(bd->regs); + bd->decode_pg = !!value; + result = bd_psr_write_bits(bd->regs, PSR_PG_STREAM, + (!!value) << 31, + 0x80000000); bd_mutex_unlock(&bd->mutex); return result; @@ -2422,15 +2595,13 @@ void bd_select_stream(BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag) { - uint32_t val; - bd_mutex_lock(&bd->mutex); - bd_psr_lock(bd->regs); switch (stream_type) { case BLURAY_PG_TEXTST_STREAM: - val = bd_psr_read(bd->regs, PSR_PG_STREAM); - bd_psr_write(bd->regs, PSR_PG_STREAM, ((!!enable_flag)<<31) | (stream_id & 0xfff) | (val & 0x7ffff000)); + bd_psr_write_bits(bd->regs, PSR_PG_STREAM, + ((!!enable_flag)<<31) | (stream_id & 0xfff), + 0x80000fff); break; /* case BLURAY_SECONDARY_VIDEO_STREAM: @@ -2438,7 +2609,6 @@ */ } - bd_psr_unlock(bd->regs); bd_mutex_unlock(&bd->mutex); } @@ -2448,31 +2618,29 @@ int bd_start_bdj(BLURAY *bd, const char *start_object) { + const BLURAY_TITLE *t; + int title_num = atoi(start_object); unsigned ii; - if (!bd || !bd->index) { + if (!bd) { return 0; } /* first play object ? */ - if (bd->index->first_play.object_type == indx_object_type_bdj && - !strcmp(start_object, bd->index->first_play.bdj.name)) { - return _start_bdj(bd, BLURAY_TITLE_FIRST_PLAY); - } - - /* top menu ? */ - if (bd->index->first_play.object_type == indx_object_type_bdj && - !strcmp(start_object, bd->index->top_menu.bdj.name)) { - return _start_bdj(bd, BLURAY_TITLE_TOP_MENU); + if (bd->disc_info.first_play_supported) { + t = bd->disc_info.first_play; + if (t && t->bdj && t->id_ref == title_num) { + return _start_bdj(bd, BLURAY_TITLE_FIRST_PLAY); + } } /* valid BD-J title from disc index ? */ - for (ii = 0; ii < bd->index->num_titles; ii++) { - INDX_TITLE *t = &bd->index->titles[ii]; - - if (t->object_type == indx_object_type_bdj && - !strcmp(start_object, t->bdj.name)) { - return _start_bdj(bd, ii + 1); + if (bd->disc_info.titles) { + for (ii = 0; ii <= bd->disc_info.num_titles; ii++) { + t = bd->disc_info.titles[ii]; + if (t && t->bdj && t->id_ref == title_num) { + return _start_bdj(bd, ii); + } } } @@ -2557,6 +2725,7 @@ libbdplus_event(bd->libbdplus, 0x110, ev->new_val, 0); break; case PSR_PLAYLIST: + _bdj_event (bd, BDJ_EVENT_PLAYLIST,ev->new_val); _queue_event(bd, BD_EVENT_PLAYLIST, ev->new_val); break; case PSR_PLAYITEM: @@ -2608,11 +2777,13 @@ } bd_mutex_lock(&bd->mutex); + if (bd->st0.clip) { _init_pg_stream(bd); if (bd->st_textst.clip) { BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Changing TextST stream\n"); _preload_textst_subpath(bd); } + } bd_mutex_unlock(&bd->mutex); break; @@ -2690,17 +2861,13 @@ static int _play_bdj(BLURAY *bd, unsigned title) { - if (!bd->disc_info.bdj_handled) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Can't play BD-J title %d\n", title); - return 0; - } - int result; bd->title_type = title_bdj; result = _start_bdj(bd, title); if (result <= 0) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Can't play BD-J title %d\n", title); bd->title_type = title_undef; _queue_event(bd, BD_EVENT_ERROR, BD_ERROR_BDJ); } @@ -2717,7 +2884,8 @@ bd->title_type = title_hdmv; if (!bd->hdmv_vm) { - bd->hdmv_vm = hdmv_vm_init(bd->device_path, bd->regs, bd->index); + bd->hdmv_vm = hdmv_vm_init(bd->device_path, bd->regs, bd->disc_info.num_titles, + bd->disc_info.first_play_supported, bd->disc_info.top_menu_supported); } if (hdmv_vm_select_object(bd->hdmv_vm, id_ref)) { @@ -2738,24 +2906,20 @@ { /* first play object ? */ if (title == BLURAY_TITLE_FIRST_PLAY) { - INDX_PLAY_ITEM *p = &bd->index->first_play; bd_psr_write(bd->regs, PSR_TITLE_NUMBER, 0xffff); /* 5.2.3.3 */ - if (p->object_type == indx_object_type_hdmv) { - if (p->hdmv.id_ref == 0xffff) { - /* no first play title (5.2.3.3) */ - bd->title_type = title_hdmv; - return 1; - } - return _play_hdmv(bd, p->hdmv.id_ref); + if (!bd->disc_info.first_play_supported) { + /* no first play title (5.2.3.3) */ + bd->title_type = title_hdmv; + return 1; } - if (p->object_type == indx_object_type_bdj) { + if (bd->disc_info.first_play->bdj) { return _play_bdj(bd, title); + } else { + return _play_hdmv(bd, bd->disc_info.first_play->id_ref); } - - return 0; } /* bd_play not called ? */ @@ -2766,36 +2930,32 @@ /* top menu ? */ if (title == BLURAY_TITLE_TOP_MENU) { - INDX_PLAY_ITEM *p = &bd->index->top_menu; bd_psr_write(bd->regs, PSR_TITLE_NUMBER, 0); /* 5.2.3.3 */ - if (p->object_type == indx_object_type_hdmv) { - if (p->hdmv.id_ref == 0xffff) { - /* no top menu (5.2.3.3) */ - bd->title_type = title_hdmv; - return 0; - } - return _play_hdmv(bd, p->hdmv.id_ref); + if (!bd->disc_info.top_menu_supported) { + /* no top menu (5.2.3.3) */ + bd->title_type = title_hdmv; + return 0; } - if (p->object_type == indx_object_type_bdj) { + if (bd->disc_info.top_menu->bdj) { return _play_bdj(bd, title); + } else { + return _play_hdmv(bd, bd->disc_info.top_menu->id_ref); } return 0; } /* valid title from disc index ? */ - if (title > 0 && title <= bd->index->num_titles) { - INDX_TITLE *t = &bd->index->titles[title-1]; + if (title > 0 && title <= bd->disc_info.num_titles) { bd_psr_write(bd->regs, PSR_TITLE_NUMBER, title); /* 5.2.3.3 */ - - if (t->object_type == indx_object_type_hdmv) { - return _play_hdmv(bd, t->hdmv.id_ref); - } else { + if (bd->disc_info.titles[title]->bdj) { return _play_bdj(bd, title); + } else { + return _play_hdmv(bd, bd->disc_info.titles[title]->id_ref); } } @@ -3053,7 +3213,7 @@ } if (bd->bdj_end_of_playlist == 1) { - _bdj_event(bd, BDJ_EVENT_END_OF_PLAYLIST, 0); + _bdj_event(bd, BDJ_EVENT_END_OF_PLAYLIST, bd_psr_read(bd->regs, PSR_PLAYLIST)); bd->bdj_end_of_playlist |= 2; } @@ -3236,6 +3396,8 @@ const struct meta_dl *bd_get_meta(BLURAY *bd) { + const struct meta_dl *meta = NULL; + if (!bd) { return NULL; } @@ -3248,11 +3410,22 @@ if (psr_menu_lang != 0 && psr_menu_lang != 0xffffff) { const char language_code[] = {(psr_menu_lang >> 16) & 0xff, (psr_menu_lang >> 8) & 0xff, psr_menu_lang & 0xff, 0 }; - return meta_get(bd->meta, language_code); + meta = meta_get(bd->meta, language_code); + } else { + meta = meta_get(bd->meta, NULL); } - else { - return meta_get(bd->meta, NULL); + + /* assign title names to disc_info */ + if (meta) { + unsigned ii; + for (ii = 0; ii < meta->toc_count; ii++) { + if (meta->toc_entries[ii].title_number > 0 && meta->toc_entries[ii].title_number <= bd->disc_info.num_titles) { + bd->titles[meta->toc_entries[ii].title_number]->name = meta->toc_entries[ii].title_name; + } + } } + + return meta; } struct clpi_cl *bd_get_clpi(BLURAY *bd, unsigned clip_ref) @@ -3273,3 +3446,13 @@ { clpi_free(cl); } + +struct mpls_pl *bd_read_mpls(const char *mpls_file) +{ + return mpls_parse(mpls_file); +} + +void bd_free_mpls(struct mpls_pl *pl) +{ + mpls_free(pl); +} diff -Nru libbluray-0.5.0/src/libbluray/bluray.h libbluray-0.6.2/src/libbluray/bluray.h --- libbluray-0.5.0/src/libbluray/bluray.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bluray.h 2014-09-01 12:06:01.000000000 +0000 @@ -2,7 +2,7 @@ * This file is part of libbluray * Copyright (C) 2009-2010 Obliter0n * Copyright (C) 2009-2010 John Stebbins - * Copyright (C) 2010 hpi1 + * Copyright (C) 2010-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -470,6 +470,17 @@ #define BD_AACS_CERT_REVOKED -5 #define BD_AACS_MMC_FAILED -6 +/* HDMV / BD-J title */ +typedef struct { + const char *name; /* optional title name in preferred language */ + uint8_t interactive; /* 1 if title is interactive (title length and playback position should not be shown in UI) */ + uint8_t accessible; /* 1 if it is allowed to jump into this title */ + uint8_t hidden; /* 1 if title number should not be shown during playback */ + + uint8_t bdj; /* 0 - HDMV title. 1 - BD-J title */ + uint16_t id_ref; /* Movie Object number / bdjo file number */ +} BLURAY_TITLE; + typedef struct { uint8_t bluray_detected; @@ -505,6 +516,20 @@ uint8_t bdplus_gen; /* BD+ content code relese date */ uint32_t bdplus_date; /* (year << 16) | (month << 8) | day */ + + /* disc application info */ + uint8_t video_format; /* bd_video_format_e */ + uint8_t frame_rate; /* bd_frame_rate_e */ + uint8_t content_exist_3D; + uint8_t initial_output_mode_preference; /* 0 - 2D, 1 - 3D */ + uint8_t provider_data[32]; + + /* HDMV / BD-J titles */ + uint32_t num_titles; + const BLURAY_TITLE * const *titles; /* index is title number 1 ... N */ + const BLURAY_TITLE *first_play; /* titles[0]. NULL if not present on the disc. */ + const BLURAY_TITLE *top_menu; /* titles[N+1]. NULL if not present on the disc. */ + } BLURAY_DISC_INFO; /** @@ -551,11 +576,6 @@ int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value); int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *s); -/* - * Java - */ -int bd_start_bdj(BLURAY *bd, const char* start_object); // start BD-J from the specified BD-J object (should be a 5 character string) -void bd_stop_bdj(BLURAY *bd); // shutdown BD-J and clean up resources /* * events @@ -831,6 +851,12 @@ const struct meta_dl *bd_get_meta(BLURAY *bd); +/* + * Testing and debugging + */ + +/* access to internal information */ + struct clpi_cl; /** * @@ -851,6 +877,18 @@ */ void bd_free_clpi(struct clpi_cl *cl); + +struct mpls_pl; +struct mpls_pl *bd_read_mpls(const char *mpls_file); +void bd_free_mpls(struct mpls_pl *); + + +/* BD-J testing */ + +int bd_start_bdj(BLURAY *bd, const char* start_object); // start BD-J from the specified BD-J object (should be a 5 character string) +void bd_stop_bdj(BLURAY *bd); // shutdown BD-J and clean up resources + + #ifdef __cplusplus }; #endif diff -Nru libbluray-0.5.0/src/libbluray/bluray_internal.h libbluray-0.6.2/src/libbluray/bluray_internal.h --- libbluray-0.5.0/src/libbluray/bluray_internal.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bluray_internal.h 2014-09-01 12:06:01.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2012 libbluray + * Copyright (C) 2012-2014 libbluray * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,7 +20,7 @@ #if !defined(_BLURAY_INTERNAL_H_) #define _BLURAY_INTERNAL_H_ -#include +#include "util/attributes.h" #include "bluray.h" @@ -32,6 +32,10 @@ BD_PRIVATE int bd_play_title_internal(BLURAY *bd, unsigned title); BD_PRIVATE uint32_t bd_reg_read(BLURAY *bd, int psr, int reg); -BD_PRIVATE int bd_reg_write(BLURAY *bd, int psr, int reg, uint32_t value); +BD_PRIVATE int bd_reg_write(BLURAY *bd, int psr, int reg, uint32_t value, uint32_t psr_value_mask); + +BD_PRIVATE void bd_select_rate(BLURAY *bd, float rate, int reason); + +BD_PRIVATE int bd_play_playlist_at(BLURAY *bd, int playlist, int playitem, int playmark, int64_t time); #endif /* _BLURAY_INTERNAL_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/bluray-version.h libbluray-0.6.2/src/libbluray/bluray-version.h --- libbluray-0.5.0/src/libbluray/bluray-version.h 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/bluray-version.h 2014-09-03 10:24:54.000000000 +0000 @@ -26,10 +26,10 @@ ((micro) * 1)) #define BLURAY_VERSION_MAJOR 0 -#define BLURAY_VERSION_MINOR 5 -#define BLURAY_VERSION_MICRO 0 +#define BLURAY_VERSION_MINOR 6 +#define BLURAY_VERSION_MICRO 2 -#define BLURAY_VERSION_STRING "0.5.0" +#define BLURAY_VERSION_STRING "0.6.2" #define BLURAY_VERSION \ BLURAY_VERSION_CODE(BLURAY_VERSION_MAJOR, BLURAY_VERSION_MINOR, BLURAY_VERSION_MICRO) diff -Nru libbluray-0.5.0/src/libbluray/decoders/graphics_controller.c libbluray-0.6.2/src/libbluray/decoders/graphics_controller.c --- libbluray-0.5.0/src/libbluray/decoders/graphics_controller.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/graphics_controller.c 2014-09-01 12:06:01.000000000 +0000 @@ -20,6 +20,7 @@ #include "graphics_controller.h" #include "graphics_processor.h" +#include "hdmv_pids.h" #include "ig.h" #include "overlay.h" #include "textst_render.h" @@ -73,6 +74,7 @@ unsigned auto_action_triggered; BOG_DATA *bog_data; BOG_DATA *saved_bog_data; + BD_UO_MASK page_uo_mask; /* page effects */ int effect_idx; @@ -367,6 +369,10 @@ X_FREE(gc->saved_bog_data); gc->saved_bog_data = calloc(page->num_bogs, sizeof(*gc->saved_bog_data)); + if (!gc->saved_bog_data) { + GC_ERROR("_save_page_state(): out of memory\n"); + return -1; + } for (ii = 0; ii < page->num_bogs; ii++) { gc->saved_bog_data[ii].enabled_button = gc->bog_data[ii].enabled_button; @@ -682,6 +688,7 @@ _select_button(gc, button_id); gc->valid_mouse_position = 0; + gc->page_uo_mask = bd_empty_uo_mask(); if (out_effects) { page = _find_page(&gc->igs->ics->interactive_composition, cur_page_id); @@ -713,6 +720,7 @@ gc->popup_visible = 0; gc->valid_mouse_position = 0; + gc->page_uo_mask = bd_empty_uo_mask(); graphics_processor_free(&gc->igp); graphics_processor_free(&gc->pgp); @@ -774,6 +782,10 @@ GRAPHICS_CONTROLLER *gc_init(BD_REGISTERS *regs, void *handle, gc_overlay_proc_f func) { GRAPHICS_CONTROLLER *p = calloc(1, sizeof(*p)); + if (!p) { + GC_ERROR("gc_init(): out of memory\n"); + return NULL; + } p->regs = regs; @@ -820,11 +832,14 @@ return -1; } - if (pid >= 0x1400 && pid < 0x1500) { + if (IS_HDMV_PID_IG(pid)) { /* IG stream */ if (!gc->igp) { gc->igp = graphics_processor_init(); + if (!gc->igp) { + return -1; + } } bd_mutex_lock(&gc->mutex); @@ -861,10 +876,13 @@ return 1; } - else if (pid >= 0x1200 && pid < 0x1300) { + else if (IS_HDMV_PID_PG(pid)) { /* PG stream */ if (!gc->pgp) { gc->pgp = graphics_processor_init(); + if (!gc->pgp) { + return -1; + } } graphics_processor_decode_ts(gc->pgp, &gc->pgs, pid, block, num_blocks, @@ -877,10 +895,13 @@ return 1; } - else if (pid == 0x1800) { + else if (IS_HDMV_PID_TEXTST(pid)) { /* TextST stream */ if (!gc->tgp) { gc->tgp = graphics_processor_init(); + if (!gc->tgp) { + return -1; + } } graphics_processor_decode_ts(gc->tgp, &gc->tgs, pid, block, num_blocks, @@ -921,6 +942,9 @@ if (!p->textst_render) { p->textst_render = textst_render_init(); + if (!p->textst_render) { + return -1; + } } return textst_render_add_font(p->textst_render, font_file); @@ -981,9 +1005,11 @@ /* next dialog too far in future ? */ if (now < 1 || dialog[ii].start_pts >= now + 90000) { - cmds->wakeup_time = dialog[ii].start_pts / 2; GC_TRACE("_render_textst(): next event #%d in %"PRId64" seconds (pts %"PRId64")\n", ii, (dialog[ii].start_pts - now)/90000, dialog[ii].start_pts); + if (cmds) { + cmds->wakeup_time = dialog[ii].start_pts / 2; + } return 1; } @@ -1042,15 +1068,19 @@ continue; } - TEXTST_BITMAP bmp = {NULL, style->text_box.width, style->text_box.height, style->text_box.width}; - bmp.mem = malloc(bmp.width * bmp.height); - memset(bmp.mem, style->region_info.background_color, bmp.width * bmp.height); + TEXTST_BITMAP bmp = {NULL, style->text_box.width, style->text_box.height, style->text_box.width, 0}; + bmp.mem = malloc((size_t)bmp.width * bmp.height); + if (bmp.mem) { + memset(bmp.mem, style->region_info.background_color, (size_t)bmp.width * bmp.height); - textst_render(p->textst_render, &bmp, style, region); + textst_render(p->textst_render, &bmp, style, region); - _render_textst_region(p, dialog[ii].start_pts, style, &bmp, s->style->palette); + _render_textst_region(p, dialog[ii].start_pts, style, &bmp, s->style->palette); - X_FREE(bmp.mem); + X_FREE(bmp.mem); + } else { + GC_ERROR("_render_textst(): out of memory\n"); + } } /* commit changes */ @@ -1377,6 +1407,7 @@ s->ics->video_descriptor.video_height); } + gc->page_uo_mask = page->uo_mask_table; for (ii = 0; ii < page->num_bogs; ii++) { BD_IG_BOG *bog = &page->bog[ii]; @@ -1429,11 +1460,13 @@ /* do not trigger auto action before single-loop animations have been terminated */ if (gc->button_effect_running) { GC_TRACE(" auto-activate #%d not triggered (ANIMATING)\n", auto_activate_button->id); - } else { + } else if (cmds) { cmds->num_nav_cmds = auto_activate_button->num_nav_cmds; cmds->nav_cmds = auto_activate_button->nav_cmds; gc->auto_action_triggered = 1; + } else { + GC_ERROR("_render_page(): auto-activate ignored (missing result buffer)\n"); } } @@ -1536,9 +1569,13 @@ case BD_VK_ENTER: activated_btn_id = cur_btn_id; - cmds->num_nav_cmds = button->num_nav_cmds; - cmds->nav_cmds = button->nav_cmds; - cmds->sound_id_ref = button->activated_sound_id_ref; + if (cmds) { + cmds->num_nav_cmds = button->num_nav_cmds; + cmds->nav_cmds = button->nav_cmds; + cmds->sound_id_ref = button->activated_sound_id_ref; + } else { + GC_ERROR("_user_input(): VD_VK_ENTER action ignored (missing result buffer)\n"); + } break; default:; } @@ -1546,7 +1583,7 @@ if (new_btn_id != cur_btn_id) { BD_IG_BUTTON *new_button = _find_button_page(page, new_btn_id, NULL); - if (new_button) { + if (new_button && cmds) { cmds->sound_id_ref = new_button->selected_sound_id_ref; } } @@ -1874,6 +1911,7 @@ cmds->nav_cmds = NULL; cmds->sound_id_ref = -1; cmds->status = GC_STATUS_NONE; + cmds->page_uo_mask = bd_empty_uo_mask(); } if (!gc) { @@ -2009,6 +2047,10 @@ cmds->status |= GC_STATUS_MENU_OPEN; } } + + if (gc->ig_open && !gc->out_effects) { + cmds->page_uo_mask = gc->page_uo_mask; + } } bd_mutex_unlock(&gc->mutex); diff -Nru libbluray-0.5.0/src/libbluray/decoders/graphics_controller.h libbluray-0.6.2/src/libbluray/decoders/graphics_controller.h --- libbluray-0.5.0/src/libbluray/decoders/graphics_controller.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/graphics_controller.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,9 @@ #if !defined(_GRAPHICS_CONTROLLER_H_) #define _GRAPHICS_CONTROLLER_H_ -#include +#include "util/attributes.h" + +#include "libbluray/bdnav/uo_mask_table.h" #include @@ -85,6 +87,9 @@ /* */ uint32_t wakeup_time; + + BD_UO_MASK page_uo_mask; + } GC_NAV_CMDS; /* diff -Nru libbluray-0.5.0/src/libbluray/decoders/graphics_processor.c libbluray-0.6.2/src/libbluray/decoders/graphics_processor.c --- libbluray-0.5.0/src/libbluray/decoders/graphics_processor.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/graphics_processor.c 2014-09-01 12:06:01.000000000 +0000 @@ -109,8 +109,16 @@ unsigned new_len = p1->len + p2->len - data_pos; if (p1->size < new_len) { + uint8_t *tmp; p1->size = new_len + 1; - p1->buf = realloc(p1->buf, p1->size); + tmp = realloc(p1->buf, p1->size); + if (!tmp) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + p1->size = 0; + p1->len = 0; + return; + } + p1->buf = tmp; } memcpy(p1->buf + p1->len, p2->buf + data_pos, p2->len - data_pos); @@ -121,7 +129,7 @@ /* return 1 if segment is ready for decoding, 0 if more data is needed */ static int _join_segment_fragments(struct pes_buffer_s *p) { - uint8_t type = p->buf[0]; + uint8_t type; unsigned id_pos = 0, id_len = 3, sd_pos = 6, data_pos = 0; if (p->len < 3) { @@ -130,6 +138,7 @@ /* check segment type */ + type = p->buf[0]; if (type == PGS_OBJECT) { id_pos = 3; sd_pos = 6; @@ -192,6 +201,11 @@ (void)p; + if (!s->decoding) { + BD_DEBUG(DBG_DECODE, "skipping orphan window definition segment\n"); + return 0; + } + s->num_window = 0; if (pg_decode_windows(bb, &w)) { @@ -201,11 +215,18 @@ return 1; } + pg_clean_windows(&w); + return 0; } static int _decode_ods(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p) { + if (!s->decoding) { + BD_DEBUG(DBG_DECODE, "skipping orphan object definition segment\n"); + return 0; + } + /* search for object to be updated */ if (s->object) { @@ -219,6 +240,7 @@ s->object[ii].pts = p->pts; return 1; } + pg_clean_object(&s->object[ii]); return 0; } } @@ -226,7 +248,12 @@ /* add and decode new object */ - s->object = realloc(s->object, sizeof(s->object[0]) * (s->num_object + 1)); + BD_PG_OBJECT *tmp = realloc(s->object, sizeof(s->object[0]) * (s->num_object + 1)); + if (!tmp) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } + s->object = tmp; memset(&s->object[s->num_object], 0, sizeof(s->object[0])); if (pg_decode_object(bb, &s->object[s->num_object])) { @@ -235,11 +262,18 @@ return 1; } + pg_clean_object(&s->object[s->num_object]); + return 0; } static int _decode_pds(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p) { + if (!s->decoding) { + BD_DEBUG(DBG_DECODE, "skipping orphan palette definition segment\n"); + return 0; + } + /* search for palette to be updated */ if (s->palette) { @@ -268,7 +302,12 @@ /* add and decode new palette */ - s->palette = realloc(s->palette, sizeof(s->palette[0]) * (s->num_palette + 1)); + BD_PG_PALETTE *tmp = realloc(s->palette, sizeof(s->palette[0]) * (s->num_palette + 1)); + if (!tmp) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } + s->palette = tmp; memset(&s->palette[s->num_palette], 0, sizeof(s->palette[0])); if (pg_decode_palette(bb, &s->palette[s->num_palette])) { @@ -304,8 +343,17 @@ static int _decode_pcs(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p) { + if (s->complete) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "ERROR: updating complete (non-consumed) PG composition\n"); + s->complete = 0; + } + pg_free_composition(&s->pcs); s->pcs = calloc(1, sizeof(*s->pcs)); + if (!s->pcs) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } if (!pg_decode_composition(bb, s->pcs)) { pg_free_composition(&s->pcs); @@ -317,13 +365,24 @@ _check_epoch_start(s); + s->decoding = 1; + return 1; } static int _decode_ics(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p) { + if (s->complete) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "ERROR: updating complete (non-consumed) IG composition\n"); + s->complete = 0; + } + ig_free_interactive(&s->ics); s->ics = calloc(1, sizeof(*s->ics)); + if (!s->ics) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } if (!ig_decode_interactive(bb, s->ics)) { ig_free_interactive(&s->ics); @@ -335,6 +394,8 @@ _check_epoch_start(s); + s->decoding = 1; + return 1; } @@ -342,7 +403,14 @@ { _free_dialogs(s); + s->complete = 0; + s->style = calloc(1, sizeof(*s->style)); + if (!s->style) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } + if (!textst_decode_dialog_style(bb, s->style)) { textst_free_dialog_style(&s->style); return 0; @@ -362,6 +430,12 @@ } s->dialog = calloc(s->total_dialog, sizeof(*s->dialog)); + if (!s->dialog) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + s->total_dialog = 0; + return 0; + } + BD_DEBUG(DBG_DECODE, "_decode_dialog_style(): %d dialogs in stream\n", s->total_dialog); return 1; } @@ -415,7 +489,13 @@ return _decode_ics(s, &bb, p); case PGS_END_OF_DISPLAY: + if (!s->decoding) { + /* avoid duplicate initialization / presenataton */ + BD_DEBUG(DBG_DECODE, "skipping orphan end of display segment\n"); + return 0; + } s->complete = 1; + s->decoding = 0; return 1; case TGS_DIALOG_STYLE: @@ -444,6 +524,10 @@ if (*s == NULL) { *s = calloc(1, sizeof(PG_DISPLAY_SET)); + if (!*s) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } } while (*p) { @@ -477,8 +561,6 @@ GP_TRACE("Decoding segment, dts %010"PRId64" pts %010"PRId64" len %d\n", (*p)->dts, (*p)->pts, (*p)->len); - (*s)->complete = 0; - _decode_segment(*s, *p); pes_buffer_remove(p, *p); @@ -525,6 +607,7 @@ int64_t stc) { unsigned ii; + int result = 0; if (pid != p->pid) { m2ts_demux_free(&p->demux); @@ -532,6 +615,9 @@ } if (!p->demux) { p->demux = m2ts_demux_init(pid); + if (!p->demux) { + return 0; + } p->pid = pid; } @@ -541,8 +627,8 @@ } if (p->queue) { - return graphics_processor_decode_pes(s, &p->queue, stc); + result = graphics_processor_decode_pes(s, &p->queue, stc); } - return 0; + return result; } diff -Nru libbluray-0.5.0/src/libbluray/decoders/graphics_processor.h libbluray-0.6.2/src/libbluray/decoders/graphics_processor.h --- libbluray-0.5.0/src/libbluray/decoders/graphics_processor.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/graphics_processor.h 2014-09-01 12:06:01.000000000 +0000 @@ -24,7 +24,7 @@ #include "ig.h" #include "textst.h" -#include +#include "util/attributes.h" #include @@ -56,6 +56,8 @@ BD_PG_COMPOSITION *pcs; BD_TEXTST_DIALOG_STYLE *style; + uint8_t decoding; /* internal flag: PCS/ICS decoded, but no end of presentation seen yet */ + } PG_DISPLAY_SET; BD_PRIVATE void pg_display_set_free(PG_DISPLAY_SET **s); diff -Nru libbluray-0.5.0/src/libbluray/decoders/hdmv_pids.h libbluray-0.6.2/src/libbluray/decoders/hdmv_pids.h --- libbluray-0.5.0/src/libbluray/decoders/hdmv_pids.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/hdmv_pids.h 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,65 @@ +/* + * This file is part of libbluray + * + * 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 + * . + */ + +#if !defined(_HDMV_PIDS_H_) +#define _HDMV_PIDS_H_ + +/* + * HDMV transport stream PIDs + */ + +#define HDMV_PID_PAT 0 +#define HDMV_PID_PMT 0x0100 +#define HDMV_PID_PCR 0x1001 + +/* primary streams */ + +#define HDMV_PID_VIDEO 0x1011 +#define HDMV_PID_VIDEO_SS 0x1012 + +#define HDMV_PID_AUDIO_FIRST 0x1100 +#define HDMV_PID_AUDIO_LAST 0x111f + +/* graphics streams */ + +#define HDMV_PID_PG_FIRST 0x1200 +#define HDMV_PID_PG_LAST 0x121f + +#define HDMV_PID_IG_FIRST 0x1400 +#define HDMV_PID_IG_LAST 0x141f + +#define HDMV_PID_TEXTST 0x1800 + +/* secondary streams */ + +#define HDMV_PID_SEC_AUDIO_FIRST 0x1a00 +#define HDMV_PID_SEC_AUDIO_LAST 0x1a1f + +#define HDMV_PID_SEC_VIDEO_FIRST 0x1b00 +#define HDMV_PID_SEC_VIDEO_LAST 0x1b1f + +/* + * + */ + +#define IS_HDMV_PID_PG(pid) ((pid) >= HDMV_PID_PG_FIRST && (pid) <= HDMV_PID_PG_LAST) +#define IS_HDMV_PID_IG(pid) ((pid) >= HDMV_PID_IG_FIRST && (pid) <= HDMV_PID_IG_LAST) +#define IS_HDMV_PID_TEXTST(pid) ((pid) == HDMV_PID_TEXTST) + + +#endif // _HDMV_PIDS_H_ diff -Nru libbluray-0.5.0/src/libbluray/decoders/ig_decode.c libbluray-0.6.2/src/libbluray/decoders/ig_decode.c --- libbluray-0.5.0/src/libbluray/decoders/ig_decode.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/ig_decode.c 2014-09-01 12:06:01.000000000 +0000 @@ -31,7 +31,7 @@ #include -static void _decode_button(BITBUFFER *bb, BD_IG_BUTTON *p) +static int _decode_button(BITBUFFER *bb, BD_IG_BUTTON *p) { unsigned ii; @@ -66,6 +66,10 @@ p->num_nav_cmds = bb_read(bb, 16); p->nav_cmds = calloc(p->num_nav_cmds, sizeof(MOBJ_CMD)); + if (!p->nav_cmds) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_nav_cmds; ii++) { uint8_t buf[12]; @@ -73,6 +77,8 @@ mobj_parse_cmd(buf, &p->nav_cmds[ii]); } + + return 1; } static void _clean_button(BD_IG_BUTTON *p) @@ -80,7 +86,7 @@ X_FREE(p->nav_cmds); } -static void _decode_bog(BITBUFFER *bb, BD_IG_BOG *p) +static int _decode_bog(BITBUFFER *bb, BD_IG_BOG *p) { unsigned ii; @@ -88,23 +94,34 @@ p->num_buttons = bb_read(bb, 8); p->button = calloc(p->num_buttons, sizeof(BD_IG_BUTTON)); + if (!p->button) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_buttons; ii++) { - _decode_button(bb, &p->button[ii]); + if (!_decode_button(bb, &p->button[ii])) { + return 0; + } } + + return 1; } static void _clean_bog(BD_IG_BOG *p) { unsigned ii; - for (ii = 0; ii < p->num_buttons; ii++) { - _clean_button(&p->button[ii]); + if (p->button) { + for (ii = 0; ii < p->num_buttons; ii++) { + _clean_button(&p->button[ii]); + } } + X_FREE(p->button); } -static void _decode_effect(BITBUFFER *bb, BD_IG_EFFECT *p) +static int _decode_effect(BITBUFFER *bb, BD_IG_EFFECT *p) { unsigned ii; @@ -113,10 +130,16 @@ p->num_composition_objects = bb_read(bb, 8); p->composition_object = calloc(p->num_composition_objects, sizeof(BD_PG_COMPOSITION_OBJECT)); + if (!p->composition_object) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_composition_objects; ii++) { pg_decode_composition_object(bb, &p->composition_object[ii]); } + + return 1; } static void _clean_effect(BD_IG_EFFECT *p) @@ -124,12 +147,16 @@ X_FREE(p->composition_object); } -static void _decode_effect_sequence(BITBUFFER *bb, BD_IG_EFFECT_SEQUENCE *p) +static int _decode_effect_sequence(BITBUFFER *bb, BD_IG_EFFECT_SEQUENCE *p) { unsigned ii; p->num_windows = bb_read(bb, 8); p->window = calloc(p->num_windows, sizeof(BD_PG_WINDOW)); + if (!p->window) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_windows; ii++) { pg_decode_window(bb, &p->window[ii]); @@ -137,19 +164,30 @@ p->num_effects = bb_read(bb, 8); p->effect = calloc(p->num_effects, sizeof(BD_IG_EFFECT)); + if (!p->effect) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_effects; ii++) { - _decode_effect(bb, &p->effect[ii]); + if (!_decode_effect(bb, &p->effect[ii])) { + return 0; + } } + + return 1; } static void _clean_effect_sequence(BD_IG_EFFECT_SEQUENCE *p) { unsigned ii; - for (ii = 0; ii < p->num_effects; ii++) { - _clean_effect(&p->effect[ii]); + if (p->effect) { + for (ii = 0; ii < p->num_effects; ii++) { + _clean_effect(&p->effect[ii]); + } } + X_FREE(p->effect); X_FREE(p->window); @@ -164,7 +202,7 @@ return mpls_parse_uo(buf, p); } -static void _decode_page(BITBUFFER *bb, BD_IG_PAGE *p) +static int _decode_page(BITBUFFER *bb, BD_IG_PAGE *p) { unsigned ii; @@ -173,8 +211,12 @@ _decode_uo_mask_table(bb, &p->uo_mask_table); - _decode_effect_sequence(bb, &p->in_effects); - _decode_effect_sequence(bb, &p->out_effects); + if (!_decode_effect_sequence(bb, &p->in_effects)) { + return 0; + } + if (!_decode_effect_sequence(bb, &p->out_effects)) { + return 0; + } p->animation_frame_rate_code = bb_read(bb, 8); p->default_selected_button_id_ref = bb_read(bb, 16); @@ -183,10 +225,18 @@ p->num_bogs = bb_read(bb, 8); p->bog = calloc(p->num_bogs, sizeof(BD_IG_BOG)); + if (!p->bog) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_bogs; ii++) { - _decode_bog(bb, &p->bog[ii]); + if (!_decode_bog(bb, &p->bog[ii])) { + return 0; + } } + + return 1; } static void _clean_page(BD_IG_PAGE *p) @@ -196,9 +246,12 @@ _clean_effect_sequence(&p->in_effects); _clean_effect_sequence(&p->out_effects); - for (ii = 0; ii < p->num_bogs; ii++) { - _clean_bog(&p->bog[ii]); + if (p->bog) { + for (ii = 0; ii < p->num_bogs; ii++) { + _clean_bog(&p->bog[ii]); + } } + X_FREE(p->bog); } @@ -239,9 +292,15 @@ p->num_pages = bb_read(bb, 8); p->page = calloc(p->num_pages, sizeof(BD_IG_PAGE)); + if (!p->page) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_pages; ii++) { - _decode_page(bb, &p->page[ii]); + if (!_decode_page(bb, &p->page[ii])) { + return 0; + } } return 1; @@ -251,9 +310,12 @@ { unsigned ii; - for (ii = 0; ii < p->num_pages; ii++) { - _clean_page(&p->page[ii]); + if (p->page) { + for (ii = 0; ii < p->num_pages; ii++) { + _clean_page(&p->page[ii]); + } } + X_FREE(p->page); } diff -Nru libbluray-0.5.0/src/libbluray/decoders/ig_decode.h libbluray-0.6.2/src/libbluray/decoders/ig_decode.h --- libbluray-0.5.0/src/libbluray/decoders/ig_decode.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/ig_decode.h 2014-09-01 12:06:01.000000000 +0000 @@ -22,8 +22,8 @@ #include "ig.h" -#include -#include +#include "util/attributes.h" +#include "util/bits.h" #include diff -Nru libbluray-0.5.0/src/libbluray/decoders/m2ts_demux.c libbluray-0.6.2/src/libbluray/decoders/m2ts_demux.c --- libbluray-0.5.0/src/libbluray/decoders/m2ts_demux.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/m2ts_demux.c 2014-09-01 12:06:01.000000000 +0000 @@ -131,9 +131,16 @@ // realloc if (p->size < p->len + len) { + uint8_t *tmp; p->size *= 2; p->size = BD_MAX(p->size, BD_MAX(result, 0x100)); - p->buf = realloc(p->buf, p->size); + tmp = realloc(p->buf, p->size); + if (!tmp) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + p->size = 0; + return -1; + } + p->buf = tmp; } // append diff -Nru libbluray-0.5.0/src/libbluray/decoders/m2ts_demux.h libbluray-0.6.2/src/libbluray/decoders/m2ts_demux.h --- libbluray-0.5.0/src/libbluray/decoders/m2ts_demux.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/m2ts_demux.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_M2TS_DEMUX_H_) #define _M2TS_DEMUX_H_ -#include +#include "util/attributes.h" #include diff -Nru libbluray-0.5.0/src/libbluray/decoders/m2ts_filter.c libbluray-0.6.2/src/libbluray/decoders/m2ts_filter.c --- libbluray-0.5.0/src/libbluray/decoders/m2ts_filter.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/m2ts_filter.c 2014-09-01 12:06:01.000000000 +0000 @@ -23,6 +23,8 @@ #include "m2ts_filter.h" +#include "hdmv_pids.h" + #include "util/logging.h" #include "util/macro.h" @@ -30,7 +32,7 @@ #include #include -#define M2TS_TRACE(...) BD_DEBUG(DBG_CRIT,__VA_ARGS__) +#define M2TS_TRACE(...) BD_DEBUG(DBG_STREAM,__VA_ARGS__) //#define M2TS_TRACE(...) do {} while(0) /* @@ -49,7 +51,8 @@ }; M2TS_FILTER *m2ts_filter_init(int64_t in_pts, int64_t out_pts, - unsigned num_video, unsigned num_audio) + unsigned num_video, unsigned num_audio, + unsigned num_ig, unsigned num_pg) { M2TS_FILTER *p = calloc(1, sizeof(*p)); @@ -59,16 +62,26 @@ p->in_pts = in_pts; p->out_pts = out_pts; - p->wipe_pid = calloc(num_audio + num_video + 1, sizeof(uint16_t)); - p->pass_pid = calloc(num_audio + num_video + 1, sizeof(uint16_t)); + p->wipe_pid = calloc(num_audio + num_video + num_ig + num_pg + 1, sizeof(uint16_t)); + p->pass_pid = calloc(num_audio + num_video + num_ig + num_pg + 1, sizeof(uint16_t)); + if (!p->pass_pid || !p->wipe_pid) { + m2ts_filter_close(&p); + return NULL; + } pid = (in_pts >= 0) ? p->wipe_pid : p->pass_pid; for (ii = 0, npid = 0; ii < num_video; ii++) { - pid[npid++] = 0x1011 + ii; + pid[npid++] = HDMV_PID_VIDEO + ii; } for (ii = 0; ii < num_audio; ii++) { - pid[npid++] = 0x1100 + ii; + pid[npid++] = HDMV_PID_AUDIO_FIRST + ii; + } + for (ii = 0; ii < num_ig; ii++) { + pid[npid++] = HDMV_PID_IG_FIRST + ii; + } + for (ii = 0; ii < num_pg; ii++) { + pid[npid++] = HDMV_PID_PG_FIRST + ii; } } @@ -214,14 +227,25 @@ } } if (p->out_pts >= 0) { - + /* + * Note: we can't compare against in_pts here (after passing it once): + * PG / IG streams can have timestamps before in_time (except for composition segments), and those are valid. + */ if (_pid_in_list(p->pass_pid, pid)) { int64_t pts = _es_timestamp(buf + 4 + payload_offset, 188 - payload_offset); - if (pts > p->out_pts) { + if (pts >= p->out_pts) { + /* + * audio/video streams are cutted after out_time (unit with pts==out_time is included in the clip). + * PG/IG streams are cutted before out_time (unit with pts==out_time is dropped out). + */ + if (pts > p->out_pts || + IS_HDMV_PID_PG(pid) || + IS_HDMV_PID_IG(pid)) { M2TS_TRACE("Pid 0x%04x passed OUT timestamp %"PRId64" (pts %"PRId64") -> start wiping\n", pid, p->out_pts, pts); _remove_pid(p->pass_pid, pid); _add_pid(p->wipe_pid, pid); + } } } } @@ -244,7 +268,7 @@ for (; buf < end; buf += 192) { uint16_t pid = ((buf[4+1] & 0x1f) << 8) | buf[4+2]; - if (!pid) { + if (pid == HDMV_PID_PAT) { p->pat_seen = 1; p->pat_packets = 0; continue; @@ -258,7 +282,8 @@ } M2TS_TRACE("NOT Wiping pid 0x%04x (inside seek buffer, PAT seen)\n", pid); } - if (pid < 0x1011) { + if (pid < HDMV_PID_VIDEO) { + /* pass PMT, PCR, SIT */ /*M2TS_TRACE("NOT Wiping pid 0x%04x (< 0x1011)\n", pid);*/ continue; } diff -Nru libbluray-0.5.0/src/libbluray/decoders/m2ts_filter.h libbluray-0.6.2/src/libbluray/decoders/m2ts_filter.h --- libbluray-0.5.0/src/libbluray/decoders/m2ts_filter.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/m2ts_filter.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_M2TS_FILTER_H_) #define _M2TS_FILTER_H_ -#include +#include "util/attributes.h" #include @@ -32,7 +32,8 @@ typedef struct m2ts_filter_s M2TS_FILTER; BD_PRIVATE M2TS_FILTER *m2ts_filter_init(int64_t in_pts, int64_t out_pts, - unsigned num_video, unsigned num_audio); + unsigned num_video, unsigned num_audio, + unsigned num_ig, unsigned num_pg); BD_PRIVATE void m2ts_filter_close(M2TS_FILTER **); /* diff -Nru libbluray-0.5.0/src/libbluray/decoders/pes_buffer.h libbluray-0.6.2/src/libbluray/decoders/pes_buffer.h --- libbluray-0.5.0/src/libbluray/decoders/pes_buffer.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/pes_buffer.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_PES_BUFFER_H_) #define _PES_BUFFER_H_ -#include +#include "util/attributes.h" #include diff -Nru libbluray-0.5.0/src/libbluray/decoders/pg_decode.c libbluray-0.6.2/src/libbluray/decoders/pg_decode.c --- libbluray-0.5.0/src/libbluray/decoders/pg_decode.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/pg_decode.c 2014-09-01 12:06:01.000000000 +0000 @@ -117,6 +117,7 @@ static int _decode_rle(BITBUFFER *bb, BD_PG_OBJECT *p) { + BD_PG_RLE_ELEM *tmp; int pixels_left = p->width * p->height; int num_rle = 0; int rle_size = p->width * p->height / 4; @@ -124,11 +125,12 @@ if (rle_size < 1) rle_size = 1; - p->img = refcnt_realloc(p->img, rle_size * sizeof(BD_PG_RLE_ELEM)); - if (!p->img) { + tmp = refcnt_realloc(p->img, rle_size * sizeof(BD_PG_RLE_ELEM)); + if (!tmp) { BD_DEBUG(DBG_DECODE | DBG_CRIT, "pg_decode_object(): realloc failed\n"); return 0; } + p->img = tmp; while (!bb_eof(bb)) { uint32_t len = 1; @@ -163,14 +165,13 @@ num_rle++; if (num_rle >= rle_size) { - void *tmp = p->img; rle_size *= 2; - p->img = refcnt_realloc(p->img, rle_size * sizeof(BD_PG_RLE_ELEM)); - if (!p->img) { + tmp = refcnt_realloc(p->img, rle_size * sizeof(BD_PG_RLE_ELEM)); + if (!tmp) { BD_DEBUG(DBG_DECODE | DBG_CRIT, "pg_decode_object(): realloc failed\n"); - X_FREE(tmp); return 0; } + p->img = tmp; } } @@ -233,6 +234,10 @@ p->num_composition_objects = bb_read(bb, 8); p->composition_object = calloc(p->num_composition_objects, sizeof(BD_PG_COMPOSITION_OBJECT)); + if (!p->composition_object) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_composition_objects; ii++) { pg_decode_composition_object(bb, &p->composition_object[ii]); @@ -247,6 +252,10 @@ p->num_windows = bb_read(bb, 8); p->window = calloc(p->num_windows, sizeof(BD_PG_WINDOW)); + if (!p->window) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_windows; ii++) { pg_decode_window(bb, &p->window[ii]); @@ -267,6 +276,13 @@ } } +void pg_clean_windows(BD_PG_WINDOWS *p) +{ + if (p) { + X_FREE(p->window); + } +} + static void pg_clean_composition(BD_PG_COMPOSITION *p) { if (p) { diff -Nru libbluray-0.5.0/src/libbluray/decoders/pg_decode.h libbluray-0.6.2/src/libbluray/decoders/pg_decode.h --- libbluray-0.5.0/src/libbluray/decoders/pg_decode.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/pg_decode.h 2014-09-01 12:06:01.000000000 +0000 @@ -22,8 +22,8 @@ #include "pg.h" -#include -#include +#include "util/attributes.h" +#include "util/bits.h" /* * elements @@ -51,6 +51,7 @@ */ BD_PRIVATE void pg_clean_object(BD_PG_OBJECT *p); +BD_PRIVATE void pg_clean_windows(BD_PG_WINDOWS *p); BD_PRIVATE void pg_free_composition(BD_PG_COMPOSITION **p); diff -Nru libbluray-0.5.0/src/libbluray/decoders/rle.h libbluray-0.6.2/src/libbluray/decoders/rle.h --- libbluray-0.5.0/src/libbluray/decoders/rle.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/rle.h 2014-09-01 12:06:01.000000000 +0000 @@ -22,7 +22,7 @@ #include "overlay.h" -#include +#include "util/attributes.h" #include diff -Nru libbluray-0.5.0/src/libbluray/decoders/textst_decode.c libbluray-0.6.2/src/libbluray/decoders/textst_decode.c --- libbluray-0.5.0/src/libbluray/decoders/textst_decode.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/textst_decode.c 2014-09-01 12:06:01.000000000 +0000 @@ -105,7 +105,7 @@ p->line_space_delta = _decode_int8(bb); } -static void _decode_dialog_region(BITBUFFER *bb, BD_TEXTST_DIALOG_REGION *p) +static int _decode_dialog_region(BITBUFFER *bb, BD_TEXTST_DIALOG_REGION *p) { p->continous_present_flag = bb_read(bb, 1); p->forced_on_flag = bb_read(bb, 1); @@ -119,6 +119,10 @@ p->elem = malloc(bytes_allocated); p->elem_count = 0; p->line_count = 1; + if (!p->elem) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } uint8_t *ptr = (uint8_t *)p->elem; @@ -143,7 +147,12 @@ int need = bytes_used + length + sizeof(BD_TEXTST_DATA); if (bytes_allocated < need) { bytes_allocated = need * 2; - p->elem = realloc(p->elem, bytes_allocated); + BD_TEXTST_DATA *tmp = realloc(p->elem, bytes_allocated); + if (!tmp) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } + p->elem = tmp; ptr = ((uint8_t *)p->elem) + bytes_used; } @@ -186,6 +195,8 @@ ptr += sizeof(BD_TEXTST_DATA); p->elem_count++; } + + return 1; } static void _decode_palette(BITBUFFER *bb, BD_PG_PALETTE_ENTRY *p) @@ -215,6 +226,10 @@ if (p->region_style_count) { p->region_style = calloc(p->region_style_count, sizeof(BD_TEXTST_REGION_STYLE)); + if (!p->region_style) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->region_style_count; ii++) { _decode_region_style(bb, &p->region_style[ii]); } @@ -222,6 +237,10 @@ if (p->user_style_count) { p->user_style = calloc(p->user_style_count, sizeof(BD_TEXTST_USER_STYLE)); + if (!p->user_style) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->user_style_count; ii++) { _decode_user_style(bb, &p->user_style[ii]); } @@ -246,13 +265,23 @@ if (palette_update_flag) { p->palette_update = calloc(256, sizeof(BD_PG_PALETTE_ENTRY)); + if (!p->palette_update) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } _decode_palette(bb, p->palette_update); } p->region_count = bb_read(bb, 8); if (p->region_count) { + if (p->region_count > 2) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "too many regions (%d)\n", p->region_count); + return 0; + } for (ii = 0; ii < p->region_count; ii++) { - _decode_dialog_region(bb, &p->region[ii]); + if (!_decode_dialog_region(bb, &p->region[ii])) { + return 0; + } } } diff -Nru libbluray-0.5.0/src/libbluray/decoders/textst_decode.h libbluray-0.6.2/src/libbluray/decoders/textst_decode.h --- libbluray-0.5.0/src/libbluray/decoders/textst_decode.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/textst_decode.h 2014-09-01 12:06:01.000000000 +0000 @@ -22,8 +22,8 @@ #include "textst.h" -#include -#include +#include "util/attributes.h" +#include "util/bits.h" #include diff -Nru libbluray-0.5.0/src/libbluray/decoders/textst_render.c libbluray-0.6.2/src/libbluray/decoders/textst_render.c --- libbluray-0.5.0/src/libbluray/decoders/textst_render.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/textst_render.c 2014-09-01 12:06:01.000000000 +0000 @@ -107,7 +107,12 @@ int textst_render_add_font(TEXTST_RENDER *p, const char *file) { #ifdef HAVE_FT2 - p->face = realloc(p->face, sizeof(*(p->face)) * (p->font_count + 1)); + FT_Face *tmp = realloc(p->face, sizeof(*(p->face)) * (p->font_count + 1)); + if (!tmp) { + TEXTST_ERROR("out of memory\n"); + return -1; + } + p->face = tmp; if (FT_New_Face(p->ft_lib, file, -1, NULL)) { TEXTST_ERROR("Unsupport font file format (%s)\n", file); diff -Nru libbluray-0.5.0/src/libbluray/decoders/textst_render.h libbluray-0.6.2/src/libbluray/decoders/textst_render.h --- libbluray-0.5.0/src/libbluray/decoders/textst_render.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/decoders/textst_render.h 2014-09-01 12:06:01.000000000 +0000 @@ -22,8 +22,8 @@ #include "textst.h" -#include -#include +#include "util/attributes.h" +#include "util/bits.h" #include diff -Nru libbluray-0.5.0/src/libbluray/hdmv/hdmv_vm.c libbluray-0.6.2/src/libbluray/hdmv/hdmv_vm.c --- libbluray-0.5.0/src/libbluray/hdmv/hdmv_vm.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/hdmv/hdmv_vm.c 2014-09-01 12:06:01.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2010-2012 Petri Hintukainen + * Copyright (C) 2010-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,9 +23,7 @@ #include "hdmv_insn.h" #include "../register.h" -#include "../bdnav/index_parse.h" #include "util/macro.h" -#include "util/strutl.h" #include "util/logging.h" #include "util/mutex.h" @@ -46,7 +44,7 @@ /* state */ uint32_t pc; /* program counter */ BD_REGISTERS *regs; /* player registers */ - MOBJ_OBJECT *object; /* currently running object code */ + const MOBJ_OBJECT *object; /* currently running object code */ HDMV_EVENT event[5]; /* pending events to return */ @@ -57,15 +55,17 @@ MOBJ_OBJECT *ig_object; /* current object from IG stream */ /* object currently playing playlist */ - MOBJ_OBJECT *playing_object; - int playing_pc; + const MOBJ_OBJECT *playing_object; + uint32_t playing_pc; /* suspended object */ - MOBJ_OBJECT *suspended_object; - int suspended_pc; + const MOBJ_OBJECT *suspended_object; + uint32_t suspended_pc; - /* disc index (used to verify CALL_TITLE/JUMP_TITLE) */ - INDX_ROOT *indx; + /* Available titles. Used to validate CALL_TITLE/JUMP_TITLE. */ + uint8_t have_top_menu; + uint8_t have_first_play; + uint16_t num_titles; }; /* @@ -239,22 +239,27 @@ * vm init */ -HDMV_VM *hdmv_vm_init(const char *disc_root, BD_REGISTERS *regs, INDX_ROOT *indx) +HDMV_VM *hdmv_vm_init(const char *disc_root, BD_REGISTERS *regs, + unsigned num_titles, unsigned first_play_available, unsigned top_menu_available) { HDMV_VM *p = calloc(1, sizeof(HDMV_VM)); - char *file; + + if (!p) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); + return NULL; + } /* read movie objects */ - file = str_printf("%s/BDMV/MovieObject.bdmv", disc_root); - p->movie_objects = mobj_parse(file); - X_FREE(file); + p->movie_objects = mobj_parse(disc_root); if (!p->movie_objects) { X_FREE(p); return NULL; } p->regs = regs; - p->indx = indx; + p->num_titles = num_titles; + p->have_top_menu = top_menu_available; + p->have_first_play = first_play_available; bd_mutex_init(&p->mutex); @@ -406,7 +411,7 @@ p->suspended_object = NULL; BD_DEBUG(DBG_HDMV, "resuming object %ld at %d\n", - (long)((p->movie_objects->objects - p->object) / sizeof(p->movie_objects->objects[0])), + (long)(p->object - p->movie_objects->objects), p->pc); _queue_event(p, HDMV_EVENT_PLAY_STOP, 0); @@ -419,29 +424,26 @@ * branching */ -static int _is_valid_title(HDMV_VM *p, int title) +static int _is_valid_title(HDMV_VM *p, uint32_t title) { - if (title == 0 || title == 0xffff) { - INDX_PLAY_ITEM *pi = (!title) ? &p->indx->top_menu : &p->indx->first_play; - - if (pi->object_type == indx_object_type_hdmv && pi->hdmv.id_ref == 0xffff) { - /* no top menu or first play title (5.2.3.3) */ - return 0; - } - return 1; + if (title == 0) { + return p->have_top_menu; + } + if (title == 0xffff) { + return p->have_first_play; } - return title > 0 && title <= p->indx->num_titles; + return title > 0 && title <= p->num_titles; } -static int _jump_object(HDMV_VM *p, int object) +static int _jump_object(HDMV_VM *p, uint32_t object) { - if (object < 0 || object >= p->movie_objects->num_objects) { - BD_DEBUG(DBG_HDMV|DBG_CRIT, "_jump_object(): invalid object %d\n", object); + if (object >= p->movie_objects->num_objects) { + BD_DEBUG(DBG_HDMV|DBG_CRIT, "_jump_object(): invalid object %u\n", object); return -1; } - BD_DEBUG(DBG_HDMV, "_jump_object(): jumping to object %d\n", object); + BD_DEBUG(DBG_HDMV, "_jump_object(): jumping to object %u\n", object); _queue_event(p, HDMV_EVENT_PLAY_STOP, 0); @@ -457,10 +459,10 @@ return 0; } -static int _jump_title(HDMV_VM *p, int title) +static int _jump_title(HDMV_VM *p, uint32_t title) { if (_is_valid_title(p, title)) { - BD_DEBUG(DBG_HDMV, "_jump_title(%d)\n", title); + BD_DEBUG(DBG_HDMV, "_jump_title(%u)\n", title); /* discard suspended object */ p->suspended_object = NULL; @@ -471,25 +473,29 @@ return 0; } - BD_DEBUG(DBG_HDMV|DBG_CRIT, "_jump_title(%d): invalid title number\n", title); + BD_DEBUG(DBG_HDMV|DBG_CRIT, "_jump_title(%u): invalid title number\n", title); return -1; } -static int _call_object(HDMV_VM *p, int object) +static int _call_object(HDMV_VM *p, uint32_t object) { - BD_DEBUG(DBG_HDMV, "_call_object(%d)\n", object); + if (object >= p->movie_objects->num_objects) { + BD_DEBUG(DBG_HDMV|DBG_CRIT, "_call_object(): invalid object %u\n", object); + return -1; + } + + BD_DEBUG(DBG_HDMV, "_call_object(%u)\n", object); - _queue_event(p, HDMV_EVENT_PLAY_STOP, 0); _suspend_object(p, 1); return _jump_object(p, object); } -static int _call_title(HDMV_VM *p, int title) +static int _call_title(HDMV_VM *p, uint32_t title) { if (_is_valid_title(p, title)) { - BD_DEBUG(DBG_HDMV, "_call_title(%d)\n", title); + BD_DEBUG(DBG_HDMV, "_call_title(%u)\n", title); _suspend_object(p, 1); @@ -498,7 +504,7 @@ return 0; } - BD_DEBUG(DBG_HDMV|DBG_CRIT, "_call_title(%d): invalid title number\n", title); + BD_DEBUG(DBG_HDMV|DBG_CRIT, "_call_title(%u): invalid title number\n", title); return -1; } @@ -510,14 +516,14 @@ static int _play_at(HDMV_VM *p, int playlist, int playitem, int playmark) { if (p->ig_object && playlist >= 0) { - BD_DEBUG(DBG_HDMV, "play_at(list %d, item %d, mark %d): " + BD_DEBUG(DBG_HDMV | DBG_CRIT, "play_at(list %d, item %d, mark %d): " "playlist change not allowed in interactive composition\n", playlist, playitem, playmark); return -1; } if (!p->ig_object && playlist < 0) { - BD_DEBUG(DBG_HDMV, "play_at(list %d, item %d, mark %d): " + BD_DEBUG(DBG_HDMV | DBG_CRIT, "play_at(list %d, item %d, mark %d): " "playlist not given in movie object (link commands not allowed)\n", playlist, playitem, playmark); return -1; @@ -545,7 +551,7 @@ static int _play_stop(HDMV_VM *p) { if (!p->ig_object) { - BD_DEBUG(DBG_HDMV, "_play_stop() not allowed in movie object\n"); + BD_DEBUG(DBG_HDMV | DBG_CRIT, "_play_stop() not allowed in movie object\n"); return -1; } @@ -846,7 +852,7 @@ dst += sprintf(dst, "%04d: ", pc); - dst += mobj_sprint_cmd(dst, cmd); + /*dst +=*/ mobj_sprint_cmd(dst, cmd); BD_DEBUG(DBG_HDMV, "%s\n", buf); } @@ -866,7 +872,7 @@ if (new_src != orig_src) { dst += sprintf(dst, " src 0x%x <== 0x%x ", orig_src, new_src); } - dst += sprintf(dst, "]"); + /*dst +=*/ sprintf(dst, "]"); BD_DEBUG(DBG_HDMV, "%s\n", buf); } @@ -1077,9 +1083,14 @@ * interface */ -int hdmv_vm_select_object(HDMV_VM *p, int object) +int hdmv_vm_select_object(HDMV_VM *p, uint32_t object) { int result; + + if (!p) { + return -1; + } + bd_mutex_lock(&p->mutex); result = _jump_object(p, object); @@ -1088,9 +1099,39 @@ return result; } +static int _set_object(HDMV_VM *p, int num_nav_cmds, void *nav_cmds) +{ + MOBJ_OBJECT *ig_object = calloc(1, sizeof(MOBJ_OBJECT)); + if (!ig_object) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); + return -1; + } + + ig_object->num_cmds = num_nav_cmds; + ig_object->cmds = calloc(num_nav_cmds, sizeof(MOBJ_CMD)); + if (!ig_object->cmds) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); + X_FREE(ig_object); + return -1; + } + + memcpy(ig_object->cmds, nav_cmds, num_nav_cmds * sizeof(MOBJ_CMD)); + + p->pc = 0; + p->ig_object = ig_object; + p->object = ig_object; + + return 0; +} + int hdmv_vm_set_object(HDMV_VM *p, int num_nav_cmds, void *nav_cmds) { int result = -1; + + if (!p) { + return -1; + } + bd_mutex_lock(&p->mutex); p->object = NULL; @@ -1098,16 +1139,7 @@ _free_ig_object(p); if (nav_cmds && num_nav_cmds > 0) { - MOBJ_OBJECT *ig_object = calloc(1, sizeof(MOBJ_OBJECT)); - ig_object->num_cmds = num_nav_cmds; - ig_object->cmds = calloc(num_nav_cmds, sizeof(MOBJ_CMD)); - memcpy(ig_object->cmds, nav_cmds, num_nav_cmds * sizeof(MOBJ_CMD)); - - p->pc = 0; - p->ig_object = ig_object; - p->object = ig_object; - - result = 0; + result = _set_object(p, num_nav_cmds, nav_cmds); } bd_mutex_unlock(&p->mutex); @@ -1129,6 +1161,11 @@ int hdmv_vm_running(HDMV_VM *p) { int result; + + if (!p) { + return 0; + } + bd_mutex_lock(&p->mutex); result = !!p->object; @@ -1140,7 +1177,11 @@ uint32_t hdmv_vm_get_uo_mask(HDMV_VM *p) { uint32_t mask = 0; - MOBJ_OBJECT *o = NULL; + const MOBJ_OBJECT *o = NULL; + + if (!p) { + return 0; + } bd_mutex_lock(&p->mutex); @@ -1156,6 +1197,11 @@ int hdmv_vm_resume(HDMV_VM *p) { int result; + + if (!p) { + return -1; + } + bd_mutex_lock(&p->mutex); result = _resume_from_play_pl(p); @@ -1167,6 +1213,11 @@ int hdmv_vm_suspend_pl(HDMV_VM *p) { int result = -1; + + if (!p) { + return -1; + } + bd_mutex_lock(&p->mutex); if (p->object || p->ig_object) { @@ -1256,6 +1307,11 @@ int hdmv_vm_run(HDMV_VM *p, HDMV_EVENT *ev) { int result; + + if (!p) { + return -1; + } + bd_mutex_lock(&p->mutex); result = _vm_run(p, ev); diff -Nru libbluray-0.5.0/src/libbluray/hdmv/hdmv_vm.h libbluray-0.6.2/src/libbluray/hdmv/hdmv_vm.h --- libbluray-0.5.0/src/libbluray/hdmv/hdmv_vm.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/hdmv/hdmv_vm.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_HDMV_VM_H_) #define _HDMV_VM_H_ -#include +#include "util/attributes.h" #include @@ -65,7 +65,6 @@ */ struct bd_registers_s; -struct indx_root_s; /* * @@ -73,10 +72,11 @@ typedef struct hdmv_vm_s HDMV_VM; -BD_PRIVATE HDMV_VM *hdmv_vm_init(const char *disc_root, struct bd_registers_s *regs, struct indx_root_s *indx); +BD_PRIVATE HDMV_VM *hdmv_vm_init(const char *disc_root, struct bd_registers_s *regs, + unsigned num_titles, unsigned first_play_available, unsigned top_menu_available); BD_PRIVATE void hdmv_vm_free(HDMV_VM **p); -BD_PRIVATE int hdmv_vm_select_object(HDMV_VM *p, int object); +BD_PRIVATE int hdmv_vm_select_object(HDMV_VM *p, uint32_t object); BD_PRIVATE int hdmv_vm_set_object(HDMV_VM *p, int num_nav_cmds, void *nav_cmds); BD_PRIVATE int hdmv_vm_run(HDMV_VM *p, HDMV_EVENT *ev); BD_PRIVATE int hdmv_vm_get_event(HDMV_VM *p, HDMV_EVENT *ev); diff -Nru libbluray-0.5.0/src/libbluray/hdmv/mobj_parse.c libbluray-0.6.2/src/libbluray/hdmv/mobj_parse.c --- libbluray-0.5.0/src/libbluray/hdmv/mobj_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/hdmv/mobj_parse.c 2014-09-01 12:06:01.000000000 +0000 @@ -17,11 +17,13 @@ * . */ +#include "mobj_parse.h" + #include "file/file.h" #include "util/bits.h" #include "util/logging.h" #include "util/macro.h" -#include "mobj_parse.h" +#include "util/strutl.h" #include #include @@ -87,6 +89,10 @@ obj->num_cmds = bs_read(bs, 16); obj->cmds = calloc(obj->num_cmds, sizeof(MOBJ_CMD)); + if (!obj->cmds) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); + return 0; + } for (i = 0; i < obj->num_cmds; i++) { uint8_t buf[12]; @@ -101,12 +107,14 @@ { if (p && *p) { - int i; - for (i = 0 ; i < (*p)->num_objects; i++) { - X_FREE((*p)->objects[i].cmds); - } + if ((*p)->objects) { + int i; + for (i = 0 ; i < (*p)->num_objects; i++) { + X_FREE((*p)->objects[i].cmds); + } - X_FREE((*p)->objects); + X_FREE((*p)->objects); + } X_FREE(*p); } @@ -134,6 +142,10 @@ goto error; } + if (extension_data_start) { + BD_DEBUG(DBG_NAV | DBG_CRIT, "MovieObject.bdmv: unknown extension data at %d\n", extension_data_start); + } + bs_seek_byte(&bs, 40); data_len = bs_read(&bs, 32); @@ -143,12 +155,21 @@ goto error; } + objects = calloc(1, sizeof(MOBJ_OBJECTS)); + if (!objects) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); + goto error; + } + bs_skip(&bs, 32); /* reserved */ num_objects = bs_read(&bs, 16); - objects = calloc(1, sizeof(MOBJ_OBJECTS)); objects->num_objects = num_objects; objects->objects = calloc(num_objects, sizeof(MOBJ_OBJECT)); + if (!objects->objects) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); + goto error; + } for (i = 0; i < objects->num_objects; i++) { if (!_mobj_parse_object(&bs, &objects->objects[i])) { @@ -167,22 +188,21 @@ return NULL; } -MOBJ_OBJECTS *mobj_parse(const char *file_name) +MOBJ_OBJECTS *mobj_parse(const char *disc_root) { - MOBJ_OBJECTS *objects = _mobj_parse(file_name); + MOBJ_OBJECTS *objects; + char *file; - /* if failed, try backup file */ - if (!objects) { - size_t len = strlen(file_name); - char *backup = malloc(len + 8); - - strcpy(backup, file_name); - strcpy(backup + len - 16, "BACKUP/MovieObject.bdmv"); - - objects = _mobj_parse(backup); - - X_FREE(backup); + file = str_printf("%s/BDMV/MovieObject.bdmv", disc_root); + objects = _mobj_parse(file); + X_FREE(file); + if (objects) { + return objects; } + /* if failed, try backup file */ + file = str_printf("%s/BDMV/BACKUP/MovieObject.bdmv", disc_root); + objects = _mobj_parse(file); + X_FREE(file); return objects; } diff -Nru libbluray-0.5.0/src/libbluray/hdmv/mobj_parse.h libbluray-0.6.2/src/libbluray/hdmv/mobj_parse.h --- libbluray-0.5.0/src/libbluray/hdmv/mobj_parse.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/hdmv/mobj_parse.h 2014-09-01 12:06:01.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_MOBJ_PARSE_H_) #define _MOBJ_PARSE_H_ -#include +#include "util/attributes.h" #include @@ -56,13 +56,13 @@ MOBJ_CMD *cmds; } MOBJ_OBJECT; -typedef struct { +typedef struct mobj_objects { uint16_t num_objects; MOBJ_OBJECT *objects; } MOBJ_OBJECTS; -BD_PRIVATE MOBJ_OBJECTS* mobj_parse(const char *path) BD_ATTR_MALLOC; /* parse MovieObject.bdmv */ +BD_PRIVATE MOBJ_OBJECTS* mobj_parse(const char *disc_root) BD_ATTR_MALLOC; /* parse MovieObject.bdmv */ BD_PRIVATE void mobj_parse_cmd(uint8_t *buf, MOBJ_CMD *cmd); BD_PRIVATE void mobj_free(MOBJ_OBJECTS **index); diff -Nru libbluray-0.5.0/src/libbluray/keys.h libbluray-0.6.2/src/libbluray/keys.h --- libbluray-0.5.0/src/libbluray/keys.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/keys.h 2014-09-01 12:06:01.000000000 +0000 @@ -54,6 +54,11 @@ /* Translated to BD_VK_ENTER if mouse is over valid button */ BD_VK_MOUSE_ACTIVATE = 17, + BD_VK_RED = 403, + BD_VK_GREEN = 404, + BD_VL_YELLOW = 405, + BD_VK_BLUE = 406, + } bd_vk_key_e; #endif // _BD_KEYS_H_ diff -Nru libbluray-0.5.0/src/libbluray/register.c libbluray-0.6.2/src/libbluray/register.c --- libbluray-0.5.0/src/libbluray/register.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/register.c 2014-09-01 12:06:01.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2010 hpi1 + * Copyright (C) 2010-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -165,9 +165,11 @@ { BD_REGISTERS *p = calloc(1, sizeof(BD_REGISTERS)); - memcpy(p->psr, bd_psr_init, sizeof(bd_psr_init)); + if (p) { + memcpy(p->psr, bd_psr_init, sizeof(bd_psr_init)); - bd_mutex_init(&p->mutex); + bd_mutex_init(&p->mutex); + } return p; } @@ -204,6 +206,7 @@ void bd_psr_register_cb (BD_REGISTERS *p, void (*callback)(void*,BD_PSR_EVENT*), void *cb_handle) { /* no duplicates ! */ + PSR_CB_DATA *cb; unsigned i; bd_psr_lock(p); @@ -216,11 +219,15 @@ } } - p->num_cb++; - p->cb = realloc(p->cb, p->num_cb * sizeof(PSR_CB_DATA)); - - p->cb[p->num_cb - 1].cb = callback; - p->cb[p->num_cb - 1].handle = cb_handle; + cb = realloc(p->cb, (p->num_cb + 1) * sizeof(PSR_CB_DATA)); + if (cb) { + p->cb = cb; + p->cb[p->num_cb].cb = callback; + p->cb[p->num_cb].handle = cb_handle; + p->num_cb++; + } else { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_psr_register_cb(): realloc failed\n"); + } bd_psr_unlock(p); } @@ -436,3 +443,21 @@ return bd_psr_setting_write(p, reg, val); } +int bd_psr_write_bits(BD_REGISTERS *p, int reg, uint32_t val, uint32_t mask) +{ + int result; + + if (mask == 0xffffffff) { + return bd_psr_write(p, reg, val); + } + + bd_psr_lock(p); + + uint32_t psr_value = bd_psr_read(p, reg); + psr_value = (psr_value & (~mask)) | (val & mask); + result = bd_psr_write(p, reg, psr_value); + + bd_psr_unlock(p); + + return result; +} diff -Nru libbluray-0.5.0/src/libbluray/register.h libbluray-0.6.2/src/libbluray/register.h --- libbluray-0.5.0/src/libbluray/register.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/libbluray/register.h 2014-09-01 12:06:01.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2010 hpi1 + * Copyright (C) 2010-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,7 +20,7 @@ #if !defined(_BD_REGISTER_H_) #define _BD_REGISTER_H_ -#include +#include "util/attributes.h" #include @@ -145,6 +145,22 @@ /** * + * Atomically change bits in player status register. + * + * Replace selected bits of player status register. + * New value for PSR is (CURRENT_PSR_VALUE & ~mask) | (val & mask) + * Writing to player setting registers will fail. + * + * @param registers BD_REGISTERS object + * @param reg register number + * @param val new value for register + * @param mask bit mask. bits to be written are set to 1. + * @return 0 on success, -1 on error (invalid register number) + */ +int bd_psr_write_bits(BD_REGISTERS *, int reg, uint32_t val, uint32_t mask); + +/** + * * Write to any PSR, including player setting registers. * * This should be called only by the application. diff -Nru libbluray-0.5.0/src/Makefile.am libbluray-0.6.2/src/Makefile.am --- libbluray-0.5.0/src/Makefile.am 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.6.2/src/Makefile.am 2014-09-01 12:06:01.000000000 +0000 @@ -1,5 +1,5 @@ SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT -SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibbluray -Ilibbluray/bdnav +SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibbluray -Ilibbluray/bdnav $(BDJAVA_CFLAGS) AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBXML2_CFLAGS) $(FT2_CFLAGS) @@ -51,6 +51,7 @@ libbluray/decoders/ig.h \ libbluray/decoders/ig_decode.h \ libbluray/decoders/ig_decode.c \ + libbluray/decoders/hdmv_pids.h \ libbluray/decoders/rle.h \ libbluray/decoders/rle.c \ libbluray/decoders/textst.h \ @@ -70,7 +71,7 @@ libbluray/hdmv/mobj_parse.c \ libbluray/hdmv/mobj_print.c \ file/file.h \ - file/file_posix.c \ + file/file.c \ file/dirs.h \ file/dl.h \ file/filesystem.h \ @@ -79,6 +80,8 @@ file/libaacs.c \ file/libbdplus.h \ file/libbdplus.c \ + util/array.h \ + util/array.c \ util/attributes.h \ util/refcnt.h \ util/refcnt.c \ @@ -86,6 +89,7 @@ util/strutl.h \ util/macro.h \ util/mutex.h \ + util/mutex.c \ util/time.h \ util/logging.c \ util/log_control.h \ @@ -95,17 +99,20 @@ if HAVE_DARWIN libbluray_la_SOURCES+= \ + file/file_posix.c \ file/dir_posix.c \ file/dl_posix.c \ file/dirs_darwin.c else if HAVE_WIN32 libbluray_la_SOURCES+= \ + file/file_win32.c \ file/dir_win32.c \ file/dl_win32.c \ file/dirs_win32.c else libbluray_la_SOURCES+= \ + file/file_posix.c \ file/dir_posix.c \ file/dl_posix.c \ file/dirs_xdg.c @@ -127,10 +134,10 @@ util/log_control.h if USING_BDJAVA -jardir=$(libdir)/libbluray/ -jar_DATA=$(top_builddir)/src/.libs/libbluray.jar +jardir=$(datadir)/java/ +jar_DATA=$(top_builddir)/src/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar -$(top_builddir)/src/.libs/libbluray.jar: all-local +$(top_builddir)/src/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar: all-local libbluray_la_SOURCES += \ libbluray/bdj/bdj.h \ @@ -159,12 +166,14 @@ -Dbuild='$(abs_builddir)/libbluray/bdj/build' \ -Ddist='$(abs_builddir)/.libs' \ -Dsrc_awt=:java-$(BDJ_TYPE) \ - -Dbootclasspath="$(BDJ_BOOTCLASSPATH)" + -Dbootclasspath="$(BDJ_BOOTCLASSPATH)" \ + -Dversion='$(BDJ_TYPE)-$(VERSION)' clean-local: ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \ -Dbuild='$(abs_builddir)/libbluray/bdj/build' \ -Ddist='$(abs_builddir)/.libs' \ + -Dversion='$(BDJ_TYPE)-$(VERSION)' \ clean endif @@ -210,20 +219,8 @@ examples/mpls_dump.c \ examples/util.c \ examples/util.h \ - file/file_posix.c \ - libbluray/bdnav/clpi_parse.c \ - libbluray/bdnav/extdata_parse.c \ - libbluray/bdnav/mpls_parse.c \ - util/bits.c \ - util/logging.c \ util/strutl.c -if HAVE_WIN32 -mpls_dump_SOURCES += \ - file/dir_win32.c -else -mpls_dump_SOURCES += \ - file/dir_posix.c -endif +mpls_dump_LDADD = libbluray.la clpi_dump_CFLAGS = $(AM_CFLAGS) clpi_dump_SOURCES = \ @@ -232,22 +229,25 @@ examples/util.h clpi_dump_LDADD = libbluray.la -index_dump_CFLAGS = $(AM_CFLAGS) -index_dump_SOURCES = \ - examples/index_dump.c \ - file/file_posix.c \ - libbluray/bdnav/index_parse.c \ - util/bits.c \ - util/logging.c +index_dump_SOURCES = examples/index_dump.c +index_dump_LDADD = libbluray.la mobj_dump_CFLAGS = $(AM_CFLAGS) mobj_dump_SOURCES = \ examples/mobj_dump.c \ - file/file_posix.c \ + file/file.c \ libbluray/hdmv/mobj_parse.c \ libbluray/hdmv/mobj_print.c \ util/bits.c \ - util/logging.c + util/logging.c \ + util/strutl.c +if HAVE_WIN32 +mobj_dump_SOURCES += \ + file/file_win32.c +else +mobj_dump_SOURCES += \ + file/file_posix.c +endif sound_dump_SOURCES = examples/sound_dump.c sound_dump_LDADD = libbluray.la diff -Nru libbluray-0.5.0/src/Makefile.in libbluray-0.6.2/src/Makefile.in --- libbluray-0.5.0/src/Makefile.in 2013-12-21 08:36:05.000000000 +0000 +++ libbluray-0.6.2/src/Makefile.in 2014-09-03 10:23:51.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,23 +18,51 @@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -55,16 +82,19 @@ build_triplet = @build@ host_triplet = @host@ @HAVE_DARWIN_TRUE@am__append_1 = \ +@HAVE_DARWIN_TRUE@ file/file_posix.c \ @HAVE_DARWIN_TRUE@ file/dir_posix.c \ @HAVE_DARWIN_TRUE@ file/dl_posix.c \ @HAVE_DARWIN_TRUE@ file/dirs_darwin.c @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__append_2 = \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/file_win32.c \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dir_win32.c \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dl_win32.c \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dirs_win32.c @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@am__append_3 = \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/file_posix.c \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dir_posix.c \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dl_posix.c \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dirs_xdg.c @@ -102,14 +132,15 @@ @USING_EXAMPLES_TRUE@bin_PROGRAMS = bd_info$(EXEEXT) @HAVE_WIN32_TRUE@@USING_EXAMPLES_TRUE@am__append_7 = \ -@HAVE_WIN32_TRUE@@USING_EXAMPLES_TRUE@ file/dir_win32.c +@HAVE_WIN32_TRUE@@USING_EXAMPLES_TRUE@ file/file_win32.c @HAVE_WIN32_FALSE@@USING_EXAMPLES_TRUE@am__append_8 = \ -@HAVE_WIN32_FALSE@@USING_EXAMPLES_TRUE@ file/dir_posix.c +@HAVE_WIN32_FALSE@@USING_EXAMPLES_TRUE@ file/file_posix.c subdir = src -DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/libbluray.pc.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(srcdir)/libbluray.pc.in $(top_srcdir)/build-aux/depcomp \ + $(pkginclude_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ @@ -179,8 +210,9 @@ libbluray/decoders/pg.h libbluray/decoders/pg_decode.h \ libbluray/decoders/pg_decode.c libbluray/decoders/ig.h \ libbluray/decoders/ig_decode.h libbluray/decoders/ig_decode.c \ - libbluray/decoders/rle.h libbluray/decoders/rle.c \ - libbluray/decoders/textst.h libbluray/decoders/textst_decode.h \ + libbluray/decoders/hdmv_pids.h libbluray/decoders/rle.h \ + libbluray/decoders/rle.c libbluray/decoders/textst.h \ + libbluray/decoders/textst_decode.h \ libbluray/decoders/textst_decode.c \ libbluray/decoders/textst_render.h \ libbluray/decoders/textst_render.c \ @@ -191,14 +223,15 @@ libbluray/hdmv/hdmv_insn.h libbluray/hdmv/hdmv_vm.h \ libbluray/hdmv/hdmv_vm.c libbluray/hdmv/mobj_parse.h \ libbluray/hdmv/mobj_parse.c libbluray/hdmv/mobj_print.c \ - file/file.h file/file_posix.c file/dirs.h file/dl.h \ + file/file.h file/file.c file/dirs.h file/dl.h \ file/filesystem.h file/filesystem.c file/libaacs.h \ - file/libaacs.c file/libbdplus.h file/libbdplus.c \ - util/attributes.h util/refcnt.h util/refcnt.c util/strutl.c \ - util/strutl.h util/macro.h util/mutex.h util/time.h \ - util/logging.c util/log_control.h util/bits.h util/bits.c \ - util/logging.h file/dir_posix.c file/dl_posix.c \ - file/dirs_darwin.c file/dir_win32.c file/dl_win32.c \ + file/libaacs.c file/libbdplus.h file/libbdplus.c util/array.h \ + util/array.c util/attributes.h util/refcnt.h util/refcnt.c \ + util/strutl.c util/strutl.h util/macro.h util/mutex.h \ + util/mutex.c util/time.h util/logging.c util/log_control.h \ + util/bits.h util/bits.c util/logging.h file/file_posix.c \ + file/dir_posix.c file/dl_posix.c file/dirs_darwin.c \ + file/file_win32.c file/dir_win32.c file/dl_win32.c \ file/dirs_win32.c file/dirs_xdg.c libbluray/bdj/bdj.h \ libbluray/bdj/bdj_private.h libbluray/bdj/bdj_util.h \ libbluray/bdj/bdj_util.c libbluray/bdj/bdj.c \ @@ -215,12 +248,15 @@ libbluray/bdj/native/register_native.h \ libbluray/bdj/native/register_native.c am__dirstamp = $(am__leading_dot)dirstamp -@HAVE_DARWIN_TRUE@am__objects_1 = file/dir_posix.lo file/dl_posix.lo \ -@HAVE_DARWIN_TRUE@ file/dirs_darwin.lo -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__objects_2 = file/dir_win32.lo \ +@HAVE_DARWIN_TRUE@am__objects_1 = file/file_posix.lo file/dir_posix.lo \ +@HAVE_DARWIN_TRUE@ file/dl_posix.lo file/dirs_darwin.lo +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__objects_2 = \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/file_win32.lo \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dir_win32.lo \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dl_win32.lo \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dirs_win32.lo @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@am__objects_3 = \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/file_posix.lo \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dir_posix.lo \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dl_posix.lo \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dirs_xdg.lo @@ -247,13 +283,17 @@ libbluray/decoders/graphics_processor.lo \ libbluray/decoders/graphics_controller.lo \ libbluray/hdmv/hdmv_vm.lo libbluray/hdmv/mobj_parse.lo \ - libbluray/hdmv/mobj_print.lo file/file_posix.lo \ - file/filesystem.lo file/libaacs.lo file/libbdplus.lo \ - util/refcnt.lo util/strutl.lo util/logging.lo util/bits.lo \ + libbluray/hdmv/mobj_print.lo file/file.lo file/filesystem.lo \ + file/libaacs.lo file/libbdplus.lo util/array.lo util/refcnt.lo \ + util/strutl.lo util/mutex.lo util/logging.lo util/bits.lo \ $(am__objects_1) $(am__objects_2) $(am__objects_3) \ $(am__objects_4) libbluray_la_OBJECTS = $(am_libbluray_la_OBJECTS) -libbluray_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libbluray_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libbluray_la_LDFLAGS) $(LDFLAGS) -o $@ @USING_BDJAVA_TRUE@@USING_EXAMPLES_TRUE@am__EXEEXT_1 = \ @@ -280,7 +320,7 @@ @USING_EXAMPLES_TRUE@ examples/clpi_dump-util.$(OBJEXT) clpi_dump_OBJECTS = $(am_clpi_dump_OBJECTS) @USING_EXAMPLES_TRUE@clpi_dump_DEPENDENCIES = libbluray.la -clpi_dump_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +clpi_dump_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(clpi_dump_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__hdmv_test_SOURCES_DIST = examples/hdmv_test.c @@ -288,19 +328,11 @@ @USING_EXAMPLES_TRUE@ examples/hdmv_test.$(OBJEXT) hdmv_test_OBJECTS = $(am_hdmv_test_OBJECTS) @USING_EXAMPLES_TRUE@hdmv_test_DEPENDENCIES = libbluray.la -am__index_dump_SOURCES_DIST = examples/index_dump.c file/file_posix.c \ - libbluray/bdnav/index_parse.c util/bits.c util/logging.c +am__index_dump_SOURCES_DIST = examples/index_dump.c @USING_EXAMPLES_TRUE@am_index_dump_OBJECTS = \ -@USING_EXAMPLES_TRUE@ examples/index_dump-index_dump.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ file/index_dump-file_posix.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/index_dump-index_parse.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/index_dump-bits.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/index_dump-logging.$(OBJEXT) +@USING_EXAMPLES_TRUE@ examples/index_dump.$(OBJEXT) index_dump_OBJECTS = $(am_index_dump_OBJECTS) -index_dump_LDADD = $(LDADD) -index_dump_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(index_dump_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +@USING_EXAMPLES_TRUE@index_dump_DEPENDENCIES = libbluray.la am__libbluray_test_SOURCES_DIST = examples/libbluray_test.c @USING_EXAMPLES_TRUE@am_libbluray_test_OBJECTS = \ @USING_EXAMPLES_TRUE@ examples/libbluray_test.$(OBJEXT) @@ -311,42 +343,35 @@ @USING_EXAMPLES_TRUE@ examples/list_titles.$(OBJEXT) list_titles_OBJECTS = $(am_list_titles_OBJECTS) @USING_EXAMPLES_TRUE@list_titles_DEPENDENCIES = libbluray.la -am__mobj_dump_SOURCES_DIST = examples/mobj_dump.c file/file_posix.c \ +am__mobj_dump_SOURCES_DIST = examples/mobj_dump.c file/file.c \ libbluray/hdmv/mobj_parse.c libbluray/hdmv/mobj_print.c \ - util/bits.c util/logging.c + util/bits.c util/logging.c util/strutl.c file/file_win32.c \ + file/file_posix.c +@HAVE_WIN32_TRUE@@USING_EXAMPLES_TRUE@am__objects_5 = file/mobj_dump-file_win32.$(OBJEXT) +@HAVE_WIN32_FALSE@@USING_EXAMPLES_TRUE@am__objects_6 = file/mobj_dump-file_posix.$(OBJEXT) @USING_EXAMPLES_TRUE@am_mobj_dump_OBJECTS = \ @USING_EXAMPLES_TRUE@ examples/mobj_dump-mobj_dump.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ file/mobj_dump-file_posix.$(OBJEXT) \ +@USING_EXAMPLES_TRUE@ file/mobj_dump-file.$(OBJEXT) \ @USING_EXAMPLES_TRUE@ libbluray/hdmv/mobj_dump-mobj_parse.$(OBJEXT) \ @USING_EXAMPLES_TRUE@ libbluray/hdmv/mobj_dump-mobj_print.$(OBJEXT) \ @USING_EXAMPLES_TRUE@ util/mobj_dump-bits.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/mobj_dump-logging.$(OBJEXT) +@USING_EXAMPLES_TRUE@ util/mobj_dump-logging.$(OBJEXT) \ +@USING_EXAMPLES_TRUE@ util/mobj_dump-strutl.$(OBJEXT) \ +@USING_EXAMPLES_TRUE@ $(am__objects_5) $(am__objects_6) mobj_dump_OBJECTS = $(am_mobj_dump_OBJECTS) mobj_dump_LDADD = $(LDADD) -mobj_dump_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +mobj_dump_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mobj_dump_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__mpls_dump_SOURCES_DIST = examples/mpls_dump.c examples/util.c \ - examples/util.h file/file_posix.c libbluray/bdnav/clpi_parse.c \ - libbluray/bdnav/extdata_parse.c libbluray/bdnav/mpls_parse.c \ - util/bits.c util/logging.c util/strutl.c file/dir_win32.c \ - file/dir_posix.c -@HAVE_WIN32_TRUE@@USING_EXAMPLES_TRUE@am__objects_5 = file/mpls_dump-dir_win32.$(OBJEXT) -@HAVE_WIN32_FALSE@@USING_EXAMPLES_TRUE@am__objects_6 = file/mpls_dump-dir_posix.$(OBJEXT) + examples/util.h util/strutl.c @USING_EXAMPLES_TRUE@am_mpls_dump_OBJECTS = \ @USING_EXAMPLES_TRUE@ examples/mpls_dump-mpls_dump.$(OBJEXT) \ @USING_EXAMPLES_TRUE@ examples/mpls_dump-util.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ file/mpls_dump-file_posix.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/mpls_dump-clpi_parse.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/mpls_dump-extdata_parse.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/mpls_dump-mpls_parse.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/mpls_dump-bits.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/mpls_dump-logging.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/mpls_dump-strutl.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ $(am__objects_5) $(am__objects_6) +@USING_EXAMPLES_TRUE@ util/mpls_dump-strutl.$(OBJEXT) mpls_dump_OBJECTS = $(am_mpls_dump_OBJECTS) -mpls_dump_LDADD = $(LDADD) -mpls_dump_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +@USING_EXAMPLES_TRUE@mpls_dump_DEPENDENCIES = libbluray.la +mpls_dump_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mpls_dump_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__sound_dump_SOURCES_DIST = examples/sound_dump.c @@ -354,19 +379,40 @@ @USING_EXAMPLES_TRUE@ examples/sound_dump.$(OBJEXT) sound_dump_OBJECTS = $(am_sound_dump_OBJECTS) @USING_EXAMPLES_TRUE@sound_dump_DEPENDENCIES = libbluray.la +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libbluray_la_SOURCES) $(bd_info_SOURCES) \ $(bdj_test_SOURCES) $(bdsplice_SOURCES) $(clpi_dump_SOURCES) \ $(hdmv_test_SOURCES) $(index_dump_SOURCES) \ @@ -387,11 +433,29 @@ esac DATA = $(jar_DATA) $(pkgconfig_DATA) HEADERS = $(pkginclude_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -448,6 +512,7 @@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_LIBS = @FT2_LIBS@ GREP = @GREP@ +HAVE_ANT = @HAVE_ANT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -544,7 +609,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT -SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibbluray -Ilibbluray/bdnav +SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibbluray -Ilibbluray/bdnav $(BDJAVA_CFLAGS) AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBXML2_CFLAGS) \ $(FT2_CFLAGS) $(am__append_5) EXTRA_DIST = \ @@ -576,8 +641,9 @@ libbluray/decoders/pg.h libbluray/decoders/pg_decode.h \ libbluray/decoders/pg_decode.c libbluray/decoders/ig.h \ libbluray/decoders/ig_decode.h libbluray/decoders/ig_decode.c \ - libbluray/decoders/rle.h libbluray/decoders/rle.c \ - libbluray/decoders/textst.h libbluray/decoders/textst_decode.h \ + libbluray/decoders/hdmv_pids.h libbluray/decoders/rle.h \ + libbluray/decoders/rle.c libbluray/decoders/textst.h \ + libbluray/decoders/textst_decode.h \ libbluray/decoders/textst_decode.c \ libbluray/decoders/textst_render.h \ libbluray/decoders/textst_render.c \ @@ -588,14 +654,14 @@ libbluray/hdmv/hdmv_insn.h libbluray/hdmv/hdmv_vm.h \ libbluray/hdmv/hdmv_vm.c libbluray/hdmv/mobj_parse.h \ libbluray/hdmv/mobj_parse.c libbluray/hdmv/mobj_print.c \ - file/file.h file/file_posix.c file/dirs.h file/dl.h \ + file/file.h file/file.c file/dirs.h file/dl.h \ file/filesystem.h file/filesystem.c file/libaacs.h \ - file/libaacs.c file/libbdplus.h file/libbdplus.c \ - util/attributes.h util/refcnt.h util/refcnt.c util/strutl.c \ - util/strutl.h util/macro.h util/mutex.h util/time.h \ - util/logging.c util/log_control.h util/bits.h util/bits.c \ - util/logging.h $(am__append_1) $(am__append_2) $(am__append_3) \ - $(am__append_4) + file/libaacs.c file/libbdplus.h file/libbdplus.c util/array.h \ + util/array.c util/attributes.h util/refcnt.h util/refcnt.c \ + util/strutl.c util/strutl.h util/macro.h util/mutex.h \ + util/mutex.c util/time.h util/logging.c util/log_control.h \ + util/bits.h util/bits.c util/logging.h $(am__append_1) \ + $(am__append_2) $(am__append_3) $(am__append_4) libbluray_la_LDFLAGS = -version-info $(LT_VERSION_INFO) libbluray_la_LIBADD = $(LIBXML2_LIBS) $(FT2_LIBS) pkginclude_HEADERS = \ @@ -608,21 +674,20 @@ libbluray/keys.h \ util/log_control.h -@USING_BDJAVA_TRUE@jardir = $(libdir)/libbluray/ -@USING_BDJAVA_TRUE@jar_DATA = $(top_builddir)/src/.libs/libbluray.jar +@USING_BDJAVA_TRUE@jardir = $(datadir)/java/ +@USING_BDJAVA_TRUE@jar_DATA = $(top_builddir)/src/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libbluray.pc @USING_EXAMPLES_TRUE@bdsplice_SOURCES = examples/bdsplice.c @USING_EXAMPLES_TRUE@bdsplice_LDADD = libbluray.la @USING_EXAMPLES_TRUE@mpls_dump_CFLAGS = $(AM_CFLAGS) -@USING_EXAMPLES_TRUE@mpls_dump_SOURCES = examples/mpls_dump.c \ -@USING_EXAMPLES_TRUE@ examples/util.c examples/util.h \ -@USING_EXAMPLES_TRUE@ file/file_posix.c \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/clpi_parse.c \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/extdata_parse.c \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/mpls_parse.c util/bits.c \ -@USING_EXAMPLES_TRUE@ util/logging.c util/strutl.c \ -@USING_EXAMPLES_TRUE@ $(am__append_7) $(am__append_8) +@USING_EXAMPLES_TRUE@mpls_dump_SOURCES = \ +@USING_EXAMPLES_TRUE@ examples/mpls_dump.c \ +@USING_EXAMPLES_TRUE@ examples/util.c \ +@USING_EXAMPLES_TRUE@ examples/util.h \ +@USING_EXAMPLES_TRUE@ util/strutl.c + +@USING_EXAMPLES_TRUE@mpls_dump_LDADD = libbluray.la @USING_EXAMPLES_TRUE@clpi_dump_CFLAGS = $(AM_CFLAGS) @USING_EXAMPLES_TRUE@clpi_dump_SOURCES = \ @USING_EXAMPLES_TRUE@ examples/clpi_dump.c \ @@ -630,23 +695,14 @@ @USING_EXAMPLES_TRUE@ examples/util.h @USING_EXAMPLES_TRUE@clpi_dump_LDADD = libbluray.la -@USING_EXAMPLES_TRUE@index_dump_CFLAGS = $(AM_CFLAGS) -@USING_EXAMPLES_TRUE@index_dump_SOURCES = \ -@USING_EXAMPLES_TRUE@ examples/index_dump.c \ -@USING_EXAMPLES_TRUE@ file/file_posix.c \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/index_parse.c \ -@USING_EXAMPLES_TRUE@ util/bits.c \ -@USING_EXAMPLES_TRUE@ util/logging.c - +@USING_EXAMPLES_TRUE@index_dump_SOURCES = examples/index_dump.c +@USING_EXAMPLES_TRUE@index_dump_LDADD = libbluray.la @USING_EXAMPLES_TRUE@mobj_dump_CFLAGS = $(AM_CFLAGS) -@USING_EXAMPLES_TRUE@mobj_dump_SOURCES = \ -@USING_EXAMPLES_TRUE@ examples/mobj_dump.c \ -@USING_EXAMPLES_TRUE@ file/file_posix.c \ -@USING_EXAMPLES_TRUE@ libbluray/hdmv/mobj_parse.c \ -@USING_EXAMPLES_TRUE@ libbluray/hdmv/mobj_print.c \ -@USING_EXAMPLES_TRUE@ util/bits.c \ -@USING_EXAMPLES_TRUE@ util/logging.c - +@USING_EXAMPLES_TRUE@mobj_dump_SOURCES = examples/mobj_dump.c \ +@USING_EXAMPLES_TRUE@ file/file.c libbluray/hdmv/mobj_parse.c \ +@USING_EXAMPLES_TRUE@ libbluray/hdmv/mobj_print.c util/bits.c \ +@USING_EXAMPLES_TRUE@ util/logging.c util/strutl.c \ +@USING_EXAMPLES_TRUE@ $(am__append_7) $(am__append_8) @USING_EXAMPLES_TRUE@sound_dump_SOURCES = examples/sound_dump.c @USING_EXAMPLES_TRUE@sound_dump_LDADD = libbluray.la @USING_EXAMPLES_TRUE@libbluray_test_SOURCES = examples/libbluray_test.c @@ -695,6 +751,7 @@ $(am__aclocal_m4_deps): libbluray.pc: $(top_builddir)/config.status $(srcdir)/libbluray.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ @@ -721,12 +778,14 @@ clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } libbluray/$(am__dirstamp): @$(MKDIR_P) libbluray @: > libbluray/$(am__dirstamp) @@ -807,8 +866,7 @@ file/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) file/$(DEPDIR) @: > file/$(DEPDIR)/$(am__dirstamp) -file/file_posix.lo: file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) +file/file.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) file/filesystem.lo: file/$(am__dirstamp) \ file/$(DEPDIR)/$(am__dirstamp) file/libaacs.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) @@ -819,14 +877,20 @@ util/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) util/$(DEPDIR) @: > util/$(DEPDIR)/$(am__dirstamp) +util/array.lo: util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) util/refcnt.lo: util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) util/strutl.lo: util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) +util/mutex.lo: util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) util/logging.lo: util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) util/bits.lo: util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) +file/file_posix.lo: file/$(am__dirstamp) \ + file/$(DEPDIR)/$(am__dirstamp) file/dir_posix.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) file/dl_posix.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) file/dirs_darwin.lo: file/$(am__dirstamp) \ file/$(DEPDIR)/$(am__dirstamp) +file/file_win32.lo: file/$(am__dirstamp) \ + file/$(DEPDIR)/$(am__dirstamp) file/dir_win32.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) file/dl_win32.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) file/dirs_win32.lo: file/$(am__dirstamp) \ @@ -865,8 +929,9 @@ libbluray/bdj/native/register_native.lo: \ libbluray/bdj/native/$(am__dirstamp) \ libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) + libbluray.la: $(libbluray_la_OBJECTS) $(libbluray_la_DEPENDENCIES) $(EXTRA_libbluray_la_DEPENDENCIES) - $(libbluray_la_LINK) -rpath $(libdir) $(libbluray_la_OBJECTS) $(libbluray_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libbluray_la_LINK) -rpath $(libdir) $(libbluray_la_OBJECTS) $(libbluray_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -876,10 +941,12 @@ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ @@ -900,7 +967,8 @@ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ + -e 's/$$/$(EXEEXT)/' \ + `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files @@ -930,58 +998,57 @@ @: > examples/$(DEPDIR)/$(am__dirstamp) examples/bd_info.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) + bd_info$(EXEEXT): $(bd_info_OBJECTS) $(bd_info_DEPENDENCIES) $(EXTRA_bd_info_DEPENDENCIES) @rm -f bd_info$(EXEEXT) - $(LINK) $(bd_info_OBJECTS) $(bd_info_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(bd_info_OBJECTS) $(bd_info_LDADD) $(LIBS) examples/bdj_test.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) + bdj_test$(EXEEXT): $(bdj_test_OBJECTS) $(bdj_test_DEPENDENCIES) $(EXTRA_bdj_test_DEPENDENCIES) @rm -f bdj_test$(EXEEXT) - $(LINK) $(bdj_test_OBJECTS) $(bdj_test_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(bdj_test_OBJECTS) $(bdj_test_LDADD) $(LIBS) examples/bdsplice.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) + bdsplice$(EXEEXT): $(bdsplice_OBJECTS) $(bdsplice_DEPENDENCIES) $(EXTRA_bdsplice_DEPENDENCIES) @rm -f bdsplice$(EXEEXT) - $(LINK) $(bdsplice_OBJECTS) $(bdsplice_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(bdsplice_OBJECTS) $(bdsplice_LDADD) $(LIBS) examples/clpi_dump-clpi_dump.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) examples/clpi_dump-util.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) + clpi_dump$(EXEEXT): $(clpi_dump_OBJECTS) $(clpi_dump_DEPENDENCIES) $(EXTRA_clpi_dump_DEPENDENCIES) @rm -f clpi_dump$(EXEEXT) - $(clpi_dump_LINK) $(clpi_dump_OBJECTS) $(clpi_dump_LDADD) $(LIBS) + $(AM_V_CCLD)$(clpi_dump_LINK) $(clpi_dump_OBJECTS) $(clpi_dump_LDADD) $(LIBS) examples/hdmv_test.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) + hdmv_test$(EXEEXT): $(hdmv_test_OBJECTS) $(hdmv_test_DEPENDENCIES) $(EXTRA_hdmv_test_DEPENDENCIES) @rm -f hdmv_test$(EXEEXT) - $(LINK) $(hdmv_test_OBJECTS) $(hdmv_test_LDADD) $(LIBS) -examples/index_dump-index_dump.$(OBJEXT): examples/$(am__dirstamp) \ + $(AM_V_CCLD)$(LINK) $(hdmv_test_OBJECTS) $(hdmv_test_LDADD) $(LIBS) +examples/index_dump.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) -file/index_dump-file_posix.$(OBJEXT): file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/index_dump-index_parse.$(OBJEXT): \ - libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -util/index_dump-bits.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) -util/index_dump-logging.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) + index_dump$(EXEEXT): $(index_dump_OBJECTS) $(index_dump_DEPENDENCIES) $(EXTRA_index_dump_DEPENDENCIES) @rm -f index_dump$(EXEEXT) - $(index_dump_LINK) $(index_dump_OBJECTS) $(index_dump_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(index_dump_OBJECTS) $(index_dump_LDADD) $(LIBS) examples/libbluray_test.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) + libbluray_test$(EXEEXT): $(libbluray_test_OBJECTS) $(libbluray_test_DEPENDENCIES) $(EXTRA_libbluray_test_DEPENDENCIES) @rm -f libbluray_test$(EXEEXT) - $(LINK) $(libbluray_test_OBJECTS) $(libbluray_test_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(libbluray_test_OBJECTS) $(libbluray_test_LDADD) $(LIBS) examples/list_titles.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) + list_titles$(EXEEXT): $(list_titles_OBJECTS) $(list_titles_DEPENDENCIES) $(EXTRA_list_titles_DEPENDENCIES) @rm -f list_titles$(EXEEXT) - $(LINK) $(list_titles_OBJECTS) $(list_titles_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(list_titles_OBJECTS) $(list_titles_LDADD) $(LIBS) examples/mobj_dump-mobj_dump.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) -file/mobj_dump-file_posix.$(OBJEXT): file/$(am__dirstamp) \ +file/mobj_dump-file.$(OBJEXT): file/$(am__dirstamp) \ file/$(DEPDIR)/$(am__dirstamp) libbluray/hdmv/mobj_dump-mobj_parse.$(OBJEXT): \ libbluray/hdmv/$(am__dirstamp) \ @@ -993,168 +1060,52 @@ util/$(DEPDIR)/$(am__dirstamp) util/mobj_dump-logging.$(OBJEXT): util/$(am__dirstamp) \ util/$(DEPDIR)/$(am__dirstamp) +util/mobj_dump-strutl.$(OBJEXT): util/$(am__dirstamp) \ + util/$(DEPDIR)/$(am__dirstamp) +file/mobj_dump-file_win32.$(OBJEXT): file/$(am__dirstamp) \ + file/$(DEPDIR)/$(am__dirstamp) +file/mobj_dump-file_posix.$(OBJEXT): file/$(am__dirstamp) \ + file/$(DEPDIR)/$(am__dirstamp) + mobj_dump$(EXEEXT): $(mobj_dump_OBJECTS) $(mobj_dump_DEPENDENCIES) $(EXTRA_mobj_dump_DEPENDENCIES) @rm -f mobj_dump$(EXEEXT) - $(mobj_dump_LINK) $(mobj_dump_OBJECTS) $(mobj_dump_LDADD) $(LIBS) + $(AM_V_CCLD)$(mobj_dump_LINK) $(mobj_dump_OBJECTS) $(mobj_dump_LDADD) $(LIBS) examples/mpls_dump-mpls_dump.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) examples/mpls_dump-util.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) -file/mpls_dump-file_posix.$(OBJEXT): file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/mpls_dump-clpi_parse.$(OBJEXT): \ - libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/mpls_dump-extdata_parse.$(OBJEXT): \ - libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/mpls_dump-mpls_parse.$(OBJEXT): \ - libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -util/mpls_dump-bits.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) -util/mpls_dump-logging.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) util/mpls_dump-strutl.$(OBJEXT): util/$(am__dirstamp) \ util/$(DEPDIR)/$(am__dirstamp) -file/mpls_dump-dir_win32.$(OBJEXT): file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -file/mpls_dump-dir_posix.$(OBJEXT): file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) + mpls_dump$(EXEEXT): $(mpls_dump_OBJECTS) $(mpls_dump_DEPENDENCIES) $(EXTRA_mpls_dump_DEPENDENCIES) @rm -f mpls_dump$(EXEEXT) - $(mpls_dump_LINK) $(mpls_dump_OBJECTS) $(mpls_dump_LDADD) $(LIBS) + $(AM_V_CCLD)$(mpls_dump_LINK) $(mpls_dump_OBJECTS) $(mpls_dump_LDADD) $(LIBS) examples/sound_dump.$(OBJEXT): examples/$(am__dirstamp) \ examples/$(DEPDIR)/$(am__dirstamp) + sound_dump$(EXEEXT): $(sound_dump_OBJECTS) $(sound_dump_DEPENDENCIES) $(EXTRA_sound_dump_DEPENDENCIES) @rm -f sound_dump$(EXEEXT) - $(LINK) $(sound_dump_OBJECTS) $(sound_dump_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(sound_dump_OBJECTS) $(sound_dump_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) - -rm -f examples/bd_info.$(OBJEXT) - -rm -f examples/bdj_test.$(OBJEXT) - -rm -f examples/bdsplice.$(OBJEXT) - -rm -f examples/clpi_dump-clpi_dump.$(OBJEXT) - -rm -f examples/clpi_dump-util.$(OBJEXT) - -rm -f examples/hdmv_test.$(OBJEXT) - -rm -f examples/index_dump-index_dump.$(OBJEXT) - -rm -f examples/libbluray_test.$(OBJEXT) - -rm -f examples/list_titles.$(OBJEXT) - -rm -f examples/mobj_dump-mobj_dump.$(OBJEXT) - -rm -f examples/mpls_dump-mpls_dump.$(OBJEXT) - -rm -f examples/mpls_dump-util.$(OBJEXT) - -rm -f examples/sound_dump.$(OBJEXT) - -rm -f file/dir_posix.$(OBJEXT) - -rm -f file/dir_posix.lo - -rm -f file/dir_win32.$(OBJEXT) - -rm -f file/dir_win32.lo - -rm -f file/dirs_darwin.$(OBJEXT) - -rm -f file/dirs_darwin.lo - -rm -f file/dirs_win32.$(OBJEXT) - -rm -f file/dirs_win32.lo - -rm -f file/dirs_xdg.$(OBJEXT) - -rm -f file/dirs_xdg.lo - -rm -f file/dl_posix.$(OBJEXT) - -rm -f file/dl_posix.lo - -rm -f file/dl_win32.$(OBJEXT) - -rm -f file/dl_win32.lo - -rm -f file/file_posix.$(OBJEXT) - -rm -f file/file_posix.lo - -rm -f file/filesystem.$(OBJEXT) - -rm -f file/filesystem.lo - -rm -f file/index_dump-file_posix.$(OBJEXT) - -rm -f file/libaacs.$(OBJEXT) - -rm -f file/libaacs.lo - -rm -f file/libbdplus.$(OBJEXT) - -rm -f file/libbdplus.lo - -rm -f file/mobj_dump-file_posix.$(OBJEXT) - -rm -f file/mpls_dump-dir_posix.$(OBJEXT) - -rm -f file/mpls_dump-dir_win32.$(OBJEXT) - -rm -f file/mpls_dump-file_posix.$(OBJEXT) - -rm -f libbluray/bdj/bdj.$(OBJEXT) - -rm -f libbluray/bdj/bdj.lo - -rm -f libbluray/bdj/bdj_util.$(OBJEXT) - -rm -f libbluray/bdj/bdj_util.lo - -rm -f libbluray/bdj/bdjo_parser.$(OBJEXT) - -rm -f libbluray/bdj/bdjo_parser.lo - -rm -f libbluray/bdj/native/java_awt_BDFontMetrics.$(OBJEXT) - -rm -f libbluray/bdj/native/java_awt_BDFontMetrics.lo - -rm -f libbluray/bdj/native/java_awt_BDGraphics.$(OBJEXT) - -rm -f libbluray/bdj/native/java_awt_BDGraphics.lo - -rm -f libbluray/bdj/native/org_videolan_Libbluray.$(OBJEXT) - -rm -f libbluray/bdj/native/org_videolan_Libbluray.lo - -rm -f libbluray/bdj/native/org_videolan_Logger.$(OBJEXT) - -rm -f libbluray/bdj/native/org_videolan_Logger.lo - -rm -f libbluray/bdj/native/register_native.$(OBJEXT) - -rm -f libbluray/bdj/native/register_native.lo - -rm -f libbluray/bdnav/bdid_parse.$(OBJEXT) - -rm -f libbluray/bdnav/bdid_parse.lo - -rm -f libbluray/bdnav/clpi_parse.$(OBJEXT) - -rm -f libbluray/bdnav/clpi_parse.lo - -rm -f libbluray/bdnav/extdata_parse.$(OBJEXT) - -rm -f libbluray/bdnav/extdata_parse.lo - -rm -f libbluray/bdnav/index_dump-index_parse.$(OBJEXT) - -rm -f libbluray/bdnav/index_parse.$(OBJEXT) - -rm -f libbluray/bdnav/index_parse.lo - -rm -f libbluray/bdnav/meta_parse.$(OBJEXT) - -rm -f libbluray/bdnav/meta_parse.lo - -rm -f libbluray/bdnav/mpls_dump-clpi_parse.$(OBJEXT) - -rm -f libbluray/bdnav/mpls_dump-extdata_parse.$(OBJEXT) - -rm -f libbluray/bdnav/mpls_dump-mpls_parse.$(OBJEXT) - -rm -f libbluray/bdnav/mpls_parse.$(OBJEXT) - -rm -f libbluray/bdnav/mpls_parse.lo - -rm -f libbluray/bdnav/navigation.$(OBJEXT) - -rm -f libbluray/bdnav/navigation.lo - -rm -f libbluray/bdnav/sound_parse.$(OBJEXT) - -rm -f libbluray/bdnav/sound_parse.lo - -rm -f libbluray/bluray.$(OBJEXT) - -rm -f libbluray/bluray.lo - -rm -f libbluray/decoders/graphics_controller.$(OBJEXT) - -rm -f libbluray/decoders/graphics_controller.lo - -rm -f libbluray/decoders/graphics_processor.$(OBJEXT) - -rm -f libbluray/decoders/graphics_processor.lo - -rm -f libbluray/decoders/ig_decode.$(OBJEXT) - -rm -f libbluray/decoders/ig_decode.lo - -rm -f libbluray/decoders/m2ts_demux.$(OBJEXT) - -rm -f libbluray/decoders/m2ts_demux.lo - -rm -f libbluray/decoders/m2ts_filter.$(OBJEXT) - -rm -f libbluray/decoders/m2ts_filter.lo - -rm -f libbluray/decoders/pes_buffer.$(OBJEXT) - -rm -f libbluray/decoders/pes_buffer.lo - -rm -f libbluray/decoders/pg_decode.$(OBJEXT) - -rm -f libbluray/decoders/pg_decode.lo - -rm -f libbluray/decoders/rle.$(OBJEXT) - -rm -f libbluray/decoders/rle.lo - -rm -f libbluray/decoders/textst_decode.$(OBJEXT) - -rm -f libbluray/decoders/textst_decode.lo - -rm -f libbluray/decoders/textst_render.$(OBJEXT) - -rm -f libbluray/decoders/textst_render.lo - -rm -f libbluray/hdmv/hdmv_vm.$(OBJEXT) - -rm -f libbluray/hdmv/hdmv_vm.lo - -rm -f libbluray/hdmv/mobj_dump-mobj_parse.$(OBJEXT) - -rm -f libbluray/hdmv/mobj_dump-mobj_print.$(OBJEXT) - -rm -f libbluray/hdmv/mobj_parse.$(OBJEXT) - -rm -f libbluray/hdmv/mobj_parse.lo - -rm -f libbluray/hdmv/mobj_print.$(OBJEXT) - -rm -f libbluray/hdmv/mobj_print.lo - -rm -f libbluray/register.$(OBJEXT) - -rm -f libbluray/register.lo - -rm -f util/bits.$(OBJEXT) - -rm -f util/bits.lo - -rm -f util/index_dump-bits.$(OBJEXT) - -rm -f util/index_dump-logging.$(OBJEXT) - -rm -f util/logging.$(OBJEXT) - -rm -f util/logging.lo - -rm -f util/mobj_dump-bits.$(OBJEXT) - -rm -f util/mobj_dump-logging.$(OBJEXT) - -rm -f util/mpls_dump-bits.$(OBJEXT) - -rm -f util/mpls_dump-logging.$(OBJEXT) - -rm -f util/mpls_dump-strutl.$(OBJEXT) - -rm -f util/refcnt.$(OBJEXT) - -rm -f util/refcnt.lo - -rm -f util/strutl.$(OBJEXT) - -rm -f util/strutl.lo + -rm -f examples/*.$(OBJEXT) + -rm -f file/*.$(OBJEXT) + -rm -f file/*.lo + -rm -f libbluray/*.$(OBJEXT) + -rm -f libbluray/*.lo + -rm -f libbluray/bdj/*.$(OBJEXT) + -rm -f libbluray/bdj/*.lo + -rm -f libbluray/bdj/native/*.$(OBJEXT) + -rm -f libbluray/bdj/native/*.lo + -rm -f libbluray/bdnav/*.$(OBJEXT) + -rm -f libbluray/bdnav/*.lo + -rm -f libbluray/decoders/*.$(OBJEXT) + -rm -f libbluray/decoders/*.lo + -rm -f libbluray/hdmv/*.$(OBJEXT) + -rm -f libbluray/hdmv/*.lo + -rm -f util/*.$(OBJEXT) + -rm -f util/*.lo distclean-compile: -rm -f *.tab.c @@ -1165,7 +1116,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/clpi_dump-clpi_dump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/clpi_dump-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/hdmv_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/index_dump-index_dump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/index_dump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/libbluray_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/list_titles.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/mobj_dump-mobj_dump.Po@am__quote@ @@ -1179,15 +1130,15 @@ @AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dirs_xdg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dl_posix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dl_win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/file_posix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/file_win32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/filesystem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/index_dump-file_posix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/libaacs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/libbdplus.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/mobj_dump-file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/mobj_dump-file_posix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/mpls_dump-dir_posix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/mpls_dump-dir_win32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/mpls_dump-file_posix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/mobj_dump-file_win32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/$(DEPDIR)/bluray.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/$(DEPDIR)/register.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdj/$(DEPDIR)/bdj.Plo@am__quote@ @@ -1201,12 +1152,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/bdid_parse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/clpi_parse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/extdata_parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/index_parse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/meta_parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/mpls_parse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/navigation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/sound_parse.Plo@am__quote@ @@ -1225,377 +1172,236 @@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/hdmv/$(DEPDIR)/mobj_parse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libbluray/hdmv/$(DEPDIR)/mobj_print.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/array.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/bits.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/index_dump-bits.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/index_dump-logging.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/logging.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/mobj_dump-bits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/mobj_dump-logging.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/mpls_dump-bits.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/mpls_dump-logging.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/mobj_dump-strutl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/mpls_dump-strutl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/mutex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/refcnt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/strutl.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< examples/clpi_dump-clpi_dump.o: examples/clpi_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT examples/clpi_dump-clpi_dump.o -MD -MP -MF examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo -c -o examples/clpi_dump-clpi_dump.o `test -f 'examples/clpi_dump.c' || echo '$(srcdir)/'`examples/clpi_dump.c -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo examples/$(DEPDIR)/clpi_dump-clpi_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/clpi_dump.c' object='examples/clpi_dump-clpi_dump.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT examples/clpi_dump-clpi_dump.o -MD -MP -MF examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo -c -o examples/clpi_dump-clpi_dump.o `test -f 'examples/clpi_dump.c' || echo '$(srcdir)/'`examples/clpi_dump.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo examples/$(DEPDIR)/clpi_dump-clpi_dump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/clpi_dump.c' object='examples/clpi_dump-clpi_dump.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o examples/clpi_dump-clpi_dump.o `test -f 'examples/clpi_dump.c' || echo '$(srcdir)/'`examples/clpi_dump.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o examples/clpi_dump-clpi_dump.o `test -f 'examples/clpi_dump.c' || echo '$(srcdir)/'`examples/clpi_dump.c examples/clpi_dump-clpi_dump.obj: examples/clpi_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT examples/clpi_dump-clpi_dump.obj -MD -MP -MF examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo -c -o examples/clpi_dump-clpi_dump.obj `if test -f 'examples/clpi_dump.c'; then $(CYGPATH_W) 'examples/clpi_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/clpi_dump.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo examples/$(DEPDIR)/clpi_dump-clpi_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/clpi_dump.c' object='examples/clpi_dump-clpi_dump.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT examples/clpi_dump-clpi_dump.obj -MD -MP -MF examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo -c -o examples/clpi_dump-clpi_dump.obj `if test -f 'examples/clpi_dump.c'; then $(CYGPATH_W) 'examples/clpi_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/clpi_dump.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo examples/$(DEPDIR)/clpi_dump-clpi_dump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/clpi_dump.c' object='examples/clpi_dump-clpi_dump.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o examples/clpi_dump-clpi_dump.obj `if test -f 'examples/clpi_dump.c'; then $(CYGPATH_W) 'examples/clpi_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/clpi_dump.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o examples/clpi_dump-clpi_dump.obj `if test -f 'examples/clpi_dump.c'; then $(CYGPATH_W) 'examples/clpi_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/clpi_dump.c'; fi` examples/clpi_dump-util.o: examples/util.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT examples/clpi_dump-util.o -MD -MP -MF examples/$(DEPDIR)/clpi_dump-util.Tpo -c -o examples/clpi_dump-util.o `test -f 'examples/util.c' || echo '$(srcdir)/'`examples/util.c -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/clpi_dump-util.Tpo examples/$(DEPDIR)/clpi_dump-util.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/util.c' object='examples/clpi_dump-util.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT examples/clpi_dump-util.o -MD -MP -MF examples/$(DEPDIR)/clpi_dump-util.Tpo -c -o examples/clpi_dump-util.o `test -f 'examples/util.c' || echo '$(srcdir)/'`examples/util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/clpi_dump-util.Tpo examples/$(DEPDIR)/clpi_dump-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/util.c' object='examples/clpi_dump-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o examples/clpi_dump-util.o `test -f 'examples/util.c' || echo '$(srcdir)/'`examples/util.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o examples/clpi_dump-util.o `test -f 'examples/util.c' || echo '$(srcdir)/'`examples/util.c examples/clpi_dump-util.obj: examples/util.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT examples/clpi_dump-util.obj -MD -MP -MF examples/$(DEPDIR)/clpi_dump-util.Tpo -c -o examples/clpi_dump-util.obj `if test -f 'examples/util.c'; then $(CYGPATH_W) 'examples/util.c'; else $(CYGPATH_W) '$(srcdir)/examples/util.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/clpi_dump-util.Tpo examples/$(DEPDIR)/clpi_dump-util.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/util.c' object='examples/clpi_dump-util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o examples/clpi_dump-util.obj `if test -f 'examples/util.c'; then $(CYGPATH_W) 'examples/util.c'; else $(CYGPATH_W) '$(srcdir)/examples/util.c'; fi` - -examples/index_dump-index_dump.o: examples/index_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT examples/index_dump-index_dump.o -MD -MP -MF examples/$(DEPDIR)/index_dump-index_dump.Tpo -c -o examples/index_dump-index_dump.o `test -f 'examples/index_dump.c' || echo '$(srcdir)/'`examples/index_dump.c -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/index_dump-index_dump.Tpo examples/$(DEPDIR)/index_dump-index_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/index_dump.c' object='examples/index_dump-index_dump.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o examples/index_dump-index_dump.o `test -f 'examples/index_dump.c' || echo '$(srcdir)/'`examples/index_dump.c - -examples/index_dump-index_dump.obj: examples/index_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT examples/index_dump-index_dump.obj -MD -MP -MF examples/$(DEPDIR)/index_dump-index_dump.Tpo -c -o examples/index_dump-index_dump.obj `if test -f 'examples/index_dump.c'; then $(CYGPATH_W) 'examples/index_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/index_dump.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/index_dump-index_dump.Tpo examples/$(DEPDIR)/index_dump-index_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/index_dump.c' object='examples/index_dump-index_dump.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o examples/index_dump-index_dump.obj `if test -f 'examples/index_dump.c'; then $(CYGPATH_W) 'examples/index_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/index_dump.c'; fi` - -file/index_dump-file_posix.o: file/file_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT file/index_dump-file_posix.o -MD -MP -MF file/$(DEPDIR)/index_dump-file_posix.Tpo -c -o file/index_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/index_dump-file_posix.Tpo file/$(DEPDIR)/index_dump-file_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/file_posix.c' object='file/index_dump-file_posix.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o file/index_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c - -file/index_dump-file_posix.obj: file/file_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT file/index_dump-file_posix.obj -MD -MP -MF file/$(DEPDIR)/index_dump-file_posix.Tpo -c -o file/index_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/index_dump-file_posix.Tpo file/$(DEPDIR)/index_dump-file_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/file_posix.c' object='file/index_dump-file_posix.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o file/index_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` - -libbluray/bdnav/index_dump-index_parse.o: libbluray/bdnav/index_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/index_dump-index_parse.o -MD -MP -MF libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Tpo -c -o libbluray/bdnav/index_dump-index_parse.o `test -f 'libbluray/bdnav/index_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/index_parse.c -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Tpo libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/index_parse.c' object='libbluray/bdnav/index_dump-index_parse.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/index_dump-index_parse.o `test -f 'libbluray/bdnav/index_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/index_parse.c - -libbluray/bdnav/index_dump-index_parse.obj: libbluray/bdnav/index_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/index_dump-index_parse.obj -MD -MP -MF libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Tpo -c -o libbluray/bdnav/index_dump-index_parse.obj `if test -f 'libbluray/bdnav/index_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/index_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/index_parse.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Tpo libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/index_parse.c' object='libbluray/bdnav/index_dump-index_parse.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/index_dump-index_parse.obj `if test -f 'libbluray/bdnav/index_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/index_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/index_parse.c'; fi` - -util/index_dump-bits.o: util/bits.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT util/index_dump-bits.o -MD -MP -MF util/$(DEPDIR)/index_dump-bits.Tpo -c -o util/index_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/index_dump-bits.Tpo util/$(DEPDIR)/index_dump-bits.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bits.c' object='util/index_dump-bits.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o util/index_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c - -util/index_dump-bits.obj: util/bits.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT util/index_dump-bits.obj -MD -MP -MF util/$(DEPDIR)/index_dump-bits.Tpo -c -o util/index_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/index_dump-bits.Tpo util/$(DEPDIR)/index_dump-bits.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bits.c' object='util/index_dump-bits.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o util/index_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` - -util/index_dump-logging.o: util/logging.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT util/index_dump-logging.o -MD -MP -MF util/$(DEPDIR)/index_dump-logging.Tpo -c -o util/index_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/index_dump-logging.Tpo util/$(DEPDIR)/index_dump-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='util/index_dump-logging.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT examples/clpi_dump-util.obj -MD -MP -MF examples/$(DEPDIR)/clpi_dump-util.Tpo -c -o examples/clpi_dump-util.obj `if test -f 'examples/util.c'; then $(CYGPATH_W) 'examples/util.c'; else $(CYGPATH_W) '$(srcdir)/examples/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/clpi_dump-util.Tpo examples/$(DEPDIR)/clpi_dump-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/util.c' object='examples/clpi_dump-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o util/index_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c - -util/index_dump-logging.obj: util/logging.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT util/index_dump-logging.obj -MD -MP -MF util/$(DEPDIR)/index_dump-logging.Tpo -c -o util/index_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/index_dump-logging.Tpo util/$(DEPDIR)/index_dump-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='util/index_dump-logging.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o util/index_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o examples/clpi_dump-util.obj `if test -f 'examples/util.c'; then $(CYGPATH_W) 'examples/util.c'; else $(CYGPATH_W) '$(srcdir)/examples/util.c'; fi` examples/mobj_dump-mobj_dump.o: examples/mobj_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT examples/mobj_dump-mobj_dump.o -MD -MP -MF examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo -c -o examples/mobj_dump-mobj_dump.o `test -f 'examples/mobj_dump.c' || echo '$(srcdir)/'`examples/mobj_dump.c -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo examples/$(DEPDIR)/mobj_dump-mobj_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/mobj_dump.c' object='examples/mobj_dump-mobj_dump.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT examples/mobj_dump-mobj_dump.o -MD -MP -MF examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo -c -o examples/mobj_dump-mobj_dump.o `test -f 'examples/mobj_dump.c' || echo '$(srcdir)/'`examples/mobj_dump.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo examples/$(DEPDIR)/mobj_dump-mobj_dump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/mobj_dump.c' object='examples/mobj_dump-mobj_dump.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o examples/mobj_dump-mobj_dump.o `test -f 'examples/mobj_dump.c' || echo '$(srcdir)/'`examples/mobj_dump.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o examples/mobj_dump-mobj_dump.o `test -f 'examples/mobj_dump.c' || echo '$(srcdir)/'`examples/mobj_dump.c examples/mobj_dump-mobj_dump.obj: examples/mobj_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT examples/mobj_dump-mobj_dump.obj -MD -MP -MF examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo -c -o examples/mobj_dump-mobj_dump.obj `if test -f 'examples/mobj_dump.c'; then $(CYGPATH_W) 'examples/mobj_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/mobj_dump.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo examples/$(DEPDIR)/mobj_dump-mobj_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/mobj_dump.c' object='examples/mobj_dump-mobj_dump.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT examples/mobj_dump-mobj_dump.obj -MD -MP -MF examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo -c -o examples/mobj_dump-mobj_dump.obj `if test -f 'examples/mobj_dump.c'; then $(CYGPATH_W) 'examples/mobj_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/mobj_dump.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo examples/$(DEPDIR)/mobj_dump-mobj_dump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/mobj_dump.c' object='examples/mobj_dump-mobj_dump.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o examples/mobj_dump-mobj_dump.obj `if test -f 'examples/mobj_dump.c'; then $(CYGPATH_W) 'examples/mobj_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/mobj_dump.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o examples/mobj_dump-mobj_dump.obj `if test -f 'examples/mobj_dump.c'; then $(CYGPATH_W) 'examples/mobj_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/mobj_dump.c'; fi` -file/mobj_dump-file_posix.o: file/file_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT file/mobj_dump-file_posix.o -MD -MP -MF file/$(DEPDIR)/mobj_dump-file_posix.Tpo -c -o file/mobj_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mobj_dump-file_posix.Tpo file/$(DEPDIR)/mobj_dump-file_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/file_posix.c' object='file/mobj_dump-file_posix.o' libtool=no @AMDEPBACKSLASH@ +file/mobj_dump-file.o: file/file.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT file/mobj_dump-file.o -MD -MP -MF file/$(DEPDIR)/mobj_dump-file.Tpo -c -o file/mobj_dump-file.o `test -f 'file/file.c' || echo '$(srcdir)/'`file/file.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) file/$(DEPDIR)/mobj_dump-file.Tpo file/$(DEPDIR)/mobj_dump-file.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file/file.c' object='file/mobj_dump-file.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o file/mobj_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o file/mobj_dump-file.o `test -f 'file/file.c' || echo '$(srcdir)/'`file/file.c -file/mobj_dump-file_posix.obj: file/file_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT file/mobj_dump-file_posix.obj -MD -MP -MF file/$(DEPDIR)/mobj_dump-file_posix.Tpo -c -o file/mobj_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mobj_dump-file_posix.Tpo file/$(DEPDIR)/mobj_dump-file_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/file_posix.c' object='file/mobj_dump-file_posix.obj' libtool=no @AMDEPBACKSLASH@ +file/mobj_dump-file.obj: file/file.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT file/mobj_dump-file.obj -MD -MP -MF file/$(DEPDIR)/mobj_dump-file.Tpo -c -o file/mobj_dump-file.obj `if test -f 'file/file.c'; then $(CYGPATH_W) 'file/file.c'; else $(CYGPATH_W) '$(srcdir)/file/file.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) file/$(DEPDIR)/mobj_dump-file.Tpo file/$(DEPDIR)/mobj_dump-file.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file/file.c' object='file/mobj_dump-file.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o file/mobj_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o file/mobj_dump-file.obj `if test -f 'file/file.c'; then $(CYGPATH_W) 'file/file.c'; else $(CYGPATH_W) '$(srcdir)/file/file.c'; fi` libbluray/hdmv/mobj_dump-mobj_parse.o: libbluray/hdmv/mobj_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT libbluray/hdmv/mobj_dump-mobj_parse.o -MD -MP -MF libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Tpo -c -o libbluray/hdmv/mobj_dump-mobj_parse.o `test -f 'libbluray/hdmv/mobj_parse.c' || echo '$(srcdir)/'`libbluray/hdmv/mobj_parse.c -@am__fastdepCC_TRUE@ $(am__mv) libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Tpo libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/hdmv/mobj_parse.c' object='libbluray/hdmv/mobj_dump-mobj_parse.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT libbluray/hdmv/mobj_dump-mobj_parse.o -MD -MP -MF libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Tpo -c -o libbluray/hdmv/mobj_dump-mobj_parse.o `test -f 'libbluray/hdmv/mobj_parse.c' || echo '$(srcdir)/'`libbluray/hdmv/mobj_parse.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Tpo libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libbluray/hdmv/mobj_parse.c' object='libbluray/hdmv/mobj_dump-mobj_parse.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o libbluray/hdmv/mobj_dump-mobj_parse.o `test -f 'libbluray/hdmv/mobj_parse.c' || echo '$(srcdir)/'`libbluray/hdmv/mobj_parse.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o libbluray/hdmv/mobj_dump-mobj_parse.o `test -f 'libbluray/hdmv/mobj_parse.c' || echo '$(srcdir)/'`libbluray/hdmv/mobj_parse.c libbluray/hdmv/mobj_dump-mobj_parse.obj: libbluray/hdmv/mobj_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT libbluray/hdmv/mobj_dump-mobj_parse.obj -MD -MP -MF libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Tpo -c -o libbluray/hdmv/mobj_dump-mobj_parse.obj `if test -f 'libbluray/hdmv/mobj_parse.c'; then $(CYGPATH_W) 'libbluray/hdmv/mobj_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/hdmv/mobj_parse.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Tpo libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/hdmv/mobj_parse.c' object='libbluray/hdmv/mobj_dump-mobj_parse.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT libbluray/hdmv/mobj_dump-mobj_parse.obj -MD -MP -MF libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Tpo -c -o libbluray/hdmv/mobj_dump-mobj_parse.obj `if test -f 'libbluray/hdmv/mobj_parse.c'; then $(CYGPATH_W) 'libbluray/hdmv/mobj_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/hdmv/mobj_parse.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Tpo libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libbluray/hdmv/mobj_parse.c' object='libbluray/hdmv/mobj_dump-mobj_parse.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o libbluray/hdmv/mobj_dump-mobj_parse.obj `if test -f 'libbluray/hdmv/mobj_parse.c'; then $(CYGPATH_W) 'libbluray/hdmv/mobj_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/hdmv/mobj_parse.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o libbluray/hdmv/mobj_dump-mobj_parse.obj `if test -f 'libbluray/hdmv/mobj_parse.c'; then $(CYGPATH_W) 'libbluray/hdmv/mobj_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/hdmv/mobj_parse.c'; fi` libbluray/hdmv/mobj_dump-mobj_print.o: libbluray/hdmv/mobj_print.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT libbluray/hdmv/mobj_dump-mobj_print.o -MD -MP -MF libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo -c -o libbluray/hdmv/mobj_dump-mobj_print.o `test -f 'libbluray/hdmv/mobj_print.c' || echo '$(srcdir)/'`libbluray/hdmv/mobj_print.c -@am__fastdepCC_TRUE@ $(am__mv) libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/hdmv/mobj_print.c' object='libbluray/hdmv/mobj_dump-mobj_print.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT libbluray/hdmv/mobj_dump-mobj_print.o -MD -MP -MF libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo -c -o libbluray/hdmv/mobj_dump-mobj_print.o `test -f 'libbluray/hdmv/mobj_print.c' || echo '$(srcdir)/'`libbluray/hdmv/mobj_print.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libbluray/hdmv/mobj_print.c' object='libbluray/hdmv/mobj_dump-mobj_print.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o libbluray/hdmv/mobj_dump-mobj_print.o `test -f 'libbluray/hdmv/mobj_print.c' || echo '$(srcdir)/'`libbluray/hdmv/mobj_print.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o libbluray/hdmv/mobj_dump-mobj_print.o `test -f 'libbluray/hdmv/mobj_print.c' || echo '$(srcdir)/'`libbluray/hdmv/mobj_print.c libbluray/hdmv/mobj_dump-mobj_print.obj: libbluray/hdmv/mobj_print.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT libbluray/hdmv/mobj_dump-mobj_print.obj -MD -MP -MF libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo -c -o libbluray/hdmv/mobj_dump-mobj_print.obj `if test -f 'libbluray/hdmv/mobj_print.c'; then $(CYGPATH_W) 'libbluray/hdmv/mobj_print.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/hdmv/mobj_print.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/hdmv/mobj_print.c' object='libbluray/hdmv/mobj_dump-mobj_print.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT libbluray/hdmv/mobj_dump-mobj_print.obj -MD -MP -MF libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo -c -o libbluray/hdmv/mobj_dump-mobj_print.obj `if test -f 'libbluray/hdmv/mobj_print.c'; then $(CYGPATH_W) 'libbluray/hdmv/mobj_print.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/hdmv/mobj_print.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libbluray/hdmv/mobj_print.c' object='libbluray/hdmv/mobj_dump-mobj_print.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o libbluray/hdmv/mobj_dump-mobj_print.obj `if test -f 'libbluray/hdmv/mobj_print.c'; then $(CYGPATH_W) 'libbluray/hdmv/mobj_print.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/hdmv/mobj_print.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o libbluray/hdmv/mobj_dump-mobj_print.obj `if test -f 'libbluray/hdmv/mobj_print.c'; then $(CYGPATH_W) 'libbluray/hdmv/mobj_print.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/hdmv/mobj_print.c'; fi` util/mobj_dump-bits.o: util/bits.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-bits.o -MD -MP -MF util/$(DEPDIR)/mobj_dump-bits.Tpo -c -o util/mobj_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mobj_dump-bits.Tpo util/$(DEPDIR)/mobj_dump-bits.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bits.c' object='util/mobj_dump-bits.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-bits.o -MD -MP -MF util/$(DEPDIR)/mobj_dump-bits.Tpo -c -o util/mobj_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/mobj_dump-bits.Tpo util/$(DEPDIR)/mobj_dump-bits.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/bits.c' object='util/mobj_dump-bits.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c util/mobj_dump-bits.obj: util/bits.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-bits.obj -MD -MP -MF util/$(DEPDIR)/mobj_dump-bits.Tpo -c -o util/mobj_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mobj_dump-bits.Tpo util/$(DEPDIR)/mobj_dump-bits.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bits.c' object='util/mobj_dump-bits.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-bits.obj -MD -MP -MF util/$(DEPDIR)/mobj_dump-bits.Tpo -c -o util/mobj_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/mobj_dump-bits.Tpo util/$(DEPDIR)/mobj_dump-bits.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/bits.c' object='util/mobj_dump-bits.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` util/mobj_dump-logging.o: util/logging.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-logging.o -MD -MP -MF util/$(DEPDIR)/mobj_dump-logging.Tpo -c -o util/mobj_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mobj_dump-logging.Tpo util/$(DEPDIR)/mobj_dump-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='util/mobj_dump-logging.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-logging.o -MD -MP -MF util/$(DEPDIR)/mobj_dump-logging.Tpo -c -o util/mobj_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/mobj_dump-logging.Tpo util/$(DEPDIR)/mobj_dump-logging.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/logging.c' object='util/mobj_dump-logging.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c util/mobj_dump-logging.obj: util/logging.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-logging.obj -MD -MP -MF util/$(DEPDIR)/mobj_dump-logging.Tpo -c -o util/mobj_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mobj_dump-logging.Tpo util/$(DEPDIR)/mobj_dump-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='util/mobj_dump-logging.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` - -examples/mpls_dump-mpls_dump.o: examples/mpls_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT examples/mpls_dump-mpls_dump.o -MD -MP -MF examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo -c -o examples/mpls_dump-mpls_dump.o `test -f 'examples/mpls_dump.c' || echo '$(srcdir)/'`examples/mpls_dump.c -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo examples/$(DEPDIR)/mpls_dump-mpls_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/mpls_dump.c' object='examples/mpls_dump-mpls_dump.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o examples/mpls_dump-mpls_dump.o `test -f 'examples/mpls_dump.c' || echo '$(srcdir)/'`examples/mpls_dump.c - -examples/mpls_dump-mpls_dump.obj: examples/mpls_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT examples/mpls_dump-mpls_dump.obj -MD -MP -MF examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo -c -o examples/mpls_dump-mpls_dump.obj `if test -f 'examples/mpls_dump.c'; then $(CYGPATH_W) 'examples/mpls_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/mpls_dump.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo examples/$(DEPDIR)/mpls_dump-mpls_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/mpls_dump.c' object='examples/mpls_dump-mpls_dump.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o examples/mpls_dump-mpls_dump.obj `if test -f 'examples/mpls_dump.c'; then $(CYGPATH_W) 'examples/mpls_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/mpls_dump.c'; fi` - -examples/mpls_dump-util.o: examples/util.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT examples/mpls_dump-util.o -MD -MP -MF examples/$(DEPDIR)/mpls_dump-util.Tpo -c -o examples/mpls_dump-util.o `test -f 'examples/util.c' || echo '$(srcdir)/'`examples/util.c -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/mpls_dump-util.Tpo examples/$(DEPDIR)/mpls_dump-util.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/util.c' object='examples/mpls_dump-util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o examples/mpls_dump-util.o `test -f 'examples/util.c' || echo '$(srcdir)/'`examples/util.c - -examples/mpls_dump-util.obj: examples/util.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT examples/mpls_dump-util.obj -MD -MP -MF examples/$(DEPDIR)/mpls_dump-util.Tpo -c -o examples/mpls_dump-util.obj `if test -f 'examples/util.c'; then $(CYGPATH_W) 'examples/util.c'; else $(CYGPATH_W) '$(srcdir)/examples/util.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/mpls_dump-util.Tpo examples/$(DEPDIR)/mpls_dump-util.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/util.c' object='examples/mpls_dump-util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o examples/mpls_dump-util.obj `if test -f 'examples/util.c'; then $(CYGPATH_W) 'examples/util.c'; else $(CYGPATH_W) '$(srcdir)/examples/util.c'; fi` - -file/mpls_dump-file_posix.o: file/file_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT file/mpls_dump-file_posix.o -MD -MP -MF file/$(DEPDIR)/mpls_dump-file_posix.Tpo -c -o file/mpls_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mpls_dump-file_posix.Tpo file/$(DEPDIR)/mpls_dump-file_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/file_posix.c' object='file/mpls_dump-file_posix.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-logging.obj -MD -MP -MF util/$(DEPDIR)/mobj_dump-logging.Tpo -c -o util/mobj_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/mobj_dump-logging.Tpo util/$(DEPDIR)/mobj_dump-logging.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/logging.c' object='util/mobj_dump-logging.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o file/mpls_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` -file/mpls_dump-file_posix.obj: file/file_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT file/mpls_dump-file_posix.obj -MD -MP -MF file/$(DEPDIR)/mpls_dump-file_posix.Tpo -c -o file/mpls_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mpls_dump-file_posix.Tpo file/$(DEPDIR)/mpls_dump-file_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/file_posix.c' object='file/mpls_dump-file_posix.obj' libtool=no @AMDEPBACKSLASH@ +util/mobj_dump-strutl.o: util/strutl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-strutl.o -MD -MP -MF util/$(DEPDIR)/mobj_dump-strutl.Tpo -c -o util/mobj_dump-strutl.o `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/mobj_dump-strutl.Tpo util/$(DEPDIR)/mobj_dump-strutl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/strutl.c' object='util/mobj_dump-strutl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o file/mpls_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-strutl.o `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c -libbluray/bdnav/mpls_dump-clpi_parse.o: libbluray/bdnav/clpi_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/mpls_dump-clpi_parse.o -MD -MP -MF libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Tpo -c -o libbluray/bdnav/mpls_dump-clpi_parse.o `test -f 'libbluray/bdnav/clpi_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/clpi_parse.c -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Tpo libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/clpi_parse.c' object='libbluray/bdnav/mpls_dump-clpi_parse.o' libtool=no @AMDEPBACKSLASH@ +util/mobj_dump-strutl.obj: util/strutl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-strutl.obj -MD -MP -MF util/$(DEPDIR)/mobj_dump-strutl.Tpo -c -o util/mobj_dump-strutl.obj `if test -f 'util/strutl.c'; then $(CYGPATH_W) 'util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/util/strutl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/mobj_dump-strutl.Tpo util/$(DEPDIR)/mobj_dump-strutl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/strutl.c' object='util/mobj_dump-strutl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/mpls_dump-clpi_parse.o `test -f 'libbluray/bdnav/clpi_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/clpi_parse.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-strutl.obj `if test -f 'util/strutl.c'; then $(CYGPATH_W) 'util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/util/strutl.c'; fi` -libbluray/bdnav/mpls_dump-clpi_parse.obj: libbluray/bdnav/clpi_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/mpls_dump-clpi_parse.obj -MD -MP -MF libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Tpo -c -o libbluray/bdnav/mpls_dump-clpi_parse.obj `if test -f 'libbluray/bdnav/clpi_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/clpi_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/clpi_parse.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Tpo libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/clpi_parse.c' object='libbluray/bdnav/mpls_dump-clpi_parse.obj' libtool=no @AMDEPBACKSLASH@ +file/mobj_dump-file_win32.o: file/file_win32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT file/mobj_dump-file_win32.o -MD -MP -MF file/$(DEPDIR)/mobj_dump-file_win32.Tpo -c -o file/mobj_dump-file_win32.o `test -f 'file/file_win32.c' || echo '$(srcdir)/'`file/file_win32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) file/$(DEPDIR)/mobj_dump-file_win32.Tpo file/$(DEPDIR)/mobj_dump-file_win32.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file/file_win32.c' object='file/mobj_dump-file_win32.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/mpls_dump-clpi_parse.obj `if test -f 'libbluray/bdnav/clpi_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/clpi_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/clpi_parse.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o file/mobj_dump-file_win32.o `test -f 'file/file_win32.c' || echo '$(srcdir)/'`file/file_win32.c -libbluray/bdnav/mpls_dump-extdata_parse.o: libbluray/bdnav/extdata_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/mpls_dump-extdata_parse.o -MD -MP -MF libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Tpo -c -o libbluray/bdnav/mpls_dump-extdata_parse.o `test -f 'libbluray/bdnav/extdata_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/extdata_parse.c -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Tpo libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/extdata_parse.c' object='libbluray/bdnav/mpls_dump-extdata_parse.o' libtool=no @AMDEPBACKSLASH@ +file/mobj_dump-file_win32.obj: file/file_win32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT file/mobj_dump-file_win32.obj -MD -MP -MF file/$(DEPDIR)/mobj_dump-file_win32.Tpo -c -o file/mobj_dump-file_win32.obj `if test -f 'file/file_win32.c'; then $(CYGPATH_W) 'file/file_win32.c'; else $(CYGPATH_W) '$(srcdir)/file/file_win32.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) file/$(DEPDIR)/mobj_dump-file_win32.Tpo file/$(DEPDIR)/mobj_dump-file_win32.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file/file_win32.c' object='file/mobj_dump-file_win32.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/mpls_dump-extdata_parse.o `test -f 'libbluray/bdnav/extdata_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/extdata_parse.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o file/mobj_dump-file_win32.obj `if test -f 'file/file_win32.c'; then $(CYGPATH_W) 'file/file_win32.c'; else $(CYGPATH_W) '$(srcdir)/file/file_win32.c'; fi` -libbluray/bdnav/mpls_dump-extdata_parse.obj: libbluray/bdnav/extdata_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/mpls_dump-extdata_parse.obj -MD -MP -MF libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Tpo -c -o libbluray/bdnav/mpls_dump-extdata_parse.obj `if test -f 'libbluray/bdnav/extdata_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/extdata_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/extdata_parse.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Tpo libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/extdata_parse.c' object='libbluray/bdnav/mpls_dump-extdata_parse.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/mpls_dump-extdata_parse.obj `if test -f 'libbluray/bdnav/extdata_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/extdata_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/extdata_parse.c'; fi` - -libbluray/bdnav/mpls_dump-mpls_parse.o: libbluray/bdnav/mpls_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/mpls_dump-mpls_parse.o -MD -MP -MF libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Tpo -c -o libbluray/bdnav/mpls_dump-mpls_parse.o `test -f 'libbluray/bdnav/mpls_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/mpls_parse.c -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Tpo libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/mpls_parse.c' object='libbluray/bdnav/mpls_dump-mpls_parse.o' libtool=no @AMDEPBACKSLASH@ +file/mobj_dump-file_posix.o: file/file_posix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT file/mobj_dump-file_posix.o -MD -MP -MF file/$(DEPDIR)/mobj_dump-file_posix.Tpo -c -o file/mobj_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) file/$(DEPDIR)/mobj_dump-file_posix.Tpo file/$(DEPDIR)/mobj_dump-file_posix.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file/file_posix.c' object='file/mobj_dump-file_posix.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/mpls_dump-mpls_parse.o `test -f 'libbluray/bdnav/mpls_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/mpls_parse.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o file/mobj_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c -libbluray/bdnav/mpls_dump-mpls_parse.obj: libbluray/bdnav/mpls_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/mpls_dump-mpls_parse.obj -MD -MP -MF libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Tpo -c -o libbluray/bdnav/mpls_dump-mpls_parse.obj `if test -f 'libbluray/bdnav/mpls_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/mpls_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/mpls_parse.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Tpo libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/mpls_parse.c' object='libbluray/bdnav/mpls_dump-mpls_parse.obj' libtool=no @AMDEPBACKSLASH@ +file/mobj_dump-file_posix.obj: file/file_posix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT file/mobj_dump-file_posix.obj -MD -MP -MF file/$(DEPDIR)/mobj_dump-file_posix.Tpo -c -o file/mobj_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) file/$(DEPDIR)/mobj_dump-file_posix.Tpo file/$(DEPDIR)/mobj_dump-file_posix.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file/file_posix.c' object='file/mobj_dump-file_posix.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/mpls_dump-mpls_parse.obj `if test -f 'libbluray/bdnav/mpls_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/mpls_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/mpls_parse.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o file/mobj_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` -util/mpls_dump-bits.o: util/bits.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-bits.o -MD -MP -MF util/$(DEPDIR)/mpls_dump-bits.Tpo -c -o util/mpls_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mpls_dump-bits.Tpo util/$(DEPDIR)/mpls_dump-bits.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bits.c' object='util/mpls_dump-bits.o' libtool=no @AMDEPBACKSLASH@ +examples/mpls_dump-mpls_dump.o: examples/mpls_dump.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT examples/mpls_dump-mpls_dump.o -MD -MP -MF examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo -c -o examples/mpls_dump-mpls_dump.o `test -f 'examples/mpls_dump.c' || echo '$(srcdir)/'`examples/mpls_dump.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo examples/$(DEPDIR)/mpls_dump-mpls_dump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/mpls_dump.c' object='examples/mpls_dump-mpls_dump.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o examples/mpls_dump-mpls_dump.o `test -f 'examples/mpls_dump.c' || echo '$(srcdir)/'`examples/mpls_dump.c -util/mpls_dump-bits.obj: util/bits.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-bits.obj -MD -MP -MF util/$(DEPDIR)/mpls_dump-bits.Tpo -c -o util/mpls_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mpls_dump-bits.Tpo util/$(DEPDIR)/mpls_dump-bits.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bits.c' object='util/mpls_dump-bits.obj' libtool=no @AMDEPBACKSLASH@ +examples/mpls_dump-mpls_dump.obj: examples/mpls_dump.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT examples/mpls_dump-mpls_dump.obj -MD -MP -MF examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo -c -o examples/mpls_dump-mpls_dump.obj `if test -f 'examples/mpls_dump.c'; then $(CYGPATH_W) 'examples/mpls_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/mpls_dump.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo examples/$(DEPDIR)/mpls_dump-mpls_dump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/mpls_dump.c' object='examples/mpls_dump-mpls_dump.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o examples/mpls_dump-mpls_dump.obj `if test -f 'examples/mpls_dump.c'; then $(CYGPATH_W) 'examples/mpls_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/mpls_dump.c'; fi` -util/mpls_dump-logging.o: util/logging.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-logging.o -MD -MP -MF util/$(DEPDIR)/mpls_dump-logging.Tpo -c -o util/mpls_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mpls_dump-logging.Tpo util/$(DEPDIR)/mpls_dump-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='util/mpls_dump-logging.o' libtool=no @AMDEPBACKSLASH@ +examples/mpls_dump-util.o: examples/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT examples/mpls_dump-util.o -MD -MP -MF examples/$(DEPDIR)/mpls_dump-util.Tpo -c -o examples/mpls_dump-util.o `test -f 'examples/util.c' || echo '$(srcdir)/'`examples/util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/mpls_dump-util.Tpo examples/$(DEPDIR)/mpls_dump-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/util.c' object='examples/mpls_dump-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o examples/mpls_dump-util.o `test -f 'examples/util.c' || echo '$(srcdir)/'`examples/util.c -util/mpls_dump-logging.obj: util/logging.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-logging.obj -MD -MP -MF util/$(DEPDIR)/mpls_dump-logging.Tpo -c -o util/mpls_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mpls_dump-logging.Tpo util/$(DEPDIR)/mpls_dump-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='util/mpls_dump-logging.obj' libtool=no @AMDEPBACKSLASH@ +examples/mpls_dump-util.obj: examples/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT examples/mpls_dump-util.obj -MD -MP -MF examples/$(DEPDIR)/mpls_dump-util.Tpo -c -o examples/mpls_dump-util.obj `if test -f 'examples/util.c'; then $(CYGPATH_W) 'examples/util.c'; else $(CYGPATH_W) '$(srcdir)/examples/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/mpls_dump-util.Tpo examples/$(DEPDIR)/mpls_dump-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/util.c' object='examples/mpls_dump-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o examples/mpls_dump-util.obj `if test -f 'examples/util.c'; then $(CYGPATH_W) 'examples/util.c'; else $(CYGPATH_W) '$(srcdir)/examples/util.c'; fi` util/mpls_dump-strutl.o: util/strutl.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-strutl.o -MD -MP -MF util/$(DEPDIR)/mpls_dump-strutl.Tpo -c -o util/mpls_dump-strutl.o `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mpls_dump-strutl.Tpo util/$(DEPDIR)/mpls_dump-strutl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/strutl.c' object='util/mpls_dump-strutl.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-strutl.o -MD -MP -MF util/$(DEPDIR)/mpls_dump-strutl.Tpo -c -o util/mpls_dump-strutl.o `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/mpls_dump-strutl.Tpo util/$(DEPDIR)/mpls_dump-strutl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/strutl.c' object='util/mpls_dump-strutl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-strutl.o `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-strutl.o `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c util/mpls_dump-strutl.obj: util/strutl.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-strutl.obj -MD -MP -MF util/$(DEPDIR)/mpls_dump-strutl.Tpo -c -o util/mpls_dump-strutl.obj `if test -f 'util/strutl.c'; then $(CYGPATH_W) 'util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/util/strutl.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mpls_dump-strutl.Tpo util/$(DEPDIR)/mpls_dump-strutl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/strutl.c' object='util/mpls_dump-strutl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-strutl.obj `if test -f 'util/strutl.c'; then $(CYGPATH_W) 'util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/util/strutl.c'; fi` - -file/mpls_dump-dir_win32.o: file/dir_win32.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT file/mpls_dump-dir_win32.o -MD -MP -MF file/$(DEPDIR)/mpls_dump-dir_win32.Tpo -c -o file/mpls_dump-dir_win32.o `test -f 'file/dir_win32.c' || echo '$(srcdir)/'`file/dir_win32.c -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mpls_dump-dir_win32.Tpo file/$(DEPDIR)/mpls_dump-dir_win32.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/dir_win32.c' object='file/mpls_dump-dir_win32.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o file/mpls_dump-dir_win32.o `test -f 'file/dir_win32.c' || echo '$(srcdir)/'`file/dir_win32.c - -file/mpls_dump-dir_win32.obj: file/dir_win32.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT file/mpls_dump-dir_win32.obj -MD -MP -MF file/$(DEPDIR)/mpls_dump-dir_win32.Tpo -c -o file/mpls_dump-dir_win32.obj `if test -f 'file/dir_win32.c'; then $(CYGPATH_W) 'file/dir_win32.c'; else $(CYGPATH_W) '$(srcdir)/file/dir_win32.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mpls_dump-dir_win32.Tpo file/$(DEPDIR)/mpls_dump-dir_win32.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/dir_win32.c' object='file/mpls_dump-dir_win32.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o file/mpls_dump-dir_win32.obj `if test -f 'file/dir_win32.c'; then $(CYGPATH_W) 'file/dir_win32.c'; else $(CYGPATH_W) '$(srcdir)/file/dir_win32.c'; fi` - -file/mpls_dump-dir_posix.o: file/dir_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT file/mpls_dump-dir_posix.o -MD -MP -MF file/$(DEPDIR)/mpls_dump-dir_posix.Tpo -c -o file/mpls_dump-dir_posix.o `test -f 'file/dir_posix.c' || echo '$(srcdir)/'`file/dir_posix.c -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mpls_dump-dir_posix.Tpo file/$(DEPDIR)/mpls_dump-dir_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/dir_posix.c' object='file/mpls_dump-dir_posix.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-strutl.obj -MD -MP -MF util/$(DEPDIR)/mpls_dump-strutl.Tpo -c -o util/mpls_dump-strutl.obj `if test -f 'util/strutl.c'; then $(CYGPATH_W) 'util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/util/strutl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/mpls_dump-strutl.Tpo util/$(DEPDIR)/mpls_dump-strutl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/strutl.c' object='util/mpls_dump-strutl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o file/mpls_dump-dir_posix.o `test -f 'file/dir_posix.c' || echo '$(srcdir)/'`file/dir_posix.c - -file/mpls_dump-dir_posix.obj: file/dir_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT file/mpls_dump-dir_posix.obj -MD -MP -MF file/$(DEPDIR)/mpls_dump-dir_posix.Tpo -c -o file/mpls_dump-dir_posix.obj `if test -f 'file/dir_posix.c'; then $(CYGPATH_W) 'file/dir_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/dir_posix.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mpls_dump-dir_posix.Tpo file/$(DEPDIR)/mpls_dump-dir_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/dir_posix.c' object='file/mpls_dump-dir_posix.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o file/mpls_dump-dir_posix.obj `if test -f 'file/dir_posix.c'; then $(CYGPATH_W) 'file/dir_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/dir_posix.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-strutl.obj `if test -f 'util/strutl.c'; then $(CYGPATH_W) 'util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/util/strutl.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -1674,26 +1480,15 @@ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -1705,15 +1500,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -1722,6 +1513,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -1892,39 +1698,41 @@ .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ +.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \ clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-local clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-jarDATA install-libLTLIBRARIES \ - install-man install-pdf install-pdf-am install-pkgconfigDATA \ - install-pkgincludeHEADERS install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-jarDATA \ + clean-libtool clean-local clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-jarDATA \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-pkgincludeHEADERS install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-jarDATA \ uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ uninstall-pkgincludeHEADERS -@USING_BDJAVA_TRUE@$(top_builddir)/src/.libs/libbluray.jar: all-local +@USING_BDJAVA_TRUE@$(top_builddir)/src/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar: all-local @USING_BDJAVA_TRUE@all-local: @USING_BDJAVA_TRUE@ ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \ @USING_BDJAVA_TRUE@ -Dbuild='$(abs_builddir)/libbluray/bdj/build' \ @USING_BDJAVA_TRUE@ -Ddist='$(abs_builddir)/.libs' \ @USING_BDJAVA_TRUE@ -Dsrc_awt=:java-$(BDJ_TYPE) \ -@USING_BDJAVA_TRUE@ -Dbootclasspath="$(BDJ_BOOTCLASSPATH)" +@USING_BDJAVA_TRUE@ -Dbootclasspath="$(BDJ_BOOTCLASSPATH)" \ +@USING_BDJAVA_TRUE@ -Dversion='$(BDJ_TYPE)-$(VERSION)' @USING_BDJAVA_TRUE@clean-local: @USING_BDJAVA_TRUE@ ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \ @USING_BDJAVA_TRUE@ -Dbuild='$(abs_builddir)/libbluray/bdj/build' \ @USING_BDJAVA_TRUE@ -Ddist='$(abs_builddir)/.libs' \ +@USING_BDJAVA_TRUE@ -Dversion='$(BDJ_TYPE)-$(VERSION)' \ @USING_BDJAVA_TRUE@ clean # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru libbluray-0.5.0/src/util/array.c libbluray-0.6.2/src/util/array.c --- libbluray-0.5.0/src/util/array.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/util/array.c 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +#include "array.h" + +#include "macro.h" +#include "logging.h" + +#include + + +void *array_alloc(size_t n, size_t sz) +{ + size_t size = sizeof(void *) + sz; + if (size < sz) { + BD_DEBUG(DBG_CRIT, "array_alloc(): overflow\n"); + return NULL; + } + + uint8_t *p = (uint8_t *)calloc(n, size); + if (!p) { + BD_DEBUG(DBG_CRIT, "array_alloc(): out of memory\n"); + return NULL; + } + + void **array = (void **)p; + p += n * sizeof(void *); + size_t i; + for (i = 0; i < n; i++, p += sz) { + array[i] = p; + } + + return array; +} + +void array_free(void **p) +{ + if (p && *p) { + X_FREE(*p); + } +} diff -Nru libbluray-0.5.0/src/util/array.h libbluray-0.6.2/src/util/array.h --- libbluray-0.5.0/src/util/array.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/util/array.h 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +#ifndef BD_ARRAY_H_ +#define BD_ARRAY_H_ + +#include "attributes.h" + +#include + +/* + * array_alloc() + * + * Allocate an array of objects. + * Each object is initialized with zeros. + * + * @param n number of objects + * @param sz size of single object + * @return array of n pointers, each pointing to memory block of size sz. + * + */ +BD_PRIVATE void *array_alloc(size_t n, size_t sz) BD_ATTR_MALLOC; + +/* + * array_free() + * + * Free array allocated with array_alloc(). + * + * @param p pointer to pointer allocated with bd_array_alloc() + */ +BD_PRIVATE void array_free(void **p); + +#endif // BD_ARRAY_H_ diff -Nru libbluray-0.5.0/src/util/attributes.h libbluray-0.6.2/src/util/attributes.h --- libbluray-0.5.0/src/util/attributes.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/util/attributes.h 2014-09-01 12:06:01.000000000 +0000 @@ -21,7 +21,11 @@ #define LIBBLURAY_ATTRIBUTES_H_ #if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3 )) -# define BD_ATTR_FORMAT_PRINTF(format,var) __attribute__((__format__(__printf__,format,var))) +# if defined(_WIN32) +# define BD_ATTR_FORMAT_PRINTF(format,var) __attribute__((__format__(__gnu_printf__,format,var))) +# else +# define BD_ATTR_FORMAT_PRINTF(format,var) __attribute__((__format__(__printf__,format,var))) +# endif # define BD_ATTR_MALLOC __attribute__((__malloc__)) # define BD_ATTR_PACKED __attribute__((packed)) #else diff -Nru libbluray-0.5.0/src/util/bits.h libbluray-0.6.2/src/util/bits.h --- libbluray-0.5.0/src/util/bits.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/util/bits.h 2014-09-01 12:06:01.000000000 +0000 @@ -80,11 +80,17 @@ { return bb->p >= bb->p_end ? 1: 0 ; } - +/* static inline int bs_eof( const BITSTREAM *bs ) { return file_eof(bs->fp) && bb_eof(&bs->bb); } +*/ + +static inline off_t bs_avail( const BITSTREAM *bs ) +{ + return bs_end(bs) - bs_pos(bs); +} static inline void bb_seek_byte( BITBUFFER *bb, off_t off) { diff -Nru libbluray-0.5.0/src/util/logging.c libbluray-0.6.2/src/util/logging.c --- libbluray-0.5.0/src/util/logging.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/util/logging.c 2014-09-01 12:06:01.000000000 +0000 @@ -20,6 +20,8 @@ #include "logging.h" +#include "file/file.h" + #include #include #include @@ -84,10 +86,11 @@ } if (mask & debug_mask) { + const char *f = strrchr(file, DIR_SEP_CHAR); char buffer[4096], *pt = buffer; va_list args; - pt += sprintf(buffer, "%s:%d: ", file, line); + pt += sprintf(buffer, "%s:%d: ", f ? f + 1 : file, line); va_start(args, format); vsnprintf(pt, sizeof(buffer) - (size_t)(intptr_t)(pt - buffer) - 1, format, args); diff -Nru libbluray-0.5.0/src/util/macro.h libbluray-0.6.2/src/util/macro.h --- libbluray-0.5.0/src/util/macro.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/util/macro.h 2014-09-01 12:06:01.000000000 +0000 @@ -33,6 +33,7 @@ #define BD_MIN(a,b) ((a)<(b)?(a):(b)) #define BD_MAX(a,b) ((a)>(b)?(a):(b)) +#define BD_MAX_SSIZE ((int64_t)(((size_t)-1)>>1)) /* * automatic cast from void* (malloc/calloc/realloc) diff -Nru libbluray-0.5.0/src/util/mutex.c libbluray-0.6.2/src/util/mutex.c --- libbluray-0.5.0/src/util/mutex.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.6.2/src/util/mutex.c 2014-09-01 12:06:01.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010-2014 Petri Hintukainen + * + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mutex.h" + +#include "logging.h" +#include "macro.h" + + +#if defined(_WIN32) + /* nothing here */ +#elif defined(HAVE_PTHREAD_H) + +#include + +int bd_mutex_init(BD_MUTEX *p) +{ + p->owner = (pthread_t)-1; + p->lock_count = 0; + + if (pthread_mutex_init(&p->mutex, NULL)) { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_init() failed !\n"); + return -1; + } + + return 0; +} + +int bd_mutex_destroy(BD_MUTEX *p) +{ + bd_mutex_lock(p); + bd_mutex_unlock(p); + if (pthread_mutex_destroy(&p->mutex)) { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_destroy() failed !\n"); + return -1; + } + return 0; +} + +#endif /* HAVE_PTHREAD_H */ diff -Nru libbluray-0.5.0/src/util/mutex.h libbluray-0.6.2/src/util/mutex.h --- libbluray-0.5.0/src/util/mutex.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/util/mutex.h 2014-09-01 12:06:01.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2010 hpi1 + * Copyright (C) 2010-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -39,24 +39,38 @@ typedef CRITICAL_SECTION BD_MUTEX; -#define bd_mutex_lock(m) \ - (EnterCriticalSection(m), 0) +static inline int bd_mutex_lock(BD_MUTEX *p) { + EnterCriticalSection(p); + return 0; +} -#define bd_mutex_unlock(m) \ - (LeaveCriticalSection(m), 0) +static inline int bd_mutex_unlock(BD_MUTEX *p) { + LeaveCriticalSection(p); + return 0; +} -#define bd_mutex_trylock(m) \ - (TryEnterCriticalSection(m) ? 0 : EBUSY) +#if 0 +static int bd_mutex_trylock(BD_MUTEX *p) { + return TryEnterCriticalSection(p) ? 0 : EBUSY; +} +#endif -#define bd_mutex_init(m) \ - (InitializeCriticalSection(m), 0) +static inline int bd_mutex_init(BD_MUTEX *p) { + InitializeCriticalSection(p); + return 0; +} -#define bd_mutex_destroy(m) \ - (DeleteCriticalSection(m), 0) +static inline int bd_mutex_destroy(BD_MUTEX *p) { + DeleteCriticalSection(p); + return 0; +} #elif defined(HAVE_PTHREAD_H) +#include "logging.h" +#include "macro.h" + /* * recursive mutex */ @@ -68,27 +82,8 @@ pthread_mutex_t mutex; }; -static inline int bd_mutex_init(BD_MUTEX *p) -{ - p->owner = (pthread_t)-1; - p->lock_count = 0; - - if (pthread_mutex_init(&p->mutex, NULL)) { - BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_init() failed !\n"); - return -1; - } - - return 0; -} - -static inline int bd_mutex_destroy(BD_MUTEX *p) -{ - if (pthread_mutex_destroy(&p->mutex)) { - BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_destroy() failed !\n"); - return -1; - } - return 0; -} +BD_PRIVATE int bd_mutex_init(BD_MUTEX *p); +BD_PRIVATE int bd_mutex_destroy(BD_MUTEX *p); static int bd_mutex_lock(BD_MUTEX *p) { diff -Nru libbluray-0.5.0/src/util/refcnt.c libbluray-0.6.2/src/util/refcnt.c --- libbluray-0.5.0/src/util/refcnt.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/util/refcnt.c 2014-09-01 12:06:01.000000000 +0000 @@ -99,8 +99,14 @@ if (obj) { obj = realloc(&((BD_REFCNT *)obj)[-1], sz); + if (!obj) { + return NULL; + } } else { obj = realloc(NULL, sz); + if (!obj) { + return NULL; + } memset(obj, 0, sizeof(BD_REFCNT)); } diff -Nru libbluray-0.5.0/src/util/refcnt.h libbluray-0.6.2/src/util/refcnt.h --- libbluray-0.5.0/src/util/refcnt.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.6.2/src/util/refcnt.h 2014-09-01 12:06:01.000000000 +0000 @@ -18,11 +18,11 @@ */ #ifndef BD_REFCNT_H_ -#define BD_FEFCNT_H_ +#define BD_REFCNT_H_ #include "attributes.h" -#include +#include #ifdef MACRO_H_ # error macro.h included before refcnt.h