Class CaptureDeviceInfo2

  • All Implemented Interfaces:
    Serializable

    public class CaptureDeviceInfo2
    extends javax.media.CaptureDeviceInfo
    Adds some important information (i.e. device type, UID.) to FMJ CaptureDeviceInfo.
    Author:
    Vincent Lucas, Lyubomir Marinov
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class javax.media.CaptureDeviceInfo

        formats, locator, name
    • Constructor Summary

      Constructors 
      Constructor Description
      CaptureDeviceInfo2​(String name, javax.media.MediaLocator locator, javax.media.Format[] formats, String uid, String transportType, String modelIdentifier)
      Initializes a new CaptureDeviceInfo2 instance with the specified name, media locator, and array of Format objects.
      CaptureDeviceInfo2​(javax.media.CaptureDeviceInfo captureDeviceInfo, String uid, String transportType, String modelIdentifier)
      Initializes a new CaptureDeviceInfo2 instance from a specific CaptureDeviceInfo instance and additional information specific to the CaptureDeviceInfo2 class.
    • Constructor Detail

      • CaptureDeviceInfo2

        public CaptureDeviceInfo2​(javax.media.CaptureDeviceInfo captureDeviceInfo,
                                  String uid,
                                  String transportType,
                                  String modelIdentifier)
        Initializes a new CaptureDeviceInfo2 instance from a specific CaptureDeviceInfo instance and additional information specific to the CaptureDeviceInfo2 class. Because the properties of the specified captureDeviceInfo are copied into the new instance, the constructor is to be used when a CaptureDeviceInfo exists for other purposes already; otherwise, it is preferable to use CaptureDeviceInfo2(String, MediaLocator, Format[], String, String, String).
        Parameters:
        captureDeviceInfo - the CaptureDeviceInfo whose properties are to be copied into the new instance
        uid - the unique identifier of the hardware device (interface) which is to be represented by the new instance
        transportType - the transport type (e.g. USB) of the device to be represented by the new instance
        modelIdentifier - the persistent identifier of the model of the hardware device to be represented by the new instance
      • CaptureDeviceInfo2

        public CaptureDeviceInfo2​(String name,
                                  javax.media.MediaLocator locator,
                                  javax.media.Format[] formats,
                                  String uid,
                                  String transportType,
                                  String modelIdentifier)
        Initializes a new CaptureDeviceInfo2 instance with the specified name, media locator, and array of Format objects.
        Parameters:
        name - the human-readable name of the new instance
        locator - the MediaLocator which uniquely identifies the device to be described by the new instance
        formats - an array of the Formats supported by the device to be described by the new instance
        uid - the unique identifier of the hardware device (interface) which is to be represented by the new instance
        transportType - the transport type (e.g. USB) of the device to be represented by the new instance
        modelIdentifier - the persistent identifier of the model of the hardware device to be represented by the new instance
    • Method Detail

      • equals

        public boolean equals​(Object obj)
        Determines whether a specific Object is equal (by value) to this instance.
        Overrides:
        equals in class javax.media.CaptureDeviceInfo
        Parameters:
        obj - the Object to be determined whether it is equal (by value) to this instance
        Returns:
        true if the specified obj is equal (by value) to this instance; otherwise, false
      • getIdentifier

        public String getIdentifier()
        Returns the device identifier used to save and load device preferences. It is composed by the system UID if not null. Otherwise returns the device name and (if not null) the transport type.
        Returns:
        The device identifier.
      • getTransportType

        public String getTransportType()
        Returns the device transport type of this instance.
        Returns:
        the device transport type of this instance
      • getUID

        public String getUID()
        Returns the device UID (unique identifier) of this instance, if available. If unavailable (e.g. because the device system does not have persistent names, like ALSA) it falls back to getModelIdentifier().
        Returns:
        the device UID (unique identifier) of this instance
      • getModelIdentifier

        public String getModelIdentifier()
        Returns the model identifier of this instance.
        Returns:
        the model identifier of this instance
      • hashCode

        public int hashCode()
        Returns a hash code value for this object for the benefit of hashtables.
        Overrides:
        hashCode in class javax.media.CaptureDeviceInfo
        Returns:
        a hash code value for this object for the benefit of hashtables
      • isSameTransportType

        public boolean isSameTransportType​(String transportType)
        Determines whether a specific transport type is equal to/the same as the transport type of this instance.
        Parameters:
        transportType - the transport type to compare to the transport type of this instance
        Returns:
        true if the specified transportType is equal to/the same as the transport type of this instance; otherwise, false