mirror of
https://github.com/samsonjs/media.git
synced 2026-04-16 13:05:46 +00:00
Add EditedMediaItemSequence and Composition objects
PiperOrigin-RevId: 505047245
This commit is contained in:
parent
9759849001
commit
e5e17d6f2c
3 changed files with 82 additions and 1 deletions
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.google.android.exoplayer2.transformer;
|
||||
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
/**
|
||||
* A composition of {@link MediaItem} instances, with transformations to apply to them.
|
||||
*
|
||||
* <p>The {@linkplain MediaItem} instances can be concatenated or mixed. {@link Effects} can be
|
||||
* applied to individual {@linkplain MediaItem} instances, as well as to the composition.
|
||||
*/
|
||||
public final class Composition {
|
||||
|
||||
/* package */ final ImmutableList<EditedMediaItemSequence> sequences;
|
||||
/* package */ final Effects effects;
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param sequences The {@link EditedMediaItemSequence} instances to compose. {@link MediaItem}
|
||||
* instances from different sequences that are overlapping in time will be mixed in the
|
||||
* output.
|
||||
* @param effects The {@link Effects} to apply to the composition.
|
||||
*/
|
||||
public Composition(ImmutableList<EditedMediaItemSequence> sequences, Effects effects) {
|
||||
this.sequences = sequences;
|
||||
this.effects = effects;
|
||||
}
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
|||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
/** A {@link MediaItem} with the transformations to apply to it. */
|
||||
public class EditedMediaItem {
|
||||
public final class EditedMediaItem {
|
||||
|
||||
/** A builder for {@link EditedMediaItem} instances. */
|
||||
public static final class Builder {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.google.android.exoplayer2.transformer;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
/**
|
||||
* A sequence of {@link EditedMediaItem} instances.
|
||||
*
|
||||
* <p>{@linkplain EditedMediaItem} instances in a sequence don't overlap in time.
|
||||
*/
|
||||
public final class EditedMediaItemSequence {
|
||||
|
||||
/* package */ final ImmutableList<EditedMediaItem> editedMediaItems;
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param editedMediaItems The {@link EditedMediaItem} instances in the sequence.
|
||||
*/
|
||||
public EditedMediaItemSequence(ImmutableList<EditedMediaItem> editedMediaItems) {
|
||||
this.editedMediaItems = editedMediaItems;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue