java.lang.Object | ||
↳ | org.opencdnunion.media.streamer.encoder.Encoder<I, O> | |
↳ | org.opencdnunion.media.streamer.encoder.AudioEncoderBase |
Base class of audio encoder.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | AUDIO_CACHE_ITEM_SIZE | ||||||||||
int | AUDIO_CACHE_NUM |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected FrameBufferCache | mAudioBufferCache | ||||||||||
protected AudioEncodeConfig | mAudioEncodeConfig | ||||||||||
protected AudioEncodeConfig | mOutConfig |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AudioEncoderBase() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int |
getEncoderType()
Implement by child class, to define what type of encoder this instance is.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | doAdjustBitrate(int bitrate) | ||||||||||
abstract int |
doEncode(AudioBufFrame frame)
Encode an audio frame.
| ||||||||||
int | doFrameAvailable(AudioBufFrame frame) | ||||||||||
void | doFrameDropped(AudioBufFrame frame) | ||||||||||
int | doStart(Object encodeConfig) | ||||||||||
abstract int |
doStart(AudioEncodeConfig config)
Start audio encoder in encoding thread.
| ||||||||||
boolean |
onFrameAvailable(AudioBufFrame frame)
Give child class a chance to handle onFrameAvailable
| ||||||||||
void | sendEncodedPacket(ByteBuffer data, long dts, long pts, int flags) | ||||||||||
boolean |
updateEncodeFormat(Object src, Object dst)
Update encode format with input frame format.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Implement by child class, to define what type of encoder this instance is.
Encode an audio frame.
frame | audio frame to be encoded. |
---|
Start audio encoder in encoding thread.
config | Audio encode configuration. |
---|
Give child class a chance to handle onFrameAvailable
frame | frame |
---|
Update encode format with input frame format.
src | input frame format |
---|---|
dst | encode format to be updated |