Moving away from Format.ps3compatible()

Discuss issues related to PS3 Media Server development (only for programmers)

Moving away from Format.ps3compatible()

Postby StreamHD » Tue Jan 10, 2012 7:45 am

Hi

I've been trying to fix the FIXMEs in this commit. Basically, the PS3's support for different formats is hardcoded into PMS, via a method Format.ps3compatible(), which causes problems for non-PS3 renderers e.g. [No Transcode] option does not appear under the #Transcode# folder for an .mkv on a mkv-supporting renderer.

I decided to define an abstract Format.isCompatible(DLNAMediaInfo media, RendererConfiguration renderer) method. The intention is to give flexibility on which detection method will be used for specific formats. Maybe there is a nicer way of doing this?

I have modified the MPEG.java, WAV.java, and MP3.java formats to check the renderers conf for compatibility. The remaining formats will point back to ps3compatible() in order to preserve the experience for formats where generalized compatibility detection has not been defined.

All the FIXMEs were then modified to use the isCompatible() method. The implementation of isCompatible() is working for the VirtualFileTranscodeFolder.java FIXME ([No Transcode] option) and the 1st DLNAResource.java FIXME (stream/transcode decision). I am not sure how to test the remaining 2 FIXMEs ("remove child" and "secondary format").

Here is the diff:
Code: Select all
From 12fb7651b42b4183fc486fce4213890b3db65246 Tue, 10 Jan 2012 06:31:56 +0200
From: StreamHD <hotmail@hotmail.com>
Date: Tue, 10 Jan 2012 05:31:59 +0200
Subject: [PATCH] A small step towards moving from Format.ps3compatible() to a more general Format.isCompatible()

diff --git a/src/main/java/net/pms/configuration/RendererConfiguration.java b/src/main/java/net/pms/configuration/RendererConfiguration.java
index 4289333..99c1a4c 100644
--- a/src/main/java/net/pms/configuration/RendererConfiguration.java
+++ b/src/main/java/net/pms/configuration/RendererConfiguration.java
@@ -9,6 +9,8 @@
 import java.util.regex.Pattern;
 
 import net.pms.Messages;
+import net.pms.PMS;
+import net.pms.dlna.DLNAMediaInfo;
 import net.pms.dlna.MediaInfoParser;
 import net.pms.dlna.RootFolder;
 import net.pms.formats.Format;
@@ -815,4 +817,13 @@
    public boolean isChunkedTransfer() {
       return getBoolean(CHUNKED_TRANSFER, false);
    }
+   
+   public boolean isCompatible(DLNAMediaInfo media, Format ext) {
+      if (isMediaParserV2() && media != null) {
+         if (getFormatConfiguration().match(media) != null) {
+            return true;
+         }
+      }
+      return (ext != null ) ? ext.skip(PMS.getConfiguration().getNoTranscode(), getStreamedExtensions()) : false;
+   }
 }
diff --git a/src/main/java/net/pms/dlna/DLNAResource.java b/src/main/java/net/pms/dlna/DLNAResource.java
index 2a868b9..6ed091d 100644
--- a/src/main/java/net/pms/dlna/DLNAResource.java
+++ b/src/main/java/net/pms/dlna/DLNAResource.java
@@ -543,15 +543,13 @@
                   }
 
                   boolean hasSubsToTranscode = false;
-
                   if (!PMS.getConfiguration().isMencoderDisableSubs()) {
                       hasSubsToTranscode = (PMS.getConfiguration().getUseSubtitles() && child.isSrtFile()) || hasEmbeddedSubs;
                   }
 
                   boolean isIncompatible = false;
-
                   // FIXME: Remove PS3 specific logic to support other renderers
-                  if (!parserV2 && !child.getExt().ps3compatible()) {
+                  if (!child.getExt().isCompatible(child.getMedia(),getDefaultRenderer())) {
                      isIncompatible = true;
                   }
 
@@ -591,7 +589,7 @@
                         }
                      }
                   }
