Package net.pms.configuration

Examples of net.pms.configuration.RendererConfiguration


     */
    @Test
  public void testRendererConfigurationBasics() {
      // This test is only useful if the MediaInfo library is available
    assumeTrue(mediaInfoParserIsValid);
    RendererConfiguration conf = RendererConfiguration.getRendererConfigurationByName("Playstation 3");
    assertNotNull("Renderer named \"Playstation 3\" found.", conf);
    assertEquals("With nothing provided isCompatible() should return false", false,
        conf.isCompatible(null, null));
  }
View Full Code Here


  @Test
  public void testPlaystationImageGifCompatibility() {
      // This test is only useful if the MediaInfo library is available
    assumeTrue(mediaInfoParserIsValid);

    RendererConfiguration conf = RendererConfiguration.getRendererConfigurationByName("Playstation 3");
    assertNotNull("Renderer named \"Playstation 3\" found.", conf);

    // Construct GIF information
    DLNAMediaInfo info = new DLNAMediaInfo();
    info.setContainer("gif");
    Format format = new GIF();
    format.match("test.gif");
    assertEquals("PS3 is compatible with GIF", true,
        conf.isCompatible(info, format));
  }
View Full Code Here

  @Test
  public void testPlaystationImagePngCompatibility() {
      // This test is only useful if the MediaInfo library is available
    assumeTrue(mediaInfoParserIsValid);

    RendererConfiguration conf = RendererConfiguration.getRendererConfigurationByName("Playstation 3");
    assertNotNull("Renderer named \"Playstation 3\" found.", conf);

    // Construct JPG information
    DLNAMediaInfo info = new DLNAMediaInfo();
    info.setContainer("png");
    Format format = new PNG();
    format.match("test.png");
    assertEquals("PS3 is compatible with PNG", true,
        conf.isCompatible(info, format));
  }
View Full Code Here

  @Test
  public void testPlaystationImageTiffCompatibility() {
      // This test is only useful if the MediaInfo library is available
    assumeTrue(mediaInfoParserIsValid);

    RendererConfiguration conf = RendererConfiguration.getRendererConfigurationByName("Playstation 3");
    assertNotNull("Renderer named \"Playstation 3\" found.", conf);

    // Construct JPG information
    DLNAMediaInfo info = new DLNAMediaInfo();
    info.setContainer("tiff");
    Format format = new TIF();
    format.match("test.tiff");
    assertEquals("PS3 is compatible with TIFF", true,
        conf.isCompatible(info, format));
  }
View Full Code Here

  @Test
  public void testPlaystationAudioMp3Compatibility() {
      // This test is only useful if the MediaInfo library is available
    assumeTrue(mediaInfoParserIsValid);

    RendererConfiguration conf = RendererConfiguration.getRendererConfigurationByName("Playstation 3");
    assertNotNull("Renderer named \"Playstation 3\" found.", conf);

    // Construct regular two channel MP3 information
    DLNAMediaInfo info = new DLNAMediaInfo();
    info.setContainer("mp3");
    info.setMimeType(HTTPResource.AUDIO_MP3_TYPEMIME);
    DLNAMediaAudio audio = new DLNAMediaAudio();
    audio.getAudioProperties().setNumberOfChannels(2);
    List<DLNAMediaAudio> audioCodes = new ArrayList<>();
    audioCodes.add(audio);
    info.setAudioTracksList(audioCodes);
    Format format = new MP3();
    format.match("test.mp3");
    assertEquals("PS3 is compatible with MP3", true,
        conf.isCompatible(info, format));

    // Construct five channel MP3 that the PS3 does not support natively
    audio.getAudioProperties().setNumberOfChannels(5);
    assertEquals("PS3 is incompatible with five channel MP3", false,
        conf.isCompatible(info, format));
  }
