Package javax.media

Examples of javax.media.MediaLocator


            localIp = this.getLocal().getLocalIp();
            localPort = this.getLocal().getPort();
            remotePort = this.getRemote().getPort();
        }

        audioChannel = new AudioChannel(new MediaLocator(this.getMediaLocator()), localIp, ip, localPort, remotePort, AudioFormatUtils.getAudioFormat(this.getPayloadType()),this);
    }
View Full Code Here


                            "Please select another file name.");
                }
            }
        }

        MediaLocator mediaLocator = new MediaLocator(_fileRoot);

        if (mediaLocator == null) {
            throw new IllegalActionException("Could not create "
                    + "MediaLocator from the given URL: " + _fileRoot);
        }
View Full Code Here

        // FIXME: This isn't crashing gracefully at all.
        CaptureDeviceInfo captureDeviceInfo = (CaptureDeviceInfo) deviceList
                .get(((IntToken) deviceNumber.getToken()).intValue());

        // Create a locator for this device.
        MediaLocator locator = captureDeviceInfo.getLocator();

        // Attempt to create a processor for this locator.
        try {
            _processor = Manager.createProcessor(locator);
        } catch (Exception ex) {
View Full Code Here

    private static synchronized Player createPlayer(String mediaUri) {
        try {
            URL url = replaceJarUrlWithFileUrl(ResourceManager.getResource(mediaUri), mediaUri);

            MediaLocator locator = new MediaLocator(url);
            final Player mediaPlayer = Manager.createRealizedPlayer(locator);

            // add a listener to put us in an infinite loop
            mediaPlayer.addControllerListener(new ControllerListener() {
                public void controllerUpdate(ControllerEvent evt) {
View Full Code Here

public class FindDupMusic extends AbstractFileScan {

  public static double getLength(final File fileLocation)
      throws MediaException, IOException {
    final MediaLocator mediaLocator = new MediaLocator(fileLocation
        .getAbsolutePath());
    final Player playMP3 = Manager.createPlayer(mediaLocator);
    return playMP3.getDuration().getSeconds();
  }
View Full Code Here

    setMovie( new File( path ).toURI().toURL() );
  }
 
  public void setMovie( URL path )
  {
    mp.setMediaLocator( new MediaLocator( path ));
    mp.realize();
    fpc = null;
    revalidate();
//    checkCEF();
  }
View Full Code Here

  /**
   * Create a media locator from the given string.
   */
  static MediaLocator createMediaLocator(String url) {

    MediaLocator ml;

    if (url.indexOf(":") > 0 && (ml = new MediaLocator(url)) != null)
      return ml;

    if (url.startsWith(File.separator)) {
      if ((ml = new MediaLocator("file:" + url)) != null)
        return ml;
    } else {
      String file = "file:" + System.getProperty("user.dir")
          + File.separator + url;
      if ((ml = new MediaLocator(file)) != null)
        return ml;
    }

    return null;
  }
View Full Code Here

        for (int i = 0; i < fileLst.length; i++) {
          imgLst.add(fileLst[i].getAbsolutePath());
        }
        logger.trace("writing " + imgLst.size() + " frames to file " + output);
        // Generate the output media locators.
        MediaLocator oml;
        if ((oml = imageToMovie.createMediaLocator(output.toString())) == null) {
          logger.debug("Cannot build media locator from: " + output);
        }
       
        if (imageToMovie.doIt(screenRegion.getBounds().width,
View Full Code Here

      }

      // Set up the sink
      outFile = new java.io.File(fileName);
      sink = Manager.createDataSink(processor.getDataOutput(),
          new MediaLocator(toURL(outFile)));
      sink.addDataSinkListener(this);
      sink.open();
      processor.start();
      sink.start();
      isSetup = true;
View Full Code Here

    });
    cameraPanel.switchFeed(0);
  }

  private boolean VideoValidationChecker(String path) {
    MediaLocator ml;
    String url = "file:" + path;
    if ((ml = new MediaLocator(url)) == null) {
      System.err.println("Cannot build media locator from: " + url);
      System.exit(0);
    }

    return camera.open(ml);
View Full Code Here

TOP

Related Classes of javax.media.MediaLocator

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.