-               } else if (!child.getExt().ps3compatible() && !child.isFolder()) {
+               } else if (!child.getExt().isCompatible(child.getMedia(),getDefaultRenderer()) && !child.isFolder()) {
                   // FIXME: Remove PS3 specific logic to support other renderers
                   getChildren().remove(child);
                }
@@ -604,7 +602,7 @@
                child.second = newChild;
 
                // FIXME: Remove PS3 specific logic to support other renderers
-               if (!newChild.getExt().ps3compatible() && newChild.getExt().getProfiles().size() > 0) {
+               if (!newChild.getExt().isCompatible(newChild.getMedia(),getDefaultRenderer()) && newChild.getExt().getProfiles().size() > 0) {
                   newChild.setPlayer(PMS.get().getPlayer(newChild.getExt().getProfiles().get(0), newChild.getExt()));
                }
                if (child.getMedia() != null && child.getMedia().isSecondaryFormatValid()) {
diff --git a/src/main/java/net/pms/dlna/FileTranscodeVirtualFolder.java b/src/main/java/net/pms/dlna/FileTranscodeVirtualFolder.java
index 6ac90de..8bd1b93 100644
--- a/src/main/java/net/pms/dlna/FileTranscodeVirtualFolder.java
+++ b/src/main/java/net/pms/dlna/FileTranscodeVirtualFolder.java
@@ -19,6 +19,7 @@
 package net.pms.dlna;
 
 import net.pms.PMS;
+import net.pms.configuration.RendererConfiguration;
 import net.pms.dlna.virtual.VirtualFolder;
 import net.pms.encoders.MEncoderVideo;
 import net.pms.encoders.Player;
@@ -103,12 +104,14 @@
             DLNAResource justStreamed = ref.clone();
 
             // FIXME: Remove PS3 specific logic to support other renderers
-            if (justStreamed.getExt() != null && (justStreamed.getExt().ps3compatible() || justStreamed.isSkipTranscode())) {
+            RendererConfiguration renderer = this.getParent() != null ? this.getParent().getDefaultRenderer() : null;
+            if (justStreamed.getExt() != null && (justStreamed.getExt().isCompatible(ref.getMedia(), renderer) || justStreamed.isSkipTranscode())) {
                justStreamed.setPlayer(null);
                justStreamed.setMedia(ref.getMedia());
                justStreamed.setNoName(true);
                addChildInternal(justStreamed);
                addChapterFile(justStreamed);
+               logger.debug("Duplicate " + ref.getName() + " for direct streaming to renderer: " + renderer.getRendererName());
             }
          }
       }
diff --git a/src/main/java/net/pms/formats/DVRMS.java b/src/main/java/net/pms/formats/DVRMS.java
index 4ce99e6..d128cc5 100644
--- a/src/main/java/net/pms/formats/DVRMS.java
+++ b/src/main/java/net/pms/formats/DVRMS.java
@@ -22,6 +22,8 @@
 
 import net.pms.PMS;
 
+import net.pms.configuration.RendererConfiguration;
+import net.pms.dlna.DLNAMediaInfo;
 import net.pms.encoders.FFMpegDVRMSRemux;
 import net.pms.encoders.Player;
 
@@ -58,4 +60,9 @@
    public boolean ps3compatible() {
       return false;
    }
+   
+   @Override
+   public boolean isCompatible(DLNAMediaInfo media, RendererConfiguration renderer) {
+      return ps3compatible();
+   }
 }
diff --git a/src/main/java/net/pms/formats/Format.java b/src/main/java/net/pms/formats/Format.java
index da19969..e294ba2 100644
--- a/src/main/java/net/pms/formats/Format.java
+++ b/src/main/java/net/pms/formats/Format.java
@@ -80,6 +80,18 @@
     * @return True if the format can be handled by PS3, false otherwise.
     */
    public abstract boolean ps3compatible();
+   
+   /**
+    * Returns whether or not a format can be handled by the renderer natively.
+    * This means the format can be streamed instead of having to be transcoded.
+    * <p>
+    * FIXME: Fine-tune detection for each format.
+    * e.g Some formats incorrectly return ps3compatible(). This is done to preserve
+    * the PMS experience where no improvements have been made yet.
+    *
+    * @return True if the format can be handled by the renderer, false otherwise.
+    */
+   public abstract boolean isCompatible(DLNAMediaInfo media, RendererConfiguration renderer);
    public abstract boolean transcodable();
    public abstract ArrayList<Class<? extends Player>> getProfiles();
 
