Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.device
Class AudioMixerMediaDevice

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.device.AbstractMediaDevice
      extended by net.java.sip.communicator.impl.neomedia.device.AudioMixerMediaDevice
All Implemented Interfaces:
MediaDevice

public class AudioMixerMediaDevice
extends AbstractMediaDevice

Implements a MediaDevice which performs audio mixing using AudioMixer.

Author:
Lyubomir Marinov, Emil Ivov

Constructor Summary
AudioMixerMediaDevice(AudioMediaDeviceImpl device)
          Initializes a new AudioMixerMediaDevice instance which is to enable audio mixing on a specific AudioMediaDeviceImpl.
 
Method Summary
 void close()
          Closes this MediaDevice and removes all of the MediaDeviceSession of its AudioMixerMediaDeviceSession.
 void connect(javax.media.protocol.DataSource captureDevice)
          Connects to a specific CaptureDevice given in the form of a DataSource.
 AudioMixingPushBufferDataSource createOutputDataSource()
          Creates a DataSource instance for this MediaDevice which gives access to the captured media.
 MediaDeviceSession createSession()
          Creates a new MediaDeviceSession instance which is to represent the use of this MediaDevice by a MediaStream.
 MediaDirection getDirection()
          Returns the MediaDirection supported by this device.
 MediaFormat getFormat()
          Gets the MediaFormat in which this MediaDevice captures media.
 MediaType getMediaType()
          Gets the MediaType that this device supports.
 List<RTPExtension> getSupportedExtensions()
          Returns a List containing (at the time of writing) a single extension descriptor indicating SENDRECV for mixer-to-client audio levels.
 List<MediaFormat> getSupportedFormats(QualityPreset sendPreset, QualityPreset receivePreset)
          Gets the list of MediaFormats supported by this MediaDevice.
(package private)  void removeInputDataSources(DataSourceFilter dataSourceFilter)
          Removes the DataSource accepted by a specific DataSourceFilter from the list of input DataSource of the AudioMixer of this AudioMixerMediaDevice from which it reads audio to be mixed.
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.device.AbstractMediaDevice
getSession, getSupportedFormats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AudioMixerMediaDevice

public AudioMixerMediaDevice(AudioMediaDeviceImpl device)
Initializes a new AudioMixerMediaDevice instance which is to enable audio mixing on a specific AudioMediaDeviceImpl.

Parameters:
device - the AudioMediaDeviceImpl which the new instance is to enable audio mixing on
Method Detail

close

public void close()
Closes this MediaDevice and removes all of the MediaDeviceSession of its AudioMixerMediaDeviceSession.

Overrides:
close in class AbstractMediaDevice

connect

public void connect(javax.media.protocol.DataSource captureDevice)
             throws IOException
Connects to a specific CaptureDevice given in the form of a DataSource.

Overrides:
connect in class AbstractMediaDevice
Parameters:
captureDevice - the CaptureDevice to be connected to
Throws:
IOException - if anything wrong happens while connecting to the specified captureDevice
See Also:
AbstractMediaDevice.connect(DataSource)

createOutputDataSource

public AudioMixingPushBufferDataSource createOutputDataSource()
Creates a DataSource instance for this MediaDevice which gives access to the captured media.

Specified by:
createOutputDataSource in class AbstractMediaDevice
Returns:
a DataSource instance which gives access to the media captured by this MediaDevice
See Also:
AbstractMediaDevice.createOutputDataSource()

createSession

public MediaDeviceSession createSession()
Creates a new MediaDeviceSession instance which is to represent the use of this MediaDevice by a MediaStream.

Overrides:
createSession in class AbstractMediaDevice
Returns:
a new MediaDeviceSession instance which is to represent the use of this MediaDevice by a MediaStream
See Also:
AbstractMediaDevice.createSession()

getDirection

public MediaDirection getDirection()
Returns the MediaDirection supported by this device.

Returns:
MediaDirection.SENDONLY if this is a read-only device, MediaDirection.RECVONLY if this is a write-only device or MediaDirection.SENDRECV if this MediaDevice can both capture and render media
See Also:
MediaDevice.getDirection()

getFormat

public MediaFormat getFormat()
Gets the MediaFormat in which this MediaDevice captures media.

Returns:
the MediaFormat in which this MediaDevice captures media
See Also:
MediaDevice.getFormat()

getMediaType

public MediaType getMediaType()
Gets the MediaType that this device supports.

Returns:
MediaType.AUDIO if this is an audio device or MediaType.VIDEO if this is a video device
See Also:
MediaDevice.getMediaType()

getSupportedExtensions

public List<RTPExtension> getSupportedExtensions()
Returns a List containing (at the time of writing) a single extension descriptor indicating SENDRECV for mixer-to-client audio levels.

Specified by:
getSupportedExtensions in interface MediaDevice
Overrides:
getSupportedExtensions in class AbstractMediaDevice
Returns:
a List containing the CSRC_AUDIO_LEVEL_URN extension descriptor.

getSupportedFormats

public List<MediaFormat> getSupportedFormats(QualityPreset sendPreset,
                                             QualityPreset receivePreset)
Gets the list of MediaFormats supported by this MediaDevice.

Parameters:
sendPreset - not used
receivePreset - not used
Returns:
the list of MediaFormats supported by this MediaDevice
See Also:
MediaDevice.getSupportedFormats()

removeInputDataSources

void removeInputDataSources(DataSourceFilter dataSourceFilter)
Removes the DataSource accepted by a specific DataSourceFilter from the list of input DataSource of the AudioMixer of this AudioMixerMediaDevice from which it reads audio to be mixed.

Parameters:
dataSourceFilter - the DataSourceFilter which selects the DataSources to be removed

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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