View Full Code Here

  @Test
  public void testPlaystationVideoMpgCompatibility() {
      // This test is only useful if the MediaInfo library is available
    assumeTrue(mediaInfoParserIsValid);

    RendererConfiguration conf = RendererConfiguration.getRendererConfigurationByName("Playstation 3");
    assertNotNull("Renderer named \"Playstation 3\" found.", conf);

    // Construct regular two channel MPG information
    DLNAMediaInfo info = new DLNAMediaInfo();
    info.setContainer("avi");
    DLNAMediaAudio audio = new DLNAMediaAudio();
    audio.setCodecA("ac3");
    audio.getAudioProperties().setNumberOfChannels(5);
    List<DLNAMediaAudio> audioCodes = new ArrayList<>();
    audioCodes.add(audio);
    info.setAudioTracksList(audioCodes);
    info.setCodecV("mp4");
    Format format = new MPG();
    format.match("test.avi");
    assertEquals("PS3 is compatible with MPG", true,
        conf.isCompatible(info, format));

    // Construct MPG with wmv codec that the PS3 does not support natively
    info.setCodecV("wmv");
    assertEquals("PS3 is incompatible with MPG with wmv codec", false,
        conf.isCompatible(info, format));
  }
View Full Code Here

  @Test
  public void testPlaystationVideoMkvCompatibility() {
      // This test is only useful if the MediaInfo library is available
    assumeTrue(mediaInfoParserIsValid);

    RendererConfiguration conf = RendererConfiguration.getRendererConfigurationByName("Playstation 3");
    assertNotNull("Renderer named \"Playstation 3\" found.", conf);

    // Construct MKV information
    DLNAMediaInfo info = new DLNAMediaInfo();
    info.setContainer("mkv");
    DLNAMediaAudio audio = new DLNAMediaAudio();
    audio.setCodecA("ac3");
    audio.getAudioProperties().setNumberOfChannels(5);
    List<DLNAMediaAudio> audioCodes = new ArrayList<>();
    audioCodes.add(audio);
    info.setAudioTracksList(audioCodes);
    info.setCodecV("mp4");
    Format format = new MPG();
    format.match("test.mkv");
    assertEquals("PS3 is incompatible with MKV", false,
        conf.isCompatible(info, format));
  }
View Full Code Here

  public void testBackwardsCompatibility() {
      // This test is only useful if the MediaInfo library is available
    assumeTrue(mediaInfoParserIsValid);

    // Testing ps3compatible(), so use renderer Playstation 3
    RendererConfiguration conf = RendererConfiguration.getRendererConfigurationByName("Playstation 3");
    assertNotNull("Renderer named \"Playstation 3\" found.", conf);

    // DVRMS: false
    DLNAMediaInfo info = new DLNAMediaInfo();
    info.setContainer("dvr");
    Format format = new DVRMS();
    format.match("test.dvr");
    assertEquals("isCompatible() gives same outcome as ps3compatible() for DVRMS",
        format.ps3compatible(),  conf.isCompatible(info, format));

    // ISO: false
    info = new DLNAMediaInfo();
    info.setContainer("iso");
    format = new ISO();
    format.match("test.iso");
    assertEquals("isCompatible() gives same outcome as ps3compatible() for ISO",
        format.ps3compatible(),  conf.isCompatible(info, format));

    // JPG: true
    info = new DLNAMediaInfo();
    info.setContainer("jpg");
    format = new JPG();
    format.match("test.jpeg");
    assertEquals("isCompatible() gives same outcome as ps3compatible() for JPG",
        format.ps3compatible(),  conf.isCompatible(info, format));

    // M4A: false
    info = new DLNAMediaInfo();
    info.setContainer("m4a");
    format = new M4A();
    format.match("test.m4a");
    assertEquals("isCompatible() gives same outcome as ps3compatible() for M4A",
        format.ps3compatible(),  conf.isCompatible(info, format));

    // MKV: false
    info = new DLNAMediaInfo();
    info.setContainer("mkv");
    format = new MKV();
    format.match("test.mkv");
    assertEquals("isCompatible() gives same outcome as ps3compatible() for MKV",
        format.ps3compatible(),  conf.isCompatible(info, format));

    // MP3: true
    info = new DLNAMediaInfo();
    info.setContainer("mp3");
    format = new MP3();
    format.match("test.mp3");
    assertEquals("isCompatible() gives same outcome as ps3compatible() for MP3",
        format.ps3compatible(),  conf.isCompatible(info, format));

    // MPG: true
    info = new DLNAMediaInfo();
    info.setContainer("avi");
    format = new MPG();
    format.match("test.mpg");
    assertEquals("isCompatible() gives same outcome as ps3compatible() for MPG",
        format.ps3compatible(),  conf.isCompatible(info, format));

    // OGG: false
    info = new DLNAMediaInfo();
    info.setContainer("ogg");
    format = new OGG();
    format.match("test.ogg");
    assertEquals("isCompatible() gives same outcome as ps3compatible() for OGG",
        format.ps3compatible(),  conf.isCompatible(info, format));

    // RAW: false
    info = new DLNAMediaInfo();
    info.setContainer("raw");
    format = new RAW();
    format.match("test.arw");
    assertEquals("isCompatible() gives same outcome as ps3compatible() for RAW",
        format.ps3compatible(),  conf.isCompatible(info, format));

    // WAV: true
    info = new DLNAMediaInfo();
    info.setContainer("wav");
    format = new WAV();
    format.match("test.wav");
    assertEquals("isCompatible() gives same outcome as ps3compatible() for WAV",
        format.ps3compatible(),  conf.isCompatible(info, format));

    // WEB: type=IMAGE
    info = new DLNAMediaInfo();
    info.setContainer("jpg");
    format = new WEB();
    format.match("http://test.org/");
    format.setType(Format.IMAGE);
    assertEquals("isCompatible() give same outcome as ps3compatible() for WEB image",
        format.ps3compatible(),  conf.isCompatible(info, format));

    // WEB: type=VIDEO
    info = new DLNAMediaInfo();
    info.setContainer("avi");
    format.setType(Format.VIDEO);
    assertEquals("isCompatible() gives same outcome as ps3compatible() for WEB video",
        format.ps3compatible(),  conf.isCompatible(info, format));
  }
