Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8098280

Provide media support for libav version 54 and 55

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8u40
    • Component/s: javafx
    • Labels:
    • Environment:

      Linux 64 bit OpenSuse 12.3
      System: Linux version 3.7.10-1.24-desktop running on amd64; UTF-8; de_DE (nb)

      Description

      Running a simple Media/MediaPlayer test program to play mp3 file from disc.

      Runs like charm on Java FX runtime version: 2.2.45-b18/jdk1.7.0.45

      Changing in Netbeans (7.4) Platform from JDK 7 to JDK 8: Java FX runtime version: 8.0.0-b128

      the following exception is thrown:

      INFO: [22] playIndefiniteStream: Read file: file:///home/dev/stream.mp3
      Exception in thread "JavaFX Application Thread" MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!
      at javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146)
      at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:511)
      at javafx.scene.media.MediaPlayer.<init>(MediaPlayer.java:414)
      at pi.util.player.Player$2.changed(Player.java:241)
      at pi.util.player.Player$2.changed(Player.java:220)
      at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:176)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
      at javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(ObjectPropertyBase.java:105)
      at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
      at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:145)
      at javafx.concurrent.Task.setState(Task.java:693)
      at javafx.concurrent.Task$TaskCallable$1.run(Task.java:1421)
      at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:301)
      at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:298)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:298)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
      at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
      at com.sun.glass.ui.gtk.GtkApplication.access$200(GtkApplication.java:48)
      at com.sun.glass.ui.gtk.GtkApplication$6$1.run(GtkApplication.java:149)
      at java.lang.Thread.run(Thread.java:744)
      Caused by: com.sun.media.jfxmedia.MediaException: Could not create player!
      at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:224)
      at com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:104)
      at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:467)
      ... 19 more

      As the MediaPlayer instantiation with JFX 2.2 works fine, I assume all required Linux libraries are present.

      Debugger in JFX code does not give any hint.


                              String fileUrl = theStreamPath.toUri().toString();
                              Logger.getLogger("").log(
                                      Level.INFO,
                                      "playIndefiniteStream: Read file: {0}",
                                      new Object[]{fileUrl});
                              final MediaPlayer mediaPlayer = new MediaPlayer(new Media(fileUrl));
                              mediaPlayer.setOnError(new Runnable() {
                                  @Override public void run() {
                                      Logger.getLogger("").log(
                                              Level.SEVERE,
                                              "playIndefiniteStream: Media Player Error: {0}",
                                              new Object[]{mediaPlayer.getError()});
                                  }
                              });
                              mediaPlayer.setAutoPlay(true);

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                stayer Kirill Kirichenko (Inactive)
                Reporter:
                bklofatjfx Boris Klofat (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: