diff --git a/src/net/java/sip/communicator/impl/neomedia/GatherEntropy.java b/src/net/java/sip/communicator/impl/neomedia/GatherEntropy.java index 8ffa22b0f..e18698381 100644 --- a/src/net/java/sip/communicator/impl/neomedia/GatherEntropy.java +++ b/src/net/java/sip/communicator/impl/neomedia/GatherEntropy.java @@ -29,6 +29,7 @@ * TODO: add JMF method to read audio (mic) data, check if we can use video? * * @author Werner Dittmann + * @author Lubomir Marinov */ public class GatherEntropy { @@ -106,8 +107,15 @@ else if (deviceConfiguration.getAudioSystem().equals( private class GatherPortAudio extends Thread { + /** + * The PortAudio DataSource which provides + * {@link #portAudioStream}. + */ private DataSource dataSource = null; + /** + * The PortAudioStream 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; diff --git a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/portaudio/DataSource.java b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/portaudio/DataSource.java index f22a25f05..a22a7e8bb 100644 --- a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/portaudio/DataSource.java +++ b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/portaudio/DataSource.java @@ -24,21 +24,53 @@ public class DataSource extends AbstractPullBufferCaptureDevice { + + /** + * The indicator which determines whether this DataSource will + * use audio quality improvement in accord with the preferences of the user. + */ private final boolean audioQualityImprovement; + /** + * The list of Formats in which this DataSource is + * capable of capturing audio data. + */ private final Format[] supportedFormats; + /** + * Initializes a new DataSource instance. + */ public DataSource() { this.supportedFormats = null; this.audioQualityImprovement = true; } + /** + * Initializes a new DataSource instance from a specific + * MediaLocator. + * + * @param locator the MediaLocator to create the new instance from + */ public DataSource(MediaLocator locator) { this(locator, null, true); } + /** + * Initializes a new DataSource instance from a specific + * MediaLocator and which has a specific list of Format + * 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 MediaLocator to create the new instance from + * @param supportedFormats the list of Formats in which the new + * instance is to be capable of capturing audio data + * @param audioQuality true if audio quality improvement is to be + * enabled in accord with the preferences of the user or false to + * completely disable audio quality improvement + */ public DataSource( MediaLocator locator, Format[] supportedFormats, diff --git a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/portaudio/PortAudioStream.java b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/portaudio/PortAudioStream.java index 641c0793c..381a03402 100644 --- a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/portaudio/PortAudioStream.java +++ b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/portaudio/PortAudioStream.java @@ -24,6 +24,12 @@ public class PortAudioStream extends AbstractPullBufferStream { + + /** + * The indicator which determines whether audio quality improvement is + * enabled for this PortAudioStream in accord with the preferences + * of the user. + */ private final boolean audioQualityImprovement; /** @@ -70,7 +76,9 @@ public class PortAudioStream * * @param formatControl the FormatControl which is to abstract the * Format-related information of the new instance - * @param audioQualityImprovement + * @param audioQualityImprovement true to enable audio quality + * improvement for the new instance in accord with the preferences of the + * user or false to completely disable audio quality improvement */ public PortAudioStream( FormatControl formatControl,