Package javax.media.protocol

Examples of javax.media.protocol.ContentDescriptor


{
  private static final Logger logger = LoggerSingleton.logger;

  public CsvAudioMux()
  {
    super(new ContentDescriptor("audio.csv"));
  }
View Full Code Here


      // TODO: what is the right place to apply ContentDescriptor.mimeTypeToPackageName?
      contentTypeStr = ContentDescriptor.mimeTypeToPackageName(conn.getContentType());
    }
   

    contentType = new ContentDescriptor(contentTypeStr);
    sources = new URLSourceStream[1];
    sources[0] = new URLSourceStream();
                                 
    connected = true;
  }
View Full Code Here

      CGUtils.toLiteral(o.getEncoding())
      + ")";
    }
    else if (c == ContentDescriptor.class)
    {
      final ContentDescriptor o = (ContentDescriptor) f;
      return "new ContentDescriptor(" +
      CGUtils.toLiteral(o.getEncoding())
      + ")";
    }
    else if (c == com.sun.media.format.WavAudioFormat.class)
    {
      // TODO: are the parameters correct?
      final com.sun.media.format.WavAudioFormat o = (com.sun.media.format.WavAudioFormat) f;
      return "new com.sun.media.format.WavAudioFormat(" +
      CGUtils.toLiteral(o.getEncoding()) +
      ", " + CGUtils.toLiteral(o.getSampleRate()) +
      //", -1" + // int arg TODO - what is this?
      ", " + CGUtils.toLiteral(o.getSampleSizeInBits()) +
      ", " + CGUtils.toLiteral(o.getChannels()) +
      ", " + CGUtils.toLiteral(o.getFrameSizeInBits()) +
      ", " + CGUtils.toLiteral(o.getAverageBytesPerSecond()) +
      ", " + CGUtils.toLiteral(o.getEndian()) +
      ", " + CGUtils.toLiteral(o.getSigned()) +
      ", " + CGUtils.toLiteral((float) o.getFrameRate()) +
      ", " + dataTypeToStr(o.getDataType()) +
      ", " + CGUtils.toLiteral(o.getCodecSpecificHeader())
      + ")";
    }
    else
    throw new IllegalArgumentException("" + f.getClass());
      //System.err.println(f.getClass());
View Full Code Here

   
    final String s = getContentTypeFor(path)// TODO: use our own mime mapping
    if (s == null)
      throw new IOException("Unknown content type for path: " + path);
    // TODO: what is the right place to apply ContentDescriptor.mimeTypeToPackageName?
    contentType = new ContentDescriptor(ContentDescriptor.mimeTypeToPackageName(s));

    sources = new ResSourceStream[1];
    sources[0] = new ResSourceStream();
                                 
    connected = true;
View Full Code Here

      final ProcessorModel p = new ProcessorModel(
          new Format[] {
            new Format("abc"),
            new Format("xyz")
          },
          new ContentDescriptor("abc"));
      for (int i = 0; i < 4; ++i)
        assertEquals(p.getTrackCount(i), 2);
     
      assertTrue(p.getOutputTrackFormat(0).equals(new Format("abc")));
      assertTrue(p.getOutputTrackFormat(1).equals(new Format("xyz")));
View Full Code Here

  public static Demultiplexer getSourceCompatibleDemultiplexer(DataSource source)
  {
    if (TRACE) logger.fine("Content type: " + source.getContentType());
     
      // loop through demuxs for content type:
    final ContentDescriptor contentDescriptor = new ContentDescriptor(source.getContentType());
      final Vector demuxs = PlugInManager.getPlugInList(contentDescriptor, null, PlugInManager.DEMULTIPLEXER);
      if (TRACE) logger.fine("Num demux: " + demuxs.size());
      for (int i = 0; i < demuxs.size(); ++i)
      {
       
View Full Code Here

  {
    com.sun.media.multiplexer.RawBufferMux m = new com.sun.media.multiplexer.RawBufferMux();
   
    ContentDescriptor[] d = m.getSupportedOutputContentDescriptors(null);
    assertEquals(d.length, 1);
    assertEquals(d[0], new ContentDescriptor("raw"));
   
   
    Format[] f = m.getSupportedInputFormats();
    assertEquals(f.length, 2);
    assertEquals(f[0], new AudioFormat(null, -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray));
    assertEquals(f[1], new VideoFormat(null, null, -1, Format.byteArray, -1.0f));

    ContentDescriptor[] d2 = m.getSupportedOutputContentDescriptors(f);
    assertEquals(d2.length, 1);
    assertEquals(d2[0], new ContentDescriptor("raw"));
   
  }
View Full Code Here

  public void testInputSourceStream() throws IOException
  {
    String test = new File("samplemedia/safexmas.mov").getAbsolutePath();

    InputSourceStream s = new InputSourceStream(new FileInputStream(test), new ContentDescriptor("video.quicktime"));
    assertEquals(s.getContentLength(), -1);
    assertEquals(s.endOfStream(), false);
    assertEquals(s.getControls().length, 0);
    assertEquals(s.getContentDescriptor().getContentType(), "video.quicktime");
    assertEquals(s.willReadBlock(), false);
View Full Code Here

    instance = this;
  }

  public ContentDescriptor[] getSupportedInputContentDescriptors()
  {
    return new ContentDescriptor[] {new ContentDescriptor("audio.test")};
  }
View Full Code Here

  }

  public Format[] getSupportedInputFormats()
  {
    trace("getSupportedInputFormats");
    return new Format[] {new ContentDescriptor("zzz")};
  }
View Full Code Here

TOP

Related Classes of javax.media.protocol.ContentDescriptor

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.