diff --git a/src/main/java/net/pms/formats/JPG.java b/src/main/java/net/pms/formats/JPG.java
index e99306c..1659a60 100644
--- a/src/main/java/net/pms/formats/JPG.java
+++ b/src/main/java/net/pms/formats/JPG.java
@@ -20,6 +20,8 @@
 
 import java.util.ArrayList;
 
+import net.pms.configuration.RendererConfiguration;
+import net.pms.dlna.DLNAMediaInfo;
 import net.pms.encoders.Player;
 
 public class JPG extends Format {
@@ -46,4 +48,9 @@
    public boolean transcodable() {
       return false;
    }
+   
+   @Override
+   public boolean isCompatible(DLNAMediaInfo media, RendererConfiguration renderer) {
+      return ps3compatible();
+   }
 }
diff --git a/src/main/java/net/pms/formats/MP3.java b/src/main/java/net/pms/formats/MP3.java
index b650f6a..90ccc9e 100644
--- a/src/main/java/net/pms/formats/MP3.java
+++ b/src/main/java/net/pms/formats/MP3.java
@@ -20,6 +20,9 @@
 
 import java.util.ArrayList;
 
+import net.pms.PMS;
+import net.pms.configuration.RendererConfiguration;
+import net.pms.dlna.DLNAMediaInfo;
 import net.pms.encoders.Player;
 
 public class MP3 extends Format {
@@ -46,4 +49,9 @@
    public boolean transcodable() {
       return false;
    }
+   
+   @Override
+   public boolean isCompatible(DLNAMediaInfo media, RendererConfiguration renderer) {
+      return (renderer != null) ? renderer.isCompatible(media, this) : skip(PMS.getConfiguration().getNoTranscode(), null);
+   }
 }
diff --git a/src/main/java/net/pms/formats/MPG.java b/src/main/java/net/pms/formats/MPG.java
index cca72ee..f51b79b 100644
--- a/src/main/java/net/pms/formats/MPG.java
+++ b/src/main/java/net/pms/formats/MPG.java
@@ -21,6 +21,8 @@
 import java.util.ArrayList;
 
 import net.pms.PMS;
+import net.pms.configuration.RendererConfiguration;
+import net.pms.dlna.DLNAMediaInfo;
 import net.pms.encoders.FFMpegVideo;
 import net.pms.encoders.MEncoderAviSynth;
 import net.pms.encoders.MEncoderVideo;
@@ -71,4 +73,9 @@
    public boolean ps3compatible() {
       return true;
    }
+   
+   @Override
+   public boolean isCompatible(DLNAMediaInfo media, RendererConfiguration renderer) {
+      return (renderer != null) ? renderer.isCompatible(media, this) : skip(PMS.getConfiguration().getNoTranscode(), null);
+   }
 }
diff --git a/src/main/java/net/pms/formats/WAV.java b/src/main/java/net/pms/formats/WAV.java
index 147167b..52de6f0 100644
--- a/src/main/java/net/pms/formats/WAV.java
+++ b/src/main/java/net/pms/formats/WAV.java
@@ -21,6 +21,8 @@
 import java.util.ArrayList;
 
 import net.pms.PMS;
+import net.pms.configuration.RendererConfiguration;
+import net.pms.dlna.DLNAMediaInfo;
 import net.pms.encoders.FFMpegAudio;
 import net.pms.encoders.MPlayerAudio;
 import net.pms.encoders.Player;
@@ -58,4 +60,9 @@
    public boolean ps3compatible() {
       return true;
    }
+   
+   @Override
+   public boolean isCompatible(DLNAMediaInfo media, RendererConfiguration renderer) {
+      return (renderer != null) ? renderer.isCompatible(media, this) : skip(PMS.getConfiguration().getNoTranscode(), null);
+   }
 }
