public class VideoTrackTranscoder extends BaseTrackTranscoder
| Constructor and Description |
|---|
VideoTrackTranscoder(DataSource dataSource,
DataSink dataSink,
TimeInterpolator timeInterpolator,
int rotation) |
| 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 |
onConfigureDecoder(android.media.MediaFormat format,
android.media.MediaCodec decoder)
Wraps the configure operation on the decoder.
|
protected void |
onConfigureEncoder(android.media.MediaFormat format,
android.media.MediaCodec encoder)
Wraps the configure operation on the encoder.
|
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.
|
protected void |
onStartEncoder(android.media.MediaFormat format,
android.media.MediaCodec encoder)
Wraps the start operation on the encoder.
|
void |
release() |
isFinished, onDecoderOutputFormatChanged, onEncoderOutputFormatChanged, onStartDecoder, setUp, transcodepublic VideoTrackTranscoder(@NonNull
DataSource dataSource,
@NonNull
DataSink dataSink,
@NonNull
TimeInterpolator timeInterpolator,
int rotation)
protected void onConfigureEncoder(@NonNull
android.media.MediaFormat format,
@NonNull
android.media.MediaCodec encoder)
BaseTrackTranscoderonConfigureEncoder in class BaseTrackTranscoderformat - output formatencoder - encoderprotected void onStartEncoder(@NonNull
android.media.MediaFormat format,
@NonNull
android.media.MediaCodec encoder)
BaseTrackTranscoderonStartEncoder in class BaseTrackTranscoderformat - output formatencoder - encoderprotected void onConfigureDecoder(@NonNull
android.media.MediaFormat format,
@NonNull
android.media.MediaCodec decoder)
BaseTrackTranscoderonConfigureDecoder in class BaseTrackTranscoderformat - input formatdecoder - decoderprotected 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 - encoderpublic void release()
release in interface TrackTranscoderrelease in class BaseTrackTranscoderprotected boolean onFeedEncoder(@NonNull
android.media.MediaCodec encoder,
@NonNull
MediaCodecBuffers encoderBuffers,
long timeoutUs)
BaseTrackTranscoderonFeedEncoder in class BaseTrackTranscoderencoder - the encodertimeoutUs - a timeout for this opprotected 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