View Full Code Here

    for(String h1: h.keySet())  {
      LOGGER.debug("key "+h1+"="+h.get(h1));
    }
    String id = RemoteUtil.getId(path, t);
    id = RemoteUtil.strip(id);
    RendererConfiguration r = render;
    if (render == null) {
      r = root.getDefaultRenderer();
    }
    List<DLNAResource> res = root.getDLNAResources(id, false, 0, 0, r);
    if (res.size() != 1) {
View Full Code Here

  protected void resolveOnce() {
    if (getChildren().size() == 1) { // OK
      DLNAResource child = getChildren().get(0);
      child.resolve();

      RendererConfiguration renderer = null;
      if (this.getParent() != null) {
        renderer = this.getParent().getDefaultRenderer();
      }

      // create copies of the audio/subtitle track lists as we're making (local)
      // modifications to them
      List<DLNAMediaAudio> audioTracks = new ArrayList<>(child.getMedia().getAudioTracksList());
      List<DLNAMediaSubtitle> subtitleTracks = new ArrayList<>(child.getMedia().getSubtitleTracksList());

      // assemble copies for each combination of audio, subtitle and player
      ArrayList<DLNAResource> entries = new ArrayList<>();

      // First, add the option to simply stream the resource.
      // Only add the option if the renderer is compatible with the format
      if (
        child.getFormat() != null &&
        (
          child.getFormat().isCompatible(child.getMedia(), renderer) ||
          child.isSkipTranscode()
        )
      ) {
        if (renderer != null) {
          LOGGER.trace(
            "Duplicating {} for direct streaming to renderer: {}",
            child.getName(),
            renderer.getRendererName()
          );
        }

        DLNAResource noTranscode = createResourceWithAudioSubtitlePlayer(child, null, null, null);
        addChildInternal(noTranscode);
        addChapterFolder(noTranscode);

        // add options for renderer capable to handle streamed subtitles
        if (!configuration.isDisableSubtitles() && renderer != null && renderer.isSubtitlesStreamingSupported()) {
          for (DLNAMediaSubtitle subtitle : subtitleTracks) {
            // only add the option if the renderer supports the given format
            if (subtitle.isExternal()) { // do not check for embedded subs
              if (renderer.isExternalSubtitlesFormatSupported(subtitle)) {
                DLNAResource copy = createResourceWithAudioSubtitlePlayer(child, null, subtitle, null);
                copy.getMediaSubtitle().setSubsStreamable(true);
                entries.add(copy);
                LOGGER.trace(
                  "Duplicating {} for direct streaming subtitles {}",
View Full Code Here

TOP

Related Classes of net.pms.configuration.RendererConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.