modules/media/src/main/java/com/sun/media/jfxmediaimpl/platform/PlatformManager.java

Print this page
rev 7591 : RT-38074: [macosx] Separate QTKit platform code from core media code so it can be removed for MAS
Reviewed-by:

@@ -79,10 +79,18 @@
     private PlatformManager() {
         platforms = new ArrayList<Platform>();
 
         Platform platty;
 
+        /*
+         * We don't want to fully initialize the platforms here for performance
+         * reasons but some platforms may be dependent on native resources that
+         * need to be loaded, those platforms need to be given a chance to load
+         * those resources (without initializing) and determine if the natives
+         * are available.
+         */
+
         // Now "universal" platform(s)
         if (isPlatformEnabled("JavaPlatform")) {
             platty = JavaPlatform.getPlatformInstance();
             if (null != platty) {
                 platforms.add(platty);

@@ -119,16 +127,10 @@
             }
             Logger.logMsg(Logger.DEBUG, sb.toString());
         }
     }
 
-    public synchronized void preloadPlatforms() {
-        for (Platform platty : platforms) {
-            platty.preloadPlatform();
-        }
-    }
-
     public synchronized void loadPlatforms() {
         // Use an iterator so we can remove on failure
         Iterator<Platform> iter = platforms.iterator();
         while (iter.hasNext()) {
             Platform platty = iter.next();

@@ -145,10 +147,13 @@
     public List<String> getSupportedContentTypes() {
         ArrayList<String> outTypes = new ArrayList<String>();
 
         if (!platforms.isEmpty()) {
             for (Platform platty : platforms) {
+                if (Logger.canLog(Logger.DEBUG)) {
+                    Logger.logMsg(Logger.DEBUG, "Getting content types from platform: "+platty);
+                }
                 String[] npt = platty.getSupportedContentTypes();
                 if (npt != null) {
                     for (String type : npt) {
                         if (!outTypes.contains(type)) {
                             outTypes.add(type);