Package javax.media

Examples of javax.media.MediaLocator


  {
    // init FMJ/JMF logging/classpath
    FmjStartup.init();
   
    // create both data sources:
    final DataSource dsVideo = Manager.createDataSource(new MediaLocator("civil:/0"));
   
    // merge them:
    final DataSource dsCloneable = Manager.createCloneableDataSource(dsVideo);
    final DataSource dsClone = ((SourceCloneable) dsCloneable).createClone();
   
View Full Code Here


        assertTrue(f.exists());
       
        // TODO: JMF and FMJ behave differently with unknown/missing files
       
        {
          Player p = Manager.createPlayer(new MediaLocator("file://" + f.getAbsolutePath()));
          assertEquals(TestDemux.instance.getStringBuffer().toString(), "setSource\ngetDuration\n");
        }
   
       
        {
          try
          {
            Player p = Manager.createRealizedPlayer(new MediaLocator("file://" + f.getAbsolutePath()));
            assertTrue(false);
          }
          catch (CannotRealizeException e)
          {
          }
View Full Code Here

      }

      // Now, we'll need to create a DataSink.
      // Caution: do not use file.toURI().toURL() with JMF
      dataSink = Manager.createDataSink(processor.getDataOutput(),
          new MediaLocator(file.toURL()));
      dataSink.open();
      dataSink.addDataSinkListener(dataSinkListener);
      this.fileDone = false;

      // Start the actual transcoding
View Full Code Here

    if(deviceName==null)
    {
      deviceName = "vfw:Microsoft WDM Image Capture (Win32):0";
    }
      CaptureDeviceInfo di = CaptureDeviceManager.getDevice( deviceName );
      MediaLocator ml = di.getLocator();
    
      player = Manager.createRealizedPlayer(ml);
      player.start();
     
      while(player.getState()!=Player.Started)
View Full Code Here

      {
        JOptionPane.showConfirmDialog(null,"No WebCam with the device name could be found.");
        return;
      }
     
      MediaLocator ml = di.getLocator();
 
      player = Manager.createRealizedPlayer(ml);
      player.start();
     
      int state = -1;
View Full Code Here

            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

    }

    public void testAudioChannelOpenClose() {
        for (int i = 0; i < 5; i++) {
            try {
                AudioChannel audioChannel0 = new AudioChannel(new MediaLocator("javasound://"), InetAddress.getLocalHost()
                        .getHostAddress(), InetAddress.getLocalHost().getHostAddress(), 7002, 7020, new AudioFormat(
                        AudioFormat.GSM_RTP), null);
                AudioChannel audioChannel1 = new AudioChannel(new MediaLocator("javasound://"), InetAddress.getLocalHost()
                        .getHostAddress(), InetAddress.getLocalHost().getHostAddress(), 7020, 7002, new AudioFormat(
                        AudioFormat.GSM_RTP), null);

                audioChannel0.start();
                audioChannel1.start();
View Full Code Here

    }

    public void testAudioChannelStartStop() {

        try {
            AudioChannel audioChannel0 = new AudioChannel(new MediaLocator("javasound://"), InetAddress.getLocalHost()
                    .getHostAddress(), InetAddress.getLocalHost().getHostAddress(), 7002, 7020,
                    new AudioFormat(AudioFormat.GSM_RTP), null);
            AudioChannel audioChannel1 = new AudioChannel(new MediaLocator("javasound://"), InetAddress.getLocalHost()
                    .getHostAddress(), InetAddress.getLocalHost().getHostAddress(), 7020, 7002,
                    new AudioFormat(AudioFormat.GSM_RTP), null);

            for (int i = 0; i < 5; i++) {
View Full Code Here

            ds = javax.media.Manager.createDataSource(locator);
        }
        catch (Exception e) {
            // Try JavaSound Locator as a last resort
            try {
                ds = javax.media.Manager.createDataSource(new MediaLocator("javasound://"));
            }
            catch (Exception ee) {
                return "Couldn't create DataSource";
            }
        }
View Full Code Here

        InetAddress localhost;
        try {
            localhost = InetAddress.getLocalHost();

            AudioChannel audioChannel0 = new AudioChannel(new MediaLocator("javasound://8000"), localhost.getHostAddress(), localhost.getHostAddress(), 7002, 7020, new AudioFormat(AudioFormat.GSM_RTP), null);
            AudioChannel audioChannel1 = new AudioChannel(new MediaLocator("javasound://8000"), localhost.getHostAddress(), localhost.getHostAddress(), 7020, 7002, new AudioFormat(AudioFormat.GSM_RTP), null);

            audioChannel0.start();
            audioChannel1.start();

            try {
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.