Package javax.media

Examples of javax.media.CaptureDeviceInfo


  {
    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


    if(deviceName==null || deviceName.length()==0)
    {
      deviceName = "vfw:Microsoft WDM Image Capture (Win32):0";
      System.out.println("Device Name now "+deviceName);
      }
      CaptureDeviceInfo di = CaptureDeviceManager.getDevice( deviceName );
     
      if(di==null)
      {
        deviceName = JOptionPane.showInputDialog("Enter the WebCam device name.\nSee the OpenForum documentation for more information.");
        if(deviceName!=null)
        {
          di = CaptureDeviceManager.getDevice( deviceName );
        }
      }
      if(di==null)
      {
        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

    //now we build the list of things we want to display
    Vector captureDevices = CaptureDeviceManager.getDeviceList(null);
    audioDevices = new Vector();
    for (int i = 0; i < captureDevices.size(); ++i)
      {
      CaptureDeviceInfo cdi = (CaptureDeviceInfo)captureDevices.get(i);
      Format[] formats = cdi.getFormats();
      for (int j = 0; j < formats.length; ++j)
        {
        if (formats[j] instanceof AudioFormat)
          {
          audioDevices.add(cdi);
View Full Code Here

         if (open.getValue()==true && player==null)
         {
            // Create capture device
            try
            {
              CaptureDeviceInfo deviceInfo = CaptureDeviceManager.getDevice(captureDevice.getValue());
              player = Manager.createRealizedPlayer(deviceInfo.getLocator());
              player.start();
            }
            catch (Exception ex)
            {
              element.jException("Cam : exception in Methode process() "+ex);
View Full Code Here

            _debug("--- Capture devices found:");

            Iterator devices = deviceList.iterator();

            while (devices.hasNext()) {
                CaptureDeviceInfo device = (CaptureDeviceInfo) devices.next();
                _debug(device.getName());
            }

            _debug("---");
        }

        // Choose the device from the device list.
        // 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

  {
    int tries = 100;
   
    try
    {
      CaptureDeviceInfo dev = CaptureDeviceManager.getDevice( device );
      p = Manager.createRealizedPlayer( dev.getLocator() );

      fg = (FrameGrabbingControl)p.getControl("javax.media.control.FrameGrabbingControl");
      FormatControl fc = (FormatControl)p.getControl("javax.media.control.FormatControl");
      Format[] devVec = dev.getFormats();
     
      for (int i=0 ; i<devVec.length; i++)
      {
        if ( devVec[i] instanceof VideoFormat && ((VideoFormat)devVec[i]).getSize().equals(imageResolution))
        {
View Full Code Here

  }
 
 
  private void deviceComboWidgetSelected(SelectionEvent evt)
  {
    CaptureDeviceInfo selectedDev;
    selectedDev=findCaptureDevice(deviceCombo.getText());
    resolutionCombo.removeAll();
    if (selectedDev != null)
    {
      Format[] devVec= selectedDev.getFormats();
      for (int i=0 ; i<devVec.length; i++)
      {
        if (devVec[i] instanceof VideoFormat && devVec[i] instanceof RGBFormat && ((RGBFormat)devVec[i]).getBitsPerPixel()== 24 )
        {
          Dimension size = ((VideoFormat)devVec[i]).getSize();
View Full Code Here

 
  private void fillDeviceCombo()
  {
    String device = null;
    CaptureDeviceInfo dev;
    deviceCombo.removeAll();
    for (int i=0; i<10;i++)
    {
      device = Defines.WEBCAM_DEVICE_WIN + i;
      dev = CaptureDeviceManager.getDevice(device);
      if (dev != null)
        deviceCombo.add(dev.getName());
       
    }
  }
View Full Code Here

  }
 
 
  private CaptureDeviceInfo findCaptureDevice(String name)
  {
    CaptureDeviceInfo tempDev;
    tempDev=CaptureDeviceManager.getDevice(name);
    if (tempDev != null)
      return tempDev;
    else
      return null ;
View Full Code Here

        .getDeviceList(new VideoFormat("RGB"));
    if (deviceInfos.isEmpty()) {
      System.out.println("No capture devices found.");
    } else {
      for (Object o : deviceInfos) {
        CaptureDeviceInfo info = (CaptureDeviceInfo) o;
        System.out.println(info.getName() + " :");
        for (Format format : info.getFormats()) {
          System.out
              .println(String.format("\t%s", format.toString()));
        }
      }
    }
View Full Code Here

TOP

Related Classes of javax.media.CaptureDeviceInfo

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.