JavaFX MediaPlayer Codecs


#25

Download the files. Using your browser. :wink:


#26

lol if i click them it just opens up and shows me the contents… see no option to download


#27

There’s a plain link next to each file. Use that.

Or, run yay -G java-openjfx.


#30

right i used the plain link, it opens the file, i copyed and pasted again, and same results, thats the only file with issue so far.
yay -G java-openjfx??? idk

nevermind i got it right now. its running now.

so it seems to be complaining about a jar file, do i just delete that file?

OS_NAME: linux
OS_ARCH: amd64
JAVA_HOME: /usr/lib/jvm/java-8-openjdk
JDK_HOME: /usr/lib/jvm/java-8-openjdk
java.runtime.version: 1.8.0_202-b26
java version: 1.8.0_202
java build number: 26
jdk.runtime.version: 1.8.0_202-b26
jdk version: 1.8.0_202
jdk build number: 26
minimum java build number: 26
CONF: Debug
NUM_COMPILE_THREADS: 2
COMPILE_TARGETS: linux
COMPILE_FLAGS_FILES: buildSrc/linux.gradle
HUDSON_JOB_NAME: not_hudson
HUDSON_BUILD_NUMBER: 0000
PROMOTED_BUILD_NUMBER: 00
PRODUCT_NAME: OpenJFX
RAW_VERSION: 8.0.162
RELEASE_NAME: 8u162
RELEASE_MILESTONE: ea
UPDATE_STUB_CACHE: false
The CompileOptions.useAnt property has been deprecated and is scheduled to be removed in Gradle 2.0. There is no replacement for this property.
:checkJfxrtJar FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/home/name/Downloads/git open-jfx/src/rt-8u172-b00/build.gradle' line: 219

* What went wrong:
Execution failed for task ':checkJfxrtJar'.
> FAIL: /usr/lib/jvm/java-8-openjdk/jre/lib/ext/jfxrt.jar must be removed before building sdk

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 28.251 secs
==> ERROR: A failure occurred in build().
    Aborting...
==> Removing installed dependencies...
checking dependencies...
:: subversion optionally requires ruby: for some hook scripts
warning: dependency cycle detected:
warning: rubygems will be removed after its ruby dependency

Packages (6) cmake-3.13.3-1  gperf-3.1-2  jsoncpp-1.8.4-2  libuv-1.25.0-1  ruby-2.6.0-5  rubygems-3.0.2-3

Total Removed Size:  48.63 MiB

:: Do you want to remove these packages? [Y/n] 


#31

That file is owned by…

$ pacman -Qo /usr/lib/jvm/java-8-openjdk/jre/lib/ext/jfxrt.jar
/usr/lib/jvm/java-8-openjdk/jre/lib/ext/jfxrt.jar is owned by java-openjfx 8.u172-2

so I’d uninstall java-openjfx.


#32

ok so before i uninstalled java-openjfk and after i uninstalled it, im stuck here:

make: *** No rule to make target '../../../gstreamer-lite/%.c', needed by '/home/name/Downloads/git'.  Stop.
:media:buildLinuxGStreamer FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/home/name/Downloads/git open-jfx/src/rt-8u172-b00/build.gradle' line: 2274

* What went wrong:
Execution failed for task ':media:buildLinuxGStreamer'.
> Process 'command 'make'' finished with non-zero exit value 2


#33

If I remember well, JavaFX needs the ffmpeg2.8 (AUR) package for sound to work. Dunno if it works at he moment, as it periodically stops working. :slight_smile:


#34

I got an updated package built for 8u202b07 (now in unstable). It still aborts with the same stack trace, so it may be a more deep-rooted issue within OpenJFX.

I suspect the next approach will be fixing the ffmpeg-compat-55 build process, and that should go in its own thread.


For reference:

diff --git c/PKGBUILD i/PKGBUILD
index 59a5ccf..8b9c2ac 100644
--- c/PKGBUILD
+++ i/PKGBUILD
@@ -18,11 +18,11 @@
 pkgbase=java-openjfx
 pkgname=('java-openjfx' 'java-openjfx-doc' 'java-openjfx-src')
 _java_ver=8
