|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.neomedia.conference.AudioMixer
public class AudioMixer
Represents an audio mixer which manages the mixing of multiple audio streams i.e. it is able to output a single audio stream which contains the audio of multiple input audio streams.
The input audio streams are provided to the AudioMixer through
addInputDataSource(DataSource) in the form of input
DataSources giving access to one or more input
SourceStreams.
The output audio stream representing the mix of the multiple input audio
streams is provided by the AudioMixer in the form of a
AudioMixingPushBufferDataSource giving access to a
AudioMixingPushBufferStream. Such an output is obtained through
createOutputDataSource(). The AudioMixer is able to provide
multiple output audio streams at one and the same time, though, each of them
containing the mix of a subset of the input audio streams.
| Field Summary | |
|---|---|
protected javax.media.protocol.CaptureDevice |
captureDevice
The CaptureDevice capabilities provided by the AudioMixingPushBufferDataSources created by this AudioMixer. |
| Constructor Summary | |
|---|---|
AudioMixer(javax.media.protocol.CaptureDevice captureDevice)
Initializes a new AudioMixer instance. |
|
| Method Summary | |
|---|---|
void |
addInputDataSource(javax.media.protocol.DataSource inputDataSource)
Adds a new input DataSource to the collection of input DataSources from which this instance reads audio. |
(package private) void |
addInputDataSource(javax.media.protocol.DataSource inputDataSource,
AudioMixingPushBufferDataSource outputDataSource)
Adds a new input DataSource to the collection of input DataSources from which this instance reads audio. |
(package private) void |
connect()
Notifies this AudioMixer that an output AudioMixingPushBufferDataSource reading from it has been connected. |
protected void |
connect(javax.media.protocol.DataSource dataSource,
javax.media.protocol.DataSource inputDataSource)
Connects to a specific DataSource which this AudioMixer will read audio from. |
(package private) void |
connected(InputDataSourceDesc inputDataSource)
Notifies this AudioMixer that a specific input DataSource has finished its connecting procedure. |
AudioMixingPushBufferDataSource |
createOutputDataSource()
Creates a new AudioMixingPushBufferDataSource which gives access to a single audio stream representing the mix of the audio streams input into this AudioMixer through its input DataSources. |
(package private) void |
disconnect()
Notifies this AudioMixer that an output AudioMixingPushBufferDataSource reading from it has been disconnected. |
(package private) javax.media.control.BufferControl |
getBufferControl()
Gets the BufferControl of this instance and, respectively, its AudioMixingPushBufferDataSources. |
(package private) javax.media.CaptureDeviceInfo |
getCaptureDeviceInfo()
Gets the CaptureDeviceInfo of the CaptureDevice this AudioMixer provides through its output AudioMixingPushBufferDataSources. |
(package private) String |
getContentType()
Gets the content type of the data output by this AudioMixer. |
(package private) javax.media.Time |
getDuration()
Gets the duration of each one of the output streams produced by this AudioMixer. |
(package private) javax.media.control.FormatControl[] |
getFormatControls()
Gets an array of FormatControls for the CaptureDevice this AudioMixer provides through its output AudioMixingPushBufferDataSources. |
AudioMixingPushBufferDataSource |
getLocalOutputDataSource()
Gets the AudioMixingPushBufferDataSource containing the mix of all input DataSources excluding the CaptureDevice of this AudioMixer and is thus meant for playback on the local peer in a call. |
(package private) AudioMixerPushBufferStream |
getOutputStream()
Gets the AudioMixerPushBufferStream, first creating it if it does not exist already, which reads data from the input DataSources of this AudioMixer and pushes it to output AudioMixingPushBufferStreams for audio mixing. |
protected void |
read(javax.media.protocol.PushBufferStream stream,
javax.media.Buffer buffer,
javax.media.protocol.DataSource dataSource)
Reads media from a specific PushBufferStream which belongs to a specific DataSource into a specific output Buffer. |
void |
removeInputDataSources(DataSourceFilter dataSourceFilter)
Removes DataSources accepted by a specific DataSourceFilter from the list of input DataSources of this AudioMixer from which it reads audio to be mixed. |
(package private) void |
start(AudioMixerPushBufferStream outputStream)
Starts the input DataSources of this AudioMixer. |
(package private) void |
stop(AudioMixerPushBufferStream outputStream)
Stops the input DataSources of this AudioMixer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final javax.media.protocol.CaptureDevice captureDevice
| Constructor Detail |
|---|
public AudioMixer(javax.media.protocol.CaptureDevice captureDevice)
captureDevice - the CaptureDevice capabilities to be
provided to the AudioMixingPushBufferDataSources created by the
new instance and its first input DataSource| Method Detail |
|---|
public void addInputDataSource(javax.media.protocol.DataSource inputDataSource)
inputDataSource - a new DataSource to input audio to this
instance
void addInputDataSource(javax.media.protocol.DataSource inputDataSource,
AudioMixingPushBufferDataSource outputDataSource)
inputDataSource - a new DataSource to input audio to this
instanceoutputDataSource - the AudioMixingPushBufferDataSource to
not include the audio contributions of inputDataSource in the
mix it outputs
void connect()
throws IOException
IOException - if input/output error occurred
protected void connect(javax.media.protocol.DataSource dataSource,
javax.media.protocol.DataSource inputDataSource)
throws IOException
dataSource - the DataSource to connect toinputDataSource - the DataSource which is the cause for
dataSource to exist in this AudioMixer
IOException - if anything wrong happens while connecting to
dataSource
void connected(InputDataSourceDesc inputDataSource)
throws IOException
inputDataSource - the InputDataSourceDesc of the input
DataSource which has finished its connecting procedure
IOException - if anything wrong happens while including
inputDataSource into the mixpublic AudioMixingPushBufferDataSource createOutputDataSource()
void disconnect()
javax.media.control.BufferControl getBufferControl()
javax.media.CaptureDeviceInfo getCaptureDeviceInfo()
String getContentType()
javax.media.Time getDuration()
javax.media.control.FormatControl[] getFormatControls()
public AudioMixingPushBufferDataSource getLocalOutputDataSource()
AudioMixerPushBufferStream getOutputStream()
protected void read(javax.media.protocol.PushBufferStream stream,
javax.media.Buffer buffer,
javax.media.protocol.DataSource dataSource)
throws IOException
stream - the PushBufferStream to read media from and known
to belong to the specified DataSOurcebuffer - the output Buffer in which the media read from the
specified stream is to be written so that it gets returned to
the callerdataSource - the DataSource from which stream
originated
IOException - if anything wrong happens while reading from the
specified streampublic void removeInputDataSources(DataSourceFilter dataSourceFilter)
dataSourceFilter - the DataSourceFilter which selects the
DataSources to be removed from the list of input
DataSources of this AudioMixer from which it reads
audio to be mixed
void start(AudioMixerPushBufferStream outputStream)
throws IOException
outputStream - the AudioMixerPushBufferStream which
requests this AudioMixer to start. If outputStream is
the current one and only AudioMixerPushBufferStream of this
AudioMixer, this AudioMixer starts if it hasn't started
yet. Otherwise, the request is ignored.
IOException - if any of the input DataSources of this
AudioMixer throws such an exception while attempting to start it
void stop(AudioMixerPushBufferStream outputStream)
throws IOException
outputStream - the AudioMixerPushBufferStream which
requests this AudioMixer to stop. If outputStream is
the current one and only AudioMixerPushBufferStream of this
AudioMixer, this AudioMixer stops. Otherwise, the
request is ignored.
IOException - if any of the input DataSources of this
AudioMixer throws such an exception while attempting to stop it
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||