mirror of
https://github.com/androidx/media.git
synced 2025-05-04 22:20:47 +08:00
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:
parent
030d8148ba
commit
15650c6bf3
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user