public abstract class AbstractFFmpegAudioCodec extends AbstractCodec2
Modifier and Type | Field and Description |
---|---|
protected long |
avctx
The AVCodecContext which performs the actual encoding/decoding
and which is the native counterpart of this open
AbstractFFmpegAudioCodec.
|
protected int |
codecID
The AVCodecID of
avctx . |
protected int |
frameSizeInBytes
The number of bytes of audio data to be encoded with a single call to
FFmpeg.avcodec_encode_audio(long, byte[], int, int, byte[], int)
based on the frame_size of avctx . |
BUFFER_FLAG_FEC, BUFFER_FLAG_PLC, EMPTY_FORMATS, features, MAX_AUDIO_SEQUENCE_NUMBERS_TO_PLC, SEQUENCE_MAX, SEQUENCE_MIN
Modifier | Constructor and Description |
---|---|
protected |
AbstractFFmpegAudioCodec(java.lang.String name,
int codecID,
javax.media.Format[] supportedOutputFormats)
Initializes a new AbstractFFmpegAudioCodec instance with a
specific PlugIn name, a specific AVCodecID, and a
specific list of Formats supported as output.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
codecIDToString(int codecID)
Returns a String representation of a specific
AVCodecID.
|
protected void |
configureAVCodecContext(long avctx,
javax.media.format.AudioFormat format)
Configures the AVCodecContext initialized in
doOpen()
prior to invoking one of the FFmpeg functions in the
avcodec_open family. |
protected void |
doClose() |
protected void |
doOpen()
Opens this Codec and acquires the resources that it needs to
operate.
|
protected abstract long |
findAVCodec(int codecID)
Finds an AVCodec with a specific AVCodecID.
|
protected abstract javax.media.format.AudioFormat |
getAVCodecContextFormat()
|
calculateLostSeqNoCount, close, discardOutputBuffer, doProcess, getMatchingOutputFormats, getName, getSupportedOutputFormats, incrementSeqNo, matches, open, process, setInputFormat, setOutputFormat, specialize, updateOutput, validateByteArraySize, validateShortArraySize
checkInputBuffer, dump, getInputFormat, getOutputFormat, getSupportedInputFormats, isEOM, propagateEOM
addControl, getControl, getControls, removeControl
protected long avctx
protected final int codecID
avctx
.protected int frameSizeInBytes
FFmpeg.avcodec_encode_audio(long, byte[], int, int, byte[], int)
based on the frame_size of avctx
.protected AbstractFFmpegAudioCodec(java.lang.String name, int codecID, javax.media.Format[] supportedOutputFormats)
name
- the PlugIn name of the new instancecodecID
- the AVCodecID of the FFmpeg codec to be
represented by the new instancesupportedOutputFormats
- the list of Formats supported by
the new instance as outputpublic static java.lang.String codecIDToString(int codecID)
codecID
- the AVCodecID to represent as a Stringprotected void configureAVCodecContext(long avctx, javax.media.format.AudioFormat format)
doOpen()
prior to invoking one of the FFmpeg functions in the
avcodec_open family. Allows extenders to override and provide
additional, optional configuration.avctx
- the AVCodecContext to configureformat
- the AudioFormat with which avctx is being
configuredprotected void doClose()
doClose
in class AbstractCodec2
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 acquiredprotected abstract long findAVCodec(int codecID)
doOpen()
in order to (eventually) open a new
AVCodecContext.codecID
- the AVCodecID of the AVCodec to findprotected abstract javax.media.format.AudioFormat getAVCodecContextFormat()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.