Package javax.media

Examples of javax.media.ProcessorModel


//     // TODO: this is hard-coded, there must be a better way.
//   }
  
   private InputStream getInputStream(String urlStr, Format outputFormat, ContentDescriptor outputContentDescriptor) throws Exception
   {
     final ProcessorModel processorModel = new ProcessorModel(new MediaLocator(urlStr), outputFormat == null ? null : new Format[]{outputFormat}, outputContentDescriptor);
    
    final Processor processor = Manager.createRealizedProcessor(processorModel);
 
    final DataSource ds = processor.getDataOutput();
View Full Code Here


{

  public void testProcessorModel()
  {
    {
      final ProcessorModel p = new ProcessorModel();
      for (int i = 0; i < 4; ++i)
        assertEquals(p.getTrackCount(i), -1);
     
      assertEquals(p.getOutputTrackFormat(0), null);
      assertEquals(p.getInputLocator(), null);
      assertTrue(p.isFormatAcceptable(0, new Format("xyz")));

    }
   
    {
     
      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")));
      assertEquals(p.getOutputTrackFormat(2), null);
      assertTrue(p.isFormatAcceptable(0, new Format("abc")));
      assertTrue(p.isFormatAcceptable(0, new Format(null)));
      assertFalse(p.isFormatAcceptable(0, new Format("xyz")));
      assertTrue(p.isFormatAcceptable(2, new Format(null)));
      try
      {
        p.isFormatAcceptable(0, null);
        assertTrue(false);
      }
      catch (NullPointerException e)
      {
      }

      final StringBuffer b = new StringBuffer();
      assertTrue(p.isFormatAcceptable(0, new Format("abc"){

        //@Override
        public boolean matches(Format arg0)
        {
          b.append("matches called");
View Full Code Here

TOP

Related Classes of javax.media.ProcessorModel

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.