|
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.control.AbstractControls
net.java.sip.communicator.impl.neomedia.control.ControlsAdapter
net.java.sip.communicator.impl.neomedia.conference.AudioMixerPushBufferStream
class AudioMixerPushBufferStream
Represents a PushBufferStream which reads data from the SourceStreams of the input DataSources of the associated AudioMixer and pushes it to AudioMixingPushBufferStreams for audio mixing.
Pretty much private to AudioMixer but extracted into its own file for the sake of clarity.
| Field Summary |
|---|
| Fields inherited from class net.java.sip.communicator.impl.neomedia.control.ControlsAdapter |
|---|
EMPTY_CONTROLS |
| Fields inherited from interface javax.media.protocol.SourceStream |
|---|
LENGTH_UNKNOWN |
| Constructor Summary | |
|---|---|
AudioMixerPushBufferStream(AudioMixer audioMixer,
javax.media.format.AudioFormat outputFormat)
Initializes a new AudioMixerPushBufferStream instance to output data in a specific AudioFormat for a specific AudioMixer. |
|
| Method Summary | |
|---|---|
(package private) void |
addOutputStream(AudioMixingPushBufferStream outputStream)
Adds a specific AudioMixingPushBufferStream to the collection of such streams to which this instance is to push the data for audio mixing it reads from its input SourceStreams. |
int[] |
allocateIntArray(int minSize)
|
void |
deallocateIntArray(int[] intArray)
|
boolean |
endOfStream()
Implements SourceStream.endOfStream(). |
(package private) void |
equalizeInputStreamBufferLength()
Attempts to equalize the length in milliseconds of the buffering performed by the inputStreams in order to always read and mix one and the same length in milliseconds. |
javax.media.protocol.ContentDescriptor |
getContentDescriptor()
Implements SourceStream.getContentDescriptor(). |
long |
getContentLength()
Implements SourceStream.getContentLength(). |
javax.media.format.AudioFormat |
getFormat()
Implements PushBufferStream.getFormat(). |
(package private) InputStreamDesc[] |
getInputStreams()
Gets the SourceStreams (in the form of InputStreamDescs) from which this instance reads audio samples. |
void |
read(javax.media.Buffer buffer)
Implements PushBufferStream.read(Buffer). |
(package private) void |
removeOutputStream(AudioMixingPushBufferStream outputStream)
Removes a specific AudioMixingPushBufferStream from the collection of such streams to which this instance pushes the data for audio mixing it reads from its input SourceStreams. |
(package private) void |
setInputStreams(Collection<InputStreamDesc> inputStreams)
Sets the SourceStreams (in the form of InputStreamDesc) from which this instance is to read audio samples and push them to the AudioMixingPushBufferStreams for audio mixing. |
void |
setTransferHandler(javax.media.protocol.BufferTransferHandler transferHandler)
Implements PushBufferStream.setTransferHandler(BufferTransferHandler). |
protected void |
transferData(javax.media.Buffer buffer)
Reads audio samples from the input SourceStreams of this instance and pushes them to its output AudioMixingPushBufferStreams for audio mixing. |
| Methods inherited from class net.java.sip.communicator.impl.neomedia.control.ControlsAdapter |
|---|
getControls |
| Methods inherited from class net.java.sip.communicator.impl.neomedia.control.AbstractControls |
|---|
getControl, getControl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.media.Controls |
|---|
getControl, getControls |
| Constructor Detail |
|---|
public AudioMixerPushBufferStream(AudioMixer audioMixer,
javax.media.format.AudioFormat outputFormat)
audioMixer - the AudioMixer which creates this instance and
for which it is to output dataoutputFormat - the AudioFormat in which the new instance is
to output data| Method Detail |
|---|
void addOutputStream(AudioMixingPushBufferStream outputStream)
throws IOException
outputStream - the AudioMixingPushBufferStream to add to
the collection of such streams to which this instance is to push the data
for audio mixing it reads from its input SourceStreams
IOException - if outputStream was the first
AudioMixingPushBufferStream and the AudioMixer failed
to startpublic int[] allocateIntArray(int minSize)
public void deallocateIntArray(int[] intArray)
public boolean endOfStream()
SourceStream.endOfStream(). Delegates to the input
SourceStreams of this instance.
endOfStream in interface javax.media.protocol.SourceStreamvoid equalizeInputStreamBufferLength()
public javax.media.protocol.ContentDescriptor getContentDescriptor()
SourceStream.getContentDescriptor(). Returns a
ContentDescriptor which describes the content type of this
instance.
getContentDescriptor in interface javax.media.protocol.SourceStreampublic long getContentLength()
SourceStream.getContentLength(). Delegates to the
input SourceStreams of this instance.
getContentLength in interface javax.media.protocol.SourceStreampublic javax.media.format.AudioFormat getFormat()
PushBufferStream.getFormat(). Returns the
AudioFormat in which this instance was configured to output its
data.
getFormat in interface javax.media.protocol.PushBufferStreamInputStreamDesc[] getInputStreams()
public void read(javax.media.Buffer buffer)
throws IOException
PushBufferStream.read(Buffer). Reads audio samples
from the input SourceStreams of this instance in various
formats, converts the read audio samples to one and the same format and
pushes them to the output AudioMixingPushBufferStreams for the
very audio mixing.
read in interface javax.media.protocol.PushBufferStreambuffer - the Buffer in which the audio samples read from
the input SourceStreams are to be returned to the caller
IOException - if any of the input SourceStreams throws
such an exception while reading from them or anything else goes wrong
void removeOutputStream(AudioMixingPushBufferStream outputStream)
throws IOException
outputStream - the AudioMixingPushBufferStream to remove
from the collection of such streams to which this instance pushes the
data for audio mixing it reads from its input SourceStreams
IOException - if outputStream was the last
AudioMixingPushBufferStream and the AudioMixer failed
to stopvoid setInputStreams(Collection<InputStreamDesc> inputStreams)
inputStreams - the SourceStreams (in the form of
InputStreamDesc) from which this instance is to read audio
samples and push them to the AudioMixingPushBufferStreams for
audio mixingpublic void setTransferHandler(javax.media.protocol.BufferTransferHandler transferHandler)
PushBufferStream.setTransferHandler(BufferTransferHandler).
Because this instance pushes data to multiple output
AudioMixingPushBufferStreams, a single
BufferTransferHandler is not sufficient and thus this method is
unsupported and throws UnsupportedOperationException.
setTransferHandler in interface javax.media.protocol.PushBufferStreamtransferHandler - the BufferTransferHandler to be notified
by this PushBufferStream when media is available for readingprotected void transferData(javax.media.Buffer buffer)
buffer - the cached Buffer instance to be used during the
execution of the method in order to reduce garbage collection. The
length of the buffer will be reset to 0 before
and after the execution of the method.
|
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 | |||||||||