Class AudioLevelEffect2
- java.lang.Object
-
- org.jitsi.impl.neomedia.control.AbstractControls
-
- org.jitsi.impl.neomedia.control.ControlsAdapter
-
- org.jitsi.impl.neomedia.audiolevel.AudioLevelEffect2
-
- All Implemented Interfaces:
javax.media.Codec,javax.media.Controls,javax.media.Effect,javax.media.PlugIn
public class AudioLevelEffect2 extends ControlsAdapter implements javax.media.Effect
AnEffectimplementation which calculates audio levels based on the samples in the Buffer and includes them in the buffer's headerExtension field in the SSRC audio level format specified in RFC6464. The class is based onAudioLevelEffect, but an important difference is that the actual calculation is performed in the same thread that callsprocess(javax.media.Buffer, javax.media.Buffer).- Author:
- Boris Grozev, Damian Minkov, Emil Ivov, Lyubomir Marinov
-
-
Field Summary
-
Fields inherited from class org.jitsi.impl.neomedia.control.ControlsAdapter
EMPTY_CONTROLS
-
-
Constructor Summary
Constructors Constructor Description AudioLevelEffect2()Initializes a new AudioLevelEffect2.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()StringgetName()Gets the name of this plug-in as a human-readable string.javax.media.Format[]getSupportedInputFormats()Lists all of the input formats that this codec accepts.javax.media.Format[]getSupportedOutputFormats(javax.media.Format input)Lists the output formats that this codec can generate.booleanisEnabled()voidopen()intprocess(javax.media.Buffer inputBuffer, javax.media.Buffer outputBuffer)Performs the media processing defined by this codec.voidreset()voidsetEnabled(boolean enabled)Enables or disables this AudioLevelEffect2 according to the value of enabled.javax.media.FormatsetInputFormat(javax.media.Format format)Sets the format of the data to be input to this codec.javax.media.FormatsetOutputFormat(javax.media.Format format)Sets the format for the data this codec outputs.voidsetRtpHeaderExtensionId(byte rtpHeaderExtensionId)Sets the ID of the RTP header extension which will be added.-
Methods inherited from class org.jitsi.impl.neomedia.control.ControlsAdapter
getControls
-
Methods inherited from class org.jitsi.impl.neomedia.control.AbstractControls
getControl, getControl, queryInterface, queryInterface
-
-
-
-
Method Detail
-
getSupportedInputFormats
public javax.media.Format[] getSupportedInputFormats()
Lists all of the input formats that this codec accepts.- Specified by:
getSupportedInputFormatsin interfacejavax.media.Codec- Returns:
- An array that contains the supported input Formats.
-
getSupportedOutputFormats
public javax.media.Format[] getSupportedOutputFormats(javax.media.Format input)
Lists the output formats that this codec can generate.- Specified by:
getSupportedOutputFormatsin interfacejavax.media.Codec- Parameters:
input- The Format of the data to be used as input to the plug-in.- Returns:
- An array that contains the supported output Formats.
-
setInputFormat
public javax.media.Format setInputFormat(javax.media.Format format)
Sets the format of the data to be input to this codec.- Specified by:
setInputFormatin interfacejavax.media.Codec- Parameters:
format- The Format to be set.- Returns:
- The Format that was set.
-
setOutputFormat
public javax.media.Format setOutputFormat(javax.media.Format format)
Sets the format for the data this codec outputs.- Specified by:
setOutputFormatin interfacejavax.media.Codec- Parameters:
format- The Format to be set.- Returns:
- The Format that was set.
-
process
public int process(javax.media.Buffer inputBuffer, javax.media.Buffer outputBuffer)Performs the media processing defined by this codec.- Specified by:
processin interfacejavax.media.Codec- Parameters:
inputBuffer- The Buffer that contains the media data to be processed.outputBuffer- The Buffer in which to store the processed media data.- Returns:
- BUFFER_PROCESSED_OK if the processing is successful.
- See Also:
PlugIn
-
getName
public String getName()
Gets the name of this plug-in as a human-readable string.- Specified by:
getNamein interfacejavax.media.PlugIn- Returns:
- A String that contains the descriptive name of the plug-in.
-
open
public void open()
- Specified by:
openin interfacejavax.media.PlugIn
-
close
public void close()
- Specified by:
closein interfacejavax.media.PlugIn
-
reset
public void reset()
- Specified by:
resetin interfacejavax.media.PlugIn
-
isEnabled
public boolean isEnabled()
-
setEnabled
public void setEnabled(boolean enabled)
Enables or disables this AudioLevelEffect2 according to the value of enabled.- Parameters:
enabled- whether to enable or disabled this Effect.
-
setRtpHeaderExtensionId
public void setRtpHeaderExtensionId(byte rtpHeaderExtensionId)
Sets the ID of the RTP header extension which will be added.- Parameters:
rtpHeaderExtensionId- the ID to set.
-
-