Back to Exoplayer

DefaultMuxer (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/transformer/DefaultMuxer.html

latest6.7 KB
Original Source

Package com.google.android.exoplayer2.transformer

Class DefaultMuxer

  • java.lang.Object

    • com.google.android.exoplayer2.transformer.DefaultMuxer
  • All Implemented Interfaces:Muxer


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classDefaultMuxerextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Muxer](Muxer.html "interface in com.google.android.exoplayer2.transformer")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

A default Muxer implementation.

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static class | DefaultMuxer.Factory | Deprecated.

A Muxer.Factory for DefaultMuxer. |

- 

Nested classes/interfaces inherited from interface com.google.android.exoplayer2.transformer.Muxer

Muxer.MuxerException

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | addMetadata​(Metadata metadata) | Deprecated.

Adds Metadata about the output file. | | int | addTrack​(Format format) | Deprecated.

Adds a track with the specified format. | | long | getMaxDelayBetweenSamplesMs() | Deprecated.

Returns the maximum delay allowed between output samples, in milliseconds, or C.TIME_UNSET if there is no maximum. | | void | release​(boolean forCancellation) | Deprecated.

Finishes writing the output and releases any resources associated with muxing. | | void | writeSampleData​(int trackIndex, ByteBuffer data, long presentationTimeUs, @com.google.android.exoplayer2.C.BufferFlags int flags) | Deprecated.

Writes the specified sample. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

- 

addTrack

public int addTrack​([Format](../Format.html "class in com.google.android.exoplayer2")format)
             throws[Muxer.MuxerException](Muxer.MuxerException.html "class in com.google.android.exoplayer2.transformer")

Deprecated.

Description copied from interface: Muxer

Adds a track with the specified format. Specified by:addTrack in interface MuxerParameters:format - The Format of the track.Returns:The index for this track, which should be passed to Muxer.writeSampleData(int, java.nio.ByteBuffer, long, @com.google.android.exoplayer2.C.BufferFlags int).Throws:Muxer.MuxerException - If the muxer encounters a problem while adding the track.

- 

writeSampleData

public void writeSampleData​(int trackIndex,[ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html "class or interface in java.nio")data,
                            long presentationTimeUs,
                            @com.google.android.exoplayer2.C.BufferFlags int flags)
                     throws[Muxer.MuxerException](Muxer.MuxerException.html "class in com.google.android.exoplayer2.transformer")

Deprecated.

Description copied from interface: Muxer

Writes the specified sample. Specified by:writeSampleData in interface MuxerParameters:trackIndex - The index of the track, previously returned by Muxer.addTrack(Format).data - A buffer containing the sample data to write to the container.presentationTimeUs - The presentation time of the sample in microseconds.flags - The C.BufferFlags associated with the data. Only C.BUFFER_FLAG_KEY_FRAME and C.BUFFER_FLAG_END_OF_STREAM are supported.Throws:Muxer.MuxerException - If the muxer fails to write the sample.

- 

addMetadata

public void addMetadata​([Metadata](../metadata/Metadata.html "class in com.google.android.exoplayer2.metadata")metadata)

Deprecated.

Description copied from interface: Muxer

Adds Metadata about the output file. Specified by:addMetadata in interface Muxer

- 

release

public void release​(boolean forCancellation)
             throws[Muxer.MuxerException](Muxer.MuxerException.html "class in com.google.android.exoplayer2.transformer")

Deprecated.

Description copied from interface: Muxer

Finishes writing the output and releases any resources associated with muxing.

The muxer cannot be used anymore once this method has been called.

Specified by:release in interface MuxerParameters:forCancellation - Whether the reason for releasing the resources is the export cancellation.Throws:Muxer.MuxerException - If the muxer fails to finish writing the output and forCancellation is false.

- 

getMaxDelayBetweenSamplesMs

public long getMaxDelayBetweenSamplesMs()

Deprecated.

Description copied from interface: Muxer

Returns the maximum delay allowed between output samples, in milliseconds, or C.TIME_UNSET if there is no maximum.

This is the maximum delay between samples of any track. They can be of the same or of different track types.

This value is used to abort the export when the maximum delay is reached. Note that there is no guarantee that the export will be aborted exactly at that time.

Specified by:getMaxDelayBetweenSamplesMs in interface Muxer