Examples of DLNAMediaInfo


Examples of net.pms.dlna.DLNAMediaInfo

    // Continue the test if the LibMediaInfoParser can be loaded, otherwise skip it.
    assumeTrue(LibMediaInfoParser.isValid());
   
    // Construct media info exactly as VirtualVideoAction does
    DLNAMediaInfo info = new DLNAMediaInfo();
    info.setContainer("mpegps");
    List<DLNAMediaAudio> audioCodes = new ArrayList<>();
    info.setAudioTracksList(audioCodes);
    info.setMimeType("video/mpeg");
    info.setCodecV("mpeg2");
    info.setMediaparsed(true);
    Format format = new MPG();
    format.match("test.mpg");

    // Test without rendererConfiguration, as can happen when plugins
    // create virtual video actions under a folder.
View Full Code Here

Examples of net.pms.dlna.DLNAMediaInfo

      if (res.isSearched()) {
        continue;
      }

      boolean keep = res.getName().toLowerCase().contains(searchCriteria);
      final DLNAMediaInfo media = res.getMedia();

      if (!keep && media != null && media.getAudioTracksList() != null) {
        for (int j = 0; j < media.getAudioTracksList().size(); j++) {
          DLNAMediaAudio audio = media.getAudioTracksList().get(j);
          if (audio.getAlbum() != null) {
            keep |= audio.getAlbum().toLowerCase().contains(searchCriteria);
          }
          if (audio.getArtist() != null) {
            keep |= audio.getArtist().toLowerCase().contains(searchCriteria);
View Full Code Here

Examples of net.pms.dlna.DLNAMediaInfo

    }
    long len = res.get(0).length();
    Range range = RemoteUtil.parseRange(t.getRequestHeaders(), len);
    String mime = root.getDefaultRenderer().getMimeType(res.get(0).mimeType());
    DLNAResource dlna = res.get(0);
    DLNAMediaInfo m = dlna.getMedia();
    if(mime.equals(FormatConfiguration.MIMETYPE_AUTO) && m != null && m.getMimeType() != null) {
      mime = m.getMimeType();
    }
    if (dlna.getFormat().isVideo()) {
      if (flash) {
        mime = "video/flash";
        dlna.setPlayer(new WebPlayer(WebPlayer.FLASH));
View Full Code Here

Examples of net.pms.dlna.DLNAMediaInfo

  /**
   * Parse media info from ffmpeg headers during playback
   */
  public void parseMediaInfo(String filename, final DLNAResource dlna, final ProcessWrapperImpl pw) {
    if (dlna.getMedia() == null) {
      dlna.setMedia(new DLNAMediaInfo());
    } else if (dlna.getMedia().isFFmpegparsed()) {
      return;
    }
    final ArrayList<String> lines = new ArrayList<>();
    final String input = filename.length() > 200 ? filename.substring(0, 199) : filename;
View Full Code Here

Examples of net.pms.dlna.DLNAMediaInfo

    timer1 = -1;
    this.enabled = enabled;

    // Create correct mediaInfo for the embedded .mpg videos
    // This is needed by Format.isCompatible()
    DLNAMediaInfo mediaInfo = new DLNAMediaInfo();
    mediaInfo.setContainer("mpegps");
    ArrayList<DLNAMediaAudio> audioCodes = new ArrayList<>();
    mediaInfo.setAudioTracksList(audioCodes);
    mediaInfo.setMimeType("video/mpeg");
    mediaInfo.setCodecV("mpeg2");
    mediaInfo.setMediaparsed(true);

    setMedia(mediaInfo);
  }
View Full Code Here

Examples of net.pms.dlna.DLNAMediaInfo

                  output(output, subtitleHttpHeader + ": " + subtitleUrl);
                }
              }
            }

            final DLNAMediaInfo media = dlna.getMedia();

            if (media != null) {
              if (StringUtils.isNotBlank(media.getContainer())) {
                name += " [container: " + media.getContainer() + "]";
              }

              if (StringUtils.isNotBlank(media.getCodecV())) {
                name += " [video: " + media.getCodecV() + "]";
              }
            }

            PMS.get().getFrame().setStatusLine("Serving " + name);
View Full Code Here

Examples of net.pms.dlna.DLNAMediaInfo

            if (rendererMimeType != null && !"".equals(rendererMimeType)) {
              output.setHeader(HttpHeaders.Names.CONTENT_TYPE, rendererMimeType);
            }

            final DLNAMediaInfo media = dlna.getMedia();
            if (media != null) {
              if (isNotBlank(media.getContainer())) {
                name += " [container: " + media.getContainer() + "]";
              }

              if (isNotBlank(media.getCodecV())) {
                name += " [video: " + media.getCodecV() + "]";
              }
            }

            PMS.get().getFrame().setStatusLine("Serving " + name);
View Full Code Here

Examples of net.pms.dlna.DLNAMediaInfo

        codecPanel.add(customPanel, BorderLayout.SOUTH);

        while (JOptionPane.showOptionDialog(SwingUtilities.getWindowAncestor((Component) PMS.get().getFrame()),
          codecPanel, Messages.getString("MEncoderVideo.34"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, null, null) == JOptionPane.OK_OPTION) {
          String newCodecparam = textArea.getText();
          DLNAMediaInfo fakemedia = new DLNAMediaInfo();
          DLNAMediaAudio audio = new DLNAMediaAudio();
          audio.setCodecA("ac3");
          fakemedia.setCodecV("mpeg4");
          fakemedia.setContainer("matroska");
          fakemedia.setDuration(45d*60);
          audio.getAudioProperties().setNumberOfChannels(2);
          fakemedia.setWidth(1280);
          fakemedia.setHeight(720);
          audio.setSampleFrequency("48000");
          fakemedia.setFrameRate("23.976");
          fakemedia.getAudioTracksList().add(audio);
          String result[] = getSpecificCodecOptions(newCodecparam, fakemedia, new OutputParams(configuration), "dummy.mpg", "dummy.srt", false, true);

          if (result.length > 0 && result[0].startsWith("@@")) {
            String errorMessage = result[0].substring(2);
            JOptionPane.showMessageDialog(
View Full Code Here

Examples of net.pms.dlna.DLNAMediaInfo

    timer1 = -1;
    this.enabled = enabled;

    // Create correct mediaInfo for the embedded .mpg videos
    // This is needed by Format.isCompatible()
    DLNAMediaInfo mediaInfo = new DLNAMediaInfo();
    mediaInfo.setContainer("mpegps");
    ArrayList<DLNAMediaAudio> audioCodes = new ArrayList<DLNAMediaAudio>();
    mediaInfo.setAudioTracksList(audioCodes);
    mediaInfo.setMimeType("video/mpeg");
    mediaInfo.setCodecV("mpeg2");
    mediaInfo.setMediaparsed(true);
   
    setMedia(mediaInfo);
  }
View Full Code Here

Examples of net.pms.dlna.DLNAMediaInfo

    // 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
TOP
Copyright © 2018 www.massapi.com. 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.