Class DeviceConfiguration

  • All Implemented Interfaces:
    PropertyChangeListener, EventListener

    public class DeviceConfiguration
    extends org.jitsi.utils.event.PropertyChangeNotifier
    implements PropertyChangeListener
    This class aims to provide a simple configuration interface for JMF. It retrieves stored configuration when started or listens to ConfigurationEvent for property changes and configures the JMF accordingly.
    Author:
    Martin Andre, Emil Ivov, Lyubomir Marinov, Vincent Lucas
    • Field Detail

      • AUDIO_CAPTURE_DEVICE

        public static final String AUDIO_CAPTURE_DEVICE
        The name of the DeviceConfiguration property which represents the device used by DeviceConfiguration for audio capture.
        See Also:
        Constant Field Values
      • AUDIO_NOTIFY_DEVICE

        public static final String AUDIO_NOTIFY_DEVICE
        The name of the DeviceConfiguration property which represents the device used by DeviceConfiguration for audio notify.
        See Also:
        Constant Field Values
      • AUDIO_PLAYBACK_DEVICE

        public static final String AUDIO_PLAYBACK_DEVICE
        The name of the DeviceConfiguration property which represents the device used by DeviceConfiguration for audio playback.
        See Also:
        Constant Field Values
      • DEFAULT_AUDIO_DENOISE

        public static final boolean DEFAULT_AUDIO_DENOISE
        The default value to be used for the PROP_AUDIO_DENOISE property when it does not have a value.
        See Also:
        Constant Field Values
      • DEFAULT_AUDIO_ECHOCANCEL

        public static final boolean DEFAULT_AUDIO_ECHOCANCEL
        The default value to be used for the PROP_AUDIO_ECHOCANCEL property when it does not have a value.
        See Also:
        Constant Field Values
      • DEFAULT_AUDIO_ECHOCANCEL_FILTER_LENGTH_IN_MILLIS

        public static final long DEFAULT_AUDIO_ECHOCANCEL_FILTER_LENGTH_IN_MILLIS
        The default value to be used for the PROP_AUDIO_ECHOCANCEL_FILTER_LENGTH_IN_MILLIS property when it does not have a value. The recommended filter length is approximately the third of the room reverberation time. For example, in a small room, reverberation time is in the order of 300 ms, so a filter length of 100 ms is a good choice (800 samples at 8000 Hz sampling rate).
        See Also:
        Constant Field Values
      • DEFAULT_VIDEO_BITRATE

        public static final int DEFAULT_VIDEO_BITRATE
        The default value for video codec bitrate.
        See Also:
        Constant Field Values
      • DEFAULT_VIDEO_FRAMERATE

        public static final int DEFAULT_VIDEO_FRAMERATE
        The default frame rate, -1 unlimited.
        See Also:
        Constant Field Values
      • DEFAULT_VIDEO_HEIGHT

        public static final int DEFAULT_VIDEO_HEIGHT
        The default video height.
        See Also:
        Constant Field Values
      • DEFAULT_VIDEO_RTP_PACING_THRESHOLD

        public static final int DEFAULT_VIDEO_RTP_PACING_THRESHOLD
        The default value for video maximum bandwidth.
        See Also:
        Constant Field Values
      • DEFAULT_VIDEO_WIDTH

        public static final int DEFAULT_VIDEO_WIDTH
        The default video width.
        See Also:
        Constant Field Values
      • PROP_VIDEO_RTP_PACING_THRESHOLD

        public static final String PROP_VIDEO_RTP_PACING_THRESHOLD
        The property we use to store the settings for maximum allowed video bandwidth (used to normalize RTP traffic, and not in codec configuration)
        See Also:
        Constant Field Values
      • SUPPORTED_RESOLUTIONS

        public static final Dimension[] SUPPORTED_RESOLUTIONS
        The currently supported resolutions we will show as option and user can select.
      • VIDEO_CAPTURE_DEVICE

        public static final String VIDEO_CAPTURE_DEVICE
        The name of the DeviceConfiguration property which represents the device used by DeviceConfiguration for video capture.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DeviceConfiguration

        public DeviceConfiguration()
        Initializes a new DeviceConfiguration instance.
    • Method Detail

      • getAudioCaptureDevice

        public CaptureDeviceInfo2 getAudioCaptureDevice()
        Returns a device that we could use for audio capture.
        Returns:
        the CaptureDeviceInfo of a device that we could use for audio capture.
      • getAudioNotifyDevice

        public javax.media.CaptureDeviceInfo getAudioNotifyDevice()
        Returns:
        the audioNotifyDevice
      • getAvailableAudioCaptureDevices

        public List<CaptureDeviceInfo2> getAvailableAudioCaptureDevices()
        Gets the list of audio capture devices which are available through this DeviceConfiguration.
        Returns:
        an array of CaptureDeviceInfo describing the audio capture devices available through this DeviceConfiguration
      • getAvailableAudioSystems

        public AudioSystem[] getAvailableAudioSystems()
        Returns a list of available AudioSystems. By default, an AudioSystem is considered available if it reports at least one device.
        Returns:
        an array of available AudioSystems
      • getAvailableVideoCaptureDevices

        public List<javax.media.CaptureDeviceInfo> getAvailableVideoCaptureDevices​(MediaUseCase useCase)
        Gets the list of video capture devices which are available through this DeviceConfiguration, amongst which is getVideoCaptureDevice(MediaUseCase) and represent acceptable values for setVideoCaptureDevice(CaptureDeviceInfo, boolean)
        Parameters:
        useCase - extract video capture devices that correspond to this MediaUseCase
        Returns:
        an array of CaptureDeviceInfo describing the video capture devices available through this DeviceConfiguration
      • getEchoCancelFilterLengthInMillis

        public long getEchoCancelFilterLengthInMillis()
        Get the echo cancellation filter length (in milliseconds).
        Returns:
        echo cancel filter length in milliseconds
      • getFrameRate

        public int getFrameRate()
        Gets the frame rate set on this DeviceConfiguration.
        Returns:
        the frame rate set on this DeviceConfiguration. The default value is DEFAULT_VIDEO_FRAMERATE
      • getVideoBitrate

        public int getVideoBitrate()
        Gets the video bitrate.
        Returns:
        the video codec bitrate. The default value is DEFAULT_VIDEO_BITRATE.
      • getVideoCaptureDevice

        public javax.media.CaptureDeviceInfo getVideoCaptureDevice​(MediaUseCase useCase)
        Returns a device that we could use for video capture.
        Parameters:
        useCase - MediaUseCase that will determined device we will use
        Returns:
        the CaptureDeviceInfo of a device that we could use for video capture.
      • getVideoRTPPacingThreshold

        public int getVideoRTPPacingThreshold()
        Gets the maximum allowed video bandwidth.
        Returns:
        the maximum allowed video bandwidth. The default value is DEFAULT_VIDEO_RTP_PACING_THRESHOLD.
      • getVideoSize

        public Dimension getVideoSize()
        Gets the video size set on this DeviceConfiguration.
        Returns:
        the video size set on this DeviceConfiguration
      • propertyChange

        public void propertyChange​(PropertyChangeEvent ev)
        Notifies this PropertyChangeListener about PropertyChangeEvents fired by, for example, the ConfigurationService and the DeviceSystems which support reinitialization/reloading.
        Specified by:
        propertyChange in interface PropertyChangeListener
        Parameters:
        ev - the PropertyChangeEvent to notify this PropertyChangeListener about and which describes the source and other specifics of the notification
      • setAudioSystem

        public void setAudioSystem​(AudioSystem audioSystem,
                                   boolean save)
      • setFrameRate

        public void setFrameRate​(int frameRate)
        Sets and stores the frame rate.
        Parameters:
        frameRate - the frame rate to be set on this DeviceConfiguration
      • setVideoBitrate

        public void setVideoBitrate​(int videoBitrate)
        Sets and stores the video bitrate.
        Parameters:
        videoBitrate - the video codec bitrate
      • setVideoCaptureDevice

        public void setVideoCaptureDevice​(javax.media.CaptureDeviceInfo device,
                                          boolean save)
        Sets the device which is to be used by this DeviceConfiguration for video capture.
        Parameters:
        device - a CaptureDeviceInfo describing device to be used by this DeviceConfiguration for video capture.
        save - whether we will save this option or not.
      • setVideoRTPPacingThreshold

        public void setVideoRTPPacingThreshold​(int videoMaxBandwidth)
        Sets and stores the maximum allowed video bandwidth.
        Parameters:
        videoMaxBandwidth - the maximum allowed video bandwidth
      • setVideoSize

        public void setVideoSize​(Dimension videoSize)
        Sets and stores the video size.
        Parameters:
        videoSize - the video size to be set on this DeviceConfiguration