-_jdk_update=172
-_jdk_build=00
+_jdk_update=202
+_jdk_build=07
 _hgtag=${_java_ver}u${_jdk_update}-b${_jdk_build}
 pkgver=${_java_ver}.u${_jdk_update}
-pkgrel=2
+pkgrel=0
 pkgdesc='Java OpenJFX 8 client application platform (open-source implementation of JavaFX)'
 arch=('x86_64')
 url='https://wiki.openjdk.java.net/display/OpenJFX/Main'
@@ -32,14 +32,15 @@ makedepends=('java-environment-openjdk=8' 'bison' 'gperf' 'gtk2'
              # TODO add junit antlr3 swt so that they are not downloaed during the build
 source=(http://hg.openjdk.java.net/openjfx/8u-dev/rt/archive/${_hgtag}.tar.bz2
         gradle.properties
-        https://services.gradle.org/distributions/gradle-1.8-bin.zip
-        # https://anonscm.debian.org/cgit/pkg-java/openjfx.git/tree/debian/patches/17-gcc-compatibility.patch
-        17-gcc-compatibility.patch)
+        final-files.patch
+        remove-xlocale.patch
+        suppress-cast-error.patch)
 
-sha256sums=('7d6aa064c1368dcba9c781083440368f835823e41b98ef61c4f0b6818484eb5a'
+sha256sums=('99366488b43206bb3ceec2462306b453afd81147d87916c48882099a8d1ec109'
             '1d09385ac23d755aec079954247365de3875507641f5ecd7bd3511ebf3fa9e3c'
-            'a342bbfa15fd18e2482287da4959588f45a41b60910970a16e6d97959aea5703'
-            '864967467efeaffdabe1e60b7cfd0a27ce93be55ef45ef9993790219ad164554')
+            'a825d654d3c11f2c99acef1bc6a0027b5c2d8917411a29b40259a194791feb70'
+            'faa8fd4cba7b1e1aaf306453750c7a7e13f81502b67b88fe640fa2497b5c07a2'
+            '95aaa1ece565866608fe77e1c81cdb205b04f099c0cf0adf7318f1cc443db81c')
 
 _openjdk8dir="/usr/lib/jvm/java-8-openjdk"
 
