FrameworkMuxer
@UnstableApi
class FrameworkMuxer : Muxer
Muxer implementation that uses a MediaMuxer.
Summary
Nested types |
|---|
class FrameworkMuxer.Factory : Muxer.Factory |
Constants |
|
|---|---|
const String! |
|
const String! |
MUXER_STOPPING_FAILED_ERROR_MESSAGE = "Failed to stop the MediaMuxer" |
Public functions |
|
|---|---|
Unit |
addMetadataEntry(metadataEntry: Metadata.Entry!)Adds |
Int |
Adds a track of the given media format. |
Unit |
close()Closes the file. |
Unit |
writeSampleData(trackId: Int, data: ByteBuffer!, bufferInfo: BufferInfo!)Writes encoded sample data. |
Constants
MUXER_STOPPING_FAILED_ERROR_MESSAGE
const val MUXER_STOPPING_FAILED_ERROR_MESSAGE = "Failed to stop the MediaMuxer": String!
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, data: ByteBuffer!, bufferInfo: BufferInfo!): Unit
Writes encoded sample data.
| Parameters | |
|---|---|
trackId: Int |
The track id, previously returned by |
data: ByteBuffer! |
A buffer containing the sample data to write to the container. |
bufferInfo: BufferInfo! |
The |