Adds Javadocs.

cusax-fix
Lyubomir Marinov 16 years ago
parent 5f3646989c
commit 1324d1e72d

@ -29,6 +29,7 @@
* TODO: add JMF method to read audio (mic) data, check if we can use video?
*
* @author Werner Dittmann <Werner.Dittmann@t-online.de>
* @author Lubomir Marinov
*/
public class GatherEntropy
{
@ -106,8 +107,15 @@ else if (deviceConfiguration.getAudioSystem().equals(
private class GatherPortAudio extends Thread
{
/**
* The PortAudio <tt>DataSource</tt> which provides
* {@link #portAudioStream}.
*/
private DataSource dataSource = null;
/**
* The <tt>PortAudioStream</tt> from which audio data is captured.
*/
private PortAudioStream portAudioStream = null;
/**
@ -161,8 +169,8 @@ private boolean preparePortAudioEntropy()
*
* The method gathers a number of samples and seeds the Fortuna PRNG.
*/
public void run() {
public void run()
{
ZrtpFortuna fortuna = ZrtpFortuna.getInstance();
Buffer firstBuf = new Buffer();
@ -182,12 +190,11 @@ public void run() {
// others on the first pools. This method is adapted to
// SC requirements to get random data
if (i < 32)
{
fortuna.addSeedMaterial(entropy);
}
else
else
{
fortuna.addSeedMaterial((i%3), entropy, 0, entropy.length);
fortuna
.addSeedMaterial((i%3), entropy, 0, entropy.length);
}
}
entropyOk = true;

@ -24,21 +24,53 @@
public class DataSource
extends AbstractPullBufferCaptureDevice
{
/**
* The indicator which determines whether this <tt>DataSource</tt> will
* use audio quality improvement in accord with the preferences of the user.
*/
private final boolean audioQualityImprovement;
/**
* The list of <tt>Format</tt>s in which this <tt>DataSource</tt> is
* capable of capturing audio data.
*/
private final Format[] supportedFormats;
/**
* Initializes a new <tt>DataSource</tt> instance.
*/
public DataSource()
{
this.supportedFormats = null;
this.audioQualityImprovement = true;
}
/**
* Initializes a new <tt>DataSource</tt> instance from a specific
* <tt>MediaLocator</tt>.
*
* @param locator the <tt>MediaLocator</tt> to create the new instance from
*/
public DataSource(MediaLocator locator)
{
this(locator, null, true);
}
/**
* Initializes a new <tt>DataSource</tt> instance from a specific
* <tt>MediaLocator</tt> and which has a specific list of <tt>Format</tt>
* in which it is capable of capturing audio data overriding its
* registration with JMF and optionally uses audio quality improvement in
* accord with the preferences of the user.
*
* @param locator the <tt>MediaLocator</tt> to create the new instance from
* @param supportedFormats the list of <tt>Format</tt>s in which the new
* instance is to be capable of capturing audio data
* @param audioQuality <tt>true</tt> if audio quality improvement is to be
* enabled in accord with the preferences of the user or <tt>false</tt> to
* completely disable audio quality improvement
*/
public DataSource(
MediaLocator locator,
Format[] supportedFormats,

@ -24,6 +24,12 @@
public class PortAudioStream
extends AbstractPullBufferStream
{
/**
* The indicator which determines whether audio quality improvement is
* enabled for this <tt>PortAudioStream</tt> in accord with the preferences
* of the user.
*/
private final boolean audioQualityImprovement;
/**
@ -70,7 +76,9 @@ public class PortAudioStream
*
* @param formatControl the <tt>FormatControl</tt> which is to abstract the
* <tt>Format</tt>-related information of the new instance
* @param audioQualityImprovement
* @param audioQualityImprovement <tt>true</tt> to enable audio quality
* improvement for the new instance in accord with the preferences of the
* user or <tt>false</tt> to completely disable audio quality improvement
*/
public PortAudioStream(
FormatControl formatControl,

Loading…
Cancel
Save