public class

MediaCodecAudioEncoder

extends MediaCodecEncoderBase<I, O>
java.lang.Object
   ↳ org.opencdnunion.media.streamer.encoder.Encoder<I, O>
     ↳ org.opencdnunion.media.streamer.encoder.MediaCodecEncoderBase<I, O>
       ↳ org.opencdnunion.media.streamer.encoder.MediaCodecAudioEncoder

Class Overview

MediaCodec Audio encoder.

Summary

[Expand]
Inherited Constants
From class org.opencdnunion.media.streamer.encoder.Encoder
[Expand]
Inherited Fields
From class org.opencdnunion.media.streamer.encoder.MediaCodecEncoderBase
From class org.opencdnunion.media.streamer.encoder.Encoder
Public Constructors
MediaCodecAudioEncoder()
Public Methods
int getEncoderType()
Implement by child class, to define what type of encoder this instance is.
Protected Methods
int doFrameAvailable(AudioBufFrame frame)
int doStart(Object encodeConfig)
void doStop()
AudioPacket getOutFrame(ByteBuffer buffer, MediaCodec.BufferInfo bufferInfo)
boolean onFrameAvailable(AudioBufFrame frame)
Give child class a chance to handle onFrameAvailable
boolean updateEncodeFormat(Object src, Object dst)
Update encode format with input frame format.
void updateOutFormat(MediaFormat mediaFormat)
[Expand]
Inherited Methods
From class org.opencdnunion.media.streamer.encoder.MediaCodecEncoderBase
From class org.opencdnunion.media.streamer.encoder.Encoder
From class java.lang.Object

Public Constructors

public MediaCodecAudioEncoder ()

Public Methods

public int getEncoderType ()

Implement by child class, to define what type of encoder this instance is.

Returns
  • type as AVConst.MEDIA_TYPE_XXX

Protected Methods

protected int doFrameAvailable (AudioBufFrame frame)

protected int doStart (Object encodeConfig)

protected void doStop ()

protected AudioPacket getOutFrame (ByteBuffer buffer, MediaCodec.BufferInfo bufferInfo)

protected boolean onFrameAvailable (AudioBufFrame frame)

Give child class a chance to handle onFrameAvailable

Parameters
frame frame
Returns
  • true if handled by child, and Encoder would ignore this frame, false otherwise.

protected boolean updateEncodeFormat (Object src, Object dst)

Update encode format with input frame format.

Parameters
src input frame format
dst encode format to be updated
Returns
  • true if success, false otherwise

protected void updateOutFormat (MediaFormat mediaFormat)