public class AudioLevelEffect2 extends ControlsAdapter implements javax.media.Effect
Effect
implementation 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 on
AudioLevelEffect
, but an important
difference is that the actual calculation is performed in the same thread
that calls process(javax.media.Buffer, javax.media.Buffer)
.EMPTY_CONTROLS
Constructor and Description |
---|
AudioLevelEffect2()
Initializes a new AudioLevelEffect2.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.lang.String |
getName()
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.
|
boolean |
isEnabled() |
void |
open() |
int |
process(javax.media.Buffer inputBuffer,
javax.media.Buffer outputBuffer)
Performs the media processing defined by this codec.
|
void |
reset() |
void |
setEnabled(boolean enabled)
Enables or disables this AudioLevelEffect2 according to the
value of enabled.
|
javax.media.Format |
setInputFormat(javax.media.Format format)
Sets the format of the data to be input to this codec.
|
javax.media.Format |
setOutputFormat(javax.media.Format format)
Sets the format for the data this codec outputs.
|
void |
setRtpHeaderExtensionId(byte rtpHeaderExtensionId)
Sets the ID of the RTP header extension which will be added.
|
getControls
getControl, getControl, queryInterface, queryInterface
public AudioLevelEffect2()
public javax.media.Format[] getSupportedInputFormats()
getSupportedInputFormats
in interface javax.media.Codec
public javax.media.Format[] getSupportedOutputFormats(javax.media.Format input)
getSupportedOutputFormats
in interface javax.media.Codec
input
- The Format of the data to be used as input to the
plug-in.public javax.media.Format setInputFormat(javax.media.Format format)
setInputFormat
in interface javax.media.Codec
format
- The Format to be set.public javax.media.Format setOutputFormat(javax.media.Format format)
setOutputFormat
in interface javax.media.Codec
format
- The Format to be set.public int process(javax.media.Buffer inputBuffer, javax.media.Buffer outputBuffer)
process
in interface javax.media.Codec
inputBuffer
- The Buffer that contains the media data to be
processed.outputBuffer
- The Buffer in which to store the processed
media data.PlugIn
public java.lang.String getName()
getName
in interface javax.media.PlugIn
public void open()
open
in interface javax.media.PlugIn
public void close()
close
in interface javax.media.PlugIn
public void reset()
reset
in interface javax.media.PlugIn
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- whether to enable or disabled this Effect.public void setRtpHeaderExtensionId(byte rtpHeaderExtensionId)
rtpHeaderExtensionId
- the ID to set.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.