List all capture devices currently known to the JMF : Media « 2D Graphics GUI « Java






List all capture devices currently known to the JMF

List all capture devices currently known to the JMF
/*

Java Media APIs: Cross-Platform Imaging, Media and Visualization
Alejandro Terrazas
Sams, Published November 2002, 
ISBN 0672320940
*/

import javax.media.*;
import java.util.*;

/*******************************************************************************
 * Simple application to list all capture devices currently known to the JMF.
 * The CaptureDeviceManager is queried as to known devices and its output
 * printed to the screen.
 * 
 * @author Michael (Spike) Barlow
 ******************************************************************************/
public class ListCaptureDevices {

  public static void main(String[] args) {

    /////////////////////////////////////////////////////////////
    // Query CaptureDeviceManager about ANY capture devices (null
    // format)
    Vector info = CaptureDeviceManager.getDeviceList(null);
    if (info == null)
      System.out.println("No Capture devices known to JMF");
    else {
      System.out.println("The following " + info.size()
          + " capture devices are known to the JMF");
      for (int i = 0; i < info.size(); i++)
        System.out
            .println("\t" + (CaptureDeviceInfo) info.elementAt(i));
    }
  }
}

           
       








Related examples in the same category

1.Java Media: Find ComponentsJava Media: Find Components
2.Query the manager class about the configuration and support of JMFQuery the manager class about the configuration and support of JMF
3.Show the Location2Location class in actionShow the Location2Location class in action
4.Capture audio or video through devices connected to the PC
5.Choose the media they wish to playChoose the media they wish to play
6.Do Audio Capture
7.Statistics about the tracks that compose a media object
8.Play the media object
9.A Bare Bones Player: play the media object
10.Play the media object 3
11.Transfer media from one location to another carrying out the specified