Examples of Processor


Examples of com.xmultra.processor.Processor

     * @param node  The element for this Manager in the config file.
     *
     * @return  A Processor instance.
     */
    private Processor getProcessorInstance(Node node) {
        Processor processorInstance = null;
        String processorClassName = "";
        try {

            // Get the default processor's class name.
            processorClassName = xmlParseUtils.getAttributeValueFromNode(
View Full Code Here

Examples of de.matrixweb.smaller.config.Processor

    new File(tempIn, "a.test").createNewFile();
    new File(tempIn, "dir/b.test").createNewFile();
    new File(tempIn, "dir/dir/c.test").createNewFile();
    new File(tempIn, "in").createNewFile();

    final Processor processor = new Processor();
    processor.setSrc("in");
    final ConfigFile configFile = new ConfigFile();
    final Environment env = configFile.getEnvironments().get("first");
    env.setPipeline(new String[] { "processor" });
    env.getProcessors().put("processor", processor);
    env.setProcess("out");
View Full Code Here

Examples of de.matrixweb.smaller.resource.Processor

    String input = processDescription.getInputFile();
    for (final de.matrixweb.smaller.common.ProcessDescription.Processor proc : processDescription
        .getProcessors()) {
      MDC.put("processor", proc.getName());
      try {
        final Processor processor = this.processorFactory.getProcessor(proc
            .getName());
        LOGGER.info("Executing processor {}", proc.getName());
        final Resource result = processor.execute(
            vfs,
            input == null ? null : resolver.resolve(input),
            injectGlobalOptionsFallback(version, manifest, proc.getName(),
                proc.getOptions()));
        input = result == null ? null : result.getPath();
View Full Code Here

Examples of examples.devs.processor.Processor

    addOutPort(PORT_OUT, Job.class);
  }

  private void addSubModels() {
    addModel(new Switch(MODEL_SWITCH));
    addModel(new Processor(MODEL_PROCESSOR0));
    addModel(new Processor(MODEL_PROCESSOR1));
  }
View Full Code Here

Examples of io.fabric8.watcher.Processor

    private BlueprintContainer parentContainer;

    public WatcherBlueprintContainer() {
        this.classLoader = getClass().getClassLoader();
        setFileMatchPattern("glob:**.xml");
        setProcessor(new Processor() {
            public void process(Path path) {
                if (!closing.get()) {
                    addPath(path);
                }
            }
View Full Code Here

Examples of javax.annotation.processing.Processor

    }
    // Cast all the processors here, rather than failing later.
    // But don't call init() until the processor is actually needed.
    _setProcessors = new ArrayList<Processor>(processors.length);
    for (Object o : processors) {
      Processor p = (Processor)o;
      _setProcessors.add(p);
    }
    _setProcessorIter = _setProcessors.iterator();

    // processors set this way take precedence over anything on the command line
View Full Code Here

Examples of javax.media.Processor

  
   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();

    final DataSink[] streamDataSinkHolder = new DataSink[] {null};
    // connect the data output of the processor to a StreamDataSink, which will make the data available to PipedInputStream, which we return.
    final PipedInputStream in = new PipedInputStream() {

      // override close to clean up everything when the media has been served.
      @Override
      public void close() throws IOException
      {
        super.close();
        logger.fine("Closed input stream");
        logger.fine("Stopping processor");
        processor.stop();
        logger.fine("Closing processor");
        processor.close();
        logger.fine("Deallocating processor");
        processor.deallocate();
        if (streamDataSinkHolder[0] != null)
        {  logger.fine("Closing StreamDataSink");
          streamDataSinkHolder[0].close();
        }
      }
     
    };
    final PipedOutputStream out = new PipedOutputStream(in);
    final DataSink streamDataSink = new StreamDataSink(out);
    streamDataSinkHolder[0] = streamDataSink;
   
    streamDataSink.setSource(ds);
    streamDataSink.open();
    streamDataSink.start();
   
    logger.info("Starting processor");
    processor.start();
   
    // TODO: if there is an error, make sure we clean up.
    // for example, if the client breaks the connection.
    // we need a controller listener to listen for errors.
View Full Code Here

Examples of javax.media.Processor

  }
  System.err.println("!!! " + format + " didn't match any stream ");
    }

    boolean createInputDataSource(String mediaFile) {
  Processor proc = null;
  try {
      MediaLocator ml = new MediaLocator(mediaFile);
      proc = Manager.createProcessor(ml);
      if (proc != null) {
    boolean reachedState = waitForState(proc, Processor.Configured);
    if (!reachedState)
        return false;
       
    TrackControl [] tracks = proc.getTrackControls();
    // get the formats, check the type and set the new
    // formats. Realize the proc and get the datasource
    // Set the local variables with datasource/stream/format
    // information
    for (int i = 0; i < tracks.length; i++) {
        Format format = tracks[i].getFormat();
        Format [] supported = tracks[i].getSupportedFormats();
        if (format instanceof AudioFormat) {
            for (int j = 0; j < supported.length; j++) {
                if (supported[j].matches(preferredAudioFormat)) {
                    preferredAudioFormat = (AudioFormat) supported[j];
                    break;
                }
            }
      tracks[i].setFormat(preferredAudioFormat);
        } else if (format instanceof VideoFormat) {
      Dimension size = ((VideoFormat)format).getSize();
      if (MiniME.getSaveType() == 1) {
         
          preferredVideoFormat = new RGBFormat(size,
                 size.width * size.height * 3,
                 Format.byteArray,
                 ((VideoFormat)format).getFrameRate(),
                 24,
                 1, 2, 3);
      } else {
          preferredVideoFormat = new RGBFormat(size,
                 size.width * size.height * 3,
                 Format.byteArray,
                 ((VideoFormat)format).getFrameRate(),
                 24,
                 3, 2, 1,
                 3, size.width * 3,
                 RGBFormat.TRUE,
                 Format.NOT_SPECIFIED);
      }
      for (int j = 0; j < supported.length; j++) {
          if (supported[j].matches(preferredVideoFormat)) {
              preferredVideoFormat = (RGBFormat) supported[j];
              break;
          }
      }
      tracks[i].setFormat(preferredVideoFormat);
        } else {
      System.err.println("Bad track in processor for " + mediaFile);
        }
    }
    proc.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW));
    reachedState = waitForState(proc, Controller.Realized);
    if (!reachedState)
        return false;
    DataSource ds = proc.getDataOutput();
    if (ds == null)
        return false;
    inputSourceNext = ds;
    ds.connect();
    inputStreamsNext = ((PushBufferDataSource)ds).getStreams();
View Full Code Here

Examples of javax.media.Processor

      }
    }

    // Create a processor for this capturedevice & exit if we
    // cannot create it
    Processor processor = null;
    try
    {
      processor = Manager.createProcessor(new MediaLocator(urlStr));
    } catch (IOException e)
    {
      e.printStackTrace();
      System.exit(-1);
    } catch (NoProcessorException e)
    {
      e.printStackTrace();
      System.exit(-1);
    }

    // configure the processor
    processor.configure();

    while (processor.getState() != Processor.Configured)
    {
      try
      {
        Thread.sleep(100);
      } catch (InterruptedException e)
      {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }

    processor.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW_RTP));

    TrackControl track[] = processor.getTrackControls();

    boolean encodingOk = false;

    // Go through the tracks and try to program one of them to
    // output gsm data.

    for (int i = 0; i < track.length; i++)
    {
      if (!encodingOk && track[i] instanceof FormatControl)
      {
        if (((FormatControl) track[i]).setFormat(format) == null)
        {

          track[i].setEnabled(false);
        } else
        {
          encodingOk = true;
        }
      } else
      {
        // we could not set this track to gsm, so disable it
        track[i].setEnabled(false);
      }
    }

    // At this point, we have determined where we can send out
    // gsm data or not.
    // realize the processor
    if (encodingOk)
    {
      if (!new net.sf.fmj.ejmf.toolkit.util.StateWaiter(processor).blockingRealize())
      {
        System.err.println("Failed to realize");
        return;
      }
   
//      while (processor.getState() != Processor.Realized)
//      {
//        try
//        {
//          Thread.sleep(100);
//        } catch (InterruptedException e)
//        {
//          // TODO Auto-generated catch block
//          e.printStackTrace();
//        }
//      }
      // get the output datasource of the processor and exit
      // if we fail
      DataSource ds = null;

      try
      {
        ds = processor.getDataOutput();
      } catch (NotRealizedError e)
      {
        e.printStackTrace();
        System.exit(-1);
      }

      // hand this datasource to manager for creating an RTP
      // datasink our RTP datasink will multicast the audio
      try
      {
        String url = "rtp://192.168.1.4:8000/audio/16";

        MediaLocator m = new MediaLocator(url);

        DataSink d = Manager.createDataSink(ds, m);
        d.open();
        d.start();
       
        System.out.println("Starting processor");
        processor.start();
        Thread.sleep(30000);
      } catch (Exception e)
      {
        e.printStackTrace();
        System.exit(-1);
View Full Code Here

Examples of javax.media.Processor

            new Dimension(160, 120));
  buttonGo.setEnabled(false);
  try {
      sgds.connect();
      sgds.setProgressListener(this);
      Processor p = Manager.createProcessor(sgds);
      boolean success = waitForState(p, Processor.Configured);

      if (!success) {
    System.err.println("Error configuring output processor");
    buttonGo.setEnabled(true);
    return;
      }

      p.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.QUICKTIME));
      success = waitForState(p, Processor.Realized);
      if (!success) {
    System.err.println("Could not realize output processor");
    buttonGo.setEnabled(true);
      }
      DataSource ds = p.getDataOutput();
      doSave(p, ds);
  } catch (Exception ex) {
      buttonGo.setEnabled(true);
      System.err.println("Exception creating processor: " + ex);
  }
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.