@@ -50,7 +51,9 @@ esac
 
 prepare() {
   cd "rt-${_hgtag}"
-  patch -p1 < "${srcdir}/17-gcc-compatibility.patch"
+  patch -p1 < "${srcdir}/final-files.patch"
+  patch -p1 < "${srcdir}/remove-xlocale.patch"
+  patch -p1 < "${srcdir}/suppress-cast-error.patch"
 }
 
 build() {
@@ -60,7 +63,7 @@ build() {
   export GRADLE_USER_HOME="${srcdir}/gradle_home"
   mkdir -p ${GRADLE_USER_HOME}
 
-  "${srcdir}"/gradle-1.8/bin/gradle
+  sh ./gradlew
 }
 
 package_java-openjfx() {
diff --git c/final-files.patch i/final-files.patch
new file mode 100644
index 0000000..372de18
--- /dev/null
+++ i/final-files.patch
@@ -0,0 +1,13 @@
+diff --git a/buildSrc/src/main/groovy/com/sun/javafx/gradle/NativeCompileTask.groovy b/buildSrc/src/main/groovy/com/sun/javafx/gradle/NativeCompileTask.groovy
+index 9fe29d7..233b01d 100644
+--- a/buildSrc/src/main/groovy/com/sun/javafx/gradle/NativeCompileTask.groovy
++++ b/buildSrc/src/main/groovy/com/sun/javafx/gradle/NativeCompileTask.groovy
+@@ -102,7 +102,7 @@ class NativeCompileTask extends DefaultTask {
+         updateFiles();
+         def source = project.files(allFiles);
+         boolean forceCompile = false;
+-        final Set<File> files = new HashSet<File>();
++        Set<File> files = new HashSet<File>();
+         source.each { File file ->
+             final Map fileData = dependencies.get(file.toString());
+             final boolean isModified = fileData == null ||
diff --git c/remove-xlocale.patch i/remove-xlocale.patch
new file mode 100644
index 0000000..19cc3e4
--- /dev/null
+++ i/remove-xlocale.patch
@@ -0,0 +1,30 @@
+diff --git a/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.56.1/glib/gstrfuncs.c b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.56.1/glib/gstrfuncs.c
+index 72dc130..b4bb920 100644
+--- a/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.56.1/glib/gstrfuncs.c
++++ b/modules/media/src/main/native/gstreamer/3rd_party/glib/glib-2.56.1/glib/gstrfuncs.c
+@@ -37,11 +37,6 @@
+ #include <errno.h>
+ #include <ctype.h>              /* For tolower() */
+ 
+-#ifdef HAVE_XLOCALE_H
+-/* Needed on BSD/OS X for e.g. strtod_l */
+-#include <xlocale.h>
+-#endif
+-
+ #ifdef G_OS_WIN32
+ #include <windows.h>
+ #endif
+diff --git a/modules/web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/xsltlocale.h b/modules/web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/xsltlocale.h
+index 5253de7..57196db 100644
+--- a/modules/web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/xsltlocale.h
++++ b/modules/web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/xsltlocale.h
+@@ -25,9 +25,6 @@
+ #ifdef HAVE_LOCALE_H
+ #include <locale.h>
+ #endif
+-#ifdef HAVE_XLOCALE_H
+-#include <xlocale.h>
+-#endif
+ 
+ typedef locale_t xsltLocale;
+ typedef xmlChar xsltLocaleChar;
diff --git c/suppress-cast-error.patch i/suppress-cast-error.patch
new file mode 100644
index 0000000..fcdfecb
--- /dev/null
+++ i/suppress-cast-error.patch
@@ -0,0 +1,12 @@
+diff --git i/buildSrc/linux.gradle w/buildSrc/linux.gradle
+index c47b7b4..2622fc4 100644
+--- i/buildSrc/linux.gradle
++++ w/buildSrc/linux.gradle
+@@ -44,6 +44,7 @@ LINUX.library = { name -> return "lib${name}.so" as String }
+ def commonFlags = [
+         "-fno-strict-aliasing", "-fPIC", "-fno-omit-frame-pointer", // optimization flags
+         "-fstack-protector",
++        "-Wno-error=cast-function-type",
+         "-W", "-Wall", "-Wno-unused", "-Wno-parentheses", "-Werror=implicit-function-declaration"] // warning flags
+ 
+ if (!IS_64) {

#35

thanks for all your help on this jonathon. i feel like this is a dead end for me and not worth the trouble lol.
i did try the compat-55 but it had a missing key or something and seems like an old solution anyway. i think its down to older .so files that are not in newer ffmpeg packages or something. anyhow thanks.


#36

This package needs patching to build against the current version of libx264.

It looks like ffmpeg-compat-54 has these patches and might provide the compatibility level needed by OpenJFX…

Success? The example code doesn’t crash when ffmpeg-compat-54 is installed but I don’t get any audio output…


#37

i keep getting missing dependencys almost the same between compat-55 and 54
this library - libavutil-52


#38

That’s not actually a problem.

The libavutil-52 package is in the AUR, so either build and install that first or use an AUR helper, e.g. yay or pamac:

yay -S ffmpeg-compat-54

#39
Making package: libavutil-52 2.3.6-3 (Sun 17 Feb 2019 04:10:08 PM EST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading ffmpeg-2.3.6.tar.bz2...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7265k  100 7265k    0     0  2587k      0  0:00:02  0:00:02 --:--:-- 2586k
  -> Downloading ffmpeg-2.3.6.tar.bz2.asc...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   473  100   473    0     0   1576      0 --:--:-- --:--:-- --:--:--  1571
==> Validating source files with sha256sums...
    ffmpeg-2.3.6.tar.bz2 ... Passed
    ffmpeg-2.3.6.tar.bz2.asc ... Skipped
==> Verifying source file signatures with gpg...
    ffmpeg-2.3.6.tar.bz2 ... FAILED (unknown public key B4322F04D67658D8)
==> ERROR: One or more PGP signatures could not be verified!


#40

#41

==> Finished making: libavutil-52 2.3.6-3 (Sun 17 Feb 2019 04:15:29 PM EST)

makepkg
==> Making package: ffmpeg-compat-54 1.2.12-3 (Sun 17 Feb 2019 04:16:26 PM EST)
==> Checking runtime dependencies…
==> Missing dependencies:
-> libavutil-52
==> Checking buildtime dependencies…
==> ERROR: Could not resolve all dependencies.

what am i missing here? im just calling makepkg do i need a argument


#42

Did you install the libavutil-52 package? e.g. makepkg -i ?

You generally call it with makepkg -sr so it installs any dependencies for the build (and removes any that aren’t needed afterwards).

Worth reading:


#43

ok thanks, its chewing on ffmpeg now…


#44

so i installed libavutil-52 2.3.6-3
and ffmpeg-compat-54 1.2.12-3
do i need to reboot? im still getting same error…
bare in mind i never got the java-openjfx to compile…
and i re-installed the regular java-openjfx from the manjaro repo


#45

it says on the oracles JDK 9 official,
You must install GLIB 2.28 in order to run JavaFX Media.

You must install the following in order to support AAC audio, MP3 audio, H.264 video, and HTTP Live Streaming:

  • libavcodec53 and libavformat53 on Ubuntu Linux 12.04 or equivalent.

at the bottom of the page:
https://www.oracle.com/technetwork/java/javase/jdk9certconfig-3761018.html

so im assuming java-openjfx needs about the same, so im trying the ffmpeg-compat-55 now.

EDIT: annnd that 1 failed lol

CC	libavcodec/libx264.o
libavcodec/libx264.c: In function ‘X264_frame’:
libavcodec/libx264.c:170:9: error: ‘x264_bit_depth’ undeclared (first use in this function); did you mean ‘x264_picture_t’?
     if (x264_bit_depth > 8)
         ^~~~~~~~~~~~~~
         x264_picture_t
libavcodec/libx264.c:170:9: note: each undeclared identifier is reported only once for each function it appears in
libavcodec/libx264.c: In function ‘X264_init_static’:
libavcodec/libx264.c:742:9: error: ‘x264_bit_depth’ undeclared (first use in this function); did you mean ‘x264_picture_t’?
     if (x264_bit_depth == 8)
         ^~~~~~~~~~~~~~
         x264_picture_t
make: *** [common.mak:49: libavcodec/libx264.o] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

#46

so an update here…
the solution that worked for me was to install ffmpeg-compat-54 1.2.12-3.
i first had to install libavutil-52 2.3.6-3 and trust a key during the process:
gpg --recv-key B4322F04D67658D8

all is working now.
i never did get the java-openjfx packages made… but i didnt need them.
i just updated my manjaro today and have the normal package for java-openjfx from the repository.
java-openjfx 8.u202-0 (i tested this version before installing ffmpeg-compat-54 1.2.12-3 and it didnt fix my issue)

one thing that helped me: i realised running makepkg instead of makepkg -sr, that it told me what
dependancys i still needed.

all signs were pointing to ffmpeg-compat-55, even the archwiki states this:
https://wiki.archlinux.org/index.php/java#JavaFX’s_MediaPlayer_constructor_throws_an_exception

however, some code in the ffmpeg-compat-55, is incorrect and will not make, it may be able to be fixed but i didnt want to go deeper into this: libavcodec/libx264.c: In function ‘X264_frame’ the same file in ffmpeg-compat-54 is different and works.

ffmpeg-compat-54 1.2.12-3
https://aur.archlinux.org/packages/ffmpeg-compat-54/

libavutil-52 2.3.6-3
https://aur.archlinux.org/packages/libavutil-52/

thanks for your help.