SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.media.renderer.audio
Class PortAudioRenderer

java.lang.Object
  extended by net.java.sip.communicator.impl.media.renderer.audio.PortAudioRenderer
All Implemented Interfaces:
javax.media.Controls, javax.media.PlugIn, javax.media.Renderer

public class PortAudioRenderer
extends Object
implements javax.media.Renderer

Portaudio renderer.

Author:
Damian Minkov

Field Summary
(package private)  boolean started
           
static javax.media.Format[] supportedInputFormats
          The supported input formats.
 
Fields inherited from interface javax.media.PlugIn
BUFFER_PROCESSED_FAILED, BUFFER_PROCESSED_OK, INPUT_BUFFER_NOT_CONSUMED, OUTPUT_BUFFER_NOT_FILLED, PLUGIN_TERMINATED
 
Constructor Summary
PortAudioRenderer()
           
 
Method Summary
 void close()
          Closes the plug-in.
 Object getControl(String controlType)
          Return required control from the Control[] array if exists.
 Object[] getControls()
          Gives control information to the caller
 String getName()
          Returns the name of the pluging.
 javax.media.Format[] getSupportedInputFormats()
          Lists the input formats supported by this Renderer.
 void open()
          Opens the device and stream that we will use to render data.
 int process(javax.media.Buffer inputBuffer)
          Processes the data and renders it to the output device represented by this Renderer.
 void reset()
          Resets the state of the plug-in.
static void setDevice(javax.media.MediaLocator locator)
          Used to set the device index used by the renderer common for all instances of it.
 javax.media.Format setInputFormat(javax.media.Format format)
          Sets the Format of the input data.
 void start()
          Initiates the rendering process.
 void stop()
          Halts the rendering process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

supportedInputFormats

public static javax.media.Format[] supportedInputFormats
The supported input formats. The Inputformats are changed after the device is set.


started

boolean started
Constructor Detail

PortAudioRenderer

public PortAudioRenderer()
Method Detail

getSupportedInputFormats

public javax.media.Format[] getSupportedInputFormats()
Lists the input formats supported by this Renderer.

Specified by:
getSupportedInputFormats in interface javax.media.Renderer
Returns:
An array of Format objects that represent the input formats supported by this Renderer.

setInputFormat

public javax.media.Format setInputFormat(javax.media.Format format)
Sets the Format of the input data.

Specified by:
setInputFormat in interface javax.media.Renderer
Parameters:
format - the format to set.
Returns:
The Format that was set.

start

public void start()
Initiates the rendering process. When start is called, the renderer begins rendering any data available in its internal buffers.

Specified by:
start in interface javax.media.Renderer

stop

public void stop()
Halts the rendering process.

Specified by:
stop in interface javax.media.Renderer

process

public int process(javax.media.Buffer inputBuffer)
Processes the data and renders it to the output device represented by this Renderer.

Specified by:
process in interface javax.media.Renderer
Parameters:
inputBuffer - the input data.
Returns:
BUFFER_PROCESSED_OK if the processing is successful.

getName

public String getName()
Returns the name of the pluging.

Specified by:
getName in interface javax.media.PlugIn
Returns:
A String that contains the descriptive name of the plug-in.

open

public void open()
          throws javax.media.ResourceUnavailableException
Opens the device and stream that we will use to render data.

Specified by:
open in interface javax.media.PlugIn
Throws:
javax.media.ResourceUnavailableException - If required resources cannot be opened/created.

close

public void close()
Closes the plug-in.

Specified by:
close in interface javax.media.PlugIn

reset

public void reset()
Resets the state of the plug-in.

Specified by:
reset in interface javax.media.PlugIn

getControls

public Object[] getControls()
Gives control information to the caller

Specified by:
getControls in interface javax.media.Controls
Returns:
the collection of object controls.

getControl

public Object getControl(String controlType)
Return required control from the Control[] array if exists.

Specified by:
getControl in interface javax.media.Controls
Parameters:
controlType - the control we are interested in.
Returns:
the object that implements the control, or null.

setDevice

public static void setDevice(javax.media.MediaLocator locator)
Used to set the device index used by the renderer common for all instances of it. Change the format corresponding the device which will be used.

Parameters:
locator - the locator containing the device index.

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.