public class JNIEncoder extends AbstractCodec2 implements FormatParametersAwareCodec, PacketLossAwareEncoder, AdvancedAttributesAwareCodec
Modifier and Type | Field and Description |
---|---|
(package private) static double[] |
SUPPORTED_INPUT_SAMPLE_RATES
The list of sample rates of audio data supported as input by
JNIEncoder instances.
|
BUFFER_FLAG_FEC, BUFFER_FLAG_PLC, EMPTY_FORMATS, features, MAX_AUDIO_SEQUENCE_NUMBERS_TO_PLC, SEQUENCE_MAX, SEQUENCE_MIN
Constructor and Description |
---|
JNIEncoder()
Initializes a new JNIEncoder instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doClose() |
protected void |
doOpen()
Opens this Codec and acquires the resources that it needs to
operate.
|
protected int |
doProcess(javax.media.Buffer inBuffer,
javax.media.Buffer outBuffer)
Processes (i.e.
|
java.awt.Component |
getControlComponent()
Implements
Control.getControlComponent() . |
javax.media.Format |
getOutputFormat()
Gets the Format of the media output by this Codec.
|
void |
setAdvancedAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the additional attributes to attributes
|
void |
setExpectedPacketLoss(int percentage)
Updates the encoder's expected packet loss percentage to the bigger of
percentage and this.minPacketLoss.
|
void |
setFormatParameters(java.util.Map<java.lang.String,java.lang.String> fmtps)
Sets the format parameters.
|
javax.media.Format |
setInputFormat(javax.media.Format format)
Automatically tracks and calculates the size in bytes of an audio frame
(to be) output by this instance.
|
calculateLostSeqNoCount, close, discardOutputBuffer, getMatchingOutputFormats, getName, getSupportedOutputFormats, incrementSeqNo, matches, open, process, setOutputFormat, specialize, updateOutput, validateByteArraySize, validateShortArraySize
checkInputBuffer, dump, getInputFormat, getSupportedInputFormats, isEOM, propagateEOM
addControl, getControl, getControls, removeControl
static final double[] SUPPORTED_INPUT_SAMPLE_RATES
The implementation does support 8, 12, 16, 24 and 48kHz but the lower sample rates are not listed to prevent FMJ from defaulting to them.
protected void doClose()
doClose
in class AbstractCodec2
AbstractCodec2.doClose()
protected void doOpen() throws javax.media.ResourceUnavailableException
PlugIn.open()
on this instance will result in
a call to doOpen only if AbstractCodec.opened
is
false. All required input and/or output formats are assumed to
have been set on this Codec before doOpen is called.doOpen
in class AbstractCodec2
javax.media.ResourceUnavailableException
- if any of the resources that this
Codec needs to operate cannot be acquiredAbstractCodec2.doOpen()
protected int doProcess(javax.media.Buffer inBuffer, javax.media.Buffer outBuffer)
doProcess
in class AbstractCodec2
inBuffer
- the Buffer from which the media to be encoded is
to be readoutBuffer
- the Buffer into which the encoded media is to
be writtenAbstractCodec2.doProcess(Buffer, Buffer)
public java.awt.Component getControlComponent()
Control.getControlComponent()
. JNIEncoder
does not provide user interface of its own.getControlComponent
in interface javax.media.Control
public javax.media.Format getOutputFormat()
getOutputFormat
in class net.sf.fmj.media.AbstractCodec
AbstractCodec.getOutputFormat()
public void setExpectedPacketLoss(int percentage)
setExpectedPacketLoss
in interface PacketLossAwareEncoder
percentage
- the expected packet loss percentage to setpublic void setFormatParameters(java.util.Map<java.lang.String,java.lang.String> fmtps)
setFormatParameters
in interface FormatParametersAwareCodec
fmtps
- the format parameters to setpublic javax.media.Format setInputFormat(javax.media.Format format)
setInputFormat
in interface javax.media.Codec
setInputFormat
in class AbstractCodec2
public void setAdvancedAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
setAdvancedAttributes
in interface AdvancedAttributesAwareCodec
attributes
- The additional attributes to set
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.