Class AbstractAudioRenderer<T extends AudioSystem>
- java.lang.Object
-
- org.jitsi.impl.neomedia.control.AbstractControls
-
- org.jitsi.impl.neomedia.control.ControlsAdapter
-
- org.jitsi.impl.neomedia.jmfext.media.renderer.AbstractRenderer<javax.media.format.AudioFormat>
-
- org.jitsi.impl.neomedia.jmfext.media.renderer.audio.AbstractAudioRenderer<T>
-
- Type Parameters:
T- the runtime type of the AudioSystem which provides the playback device used by the AbstractAudioRenderer
- All Implemented Interfaces:
javax.media.Controls,javax.media.PlugIn,javax.media.Renderer
- Direct Known Subclasses:
MacCoreaudioRenderer,PortAudioRenderer,PulseAudioRenderer,WASAPIRenderer
public abstract class AbstractAudioRenderer<T extends AudioSystem> extends AbstractRenderer<javax.media.format.AudioFormat>
Provides an abstract base implementation of Renderer which processes media in AudioFormat in order to facilitate extenders.- Author:
- Lyubomir Marinov
-
-
Field Summary
Fields Modifier and Type Field Description protected TaudioSystemThe AudioSystem which provides the playback device used by this Renderer.protected AudioSystem.DataFlowdataFlowThe flow of the media data (to be) implemented by this instance which is eitherAudioSystem.DataFlow.NOTIFYorAudioSystem.DataFlow.PLAYBACK.static intJAVA_AUDIO_FORMAT_ENDIANThe byte order of the running Java virtual machine expressed in the endian term ofAudioFormat.static intNATIVE_AUDIO_FORMAT_ENDIANThe native byte order of the hardware upon which this Java virtual machine is running expressed in the endian term ofAudioFormat.-
Fields inherited from class org.jitsi.impl.neomedia.jmfext.media.renderer.AbstractRenderer
inputFormat
-
Fields inherited from class org.jitsi.impl.neomedia.control.ControlsAdapter
EMPTY_CONTROLS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractAudioRenderer(String locatorProtocol)Initializes a new AbstractAudioRenderer instance which is to use playback devices provided by an AudioSystem specified by the protocol of the MediaLocators of the CaptureDeviceInfos registered by the AudioSystem.protectedAbstractAudioRenderer(String locatorProtocol, AudioSystem.DataFlow dataFlow)Initializes a new AbstractAudioRenderer instance which is to use notification or playback devices provided by an AudioSystem specified by the protocol of the MediaLocators of the CaptureDeviceInfos registered by the AudioSystem.protectedAbstractAudioRenderer(T audioSystem)Initializes a new AbstractAudioRenderer instance which is to use playback devices provided by a specific AudioSystem.protectedAbstractAudioRenderer(T audioSystem, AudioSystem.DataFlow dataFlow)Initializes a new AbstractAudioRenderer instance which is to use notification or playback (as determined by dataFlow) devices provided by a specific AudioSystem.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Object[]getControls()ImplementsControls.getControls().protected javax.media.GainControlgetGainControl()Gets the GainControl, if any, which controls the volume level of the audio (to be) played back by this Renderer.javax.media.MediaLocatorgetLocator()Gets the MediaLocator which specifies the playback device to be used by this Renderer.javax.media.Format[]getSupportedInputFormats()voidopen()protected voidplaybackDevicePropertyChange(PropertyChangeEvent ev)Notifies this instance that the value of the property ofaudioSystemwhich identifies the default notification or playback (as determined bydataFlow) device has changed.voidsetLocator(javax.media.MediaLocator locator)Sets the MediaLocator which specifies the playback device to be used by this Renderer.voidsetVolumeControl(VolumeControl volumeControl)Sets the VolumeControl which is to control the volume (level) of the audio (to be) played back by this Renderer.static voiduseAudioThreadPriority()Changes the priority of the current thread to a value which is considered appropriate for the purposes of audio processing.-
Methods inherited from class org.jitsi.impl.neomedia.jmfext.media.renderer.AbstractRenderer
reset, setInputFormat, useThreadPriority
-
Methods inherited from class org.jitsi.impl.neomedia.control.AbstractControls
getControl, getControl, queryInterface, queryInterface
-
-
-
-
Field Detail
-
JAVA_AUDIO_FORMAT_ENDIAN
public static final int JAVA_AUDIO_FORMAT_ENDIAN
The byte order of the running Java virtual machine expressed in the endian term ofAudioFormat.- See Also:
- Constant Field Values
-
NATIVE_AUDIO_FORMAT_ENDIAN
public static final int NATIVE_AUDIO_FORMAT_ENDIAN
The native byte order of the hardware upon which this Java virtual machine is running expressed in the endian term ofAudioFormat.
-
audioSystem
protected final T extends AudioSystem audioSystem
The AudioSystem which provides the playback device used by this Renderer.
-
dataFlow
protected final AudioSystem.DataFlow dataFlow
The flow of the media data (to be) implemented by this instance which is eitherAudioSystem.DataFlow.NOTIFYorAudioSystem.DataFlow.PLAYBACK.
-
-
Constructor Detail
-
AbstractAudioRenderer
protected AbstractAudioRenderer(T audioSystem)
Initializes a new AbstractAudioRenderer instance which is to use playback devices provided by a specific AudioSystem.- Parameters:
audioSystem- the AudioSystem which is to provide the playback devices to be used by the new instance
-
AbstractAudioRenderer
protected AbstractAudioRenderer(T audioSystem, AudioSystem.DataFlow dataFlow)
Initializes a new AbstractAudioRenderer instance which is to use notification or playback (as determined by dataFlow) devices provided by a specific AudioSystem.- Parameters:
audioSystem- the AudioSystem which is to provide the notification or playback devices to be used by the new instancedataFlow- the flow of the media data to be implemented by the new instance i.e. whether notification or playback devices provided by the specified audioSystem are to be used by the new instance. Must be eitherAudioSystem.DataFlow.NOTIFYorAudioSystem.DataFlow.PLAYBACK.- Throws:
IllegalArgumentException- if the specified dataFlow is neither AudioSystem.DataFlow.NOTIFY nor AudioSystem.DataFlow.PLAYBACK
-
AbstractAudioRenderer
protected AbstractAudioRenderer(String locatorProtocol)
Initializes a new AbstractAudioRenderer instance which is to use playback devices provided by an AudioSystem specified by the protocol of the MediaLocators of the CaptureDeviceInfos registered by the AudioSystem.- Parameters:
locatorProtocol- the protocol of the MediaLocators of the CaptureDeviceInfo registered by the AudioSystem which is to provide the playback devices to be used by the new instance
-
AbstractAudioRenderer
protected AbstractAudioRenderer(String locatorProtocol, AudioSystem.DataFlow dataFlow)
Initializes a new AbstractAudioRenderer instance which is to use notification or playback devices provided by an AudioSystem specified by the protocol of the MediaLocators of the CaptureDeviceInfos registered by the AudioSystem.- Parameters:
locatorProtocol- the protocol of the MediaLocators of the CaptureDeviceInfo registered by the AudioSystem which is to provide the notification or playback devices to be used by the new instancedataFlow- the flow of the media data to be implemented by the new instance i.e. whether notification or playback devices provided by the specified audioSystem are to be used by the new instance. Must be eitherAudioSystem.DataFlow.NOTIFYorAudioSystem.DataFlow.PLAYBACK.- Throws:
IllegalArgumentException- if the specified dataFlow is neither AudioSystem.DataFlow.NOTIFY nor AudioSystem.DataFlow.PLAYBACK
-
-
Method Detail
-
close
public void close()
-
getControls
public Object[] getControls()
ImplementsControls.getControls(). Gets the available controls over this instance. AbstractAudioRenderer returns aGainControlif available.- Specified by:
getControlsin interfacejavax.media.Controls- Overrides:
getControlsin classControlsAdapter- Returns:
- an array of Objects which represent the available controls over this instance
-
getGainControl
protected javax.media.GainControl getGainControl()
Gets the GainControl, if any, which controls the volume level of the audio (to be) played back by this Renderer.- Returns:
- the GainControl, if any, which controls the volume level of the audio (to be) played back by this Renderer
-
getLocator
public javax.media.MediaLocator getLocator()
Gets the MediaLocator which specifies the playback device to be used by this Renderer.- Returns:
- the MediaLocator which specifies the playback device to be used by this Renderer
-
getSupportedInputFormats
public javax.media.Format[] getSupportedInputFormats()
-
open
public void open() throws javax.media.ResourceUnavailableException- Throws:
javax.media.ResourceUnavailableException
-
playbackDevicePropertyChange
protected void playbackDevicePropertyChange(PropertyChangeEvent ev)
Notifies this instance that the value of the property ofaudioSystemwhich identifies the default notification or playback (as determined bydataFlow) device has changed. The default implementation does nothing so extenders may safely not call back to their AbstractAudioRenderer super.- Parameters:
ev- a PropertyChangeEvent which specifies details about the change such as the name of the property and its old and new values
-
setLocator
public void setLocator(javax.media.MediaLocator locator)
Sets the MediaLocator which specifies the playback device to be used by this Renderer.- Parameters:
locator- the MediaLocator which specifies the playback device to be used by this Renderer
-
setVolumeControl
public void setVolumeControl(VolumeControl volumeControl)
Sets the VolumeControl which is to control the volume (level) of the audio (to be) played back by this Renderer.- Parameters:
volumeControl- the VolumeControl which is to control the volume (level) of the audio (to be) played back by this Renderer
-
useAudioThreadPriority
public static void useAudioThreadPriority()
Changes the priority of the current thread to a value which is considered appropriate for the purposes of audio processing.
-
-