FragmentedMp4Muxer.Builder


class FragmentedMp4Muxer.Builder


A builder for FragmentedMp4Muxer instances.

Summary

Public constructors

Builder(outputStream: OutputStream!)

Creates a Builder instance with default values.

Public functions

FragmentedMp4Muxer!

Builds a FragmentedMp4Muxer instance.

FragmentedMp4Muxer.Builder!

Sets the fragment duration (in milliseconds).

FragmentedMp4Muxer.Builder!

Sets whether to enable the sample copy.

Public constructors

Builder

Builder(outputStream: OutputStream!)

Creates a Builder instance with default values.

Parameters
outputStream: OutputStream!

The OutputStream to write the media data to. This stream will be automatically closed by the muxer when close is called.

Public functions

build

fun build(): FragmentedMp4Muxer!

Builds a FragmentedMp4Muxer instance.

setFragmentDurationMs

@CanIgnoreReturnValue
fun setFragmentDurationMs(fragmentDurationMs: Long): FragmentedMp4Muxer.Builder!

Sets the fragment duration (in milliseconds).

The muxer will attempt to create fragments of the given duration but the actual duration might be greater depending upon the frequency of sync samples.

The default value is DEFAULT_FRAGMENT_DURATION_MS.

setSampleCopyingEnabled

@CanIgnoreReturnValue
fun setSampleCopyingEnabled(enabled: Boolean): FragmentedMp4Muxer.Builder!

Sets whether to enable the sample copy.

If the sample copy is enabled, writeSampleData copies the input ByteBuffer and BufferInfo before it returns, so it is safe to reuse them immediately. Otherwise, the muxer takes ownership of the ByteBuffer and the BufferInfo and the caller must not modify them.

The default value is true.