diff --git a/src/main/java/net/pms/formats/WEB.java b/src/main/java/net/pms/formats/WEB.java
index f7d2b1e..9074db4 100644
--- a/src/main/java/net/pms/formats/WEB.java
+++ b/src/main/java/net/pms/formats/WEB.java
@@ -21,6 +21,8 @@
 import java.util.ArrayList;
 
 import net.pms.PMS;
+import net.pms.configuration.RendererConfiguration;
+import net.pms.dlna.DLNAMediaInfo;
 import net.pms.encoders.MEncoderWebVideo;
 import net.pms.encoders.MPlayerWebAudio;
 import net.pms.encoders.MPlayerWebVideoDump;
@@ -70,4 +72,9 @@
    public boolean transcodable() {
       return true;
    }
+   
+   @Override
+   public boolean isCompatible(DLNAMediaInfo media, RendererConfiguration renderer) {
+      return ps3compatible();
+   }
 }


This log shows my results for several renderers when browsing the same shared video folder:
("for direct streaming" means the video was detected as compatible and a [No Transcode] option has been added)
Code: Select all
Samsung AllShare (using official conf):
[pool-12-thread-1] DEBUG 05:53:08.381 Duplicate 9 [2009].mkv with player: MEncoder and aid: 0 and sid: Sub: ASS/SSA / lang: en / flavor: null / ID: 0 / FILE: -
[pool-12-thread-1] DEBUG 05:53:08.381 Duplicate 9 [2009].mkv for direct streaming to renderer: Samsung AllShare
[pool-13-thread-1] DEBUG 05:53:08.399 Duplicate Cars 2 [2011].avi for direct streaming to renderer: Samsung AllShare
[pool-13-thread-3] DEBUG 05:53:08.400 Duplicate Bunraku [2010].avi for direct streaming to renderer: Samsung AllShare
[pool-13-thread-1] DEBUG 05:53:08.401 Duplicate Rango [2011].avi for direct streaming to renderer: Samsung AllShare
[pool-13-thread-2] DEBUG 05:53:08.403 Duplicate Green Lantern - Emerald Knights [2011].mkv with player: MEncoder and aid: 0 and sid: Sub: Embedded / lang: und / flavor: epicmoviez.com / ID: 0 / FILE: -
[pool-13-thread-2] DEBUG 05:53:08.403 Duplicate Green Lantern - Emerald Knights [2011].mkv for direct streaming to renderer: Samsung AllShare
[pool-13-thread-1] DEBUG 05:53:08.404 Duplicate Thor [2011].avi for direct streaming to renderer: Samsung AllShare
[pool-13-thread-2] DEBUG 05:53:08.408 Duplicate Transformers - Dark of the Moon [2011].avi for direct streaming to renderer: Samsung AllShare
[pool-13-thread-1] DEBUG 05:53:08.409 Duplicate X-Men - First Class [2011].mkv for direct streaming to renderer: Samsung AllShare

