public abstract class Muxer
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Muxer.FORMAT |
| Modifier and Type | Field and Description |
|---|---|
protected long |
mFirstPts |
protected long[] |
mLastPts |
protected int |
mNumTracks |
protected int |
mNumTracksFinished |
| Modifier | Constructor and Description |
|---|---|
protected |
Muxer() |
| Modifier and Type | Method and Description |
|---|---|
int |
addTrack(android.media.MediaFormat trackFormat)
Adds the specified track and returns the track index
|
protected boolean |
allTracksAdded() |
protected boolean |
allTracksFinished() |
protected boolean |
formatRequiresADTS()
Does this Muxer's format require AAC ADTS headers?
see http://wiki.multimedia.cx/index.php?title=ADTS
|
protected boolean |
formatRequiresBuffering()
Does this Muxer's format require
copying and buffering encoder output buffers.
|
EncodingConfig |
getConfig() |
protected long |
getNextRelativePts(long absPts,
int trackIndex)
Return a relative pts given an absolute pts and trackIndex.
|
java.lang.String |
getOutputPath()
Returns the absolute output path.
|
void |
onEncoderReleased(int trackIndex)
Called by the hosting Encoder
to notify the Muxer that it should no
longer assume the Encoder resources are available.
|
void |
prepare(EncodingConfig config) |
void |
release() |
void |
setEventBus(EventBus eventBus) |
void |
signalEndOfTrack()
Muxer will call this itself if it detects BUFFER_FLAG_END_OF_STREAM
in writeSampleData.
|
void |
writeSampleData(android.media.MediaCodec encoder,
int trackIndex,
int bufferIndex,
java.nio.ByteBuffer encodedData,
android.media.MediaCodec.BufferInfo bufferInfo)
Write the MediaCodec output buffer.
|
protected int mNumTracks
protected int mNumTracksFinished
protected long mFirstPts
protected long[] mLastPts
public EncodingConfig getConfig()
public void prepare(EncodingConfig config)
public void setEventBus(EventBus eventBus)
public java.lang.String getOutputPath()
public int addTrack(android.media.MediaFormat trackFormat)
trackFormat - MediaFormat of the track to add. Gotten from MediaCodec#dequeueOutputBuffer
when returned status is INFO_OUTPUT_FORMAT_CHANGEDpublic void onEncoderReleased(int trackIndex)
public void release()
public void writeSampleData(android.media.MediaCodec encoder,
int trackIndex,
int bufferIndex,
java.nio.ByteBuffer encodedData,
android.media.MediaCodec.BufferInfo bufferInfo)
trackIndex - encodedData - bufferInfo - protected boolean allTracksFinished()
protected boolean allTracksAdded()
public void signalEndOfTrack()
protected boolean formatRequiresADTS()
protected boolean formatRequiresBuffering()
protected long getNextRelativePts(long absPts,
int trackIndex)
writeSampleData(android.media.MediaCodec, int, int, java.nio.ByteBuffer, android.media.MediaCodec.BufferInfo).