Mark CompositeSequenceableLoader final

Subclasses of this component can customize it by wrapping with the
decorator pattern, and a custom `CompositeSequencableLoaderFactory`
allows access to the list of delegate `SequenceableLoader` instances.

The `final` keyword was removed as part of <unknown commit> but this
component never ended up being subclassed within the library.

Making this class `final` makes upcoming changes easier to reason
about.

PiperOrigin-RevId: 597853429
This commit is contained in:
ibaker 2024-01-12 08:58:48 -08:00 committed by Copybara-Service
parent 4061d476a1
commit d4be30b04d
2 changed files with 11 additions and 5 deletions

View File

@ -35,6 +35,12 @@
* Implement `HttpEngineDataSource`, an `HttpDataSource` using the
[HttpEngine](https://developer.android.com/reference/android/net/http/HttpEngine)
API.
* Prevent subclassing `CompositeSequenceableLoader`. This component was
[previously made extensible](https://github.com/androidx/media/commit/0de57cbfae7165dd3bb829e323d089cd312b4b1b)
but was never subclassed within the library. Customizations can be done
by wrapping an instance using the
[decorator pattern](https://en.wikipedia.org/wiki/Decorator_pattern) and
implementing a custom `CompositeSequenceableLoaderFactory`.
* Transformer:
* Add support for flattening H.265/HEVC SEF slow motion videos.
* Increase transmuxing speed, especially for 'remove video' edits.

View File

@ -23,16 +23,16 @@ import androidx.media3.exoplayer.LoadingInfo;
/** A {@link SequenceableLoader} that encapsulates multiple other {@link SequenceableLoader}s. */
@UnstableApi
public class CompositeSequenceableLoader implements SequenceableLoader {
public final class CompositeSequenceableLoader implements SequenceableLoader {
protected final SequenceableLoader[] loaders;
private final SequenceableLoader[] loaders;
public CompositeSequenceableLoader(SequenceableLoader[] loaders) {
this.loaders = loaders;
}
@Override
public final long getBufferedPositionUs() {
public long getBufferedPositionUs() {
long bufferedPositionUs = Long.MAX_VALUE;
for (SequenceableLoader loader : loaders) {
long loaderBufferedPositionUs = loader.getBufferedPositionUs();
@ -44,7 +44,7 @@ public class CompositeSequenceableLoader implements SequenceableLoader {
}
@Override
public final long getNextLoadPositionUs() {
public long getNextLoadPositionUs() {
long nextLoadPositionUs = Long.MAX_VALUE;
for (SequenceableLoader loader : loaders) {
long loaderNextLoadPositionUs = loader.getNextLoadPositionUs();
@ -56,7 +56,7 @@ public class CompositeSequenceableLoader implements SequenceableLoader {
}
@Override
public final void reevaluateBuffer(long positionUs) {
public void reevaluateBuffer(long positionUs) {
for (SequenceableLoader loader : loaders) {
loader.reevaluateBuffer(positionUs);
}