Samsung AllShare (using my custom conf):
[pool-12-thread-1] DEBUG 06:05:42.409 Duplicate 9 [2009].mkv with player: MEncoder and aid: 0 and sid: Sub: ASS/SSA / lang: en / flavor: null / ID: 0 / FILE: -
[pool-12-thread-1] DEBUG 06:05:42.410 Duplicate 9 [2009].mkv for direct streaming to renderer: Samsung AllShare
[pool-13-thread-2] DEBUG 06:05:42.421 Duplicate Balls Out - Gary the Tennis Coach [2009].wmv for direct streaming to renderer: Samsung AllShare
[pool-13-thread-3] DEBUG 06:05:42.422 Duplicate Bunraku [2010].avi for direct streaming to renderer: Samsung AllShare
[pool-13-thread-1] DEBUG 06:05:42.422 Duplicate Cars 2 [2011].avi for direct streaming to renderer: Samsung AllShare
[pool-13-thread-2] DEBUG 06:05:42.422 Duplicate Green Lantern - Emerald Knights [2011].mkv with player: MEncoder and aid: 0 and sid: Sub: Embedded / lang: und / flavor: epicmoviez.com / ID: 0 / FILE: -
[pool-13-thread-2] DEBUG 06:05:42.423 Duplicate Green Lantern - Emerald Knights [2011].mkv for direct streaming to renderer: Samsung AllShare
[pool-13-thread-1] DEBUG 06:05:42.423 Duplicate The International [2009].wmv for direct streaming to renderer: Samsung AllShare
[pool-13-thread-3] DEBUG 06:05:42.423 Duplicate Rango [2011].avi for direct streaming to renderer: Samsung AllShare
[pool-13-thread-2] DEBUG 06:05:42.423 Duplicate Thor [2011].avi for direct streaming to renderer: Samsung AllShare
[pool-13-thread-3] DEBUG 06:05:42.424 Duplicate X-Men - First Class [2011].mkv for direct streaming to renderer: Samsung AllShare
[pool-13-thread-1] DEBUG 06:05:42.424 Duplicate Transformers - Dark of the Moon [2011].avi for direct streaming to renderer: Samsung AllShare
[pool-13-thread-2] DEBUG 06:05:42.425 Duplicate XMEN First Class 12GB.m2ts for direct streaming to renderer: Samsung AllShare
[pool-13-thread-1] DEBUG 06:05:42.425 Duplicate X-Men Origins - Wolverine [2009].wmv for direct streaming to renderer: Samsung AllShare
[pool-13-thread-3] DEBUG 06:05:42.425 Duplicate X-Men Origins - Wolverine [2009].mpg for direct streaming to renderer: Samsung AllShare

Xbox 360:
[pool-25-thread-1] DEBUG 05:55:10.048 Duplicate 9 [2009].mkv with player: MEncoder and aid: 0 and sid: Sub: ASS/SSA / lang: en / flavor: null / ID: 0 / FILE: -
[pool-25-thread-2] DEBUG 05:55:10.048 Duplicate Balls Out - Gary the Tennis Coach [2009].wmv for direct streaming to renderer: Xbox 360
[pool-25-thread-2] DEBUG 05:55:10.049 Duplicate Cars 2 [2011].avi for direct streaming to renderer: Xbox 360
[pool-25-thread-3] DEBUG 05:55:10.049 Duplicate Bunraku [2010].avi for direct streaming to renderer: Xbox 360
[pool-25-thread-1] DEBUG 05:55:10.049 Duplicate Green Lantern - Emerald Knights [2011].mkv with player: MEncoder and aid: 0 and sid: Sub: Embedded / lang: und / flavor: epicmoviez.com / ID: 0 / FILE: -
[pool-25-thread-2] DEBUG 05:55:10.049 Duplicate Rango [2011].avi for direct streaming to renderer: Xbox 360
[pool-25-thread-3] DEBUG 05:55:10.049 Duplicate The International [2009].wmv for direct streaming to renderer: Xbox 360
[pool-25-thread-1] DEBUG 05:55:10.050 Duplicate Thor [2011].avi for direct streaming to renderer: Xbox 360
[pool-25-thread-2] DEBUG 05:55:10.050 Duplicate Transformers - Dark of the Moon [2011].avi for direct streaming to renderer: Xbox 360
[pool-25-thread-2] DEBUG 05:55:10.050 Duplicate X-Men Origins - Wolverine [2009].wmv for direct streaming to renderer: Xbox 360

