Class MacCoreaudioRenderer
- 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<MacCoreaudioSystem>
-
- org.jitsi.impl.neomedia.jmfext.media.renderer.audio.MacCoreaudioRenderer
-
- All Implemented Interfaces:
javax.media.Controls,javax.media.PlugIn,javax.media.Renderer
public class MacCoreaudioRenderer extends AbstractAudioRenderer<MacCoreaudioSystem>
Implements an audio Renderer which uses MacOSX Coreaudio.- Author:
- Vincent Lucas
-
-
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 MacCoreaudioRenderer()Initializes a new MacCoreaudioRenderer instance.MacCoreaudioRenderer(boolean playback)Initializes a new MacCoreaudioRenderer 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 MacCoreaudio 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 MacCoreaudio device represented by this Renderer.voidsetLocator(javax.media.MediaLocator locator)Sets the MediaLocator which specifies the device index of the MacCoreaudio device to be used by this instance for rendering.voidstart()Starts the rendering process.voidstop()Stops the rendering process.voidwriteOutput(byte[] buffer, int bufferLength)Writes the data received to the buffer give in arguments, which is provided by the CoreAudio library.-
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
-
MacCoreaudioRenderer
public MacCoreaudioRenderer()
Initializes a new MacCoreaudioRenderer instance.
-
MacCoreaudioRenderer
public MacCoreaudioRenderer(boolean playback)
Initializes a new MacCoreaudioRenderer 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<MacCoreaudioSystem>
-
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<MacCoreaudioSystem>- 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 MacCoreaudio 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<MacCoreaudioSystem>- Throws:
javax.media.ResourceUnavailableException- if the MacCoreaudio 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<MacCoreaudioSystem>- 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 MacCoreaudio 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 MacCoreaudio device to be used by this instance for rendering.- Overrides:
setLocatorin classAbstractAudioRenderer<MacCoreaudioSystem>- Parameters:
locator- a MediaLocator which specifies the device index of the MacCoreaudio 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 MacCoreaudioRenderer will begin being rendered.
-
stop
public void stop()
Stops the rendering process.
-
writeOutput
public void writeOutput(byte[] buffer, int bufferLength)Writes the data received to the buffer give in arguments, which is provided by the CoreAudio library.- Parameters:
buffer- The buffer to fill in provided by the CoreAudio library.bufferLength- The length of the buffer provided.
-
-