Class PortAudioRenderer
- 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<PortAudioSystem>
-
- org.jitsi.impl.neomedia.jmfext.media.renderer.audio.PortAudioRenderer
-
- All Implemented Interfaces:
javax.media.Controls,javax.media.PlugIn,javax.media.Renderer
public class PortAudioRenderer extends AbstractAudioRenderer<PortAudioSystem>
Implements an audio Renderer which uses Pa.- Author:
- Damian Minkov, Lyubomir Marinov
-
-
Field Summary
-
Fields inherited from class org.jitsi.impl.neomedia.jmfext.media.renderer.audio.AbstractAudioRenderer
audioSystem, dataFlow, JAVA_AUDIO_FORMAT_ENDIAN, NATIVE_AUDIO_FORMAT_ENDIAN
-
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 Constructor Description PortAudioRenderer()Initializes a new PortAudioRenderer instance.PortAudioRenderer(boolean playback)Initializes a new PortAudioRenderer instance which is to either perform playback or sound a notification.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this PlugIn.StringgetName()Gets the descriptive/human-readable name of this JMF plug-in.javax.media.Format[]getSupportedInputFormats()Gets the list of JMF Formats of audio data which this Renderer is capable of rendering.voidopen()Opens the PortAudio device and output stream represented by this instance which are to be used to render audio.protected voidplaybackDevicePropertyChange(PropertyChangeEvent ev)Notifies this instance that the value of the PROP_PLAYBACK_DEVICE property of its associated AudioSystem has changed.intprocess(javax.media.Buffer buffer)Renders the audio data contained in a specific Buffer onto the PortAudio device represented by this Renderer.voidsetLocator(javax.media.MediaLocator locator)Sets the MediaLocator which specifies the device index of the PortAudio device to be used by this instance for rendering.voidstart()Starts the rendering process.voidstop()Stops the rendering process.-
Methods inherited from class org.jitsi.impl.neomedia.jmfext.media.renderer.audio.AbstractAudioRenderer
getControls, getGainControl, getLocator, setVolumeControl, useAudioThreadPriority
-
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
-
-
-
-
Constructor Detail
-
PortAudioRenderer
public PortAudioRenderer()
Initializes a new PortAudioRenderer instance.
-
PortAudioRenderer
public PortAudioRenderer(boolean playback)
Initializes a new PortAudioRenderer instance which is to either perform playback or sound a notification.- Parameters:
playback- true if the new instance is to perform playback or false if the new instance is to sound a notification
-
-
Method Detail
-
close
public void close()
Closes this PlugIn.- Specified by:
closein interfacejavax.media.PlugIn- Overrides:
closein classAbstractAudioRenderer<PortAudioSystem>
-
getName
public String getName()
Gets the descriptive/human-readable name of this JMF plug-in.- Returns:
- the descriptive/human-readable name of this JMF plug-in
-
getSupportedInputFormats
public javax.media.Format[] getSupportedInputFormats()
Gets the list of JMF Formats of audio data which this Renderer is capable of rendering.- Specified by:
getSupportedInputFormatsin interfacejavax.media.Renderer- Overrides:
getSupportedInputFormatsin classAbstractAudioRenderer<PortAudioSystem>- Returns:
- an array of JMF Formats of audio data which this Renderer is capable of rendering
-
open
public void open() throws javax.media.ResourceUnavailableExceptionOpens the PortAudio device and output stream represented by this instance which are to be used to render audio.- Specified by:
openin interfacejavax.media.PlugIn- Overrides:
openin classAbstractAudioRenderer<PortAudioSystem>- Throws:
javax.media.ResourceUnavailableException- if the PortAudio device or output stream cannot be created or opened
-
playbackDevicePropertyChange
protected void playbackDevicePropertyChange(PropertyChangeEvent ev)
Notifies this instance that the value of the PROP_PLAYBACK_DEVICE property of its associated AudioSystem has changed.- Overrides:
playbackDevicePropertyChangein classAbstractAudioRenderer<PortAudioSystem>- Parameters:
ev- a PropertyChangeEvent which specifies details about the change such as the name of the property and its old and new values
-
process
public int process(javax.media.Buffer buffer)
Renders the audio data contained in a specific Buffer onto the PortAudio device represented by this Renderer.- Parameters:
buffer- the Buffer which contains the audio data to be rendered- Returns:
- BUFFER_PROCESSED_OK if the specified buffer has been successfully processed
-
setLocator
public void setLocator(javax.media.MediaLocator locator)
Sets the MediaLocator which specifies the device index of the PortAudio device to be used by this instance for rendering.- Overrides:
setLocatorin classAbstractAudioRenderer<PortAudioSystem>- Parameters:
locator- a MediaLocator which specifies the device index of the PortAudio device to be used by this instance for rendering
-
start
public void start()
Starts the rendering process. Any audio data available in the internal resources associated with this PortAudioRenderer will begin being rendered.
-
stop
public void stop()
Stops the rendering process.
-
-