Playstation 3:
[pool-41-thread-1] DEBUG 05:56:55.768 Duplicate 9 [2009].mkv with player: MEncoder and aid: 0 and sid: Sub: ASS/SSA / lang: en / flavor: null / ID: 0 / FILE: -
[pool-41-thread-3] DEBUG 05:56:55.768 Duplicate Bunraku [2010].avi for direct streaming to renderer: Playstation 3
[pool-41-thread-2] DEBUG 05:56:55.768 Duplicate Cars 2 [2011].avi for direct streaming to renderer: Playstation 3
[pool-41-thread-3] DEBUG 05:56:55.768 Duplicate Green Lantern - Emerald Knights [2011].mkv with player: MEncoder and aid: 0 and sid: Sub: Embedded / lang: und / flavor: epicmoviez.com / ID: 0 / FILE: -
[pool-41-thread-1] DEBUG 05:56:55.768 Duplicate Rango [2011].avi for direct streaming to renderer: Playstation 3
[pool-41-thread-1] DEBUG 05:56:55.769 Duplicate Thor [2011].avi for direct streaming to renderer: Playstation 3
[pool-41-thread-3] DEBUG 05:56:55.769 Duplicate Transformers - Dark of the Moon [2011].avi for direct streaming to renderer: Playstation 3
[pool-42-thread-2] DEBUG 05:56:56.170 Duplicate X-Men Origins - Wolverine [2009].mpg for direct streaming to renderer: Playstation 3
[pool-42-thread-1] DEBUG 05:56:56.170 Duplicate XMEN First Class 12GB.m2ts for direct streaming to renderer: Playstation 3


I'd like to hear what you guys think. Your advice/criticism is welcome!
Attachments
ps3compatible.patch.zip
(2.31 KiB) Downloaded 76 times
PMS 1.50.1-Snapshot (latest commit); 400MB buffer;
Samsung LCD D550 Series with custom conf; Sony PS3; Xbox 360;
Win7 x64; JDK-7u2-x64; Intel i7 930 + X58 chipset; 3 x 2GB DDR3 1333Mhz; Gigabit backbone;
StreamHD
 
Posts: 63
Joined: Tue Dec 20, 2011 3:26 am

Re: Moving away from Format.ps3compatible()

Postby ExSport » Thu Jan 12, 2012 8:44 am

Seems promissing 8-)
Hopefully code will be revised and applied to master code if nobody will found some break-ups with other renderers.
Thx
ExSport
 
Posts: 2168
Joined: Mon Jan 19, 2009 5:40 pm

Re: Moving away from Format.ps3compatible()

Postby Raptor399 » Thu Jan 12, 2012 9:16 am

Hey, nice work!

I don't have time right now, but I'll have a look over the weekend.
If you feel like it, you can even create a Pull Request on GitHub for this.
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Moving away from Format.ps3compatible()

Postby StreamHD » Thu Jan 12, 2012 11:58 am

Thanks, I will look into a pull request. The attached patch was created with Eclipse in Git format.

Be warned, when you take a closer look you will see inefficiencies. If you are happy with the abstract isCompatible() method and the respective overrides, I will investigate the possibility of storing the result somewhere after the 1st call, so that subsequent calls can retrieve the value without much computation.

If you have better ideas, feel free to tell me what you want and I'll do my best to get it up to PMS standard.

Edit: Been looking and learning. I will try clean up the inefficiencies before sending a pull-request.
PMS 1.50.1-Snapshot (latest commit); 400MB buffer;
Samsung LCD D550 Series with custom conf; Sony PS3; Xbox 360;
Win7 x64; JDK-7u2-x64; Intel i7 930 + X58 chipset; 3 x 2GB DDR3 1333Mhz; Gigabit backbone;
StreamHD
 
Posts: 63
Joined: Tue Dec 20, 2011 3:26 am

Re: Moving away from Format.ps3compatible()

Postby Raptor399 » Sat Jan 14, 2012 12:17 pm

I have reviewed the patch, made some adjustments and committed it to a fresh branch named "iscompatible".
The proposed change looked good, thanks!

Most of my changes added comments, reformatted code a bit and marked the old method as deprecated.
Formats cannot know upfront what renderers they are compatible with, so there is no need for any format to override the default isCompatible() behavior.
To enforce this, I moved the method to Format and made it final.

What do you think?
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Moving away from Format.ps3compatible()

Postby StreamHD » Sat Jan 14, 2012 1:31 pm

I will take a closer look and comment, thanks for your efforts!

Maybe of interest, I've been studying Format.java and noticed this ps3compatible() problem has existed since at least version 1.21.1 (when multiple renderer support was added)!
PMS 1.50.1-Snapshot (latest commit); 400MB buffer;
Samsung LCD D550 Series with custom conf; Sony PS3; Xbox 360;
Win7 x64; JDK-7u2-x64; Intel i7 930 + X58 chipset; 3 x 2GB DDR3 1333Mhz; Gigabit backbone;
StreamHD
 
