Add buildUpon method in Composition

We will need to build upon original composition
for pause and resume feature and will have to set modified sequences.
In the next CL, will add method to set sequences on builder and will
probably remove it from the constructor parameter (to avoid providing
two APIs for same thing).

PiperOrigin-RevId: 558127334
This commit is contained in:
sheenachhabra 2023-08-18 14:18:58 +01:00 committed by Julia Bibik
parent 030d8148ba
commit 15650c6bf3

View File

@ -50,6 +50,16 @@ public final class Composition {
private boolean transmuxVideo;
private @HdrMode int hdrMode;
/** Creates a new instance to build upon the provided {@link Composition}. */
private Builder(Composition composition) {
sequences = composition.sequences;
effects = composition.effects;
forceAudioTrack = composition.forceAudioTrack;
transmuxAudio = composition.transmuxAudio;
transmuxVideo = composition.transmuxVideo;
hdrMode = composition.hdrMode;
}
/**
* Creates an instance.
*
@ -306,6 +316,11 @@ public final class Composition {
*/
public final @HdrMode int hdrMode;
/** Returns a {@link Composition.Builder} initialized with the values of this instance. */
public Builder buildUpon() {
return new Builder(this);
}
private Composition(
List<EditedMediaItemSequence> sequences,
Effects effects,