From dde39782e1d5ee2ce638fb8ea1563c67d1025941 Mon Sep 17 00:00:00 2001 From: Sebastien Vincent Date: Tue, 6 Jul 2010 06:29:24 +0000 Subject: [PATCH] Fix some javadoc warnings. --- .../DeviceConfigurationComboBoxModel.java | 6 +- .../impl/neomedia/FMJConditionals.java | 7 ++- .../impl/neomedia/GatherEntropy.java | 50 ++++++++-------- .../neomedia/RTPConnectorOutputStream.java | 37 ++++++++---- .../codec/video/FinalizableAVFrame.java | 1 + .../neomedia/codec/video/h264/Packetizer.java | 55 ++++++++++++++++- .../impl/neomedia/conference/AudioMixer.java | 40 ++++++------- .../device/AudioMediaDeviceSession.java | 2 +- .../neomedia/device/DeviceConfiguration.java | 6 +- .../neomedia/device/ImageStreamingAuto.java | 5 +- .../impl/neomedia/device/PortAudioAuto.java | 6 +- .../device/VideoMediaDeviceSession.java | 12 ++-- .../impl/neomedia/directshow/DSManager.java | 3 +- .../imgstreaming/ImageStreamingUtils.java | 4 +- .../protocol/directshow/DirectShowStream.java | 12 ++-- .../protocol/imgstreaming/DataSource.java | 4 -- .../media/protocol/portaudio/DataSource.java | 6 +- .../protocol/portaudio/PortAudioStream.java | 7 +++ .../protocol/quicktime/QuickTimeStream.java | 4 +- .../media/renderer/video/JAWTRenderer.java | 4 ++ .../portaudio/PortAudioException.java | 8 +++ .../protocol/BufferStreamAdapter.java | 14 ++--- .../neomedia/quicktime/CVPixelBuffer.java | 7 +++ .../transform/RTPTransformConnector.java | 8 +-- .../neomedia/transform/srtp/SRTPPolicy.java | 22 +++---- .../transform/srtp/SRTPTransformEngine.java | 29 ++++----- .../transform/zrtp/ZRTPTransformEngine.java | 60 +++++++++---------- .../transform/zrtp/ZrtpRawPacket.java | 52 ++++++++-------- 28 files changed, 279 insertions(+), 192 deletions(-) diff --git a/src/net/java/sip/communicator/impl/neomedia/DeviceConfigurationComboBoxModel.java b/src/net/java/sip/communicator/impl/neomedia/DeviceConfigurationComboBoxModel.java index 70ac420fa..a1366ce74 100644 --- a/src/net/java/sip/communicator/impl/neomedia/DeviceConfigurationComboBoxModel.java +++ b/src/net/java/sip/communicator/impl/neomedia/DeviceConfigurationComboBoxModel.java @@ -28,8 +28,8 @@ public static class CaptureDevice { /** * Compares two CaptureDeviceInfo - * @param a - * @param b + * @param a first CaptureDeviceInfo to compare + * @param b second CaptureDeviceInfo to compare * @return whether a is equal to b */ public static boolean equals(CaptureDeviceInfo a, CaptureDeviceInfo b) @@ -206,7 +206,7 @@ private CaptureDevice[] getDevices() /** * Extracts the devices selected by the configuration. - * @return + * @return CaptureDevice selected */ private CaptureDevice getSelectedDevice() { diff --git a/src/net/java/sip/communicator/impl/neomedia/FMJConditionals.java b/src/net/java/sip/communicator/impl/neomedia/FMJConditionals.java index 85d14a84e..bd3674cfa 100644 --- a/src/net/java/sip/communicator/impl/neomedia/FMJConditionals.java +++ b/src/net/java/sip/communicator/impl/neomedia/FMJConditionals.java @@ -9,13 +9,16 @@ import javax.media.format.*; /** - * Class to centralize workarounds or changes that need to be made for FMJ to work. - * This is also a place to tweak which workarounds are used. + * Class to centralize workarounds or changes that need to be made for FMJ to + * work. This is also a place to tweak which workarounds are used. * * @author Ken Larson */ public class FMJConditionals { + /** + * If FMJ is used. + */ public static final boolean IS_FMJ = false; /** diff --git a/src/net/java/sip/communicator/impl/neomedia/GatherEntropy.java b/src/net/java/sip/communicator/impl/neomedia/GatherEntropy.java index d5419d871..b260460ed 100644 --- a/src/net/java/sip/communicator/impl/neomedia/GatherEntropy.java +++ b/src/net/java/sip/communicator/impl/neomedia/GatherEntropy.java @@ -20,11 +20,11 @@ * devices and uses this data to seed the Fortuna PRNG. The ZrtpFortuna PRNG * is a singleton and all other methods that require random data shall use * this singleton. - * - * Use GatherEntropy during startup and initialization phase of SIP + * + * Use GatherEntropy during startup and initialization phase of SIP * Communicator but after initialization of the media devices to get entropy * data at the earliest point. Also make sure that entropy data is read from - * local sources only and that entropy data is never send out (via networks + * local sources only and that entropy data is never send out (via networks * for example). * * @author Werner Dittmann @@ -43,13 +43,13 @@ public class GatherEntropy * Device config to look for capture devices. */ private final DeviceConfiguration deviceConfiguration; - + /** * Other methods shall/may check this to see if Fortuna was seeded with * entropy. */ private static boolean entropyOk = false; - + /** * Number of gathered entropy bytes. */ @@ -61,33 +61,33 @@ public class GatherEntropy * data. */ private int bytesToGather = 0; - + /** * Bytes per 20ms time slice. */ private int bytes20ms = 0; - + /** * How many seconds of audio to read. - * + * */ private static final int NUM_OF_SECONDS = 2; - public GatherEntropy(DeviceConfiguration deviceConfiguration) + public GatherEntropy(DeviceConfiguration deviceConfiguration) { this.deviceConfiguration = deviceConfiguration; } - + /** * Get status of entropy flag. - * - * @return Status if entropy was gathered and set in Fortuna PRNG. + * + * @return Status if entropy was gathered and set in Fortuna PRNG. */ public static boolean isEntropyOk() { return entropyOk; } - + /** * @return the number of gathered entropy bytes. */ @@ -97,11 +97,11 @@ protected int getGatheredEntropy() } /** * Set entropy to ZrtpFortuna singleton. - * - * The methods reads entropy data and seeds the ZrtpFortuna singleton. + * + * The methods reads entropy data and seeds the ZrtpFortuna singleton. * The methods seeds the first pool (0) of Fortuna to make sure that * this entropy is always used. - * + * * @return true if entropy data was available, false otherwise. */ public boolean setEntropy() @@ -118,7 +118,7 @@ private class GatherAudio extends Thread implements BufferTransferHandler { /** * The PortAudio DataSource which provides - * {@link #portAudioStream}. + * {@link #audioStream}. */ private DataSource dataSource = null; @@ -134,18 +134,18 @@ private class GatherAudio extends Thread implements BufferTransferHandler private final Buffer firstBuf = new Buffer(); private boolean bufferAvailable = false; private final Object bufferSync = new Object(); - + /** * Prepares to read entropy data from portaudio capture device. - * - * The method gets an PortAudio instance with a set of capture + * + * The method gets an PortAudio instance with a set of capture * parameters. - * - * @return True if the PortAudio input stream is available. + * + * @return True if the PortAudio input stream is available. */ private boolean prepareAudioEntropy() { - CaptureDeviceInfo audioCaptureDevice = + CaptureDeviceInfo audioCaptureDevice = deviceConfiguration.getAudioCaptureDevice(); if (audioCaptureDevice == null) return false; @@ -207,7 +207,7 @@ public void transferData(PushBufferStream stream) } /** * Gather entropy from portaudio capture device and seed Fortuna PRNG. - * + * * The method gathers a number of samples and seeds the Fortuna PRNG. */ @Override @@ -223,7 +223,7 @@ public void run() dataSource.start(); int i = 0; - while (gatheredEntropy < bytesToGather) + while (gatheredEntropy < bytesToGather) { if (audioStream instanceof PushBufferStream) { diff --git a/src/net/java/sip/communicator/impl/neomedia/RTPConnectorOutputStream.java b/src/net/java/sip/communicator/impl/neomedia/RTPConnectorOutputStream.java index 2065e3f0d..0c343052d 100755 --- a/src/net/java/sip/communicator/impl/neomedia/RTPConnectorOutputStream.java +++ b/src/net/java/sip/communicator/impl/neomedia/RTPConnectorOutputStream.java @@ -53,6 +53,9 @@ public class RTPConnectorOutputStream protected final List targets = new LinkedList(); + /** + * List of available raw packets. + */ private final LinkedBlockingQueue availRawPackets = new LinkedBlockingQueue(); @@ -90,7 +93,7 @@ public void close() maxPacketsPerMillisPolicy = null; removeTargets(); } - + /** * Creates a new RawPacket from a specific byte[] buffer * in order to have this instance send its packet data through its @@ -109,10 +112,10 @@ public void close() protected RawPacket createRawPacket(byte[] buffer, int offset, int length) { RawPacket pkt = availRawPackets.poll(); - if (pkt == null || pkt.getBuffer().length < length) + if (pkt == null || pkt.getBuffer().length < length) { byte[] buf = new byte[length]; - pkt = new RawPacket(); + pkt = new RawPacket(); pkt.setBuffer(buf); } System.arraycopy(buffer, offset, pkt.getBuffer(), 0, length); @@ -223,10 +226,14 @@ public void setMaxPacketsPerMillis(int maxPackets, long perMillis) /** * Implements {@link OutputDataStream#write(byte[], int, int)}. * - * @param buffer - * @param offset - * @param length - * @return + * @param buffer the byte[] that we'd like to copy the content + * of the packet to. + * @param offset the position where we are supposed to start writing in + * buffer. + * @param length the number of bytes available for writing in + * inBuffer. + * + * @return the number of bytes read */ public int write(byte[] buffer, int offset, int length) { @@ -287,7 +294,8 @@ private class MaxPacketsPerMillisPolicy * DatagramSocket of this OutputDataSource. */ private final ArrayBlockingQueue packetQueue - = new ArrayBlockingQueue(MAX_PACKETS_PER_MILLIS_POLICY_PACKET_QUEUE_CAPACITY); + = new ArrayBlockingQueue( + MAX_PACKETS_PER_MILLIS_POLICY_PACKET_QUEUE_CAPACITY); /** * The number of RTP packets already sent during the current @@ -308,7 +316,7 @@ private class MaxPacketsPerMillisPolicy * OutputDataSource. */ private Thread sendThread; - + /** * To signal run or stop condition to send thread. */ @@ -347,7 +355,10 @@ public void run() } } } - + + /** + * Closes the connector. + */ synchronized void close() { if (!sendRun) @@ -384,7 +395,7 @@ private void runInSendThread() } if (!sendRun) break; - + long time = System.nanoTime(); long millisRemainingTime = time - millisStartTime; @@ -397,7 +408,7 @@ private void runInSendThread() else if ((maxPackets > 0) && (packetsSentInMillis >= maxPackets)) { - while (true) + while (true) { millisRemainingTime = System.nanoTime() - millisStartTime; @@ -463,7 +474,7 @@ public void setMaxPacketsPerMillis(int maxPackets, long perMillis) */ public void write(RawPacket packet) { - while (true) + while (true) { try { diff --git a/src/net/java/sip/communicator/impl/neomedia/codec/video/FinalizableAVFrame.java b/src/net/java/sip/communicator/impl/neomedia/codec/video/FinalizableAVFrame.java index 0a281538e..80f517de1 100644 --- a/src/net/java/sip/communicator/impl/neomedia/codec/video/FinalizableAVFrame.java +++ b/src/net/java/sip/communicator/impl/neomedia/codec/video/FinalizableAVFrame.java @@ -71,6 +71,7 @@ protected void finalize() /** * Frees the memory pointed to by the data0 member of the native * AVFrame. + * @param data0 pointer to free */ protected void freeData0(long data0) { diff --git a/src/net/java/sip/communicator/impl/neomedia/codec/video/h264/Packetizer.java b/src/net/java/sip/communicator/impl/neomedia/codec/video/h264/Packetizer.java index 15f560114..73f37c06c 100644 --- a/src/net/java/sip/communicator/impl/neomedia/codec/video/h264/Packetizer.java +++ b/src/net/java/sip/communicator/impl/neomedia/codec/video/h264/Packetizer.java @@ -25,12 +25,20 @@ public class Packetizer extends AbstractPacketizer { + /** + * Array of default output formats. + */ private static final Format[] DEFAULT_OUTPUT_FORMATS = { new VideoFormat(Constants.H264_RTP) }; - // without the headers + /** + * Maximum payload size without the headers. + */ public static final int MAX_PAYLOAD_SIZE = 1024; + /** + * Name of the plugin. + */ private static final String PLUGIN_NAME = "H264 Packetizer"; /** @@ -62,6 +70,9 @@ public Packetizer() outputFormat = null; } + /** + * Close this Packetizer. + */ @Override public synchronized void close() { @@ -100,6 +111,12 @@ private static int ff_avc_find_startcode( return endIndex; } + /** + * Get the matching output formats for a specific format. + * + * @param in input format + * @return array for formats matching input format + */ private Format[] getMatchingOutputFormats(Format in) { VideoFormat videoIn = (VideoFormat) in; @@ -116,7 +133,11 @@ private Format[] getMatchingOutputFormats(Format in) videoIn.getFrameRate()) }; } - + /** + * Get codec name. + * + * @return codec name + */ @Override public String getName() { @@ -125,6 +146,9 @@ public String getName() /** * Return the list of formats supported at the output. + * @param in input Format to determine corresponding output + * Format/tt>s + * @return array of formats supported at output */ public Format[] getSupportedOutputFormats(Format in) { @@ -140,6 +164,9 @@ public Format[] getSupportedOutputFormats(Format in) return getMatchingOutputFormats(in); } + /** + * Open this Packetizer. + */ @Override public synchronized void open() throws ResourceUnavailableException @@ -245,6 +272,14 @@ private boolean packetizeNAL(byte[] nal, int nalOffset, int nalLength) return nalsAdded; } + /** + * Processes (packetize) a buffer. + * + * @param inBuffer input buffer + * @param outBuffer output buffer + * @return BUFFER_PROCESSED_OK if buffer has been successfully + * processed + */ @Override public int process(Buffer inBuffer, Buffer outBuffer) { @@ -364,6 +399,12 @@ public int process(Buffer inBuffer, Buffer outBuffer) nalsAdded ? process(inBuffer, outBuffer) : OUTPUT_BUFFER_NOT_FILLED; } + /** + * Sets the input format. + * + * @param in format to set + * @return format + */ @Override public Format setInputFormat(Format in) { @@ -379,6 +420,16 @@ public Format setInputFormat(Format in) return in; } + /** + * Sets the Format in which this Codec is to output media + * data. + * + * @param out the Format in which this Codec is to + * output media data + * @return the Format in which this Codec is currently + * configured to output media data or null if format was + * found to be incompatible with this Codec + */ @Override public Format setOutputFormat(Format out) { diff --git a/src/net/java/sip/communicator/impl/neomedia/conference/AudioMixer.java b/src/net/java/sip/communicator/impl/neomedia/conference/AudioMixer.java index 5e02d3a8b..0ac205af9 100644 --- a/src/net/java/sip/communicator/impl/neomedia/conference/AudioMixer.java +++ b/src/net/java/sip/communicator/impl/neomedia/conference/AudioMixer.java @@ -41,7 +41,7 @@ * 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. *

- * + * * @author Lubomir Marinov */ public class AudioMixer @@ -131,7 +131,7 @@ public class AudioMixer * AudioMixingPushBufferDataSources it creates. The specified * CaptureDevice is also added as the first input * DataSource of the new instance. - * + * * @param captureDevice the CaptureDevice capabilities to be * provided to the AudioMixingPushBufferDataSources created by the * new instance and its first input DataSource @@ -167,7 +167,7 @@ public AudioMixer(CaptureDevice captureDevice) * DataSources from which this instance reads audio. If the * specified DataSource indeed provides audio, the respective * contributions to the mix are always included. - * + * * @param inputDataSource a new DataSource to input audio to this * instance */ @@ -182,7 +182,7 @@ public void addInputDataSource(DataSource inputDataSource) * specified DataSource indeed provides audio, the respective * contributions to the mix will be excluded from the mix output provided * through a specific AudioMixingPushBufferDataSource. - * + * * @param inputDataSource a new DataSource to input audio to this * instance * @param outputDataSource the AudioMixingPushBufferDataSource to @@ -258,8 +258,8 @@ void addInputDataSource( * AudioMixingPushBufferDataSources reading from this * AudioMixer which gets connected causes it to connect to the * input DataSources it manages. - * - * @throws IOException + * + * @throws IOException if input/output error occurred */ void connect() throws IOException @@ -377,7 +377,7 @@ private InputStreamDesc createInputStreamDesc( * new input DataSources in this AudioMixer but * have their contributions not included in the mix available through the * returned AudioMixingPushBufferDataSource. - * + * * @return 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 @@ -391,7 +391,7 @@ public AudioMixingPushBufferDataSource createOutputDataSource() * Creates a DataSource which attempts to transcode the tracks of a * specific input DataSource into a specific output * Format. - * + * * @param inputDataSourceDesc the InputDataSourceDesc describing * the input DataSource to be transcoded into the specified output * Format and to receive the transcoding DataSource @@ -477,7 +477,7 @@ BufferControl getBufferControl() * Gets the CaptureDeviceInfo of the CaptureDevice * this AudioMixer provides through its output * AudioMixingPushBufferDataSources. - * + * * @return the CaptureDeviceInfo of the CaptureDevice this * AudioMixer provides through its output * AudioMixingPushBufferDataSources @@ -489,7 +489,7 @@ CaptureDeviceInfo getCaptureDeviceInfo() /** * Gets the content type of the data output by this AudioMixer. - * + * * @return the content type of the data output by this AudioMixer */ String getContentType() @@ -544,7 +544,7 @@ private InputStreamDesc getExistingInputStreamDesc( /** * Gets the duration of each one of the output streams produced by this * AudioMixer. - * + * * @return the duration of each one of the output streams produced by this * AudioMixer */ @@ -556,7 +556,7 @@ Time getDuration() /** * Gets the Format in which a specific DataSource * provides stream data. - * + * * @param dataSource the DataSource for which the Format * in which it provides stream data is to be determined * @return the Format in which the specified dataSource @@ -574,7 +574,7 @@ private static Format getFormat(DataSource dataSource) /** * Gets the Format in which a specific * SourceStream provides data. - * + * * @param stream * the SourceStream for which the * Format in which it provides data is to be @@ -596,7 +596,7 @@ private static Format getFormat(SourceStream stream) * Gets an array of FormatControls for the * CaptureDevice this AudioMixer provides through * its output AudioMixingPushBufferDataSources. - * + * * @return an array of FormatControls for the * CaptureDevice this AudioMixer provides * through its output AudioMixingPushBufferDataSources @@ -621,7 +621,7 @@ FormatControl[] getFormatControls() * InputStreamDesc) of a specific DataSource * (provided in the form of InputDataSourceDesc) which produce * data in a specific AudioFormat (or a matching one). - * + * * @param inputDataSourceDesc * the DataSource (in the form of * InputDataSourceDesc) which is to be examined for @@ -739,7 +739,7 @@ && matches(inputFormat, outputFormat)) * DataSource does not have such SourceStreams, an attempt * is made to transcode its tracks so that such SourceStreams can * be retrieved from it after transcoding. - * + * * @param outputFormat the AudioFormat in which the retrieved * SourceStreams are to produce data * @param existingInputStreams the SourceStreams which are already @@ -804,7 +804,7 @@ public AudioMixingPushBufferDataSource getLocalOutputDataSource() * DataSources of this AudioMixer can produce data * and which is to be the output Format of this * AudioMixer. - * + * * @return the AudioFormat in which the input * DataSources of this AudioMixer can * produce data and which is to be the output Format of @@ -874,7 +874,7 @@ private AudioFormat getOutputFormatFromInputDataSources() * does not exist already, which reads data from the input * DataSources of this AudioMixer and pushes it to * output AudioMixingPushBufferStreams for audio mixing. - * + * * @return the AudioMixerPushBufferStream which reads data from * the input DataSources of this * AudioMixer and pushes it to output @@ -923,7 +923,7 @@ AudioMixerPushBufferStream getOutputStream() * Format, the only requirement for the specified * Formats to match is for both of them to have one and the * same encoding. - * + * * @param input * the Format for which it is required to determine * whether it matches a specific Format @@ -1000,7 +1000,7 @@ public void removeInputDataSources(DataSourceFilter dataSourceFilter) * format of the input DataSources of this * AudioMixer in an attempt to not have to perform explicit * transcoding of the input SourceStreams. - * + * * @param outputFormat * the AudioFormat in which the input * DataSources of this AudioMixer are diff --git a/src/net/java/sip/communicator/impl/neomedia/device/AudioMediaDeviceSession.java b/src/net/java/sip/communicator/impl/neomedia/device/AudioMediaDeviceSession.java index 53cc75c7e..9d2c9c6cc 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/AudioMediaDeviceSession.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/AudioMediaDeviceSession.java @@ -56,7 +56,7 @@ protected AudioMediaDeviceSession(AbstractMediaDevice device) } /** - * Called by {@link MediaDeviceSession#createPlayer(DataSource dataSource)} + * Called by {@link MediaDeviceSession#createPlayer(DataSource dataSource)} * when the player associated with this session's * ReceiveStream moves enters the Configured state, so * we use the occasion to add our audio level effect. diff --git a/src/net/java/sip/communicator/impl/neomedia/device/DeviceConfiguration.java b/src/net/java/sip/communicator/impl/neomedia/device/DeviceConfiguration.java index dd2585e0e..b245b6790 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/DeviceConfiguration.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/DeviceConfiguration.java @@ -440,8 +440,8 @@ public CaptureDeviceInfo[] getAvailableAudioPlaybackDevices() /** * Gets the list of video capture devices which are available through this * DeviceConfiguration, amongst which is - * {@link #getVideoCaptureDevice()} and represent acceptable values - * for {@link #setVideoCaptureDevice(CaptureDeviceInfo, boolean)} + * {@link #getVideoCaptureDevice(MediaUseCase)} and represent acceptable + * values for {@link #setVideoCaptureDevice(CaptureDeviceInfo, boolean)} * * @param useCase extract video capture devices that correspond to this * MediaUseCase @@ -1007,7 +1007,6 @@ public boolean isDenoiseEnabled() */ private void registerCustomRenderers() { - @SuppressWarnings("unchecked") Vector renderers = PlugInManager.getPlugInList(null, null, PlugInManager.RENDERER); boolean commit = false; @@ -1044,7 +1043,6 @@ private void registerCustomRenderers() * are considered preferred. */ int pluginType = PlugInManager.RENDERER; - @SuppressWarnings("unchecked") Vector plugins = PlugInManager.getPlugInList(null, null, pluginType); diff --git a/src/net/java/sip/communicator/impl/neomedia/device/ImageStreamingAuto.java b/src/net/java/sip/communicator/impl/neomedia/device/ImageStreamingAuto.java index 0b37306a3..4d67c6eaf 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/ImageStreamingAuto.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/ImageStreamingAuto.java @@ -17,11 +17,10 @@ import net.java.sip.communicator.impl.neomedia.codec.video.*; import net.java.sip.communicator.impl.neomedia.*; import net.java.sip.communicator.impl.neomedia.imgstreaming.*; -import net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.imgstreaming.*; /** * Add ImageStreaming capture device. - * + * * @author Sebastien Vincent */ public class ImageStreamingAuto @@ -94,7 +93,7 @@ public ImageStreamingAuto() throws Exception new MediaLocator( ImageStreamingUtils.LOCATOR_PROTOCOL + ":" + i), formats); - + /* add to JMF device manager */ CaptureDeviceManager.addDevice(devInfo); i++; diff --git a/src/net/java/sip/communicator/impl/neomedia/device/PortAudioAuto.java b/src/net/java/sip/communicator/impl/neomedia/device/PortAudioAuto.java index 3dfa2b2e5..34397541f 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/PortAudioAuto.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/PortAudioAuto.java @@ -195,13 +195,13 @@ public class PortAudioAuto * Gets a sample rate supported by a PortAudio device with a specific device * index with which it is to be registered with JMF. * - * @param true if the supported sample rate is to be retrieved for + * @param input true if the supported sample rate is to be retrieved for * the PortAudio device with the specified device index as an input device * or false for an output device * @param deviceIndex the device index of the PortAudio device for which a * supported sample rate is to be retrieved - * @param channelCount - * @param sampleFormat + * @param channelCount number of channel + * @param sampleFormat sample format * @return a sample rate supported by the PortAudio device with the * specified device index with which it is to be registered with JMF */ diff --git a/src/net/java/sip/communicator/impl/neomedia/device/VideoMediaDeviceSession.java b/src/net/java/sip/communicator/impl/neomedia/device/VideoMediaDeviceSession.java index 3de5e0f6f..046e85158 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/VideoMediaDeviceSession.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/VideoMediaDeviceSession.java @@ -1276,11 +1276,11 @@ public PlayerScaler(Player player) * Determines when the input video sizes changes and reports it as a * SizeChangeVideoEvent because Player is unable to * do it when this SwScaler is scaling to a specific - * outputSize. + * outputSize. * - * @param input - * @param output - * @return + * @param input input buffer + * @param output output buffer + * @return the native PaSampleFormat * @see SwScaler#process(Buffer, Buffer) */ @Override @@ -1313,8 +1313,8 @@ public int process(Buffer input, Buffer output) * Ensures that this SwScaler preserves the aspect ratio of its * input video when scaling. * - * @param inputFormat - * @return + * @param inputFormat format to set + * @return format * @see SwScaler#setInputFormat(Format) */ @Override diff --git a/src/net/java/sip/communicator/impl/neomedia/directshow/DSManager.java b/src/net/java/sip/communicator/impl/neomedia/directshow/DSManager.java index 01992b883..957f9c440 100644 --- a/src/net/java/sip/communicator/impl/neomedia/directshow/DSManager.java +++ b/src/net/java/sip/communicator/impl/neomedia/directshow/DSManager.java @@ -175,7 +175,8 @@ public DSCaptureDevice[] getCaptureDevices() /** * Native method to get capture devices pointers. * - * @return array of native pointer + * @param ptr native pointer of DSManager + * @return array of native pointer to DSCaptureDevice */ private native long[] getCaptureDevices(long ptr); } diff --git a/src/net/java/sip/communicator/impl/neomedia/imgstreaming/ImageStreamingUtils.java b/src/net/java/sip/communicator/impl/neomedia/imgstreaming/ImageStreamingUtils.java index 78dbf3d91..b98f4a266 100644 --- a/src/net/java/sip/communicator/impl/neomedia/imgstreaming/ImageStreamingUtils.java +++ b/src/net/java/sip/communicator/impl/neomedia/imgstreaming/ImageStreamingUtils.java @@ -32,7 +32,7 @@ public class ImageStreamingUtils * @param src source image * @param width width of scaled image * @param height height of scaled image - * @param type + * @param type BufferedImage type * @return scaled BufferedImage */ public static BufferedImage getScaledImage(BufferedImage src, @@ -63,7 +63,7 @@ public static BufferedImage getScaledImage(BufferedImage src, * @param output output buffer, if not null and if its length is at least * image's (width * height) * 4, method will put bytes in it. * @return raw bytes or null if src is not an ARGB - * BufferedImage + * BufferedImage */ public static byte[] getImageBytes(BufferedImage src, byte output[]) { diff --git a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/directshow/DirectShowStream.java b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/directshow/DirectShowStream.java index 26aa4e00e..1f5582d62 100644 --- a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/directshow/DirectShowStream.java +++ b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/directshow/DirectShowStream.java @@ -28,8 +28,8 @@ public class DirectShowStream extends AbstractPushBufferStream /** * The pool of ByteBuffers this instances is using to transfer the - * media data captured by {@link #captureOutput} out of this instance - * through the Buffers specified in its {@link #process(Buffer)}. + * media data captured by {@link #grabber} out of this instance + * through the Buffers specified in its {@link #read(Buffer)}. */ private final ByteBufferPool bufferPool = new ByteBufferPool(); @@ -72,13 +72,13 @@ public class DirectShowStream extends AbstractPushBufferStream * The Thread which is to call * {@link BufferTransferHandler#transferData(PushBufferStream)} for this * DirectShowStream so that the call is not made in DirectShow - * and we can drop late frames when {@link #automaticallyDropsLateFrames} is - * false. + * and we can drop late frames when + * {@link #automaticallyDropsLateVideoFrames} is false. */ private Thread transferDataThread; /** - * The indicator which determines whether {@link #captureOutput} + * The indicator which determines whether {@link #grabber} * automatically drops late frames. If false, we have to drop them * ourselves because DirectShow will buffer them all and the video will * be late. @@ -332,7 +332,7 @@ public void stop() throws IOException bufferPool.returnFreeBuffer(data); data = null; } - + if(nextData != null) { bufferPool.returnFreeBuffer(nextData); diff --git a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/imgstreaming/DataSource.java b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/imgstreaming/DataSource.java index 7fc411750..6c93f2874 100644 --- a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/imgstreaming/DataSource.java +++ b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/imgstreaming/DataSource.java @@ -6,13 +6,9 @@ */ package net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.imgstreaming; -import java.awt.*; - import javax.media.*; import javax.media.control.*; -import javax.media.format.*; -import net.java.sip.communicator.impl.neomedia.codec.video.*; import net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.*; /** 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 a22a7e8bb..4cc8ad5c4 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 @@ -67,9 +67,9 @@ public DataSource(MediaLocator locator) * @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 + * @param audioQualityImprovement 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, 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 ac3c1c627..06c489061 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 @@ -56,8 +56,14 @@ public class PortAudioStream */ private int framesPerBuffer; + /** + * Native pointer to a PaStreamParameters object. + */ private long inputParameters = 0; + /** + * Current sequence number. + */ private int sequenceNumber = 0; /** @@ -190,6 +196,7 @@ public void read(Buffer buffer) * * @param deviceIndex the device index of the PortAudio device to be read * through this PullBufferStream + * @throws IOException if input/output error occurred */ synchronized void setDeviceIndex(int deviceIndex) throws IOException diff --git a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/quicktime/QuickTimeStream.java b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/quicktime/QuickTimeStream.java index 9e8553e43..030080485 100644 --- a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/quicktime/QuickTimeStream.java +++ b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/protocol/quicktime/QuickTimeStream.java @@ -105,8 +105,8 @@ public class QuickTimeStream * The Thread which is to call * {@link BufferTransferHandler#transferData(PushBufferStream)} for this * QuickTimeStream so that the call is not made in QuickTime/QTKit - * and we can drop late frames when {@link #automaticallyDropsLateFrames} is - * false. + * and we can drop late frames when + * {@link #automaticallyDropsLateVideoFrames} is false. */ private Thread transferDataThread; diff --git a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/renderer/video/JAWTRenderer.java b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/renderer/video/JAWTRenderer.java index c31d3d80d..971f16c7b 100644 --- a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/renderer/video/JAWTRenderer.java +++ b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/renderer/video/JAWTRenderer.java @@ -32,6 +32,9 @@ public class JAWTRenderer */ private static final String PLUGIN_NAME = "JAWT Renderer"; + /** + * Array of supported input formats. + */ private static final Format[] SUPPORTED_INPUT_FORMATS = new Format[] { @@ -374,6 +377,7 @@ public synchronized int process(Buffer buffer) * offset which represent the data to be processed and rendered * @param width the width of the video frame in data * @param height the height of the video frame in data + * @return true if data has been successfully processed */ private static native boolean process( long handle, diff --git a/src/net/java/sip/communicator/impl/neomedia/portaudio/PortAudioException.java b/src/net/java/sip/communicator/impl/neomedia/portaudio/PortAudioException.java index 0bfe911b8..ea0a0b4f1 100644 --- a/src/net/java/sip/communicator/impl/neomedia/portaudio/PortAudioException.java +++ b/src/net/java/sip/communicator/impl/neomedia/portaudio/PortAudioException.java @@ -12,8 +12,16 @@ public class PortAudioException extends Exception { + /** + * Serial version UID. + */ private static final long serialVersionUID = 0L; + /** + * Constructs a PortAudioException with message as + * description. + * @param message description of the exception + */ public PortAudioException(String message) { super(message); diff --git a/src/net/java/sip/communicator/impl/neomedia/protocol/BufferStreamAdapter.java b/src/net/java/sip/communicator/impl/neomedia/protocol/BufferStreamAdapter.java index de1605473..aeac468bf 100644 --- a/src/net/java/sip/communicator/impl/neomedia/protocol/BufferStreamAdapter.java +++ b/src/net/java/sip/communicator/impl/neomedia/protocol/BufferStreamAdapter.java @@ -40,7 +40,7 @@ public abstract class BufferStreamAdapter * Initializes a new BufferStreamAdapter which is to adapt a * specific SourceStream into a SourceStream with * a specific Format. - * + * * @param stream * @param format */ @@ -96,7 +96,7 @@ public Object[] getControls() /** * Gets the Format of the data this stream provides. - * + * * @return the Format of the data this stream provides */ public Format getFormat() @@ -117,7 +117,7 @@ public T getStream() /** * Reads byte data from this stream into a specific Buffer * which is to use a specific array of bytes for its data. - * + * * @param buffer the Buffer to read byte data into from this * instance * @param bytes the array of bytes to read data into from this @@ -136,9 +136,9 @@ protected void read(Buffer buffer, byte[] bytes) buffer.setData(bytes); buffer.setOffset(offset); buffer.setLength(numberOfBytesRead); - + Format format = getFormat(); - + if (format != null) buffer.setFormat(format); } @@ -148,11 +148,11 @@ protected void read(Buffer buffer, byte[] bytes) * Reads byte data from this stream into a specific array of * bytes starting the storing at a specific offset and reading * at most a specific number of bytes. - * + * * @param buffer the array of bytes into which the data read * from this stream is to be written * @param offset the offset in the specified buffer at which - * writing data read from this stream should start + * writing data read from this stream should start * @param length the maximum number of bytes to be written into the * specified buffer * @return the number of bytes read from this stream and written into the diff --git a/src/net/java/sip/communicator/impl/neomedia/quicktime/CVPixelBuffer.java b/src/net/java/sip/communicator/impl/neomedia/quicktime/CVPixelBuffer.java index 6833e0cbe..eaa10d3bb 100644 --- a/src/net/java/sip/communicator/impl/neomedia/quicktime/CVPixelBuffer.java +++ b/src/net/java/sip/communicator/impl/neomedia/quicktime/CVPixelBuffer.java @@ -140,6 +140,13 @@ public int getWidth() */ private static native int getWidth(long ptr); + /** + * Native copy from native pointer src to byte array dst. + * @param dst destination array + * @param dstOffset offset of dst to copy data to + * @param dstLength length of dst + * @param src native pointer source + */ public static native void memcpy( byte[] dst, int dstOffset, int dstLength, long src); diff --git a/src/net/java/sip/communicator/impl/neomedia/transform/RTPTransformConnector.java b/src/net/java/sip/communicator/impl/neomedia/transform/RTPTransformConnector.java index 3e5e8fcf6..b88456681 100755 --- a/src/net/java/sip/communicator/impl/neomedia/transform/RTPTransformConnector.java +++ b/src/net/java/sip/communicator/impl/neomedia/transform/RTPTransformConnector.java @@ -67,7 +67,7 @@ public RTPTransformConnector(StreamConnector connector) super(connector); } - /* + /** * Overrides RTPConnectorImpl#createControlInputStream() to use * TransformInputStream. */ @@ -82,7 +82,7 @@ protected TransformInputStream createControlInputStream() return controlInputStream; } - /* + /** * Overrides RTPConnectorImpl#createControlOutputStream() to use * TransformOutputStream. */ @@ -97,7 +97,7 @@ protected TransformOutputStream createControlOutputStream() return controlOutputStream; } - /* + /** * Overrides RTPConnectorImpl#createDataInputStream() to use * TransformInputStream. */ @@ -112,7 +112,7 @@ protected TransformInputStream createDataInputStream() return dataInputStream; } - /* + /** * Overrides RTPConnectorImpl#createDataOutputStream() to use * TransformOutputStream. */ diff --git a/src/net/java/sip/communicator/impl/neomedia/transform/srtp/SRTPPolicy.java b/src/net/java/sip/communicator/impl/neomedia/transform/srtp/SRTPPolicy.java index 601c49806..575c32c94 100644 --- a/src/net/java/sip/communicator/impl/neomedia/transform/srtp/SRTPPolicy.java +++ b/src/net/java/sip/communicator/impl/neomedia/transform/srtp/SRTPPolicy.java @@ -9,7 +9,7 @@ /** * SRTPPolicy holds the SRTP encryption / authentication policy of a SRTP * session. - * + * * @author Bing SU (nova.su@gmail.com) */ public class SRTPPolicy @@ -18,12 +18,12 @@ public class SRTPPolicy * Null Cipher, does not change the content of RTP payload */ public final static int NULL_ENCRYPTION = 0; - + /** * Counter Mode AES Cipher, defined in Section 4.1.1, RFC3711 */ public final static int AESCM_ENCRYPTION = 1; - + /** * F8 mode AES Cipher, defined in Section 4.1.2, RFC 3711 */ @@ -33,7 +33,7 @@ public class SRTPPolicy * Null Authentication, no authentication */ public final static int NULL_AUTHENTICATION = 0; - + /** * HMC SHA1 Authentication, defined in Section 4.2.1, RFC3711 */ @@ -43,27 +43,27 @@ public class SRTPPolicy * SRTP encryption type */ private int encType; - + /** * SRTP encryption key length */ private int encKeyLength; - + /** * SRTP authentication type */ private int authType; - + /** * SRTP authentication key length */ private int authKeyLength; - + /** * SRTP authentication tag length */ private int authTagLength; - + /** * SRTP salt key length */ @@ -73,7 +73,7 @@ public class SRTPPolicy * Construct a SRTPPolicy object based on given parameters. * This class acts as a storage class, so all the parameters are passed in * through this constructor. - * + * * @param encType SRTP encryption type * @param encKeyLength SRTP encryption key length * @param authType SRTP authentication type @@ -189,7 +189,7 @@ public int getEncType() /** * Set the encryption type * - * @param encType + * @param encType encryption type */ public void setEncType(int encType) { diff --git a/src/net/java/sip/communicator/impl/neomedia/transform/srtp/SRTPTransformEngine.java b/src/net/java/sip/communicator/impl/neomedia/transform/srtp/SRTPTransformEngine.java index d9318306a..48aedfb86 100644 --- a/src/net/java/sip/communicator/impl/neomedia/transform/srtp/SRTPTransformEngine.java +++ b/src/net/java/sip/communicator/impl/neomedia/transform/srtp/SRTPTransformEngine.java @@ -12,8 +12,8 @@ * SRTPTransformEngine class implements TransformEngine interface. * It stores important information / objects regarding SRTP processing. * Through SRTPTransformEngine, we can get the needed PacketTransformer, which - * will be used by abstract TransformConnector classes. - * + * will be used by abstract TransformConnector classes. + * * @author Bing SU (nova.su@gmail.com) * */ @@ -24,22 +24,22 @@ public class SRTPTransformEngine * Master key of this SRTP session */ private final byte[] masterKey; - + /** * Master salt key of this SRTP session */ private final byte[] masterSalt; - + /** * SRTP processing policy */ private final SRTPPolicy srtpPolicy; - + /** * SRTCP processing policy */ private final SRTPPolicy srtcpPolicy; - + /** * The default SRTPCryptoContext, which will be used to derivate other * contexts. @@ -49,7 +49,7 @@ public class SRTPTransformEngine /** * Construct a SRTPTransformEngine based on given master encryption key, * master salt key and SRTP/SRTCP policy. - * + * * @param masterKey the master encryption key * @param masterSalt the master salt key * @param srtpPolicy SRTP policy @@ -60,19 +60,19 @@ public SRTPTransformEngine(byte[] masterKey, byte[] masterSalt, { this.masterKey = new byte[masterKey.length]; System.arraycopy(masterKey, 0, this.masterKey, 0, masterKey.length); - + this.masterSalt = new byte[masterSalt.length]; System.arraycopy(masterSalt, 0, this.masterSalt, 0, masterSalt.length); - + this.srtpPolicy = srtpPolicy; this.srtcpPolicy = srtcpPolicy; - this.defaultContext = new SRTPCryptoContext(0, 0, 0, + this.defaultContext = new SRTPCryptoContext(0, 0, 0, this.masterKey, - this.masterSalt, + this.masterSalt, this.srtpPolicy); } - + /** * Gets the PacketTransformer for RTCP packets. * @@ -83,7 +83,8 @@ public PacketTransformer getRTCPTransformer() return new SRTCPTransformer(this); } - /* (non-Javadoc) + /* + * (non-Javadoc) * @see net.java.sip.communicator.impl.media.transform. * TransformEngine#getRTPTransformer() */ @@ -101,7 +102,7 @@ public byte[] getMasterKey() { return this.masterKey; } - + /** * Get the master salt key * diff --git a/src/net/java/sip/communicator/impl/neomedia/transform/zrtp/ZRTPTransformEngine.java b/src/net/java/sip/communicator/impl/neomedia/transform/zrtp/ZRTPTransformEngine.java index b411a8079..ce9cd8de6 100644 --- a/src/net/java/sip/communicator/impl/neomedia/transform/zrtp/ZRTPTransformEngine.java +++ b/src/net/java/sip/communicator/impl/neomedia/transform/zrtp/ZRTPTransformEngine.java @@ -367,7 +367,7 @@ public ZRTPTransformEngine() /** * Returns an instance of ZRTPCTransformer. - * + * * @see TransformEngine#getRTCPTransformer() */ public PacketTransformer getRTCPTransformer() @@ -377,7 +377,7 @@ public PacketTransformer getRTCPTransformer() /** * Returns this RTPTransformer. - * + * * @see TransformEngine#getRTPTransformer() */ public PacketTransformer getRTPTransformer() @@ -405,7 +405,7 @@ public boolean initialize(String zidFilename, ZrtpConfigure config) * auto-sensing and a default configuration setting. * * @param zidFilename The ZID file name - * @param autoEnable If true start with auto-sensing mode. + * @param autoEnable If true start with auto-sensing mode. * @return true if initialization fails, false if succeeds */ public boolean initialize(String zidFilename, boolean autoEnable) { @@ -414,7 +414,7 @@ public boolean initialize(String zidFilename, boolean autoEnable) { /** * Default engine initialization method. - * + * * Calling this for engine initialization and start it with auto-sensing * and default configuration setting. * @@ -436,7 +436,7 @@ public boolean initialize(String zidFilename) { * @param config the zrtp config to use * @return true if initialization fails, false if succeeds */ - public synchronized boolean initialize(String zidFilename, + public synchronized boolean initialize(String zidFilename, boolean autoEnable, ZrtpConfigure config) { // Get a reference to the FileAccessService @@ -585,10 +585,10 @@ public void cleanup() /** * Set the SSRC of the RTP transmitter stream. - * + * * ZRTP fills the SSRC in the ZRTP messages. - * - * @param ssrc + * + * @param ssrc SSRC to set */ public void setOwnSSRC(long ssrc) { ownSSRC = (int)(ssrc & 0xffffffff); @@ -597,14 +597,14 @@ public void setOwnSSRC(long ssrc) { /** * The data output stream calls this method to transform outgoing * packets. - * + * * @see PacketTransformer#transform(RawPacket) */ public RawPacket transform(RawPacket pkt) { /* * Never transform outgoing ZRTP (invalid RTP) packets. - */ + */ if (ZrtpRawPacket.isZrtpData(pkt)) { return pkt; @@ -629,7 +629,7 @@ public RawPacket transform(RawPacket pkt) /** * The input data stream calls this method to transform * incoming packets. - * + * * @see PacketTransformer#reverseTransform(RawPacket) */ public RawPacket reverseTransform(RawPacket pkt) @@ -654,7 +654,7 @@ public RawPacket reverseTransform(RawPacket pkt) pkt = srtpInTransformer.reverseTransform(pkt); // if packet was valid (i.e. not null) and ZRTP engine started and - // in Wait for Confirm2 Ack then emulate a Conf2Ack packet. + // in Wait for Confirm2 Ack then emulate a Conf2Ack packet. // See ZRTP specification chap. 5.6 if ((pkt != null) && started @@ -667,9 +667,9 @@ public RawPacket reverseTransform(RawPacket pkt) } /* - * If ZRTP is enabled process it. - * - * In any case return null because ZRTP packets must never reach + * If ZRTP is enabled process it. + * + * In any case return null because ZRTP packets must never reach * the application. */ if (enableZrtp && started) @@ -833,10 +833,10 @@ public boolean srtpSecretsReady( } /** - * + * * @param c * @param s - * @param verified + * @param verified * @see gnu.java.zrtp.ZrtpCallback#srtpSecretsOn(java.lang.String, * java.lang.String, boolean) */ @@ -855,7 +855,7 @@ public void srtpSecretsOn(String c, String s, boolean verified) /** * This method shall clear the ZRTP secrets. - * + * * @param part Defines for which part (sender or receiver) * to switch on security */ @@ -879,7 +879,7 @@ public void srtpSecretsOff(EnableSecurity part) /** * Activate timer. - * @param time The time in ms for the timer. + * @param time The time in ms for the timer. * @return always return 1. */ public int activateTimer(int time) @@ -919,8 +919,8 @@ public void handleTimeout() /** * Send information messages to the hosting environment. - * @param severity This defines the message's severity - * @param subCode The message code. + * @param severity This defines the message's severity + * @param subCode The message code. */ public void sendInfo(ZrtpCodes.MessageSeverity severity, EnumSet subCode) { @@ -933,7 +933,7 @@ public void sendInfo(ZrtpCodes.MessageSeverity severity, EnumSet subCode) /** * Comes a message that zrtp negotiation has failed. * @param severity This defines the message's severity - * @param subCode The message code. + * @param subCode The message code. */ public void zrtpNegotiationFailed(ZrtpCodes.MessageSeverity severity, EnumSet subCode) @@ -968,8 +968,8 @@ public void zrtpAskEnrollment(String info) } /** - * - * @param info + * + * @param info * @see gnu.java.zrtp.ZrtpCallback#zrtpInformEnrollment(java.lang.String) */ public void zrtpInformEnrollment(String info) @@ -981,8 +981,8 @@ public void zrtpInformEnrollment(String info) } /** - * - * @param sas + * + * @param sas * @see gnu.java.zrtp.ZrtpCallback#signSAS(java.lang.String) */ public void signSAS(String sas) @@ -994,7 +994,7 @@ public void signSAS(String sas) } /** - * + * * @param sas * @return false if signature check fails, true otherwise * @see gnu.java.zrtp.ZrtpCallback#checkSASSignature(java.lang.String) @@ -1070,7 +1070,7 @@ public void requestGoSecure() * * @param data The auxilliary secret data */ - public void setAuxSecret(byte[] data) + public void setAuxSecret(byte[] data) { if (zrtpEngine != null) zrtpEngine.setAuxSecret(data); @@ -1257,8 +1257,8 @@ public SecurityEventManager getUserCallback() /** * Get other party's ZID (ZRTP Identifier) data * - * This functions returns the other party's ZID that was receivied - * during ZRTP processing. + * This functions returns the other party's ZID that was receivied + * during ZRTP processing. * * The ZID data can be retrieved after ZRTP receive the first Hello * packet from the other party. The application may call this method diff --git a/src/net/java/sip/communicator/impl/neomedia/transform/zrtp/ZrtpRawPacket.java b/src/net/java/sip/communicator/impl/neomedia/transform/zrtp/ZrtpRawPacket.java index e1f4ad014..c48f75838 100644 --- a/src/net/java/sip/communicator/impl/neomedia/transform/zrtp/ZrtpRawPacket.java +++ b/src/net/java/sip/communicator/impl/neomedia/transform/zrtp/ZrtpRawPacket.java @@ -13,50 +13,50 @@ /** * ZRTP packet representation. - * + * * This class extends the RawPacket class and adds some methods * required by the ZRTP transformer. - * + * * @author Werner Dittmann */ -public class ZrtpRawPacket extends RawPacket +public class ZrtpRawPacket extends RawPacket { /** * Each ZRTP packet contains this magic number. */ public static byte[] zrtpMagic; - + static { zrtpMagic = new byte[4]; - zrtpMagic[0]= 0x5a; - zrtpMagic[1]= 0x52; - zrtpMagic[2]= 0x54; + zrtpMagic[0]= 0x5a; + zrtpMagic[1]= 0x52; + zrtpMagic[2]= 0x54; zrtpMagic[3]= 0x50; } /** * Construct an input ZrtpRawPacket using a received RTP raw packet. - * - * @param pkt a raw RTP packet as received + * + * @param pkt a raw RTP packet as received */ - public ZrtpRawPacket(RawPacket pkt) + public ZrtpRawPacket(RawPacket pkt) { super (pkt.getBuffer(), pkt.getOffset(), pkt.getLength()); } /** * Construct an output ZrtpRawPacket using specified value. - * + * * Initialize this packet and set the ZRTP magic value * to mark it as a ZRTP packet. - * + * * @param buf Byte array holding the content of this Packet * @param off Start offset of packet content inside buffer * @param len Length of the packet's data */ - public ZrtpRawPacket(byte[] buf, int off, int len) + public ZrtpRawPacket(byte[] buf, int off, int len) { - super (buf, off, len); + super (buf, off, len); writeByte(0, (byte)0x10); writeByte(1, (byte)0); @@ -69,13 +69,13 @@ public ZrtpRawPacket(byte[] buf, int off, int len) /** * Check if it could be a ZRTP packet. - * + * * The method checks if the first byte of the received data * matches the defined ZRTP pattern 0x10 - * + * * @return true if could be a ZRTP packet, false otherwise. */ - protected boolean isZrtpPacket() + protected boolean isZrtpPacket() { return isZrtpData(this); } @@ -99,13 +99,13 @@ static boolean isZrtpData(RawPacket pkt) /** * Check if it is really a ZRTP packet. - * + * * The method checks if the packet contains the ZRTP magic * number. - * + * * @return true if packet contains the magic number, false otherwise. */ - protected boolean hasMagic() + protected boolean hasMagic() { return (readByte(4) == zrtpMagic[0]) @@ -116,9 +116,9 @@ protected boolean hasMagic() /** * Set the sequence number in this packet. - * @param seq + * @param seq sequence number */ - protected void setSeqNum(short seq) + protected void setSeqNum(short seq) { int at = 2; writeByte(at++, (byte)(seq>>8)); @@ -127,9 +127,9 @@ protected void setSeqNum(short seq) /** * Set SSRC in this packet - * @param ssrc + * @param ssrc SSRC to set */ - protected void setSSRC(int ssrc) + protected void setSSRC(int ssrc) { writeInt(8, ssrc); } @@ -139,7 +139,7 @@ protected void setSSRC(int ssrc) * * @return true if the CRC is valid, false otherwise */ - protected boolean checkCrc() + protected boolean checkCrc() { int crc = readInt(getLength()-ZrtpPacketBase.CRC_SIZE); return ZrtpCrc32.zrtpCheckCksum(getBuffer(), getOffset(), @@ -149,7 +149,7 @@ protected boolean checkCrc() /** * Set ZRTP CRC in this packet */ - protected void setCrc() + protected void setCrc() { int crc = ZrtpCrc32.zrtpGenerateCksum(getBuffer(), getOffset(), getLength() - ZrtpPacketBase.CRC_SIZE);