Posts: 63
Joined: Tue Dec 20, 2011 3:26 am

Re: Moving away from Format.ps3compatible()

Postby Raptor399 » Sun Jan 15, 2012 9:19 am

Funny how unit tests manage to bring out inconsistencies hidden in old code. :-)
It looks like isCompatible() is fully backwards compatible with ps3compatible(); no build failure when I build the latest version of the iscompatible branch.
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Moving away from Format.ps3compatible()

Postby StreamHD » Sun Jan 15, 2012 5:39 pm

Sorry, haven't had much time lately. Excellent progress! The comments are good... I found the names of the types in the Format type hierarchy to be misleading.

The last commit shows the reason why I chose to make isCompatible() over-ridable... the media info library and force stream extensions are not always enough to assess format compatibility. I guess the idea needs to be made more general before the method can be made final.

What do you think about the liberal use of the RendererConfiguration.match(media) method? It seems to be a long routine and can be called several times for every child added (now that Format.isCompatible() makes use of it). Would probably need some kind of caching system if this causes problems.

Edit: Most of the video formats have been tested and are detecting properly for all my renderers.
PMS 1.50.1-Snapshot (latest commit); 400MB buffer;
Samsung LCD D550 Series with custom conf; Sony PS3; Xbox 360;
Win7 x64; JDK-7u2-x64; Intel i7 930 + X58 chipset; 3 x 2GB DDR3 1333Mhz; Gigabit backbone;
StreamHD
 
Posts: 63
Joined: Tue Dec 20, 2011 3:26 am

Re: Moving away from Format.ps3compatible()

Postby Raptor399 » Sun Jan 15, 2012 7:19 pm

StreamHD wrote:Sorry, haven't had much time lately. Excellent progress! The comments are good... I found the names of the types in the Format type hierarchy to be misleading.

The last commit shows the reason why I chose to make isCompatible() over-ridable... the media info library and force stream extensions are not always enough to assess format compatibility. I guess the idea needs to be made more general before the method can be made final.

Well, the code is a bit peculiar there. WEB isn't a format, it's a protocol. And why would a MP3 or MPG downloaded via the web or some other protocol not be supported by a renderer? It merely means transport will be different.

But that's an exercise for another time. ;-)

What do you think about the liberal use of the RendererConfiguration.match(media) method? It seems to be a long routine and can be called several times for every child added (now that Format.isCompatible() makes use of it). Would probably need some kind of caching system if this causes problems.

If problems arise the outcome can be stored for reuse.
But for now it seems to work as advertised.

Edit: Most of the video formats have been tested and are detecting properly for all my renderers.

Good! After that last commit no problems here either. I'll make a pull request for it.

Thanks for your assistance! :-)
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Moving away from Format.ps3compatible()

Postby StreamHD » Mon Jan 16, 2012 7:10 am

Raptor399 wrote:Well, the code is a bit peculiar there. WEB isn't a format, it's a protocol. And why would a MP3 or MPG downloaded via the web or some other protocol not be supported by a renderer? It merely means transport will be different.

But that's an exercise for another time. ;-)

That makes alot more sense!

Raptor399 wrote:If problems arise the outcome can be stored for reuse.
But for now it seems to work as advertised.

Take a look at the commits to my iscompatible branch. It solves the inefficiencies without getting a headache over WEB.java.

Raptor399 wrote:Thanks for your assistance! :-)

The pleasure is all mine! I've learnt alot from your participation!
PMS 1.50.1-Snapshot (latest commit); 400MB buffer;
Samsung LCD D550 Series with custom conf; Sony PS3; Xbox 360;
Win7 x64; JDK-7u2-x64; Intel i7 930 + X58 chipset; 3 x 2GB DDR3 1333Mhz; Gigabit backbone;
StreamHD
 
Posts: 63
Joined: Tue Dec 20, 2011 3:26 am

Next

Return to Developers

Who is online

Users browsing this forum: No registered users and 2 guests