Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.conference
Class InputDataSourceDesc

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.conference.InputDataSourceDesc

 class InputDataSourceDesc
extends Object

Describes additional information about a specific input DataSource of an AudioMixer so that the AudioMixer can, for example, quickly discover the output AudioMixingPushBufferDataSource in the mix of which the contribution of the DataSource is to not be included.

Private to AudioMixer and AudioMixerPushBufferStream but extracted into its own file for the sake of clarity.

Author:
Lubomir Marinov

Field Summary
 javax.media.protocol.DataSource inputDataSource
          The DataSource for which additional information is described by this instance.
 AudioMixingPushBufferDataSource outputDataSource
          The AudioMixingPushBufferDataSource in which the mix contributions of inputDataSource are to not be included.
 
Constructor Summary
InputDataSourceDesc(javax.media.protocol.DataSource inputDataSource, AudioMixingPushBufferDataSource outputDataSource)
          Initializes a new InputDataSourceDesc instance which is to describe additional information about a specific input DataSource of an AudioMixer.
 
Method Summary
(package private)  void connect(AudioMixer audioMixer)
          Connects the effective input DataSource described by this instance upon request from a specific AudioMixer.
(package private)  boolean createTranscodingDataSource(javax.media.Format outputFormat)
          Creates a DataSource which attempts to transcode the tracks of the input DataSource described by this instance into a specific output Format.
(package private)  void disconnect()
          Disconnects the effective input DataSource described by this instance if it is already connected.
 Object getControl(String controlType)
          Gets the control available for the effective input DataSource described by this instance with a specific type.
 javax.media.protocol.DataSource getEffectiveInputDataSource()
          Gets the actual DataSource from which the associated AudioMixer directly reads in order to retrieve the mix contribution of the DataSource described by this instance.
 javax.media.protocol.SourceStream[] getStreams()
          Gets the SourceStreams of the effective input DataSource described by this instance.
(package private)  void start()
          Starts the effective input DataSource described by this instance if it is connected.
(package private)  void stop()
          Stops the effective input DataSource described by this instance if it is connected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputDataSource

public final javax.media.protocol.DataSource inputDataSource
The DataSource for which additional information is described by this instance.


outputDataSource

public final AudioMixingPushBufferDataSource outputDataSource
The AudioMixingPushBufferDataSource in which the mix contributions of inputDataSource are to not be included.

Constructor Detail

InputDataSourceDesc

public InputDataSourceDesc(javax.media.protocol.DataSource inputDataSource,
                           AudioMixingPushBufferDataSource outputDataSource)
Initializes a new InputDataSourceDesc instance which is to describe additional information about a specific input DataSource of an AudioMixer. Associates the specified DataSource with the AudioMixingPushBufferDataSource in which the mix contributions of the specified input DataSource are to not be included.

Parameters:
inputDataSource - a DataSourc for which additional information is to be described by the new instance
outputDataSource - the AudioMixingPushBufferDataSource in which the mix contributions of inputDataSource are to not be included
Method Detail

connect

void connect(AudioMixer audioMixer)
       throws IOException
Connects the effective input DataSource described by this instance upon request from a specific AudioMixer. If the effective input DataSource is to be asynchronously connected, the completion of the connect procedure will be reported to the specified AudioMixer by calling its AudioMixer.connected(InputDataSourceDesc).

Parameters:
audioMixer - the AudioMixer requesting the effective input DataSource described by this instance to be connected
Throws:
IOException - if anything wrong happens while connecting the effective input DataSource described by this instance

createTranscodingDataSource

boolean createTranscodingDataSource(javax.media.Format outputFormat)
Creates a DataSource which attempts to transcode the tracks of the input DataSource described by this instance into a specific output Format.

Parameters:
outputFormat - the Format in which the tracks of the input DataSource described by this instance are to be transcoded
Returns:
true if a new transcoding DataSource has been created for the input DataSource described by this instance; otherwise, false

disconnect

void disconnect()
Disconnects the effective input DataSource described by this instance if it is already connected.


getControl

public Object getControl(String controlType)
Gets the control available for the effective input DataSource described by this instance with a specific type.

Parameters:
controlType - a String value which specifies the type of the control to be retrieved
Returns:
an Object which represents the control available for the effective input DataSource described by this instance with the specified controlType if such a control exists; otherwise, null

getEffectiveInputDataSource

public javax.media.protocol.DataSource getEffectiveInputDataSource()
Gets the actual DataSource from which the associated AudioMixer directly reads in order to retrieve the mix contribution of the DataSource described by this instance.

Returns:
the actual DataSource from which the associated AudioMixer directly reads in order to retrieve the mix contribution of the DataSource described by this instance

getStreams

public javax.media.protocol.SourceStream[] getStreams()
Gets the SourceStreams of the effective input DataSource described by this instance.

Returns:
an array of the SourceStreams of the effective input DataSource described by this instance

start

void start()
     throws IOException
Starts the effective input DataSource described by this instance if it is connected.

Throws:
IOException - if starting the effective input DataSource described by this instance fails

stop

void stop()
    throws IOException
Stops the effective input DataSource described by this instance if it is connected.

Throws:
IOException - if stopping the effective input DataSource described by this instance fails

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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