public class AudioTrackTranscoder extends BaseTrackTranscoder
| Constructor and Description |
|---|
AudioTrackTranscoder(DataSource dataSource,
DataSink dataSink,
TimeInterpolator timeInterpolator,
AudioStretcher audioStretcher,
AudioResampler audioResampler) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
onCodecsStarted(android.media.MediaFormat inputFormat,
android.media.MediaFormat outputFormat,
android.media.MediaCodec decoder,
android.media.MediaCodec encoder)
Called when both codecs have been started with the given formats.
|
protected void |
onDecoderOutputFormatChanged(android.media.MediaCodec decoder,
android.media.MediaFormat format)
Called when the decoder has defined its actual output format.
|
protected void |
onDrainDecoder(android.media.MediaCodec decoder,
int bufferIndex,
java.nio.ByteBuffer bufferData,
long presentationTimeUs,
boolean endOfStream)
Called to drain the decoder.
|
protected boolean |
onFeedEncoder(android.media.MediaCodec encoder,
MediaCodecBuffers encoderBuffers,
long timeoutUs)
Called to feed the encoder with processed data.
|
isFinished, onConfigureDecoder, onConfigureEncoder, onEncoderOutputFormatChanged, onStartDecoder, onStartEncoder, release, setUp, transcodepublic AudioTrackTranscoder(@NonNull
DataSource dataSource,
@NonNull
DataSink dataSink,
@NonNull
TimeInterpolator timeInterpolator,
@NonNull
AudioStretcher audioStretcher,
@NonNull
AudioResampler audioResampler)
protected void onCodecsStarted(@NonNull
android.media.MediaFormat inputFormat,
@NonNull
android.media.MediaFormat outputFormat,
@NonNull
android.media.MediaCodec decoder,
@NonNull
android.media.MediaCodec encoder)
BaseTrackTranscoderonCodecsStarted in class BaseTrackTranscoderinputFormat - input formatoutputFormat - output formatdecoder - decoderencoder - encoderprotected boolean onFeedEncoder(@NonNull
android.media.MediaCodec encoder,
@NonNull
MediaCodecBuffers encoderBuffers,
long timeoutUs)
BaseTrackTranscoderonFeedEncoder in class BaseTrackTranscoderencoder - the encodertimeoutUs - a timeout for this opprotected void onDecoderOutputFormatChanged(@NonNull
android.media.MediaCodec decoder,
@NonNull
android.media.MediaFormat format)
BaseTrackTranscoderonDecoderOutputFormatChanged in class BaseTrackTranscoderformat - formatprotected void onDrainDecoder(@NonNull
android.media.MediaCodec decoder,
int bufferIndex,
@NonNull
java.nio.ByteBuffer bufferData,
long presentationTimeUs,
boolean endOfStream)
BaseTrackTranscoderMediaCodec.releaseOutputBuffer(int, boolean)
with the given bufferIndex at some point.onDrainDecoder in class BaseTrackTranscoderdecoder - the decoderbufferIndex - the buffer index to be releasedbufferData - the buffer datapresentationTimeUs - frame timestampendOfStream - whether we are in end of stream