Composition.Builder
class Composition.Builder
A builder for Composition instances.
Summary
Public constructors |
|---|
Builder(sequences: (Mutable)List<EditedMediaItemSequence!>!)Creates an instance. |
Builder(Creates an instance. |
Public constructors
Builder
Builder(sequences: (Mutable)List<EditedMediaItemSequence!>!)
Creates an instance.
| Parameters | |
|---|---|
sequences: (Mutable)List<EditedMediaItemSequence!>! |
The |
Builder
Builder(
sequence: EditedMediaItemSequence!,
sequences: Array<EditedMediaItemSequence!>!
)
Creates an instance.
| See also | |
|---|---|
Builder |
Public functions
experimentalSetForceAudioTrack
@CanIgnoreReturnValue
funexperimentalSetForceAudioTrack(forceAudioTrack: Boolean): Composition.Builder!
experimentalSetRetainHdrFromUltraHdrImage
@CanIgnoreReturnValue
fun experimentalSetRetainHdrFromUltraHdrImage(
retainHdrFromUltraHdrImage: Boolean
): Composition.Builder!
Sets whether to use produce an HDR output video from Ultra HDR image input.
If the HdrMode is HDR_MODE_KEEP_HDR, then setting this to true applies the recovery map (i.e. the gainmap) to the base image to produce HDR video frames. This is automatically overridden to true, if the first asset is a HDR video.
The output video will have the same color encoding as the first EditedMediaItem the sequence. If the Ultra HDR image is first in the sequence, output video will default to BT2020 HLG full range colors.
Ignored if HdrMode is not HDR_MODE_KEEP_HDR.
Supported on API 34+, by some device and HDR format combinations. Ignored if unsupported by device or API level.
The default value is false.
| Parameters | |
|---|---|
retainHdrFromUltraHdrImage: Boolean |
Whether to use produce an HDR output video from Ultra HDR image input. |
| Returns | |
|---|---|
Composition.Builder! |
This builder. |
setEffects
@CanIgnoreReturnValue
fun setEffects(effects: Effects!): Composition.Builder!
Sets the Effects to apply to the Composition.
The default value is EMPTY.
| Parameters | |
|---|---|
effects: Effects! |
The |
| Returns | |
|---|---|
Composition.Builder! |
This builder. |
setHdrMode
@CanIgnoreReturnValue
fun setHdrMode(@Composition.HdrMode hdrMode: Int): Composition.Builder!
Sets the HdrMode for HDR video input.
The default value is HDR_MODE_KEEP_HDR. Apps that need to tone-map HDR to SDR should generally prefer HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_OPEN_GL over HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_MEDIACODEC, because its behavior is likely to be more consistent across devices.
| Parameters | |
|---|---|
@Composition.HdrMode hdrMode: Int |
The |
| Returns | |
|---|---|
Composition.Builder! |
This builder. |
setTransmuxAudio
@CanIgnoreReturnValue
fun setTransmuxAudio(transmuxAudio: Boolean): Composition.Builder!
Sets whether to transmux the media items' audio tracks.
The default value is false.
If the Composition contains one MediaItem, the value set is ignored. The audio track will only be transcoded if necessary.
If the input Composition contains multiple media items, all the audio tracks are transcoded by default. They are all transmuxed if transmuxAudio is true. Transmuxed tracks must be compatible (typically, all the MediaItem instances containing the track to transmux are concatenated in a single EditedMediaItemSequence and have the same sample format for that track). Any transcoding effects requested will be ignored.
Requesting audio transmuxing while also requiring silence generation is not allowed, as generating silence requires transcoding. Silence generation is needed when a sequence has TRACK_TYPE_AUDIO and contains gaps or an audio-less EditedMediaItem.
| Parameters | |
|---|---|
transmuxAudio: Boolean |
Whether to transmux the audio tracks. |
| Returns | |
|---|---|
Composition.Builder! |
This builder. |
setTransmuxVideo
@CanIgnoreReturnValue
fun setTransmuxVideo(transmuxVideo: Boolean): Composition.Builder!
Sets whether to transmux the media items' video tracks.
The default value is false.
If the Composition contains one MediaItem, the value set is ignored. The video track will only be transcoded if necessary.
If the input Composition contains multiple media items, all the video tracks are transcoded by default. They are all transmuxed if transmuxVideo is true. Transmuxed tracks must be compatible (typically, all the MediaItem instances containing the track to transmux are concatenated in a single EditedMediaItemSequence and have the same sample format for that track). Any transcoding effects requested will be ignored.
| Parameters | |
|---|---|
transmuxVideo: Boolean |
Whether to transmux the video tracks. |
| Returns | |
|---|---|
Composition.Builder! |
This builder. |
setVideoCompositorSettings
@CanIgnoreReturnValue
fun setVideoCompositorSettings(
videoCompositorSettings: VideoCompositorSettings!
): Composition.Builder!
Sets the VideoCompositorSettings to apply to the Composition.
The default value is DEFAULT.
| Parameters | |
|---|---|
videoCompositorSettings: VideoCompositorSettings! |
| Returns | |
|---|---|
Composition.Builder! |
This builder. |