Class DefaultMuxer
- java.lang.Object
-
- com.google.android.exoplayer2.transformer.DefaultMuxer
-
- All Implemented Interfaces:
Muxer
@Deprecated public final class DefaultMuxer extends Object implements Muxer
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 defaultMuxerimplementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultMuxer.FactoryDeprecated.AMuxer.FactoryforDefaultMuxer.-
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 voidaddMetadata(Metadata metadata)Deprecated.AddsMetadataabout the output file.intaddTrack(Format format)Deprecated.Adds a track with the specified format.longgetMaxDelayBetweenSamplesMs()Deprecated.Returns the maximum delay allowed between output samples, in milliseconds, orC.TIME_UNSETif there is no maximum.voidrelease(boolean forCancellation)Deprecated.Finishes writing the output and releases any resources associated with muxing.voidwriteSampleData(int trackIndex, ByteBuffer data, long presentationTimeUs, @com.google.android.exoplayer2.C.BufferFlags int flags)Deprecated.Writes the specified sample.
-
-
-
Method Detail
-
addTrack
public int addTrack(Format format) throws Muxer.MuxerException
Deprecated.Description copied from interface:MuxerAdds a track with the specified format.- Specified by:
addTrackin interfaceMuxer- Parameters:
format- TheFormatof 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 data, long presentationTimeUs, @com.google.android.exoplayer2.C.BufferFlags int flags) throws Muxer.MuxerExceptionDeprecated.Description copied from interface:MuxerWrites the specified sample.- Specified by:
writeSampleDatain interfaceMuxer- Parameters:
trackIndex- The index of the track, previously returned byMuxer.addTrack(Format).data- A buffer containing the sample data to write to the container.presentationTimeUs- The presentation time of the sample in microseconds.flags- TheC.BufferFlagsassociated with the data. OnlyC.BUFFER_FLAG_KEY_FRAMEandC.BUFFER_FLAG_END_OF_STREAMare supported.- Throws:
Muxer.MuxerException- If the muxer fails to write the sample.
-
addMetadata
public void addMetadata(Metadata metadata)
Deprecated.Description copied from interface:MuxerAddsMetadataabout the output file.- Specified by:
addMetadatain interfaceMuxer
-
release
public void release(boolean forCancellation) throws Muxer.MuxerExceptionDeprecated.Description copied from interface:MuxerFinishes writing the output and releases any resources associated with muxing.The muxer cannot be used anymore once this method has been called.
- Specified by:
releasein interfaceMuxer- Parameters:
forCancellation- Whether the reason for releasing the resources is the export cancellation.- Throws:
Muxer.MuxerException- If the muxer fails to finish writing the output andforCancellationis false.
-
getMaxDelayBetweenSamplesMs
public long getMaxDelayBetweenSamplesMs()
Deprecated.Description copied from interface:MuxerReturns the maximum delay allowed between output samples, in milliseconds, orC.TIME_UNSETif 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:
getMaxDelayBetweenSamplesMsin interfaceMuxer
-
-