DefaultMuxer
@UnstableApi
class DefaultMuxer : Muxer
A default Muxer implementation.
Summary
Nested types |
|---|
class DefaultMuxer.Factory : Muxer.FactoryA |
Constants |
|
|---|---|
const String! |
Public functions |
|
|---|---|
Unit |
addMetadataEntry(metadataEntry: Metadata.Entry!)Adds |
Int |
Adds a track of the given media format. |
Unit |
close()Closes the file. |
Unit |
writeSampleData(Writes encoded sample data. |
Constants
Public functions
addMetadataEntry
fun addMetadataEntry(metadataEntry: Metadata.Entry!): Unit
Adds metadata about the output file.
addTrack
fun addTrack(format: Format!): Int
Adds a track of the given media format.
All tracks must be added before any samples are written to any track.
| Returns | |
|---|---|
Int |
A track id for this track, which should be passed to |
| Throws | |
|---|---|
androidx.media3.muxer.MuxerException |
If the muxer encounters a problem while adding the track. |
close
fun close(): Unit
Closes the file.
The muxer cannot be used anymore once this method returns.
| Throws | |
|---|---|
androidx.media3.muxer.MuxerException |
If the muxer fails to finish writing the output. |
writeSampleData
fun writeSampleData(
trackId: Int,
byteBuffer: ByteBuffer!,
bufferInfo: BufferInfo!
): Unit
Writes encoded sample data.
| Parameters | |
|---|---|
trackId: Int |
The track id, previously returned by |
byteBuffer: ByteBuffer! |
A buffer containing the sample data to write to the container. |
bufferInfo: BufferInfo! |
The |
| Throws | |
|---|---|
androidx.media3.muxer.MuxerException |
If the muxer fails to write the sample. |