Package org.jitsi.impl.neomedia.device
Class AudioSystem2
- java.lang.Object
-
- org.jitsi.utils.event.PropertyChangeNotifier
-
- org.jitsi.impl.neomedia.device.DeviceSystem
-
- org.jitsi.impl.neomedia.device.AudioSystem
-
- org.jitsi.impl.neomedia.device.AudioSystem2
-
- Direct Known Subclasses:
MacCoreaudioSystem,PortAudioSystem
public abstract class AudioSystem2 extends AudioSystem
- Author:
- Lyubomir Marinov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jitsi.impl.neomedia.device.AudioSystem
AudioSystem.DataFlow
-
-
Field Summary
-
Fields inherited from class org.jitsi.impl.neomedia.device.AudioSystem
FEATURE_AGC, FEATURE_DENOISE, FEATURE_ECHO_CANCELLATION, FEATURE_NOTIFY_AND_PLAYBACK_DEVICES, LOCATOR_PROTOCOL_AUDIORECORD, LOCATOR_PROTOCOL_AUDIOSILENCE, LOCATOR_PROTOCOL_JAVASOUND, LOCATOR_PROTOCOL_MACCOREAUDIO, LOCATOR_PROTOCOL_OPENSLES, LOCATOR_PROTOCOL_PORTAUDIO, LOCATOR_PROTOCOL_PULSEAUDIO, LOCATOR_PROTOCOL_WASAPI, PNAME_DENOISE, PNAME_ECHOCANCEL
-
Fields inherited from class org.jitsi.impl.neomedia.device.DeviceSystem
FEATURE_REINITIALIZE, LOCATOR_PROTOCOL_ANDROIDCAMERA, LOCATOR_PROTOCOL_CIVIL, LOCATOR_PROTOCOL_DIRECTSHOW, LOCATOR_PROTOCOL_IMGSTREAMING, LOCATOR_PROTOCOL_MEDIARECORDER, LOCATOR_PROTOCOL_QUICKTIME, LOCATOR_PROTOCOL_VIDEO4LINUX2, PROP_DEVICES
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAudioSystem2(String locatorProtocol, int features)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddUpdateAvailableDeviceListListener(UpdateAvailableDeviceListListener listener)Adds a listener which is to be notified before and after this AudioSystem's method updateAvailableDeviceList() is invoked.protected static voidbubbleUpUsbDevices(List<CaptureDeviceInfo2> devices)Sorts a specific list of CaptureDeviceInfo2s so that the ones representing USB devices appear at the beginning/top of the specified list.voiddidOpenStream()Notifies this AudioSystem that an API client finished executing a Pa_OpenStream-like function.protected static voidmatchDevicesByName(List<CaptureDeviceInfo2> captureDevices, List<CaptureDeviceInfo2> playbackDevices)Attempts to reorder specific lists of capture and playback/notify CaptureDeviceInfo2s so that devices from the same hardware appear at the same indices in the respective lists.protected voidreinitialize()Reinitializes this AudioSystem in order to bring it up to date with possible changes in the list of available devices.voidremoveUpdateAvailableDeviceListListener(UpdateAvailableDeviceListListener listener)protected abstract voidupdateAvailableDeviceList()voidwillOpenStream()Notifies this AudioSystem that an API client will start executing a Pa_OpenStream-like function.-
Methods inherited from class org.jitsi.impl.neomedia.device.AudioSystem
createRenderer, createRenderer, getAudioInputStream, getAudioSystem, getAudioSystems, getDevice, getDevices, getFormat, getPropertyName, getSelectedDevice, isAutomaticGainControl, isDenoise, isEchoCancel, postInitialize, postInitializeSpecificDevices, preInitialize, setAutomaticGainControl, setCaptureDevices, setDenoise, setDevice, setEchoCancel, setPlaybackDevices
-
Methods inherited from class org.jitsi.impl.neomedia.device.DeviceSystem
doInitialize, filterDeviceListByLocatorProtocol, getDeviceSystems, getFeatures, getFormat, getLocatorProtocol, getMediaType, getRendererClassName, initialize, initializeDeviceSystems, initializeDeviceSystems, toString
-
-
-
-
Method Detail
-
addUpdateAvailableDeviceListListener
public void addUpdateAvailableDeviceListListener(UpdateAvailableDeviceListListener listener)
Adds a listener which is to be notified before and after this AudioSystem's method updateAvailableDeviceList() is invoked.Note: The AudioSystem2 class keeps a WeakReference to the specified listener in order to avoid memory leaks.
- Parameters:
listener- the UpdateAvailableDeviceListListener to be notified before and after this AudioSystem's method updateAvailableDeviceList() is invoked
-
bubbleUpUsbDevices
protected static void bubbleUpUsbDevices(List<CaptureDeviceInfo2> devices)
Sorts a specific list of CaptureDeviceInfo2s so that the ones representing USB devices appear at the beginning/top of the specified list.- Parameters:
devices- the list of CaptureDeviceInfo2s to be sorted so that the ones representing USB devices appear at the beginning/top of the list
-
didOpenStream
public void didOpenStream()
Notifies this AudioSystem that an API client finished executing a Pa_OpenStream-like function.
-
matchDevicesByName
protected static void matchDevicesByName(List<CaptureDeviceInfo2> captureDevices, List<CaptureDeviceInfo2> playbackDevices)
Attempts to reorder specific lists of capture and playback/notify CaptureDeviceInfo2s so that devices from the same hardware appear at the same indices in the respective lists. The judgment with respect to the belonging to the same hardware is based on the names of the specified CaptureDeviceInfo2s. The implementation is provided as a fallback to stand in for scenarios in which more accurate relevant information is not available.- Parameters:
captureDevices-playbackDevices-
-
reinitialize
protected void reinitialize() throws ExceptionReinitializes this AudioSystem in order to bring it up to date with possible changes in the list of available devices. Invokes updateAvailableDeviceList() to update the devices on the native side and thenDeviceSystem.initialize()to reflect any changes on the Java side. Invoked by the native side of this AudioSystem when it detects that the list of available devices has changed.- Throws:
Exception- if there was an error during the invocation of updateAvailableDeviceList() and DeviceSystem.initialize()
-
removeUpdateAvailableDeviceListListener
public void removeUpdateAvailableDeviceListListener(UpdateAvailableDeviceListListener listener)
-
updateAvailableDeviceList
protected abstract void updateAvailableDeviceList()
-
willOpenStream
public void willOpenStream()
Notifies this AudioSystem that an API client will start executing a Pa_OpenStream-like function.
-
-