Remove usages of deprecated DefaultDecoderFactory constructor

The constructor was deprecated but usages were not migrated.

PiperOrigin-RevId: 678683678
This commit is contained in:
kimvde 2024-09-25 06:58:41 -07:00 committed by Copybara-Service
parent fa04386863
commit 2dc32360d6
5 changed files with 8 additions and 7 deletions

View File

@ -144,7 +144,7 @@ public class ForceEndOfStreamTest {
private final int framesToDrop; private final int framesToDrop;
private FrameDroppingDecoderFactory(Context context, int sourceFrameCount, int framesToDrop) { private FrameDroppingDecoderFactory(Context context, int sourceFrameCount, int framesToDrop) {
this.defaultDecoderFactory = new DefaultDecoderFactory(context); defaultDecoderFactory = new DefaultDecoderFactory.Builder(context).build();
this.sourceFrameCount = sourceFrameCount; this.sourceFrameCount = sourceFrameCount;
this.framesToDrop = framesToDrop; this.framesToDrop = framesToDrop;
} }

View File

@ -97,10 +97,10 @@ public final class DefaultAssetLoaderFactory implements AssetLoader.Factory {
*/ */
public DefaultAssetLoaderFactory(Context context, BitmapLoader bitmapLoader) { public DefaultAssetLoaderFactory(Context context, BitmapLoader bitmapLoader) {
this.context = context.getApplicationContext(); this.context = context.getApplicationContext();
this.decoderFactory = new DefaultDecoderFactory(context);
this.clock = Clock.DEFAULT;
this.mediaSourceFactory = null;
this.bitmapLoader = bitmapLoader; this.bitmapLoader = bitmapLoader;
decoderFactory = new DefaultDecoderFactory.Builder(context).build();
clock = Clock.DEFAULT;
mediaSourceFactory = null;
} }
/** /**

View File

@ -1626,7 +1626,8 @@ public final class Transformer {
AssetLoader.Factory assetLoaderFactory = this.assetLoaderFactory; AssetLoader.Factory assetLoaderFactory = this.assetLoaderFactory;
if (useDefaultAssetLoaderFactory || assetLoaderFactory == null) { if (useDefaultAssetLoaderFactory || assetLoaderFactory == null) {
assetLoaderFactory = assetLoaderFactory =
new DefaultAssetLoaderFactory(context, new DefaultDecoderFactory(context), clock); new DefaultAssetLoaderFactory(
context, new DefaultDecoderFactory.Builder(context).build(), clock);
} }
DebugTraceUtil.reset(); DebugTraceUtil.reset();
transformerInternal = transformerInternal =

View File

@ -141,7 +141,7 @@ public class ExoPlayerAssetLoaderTest {
private static AssetLoader getAssetLoader(AssetLoader.Listener listener, Clock clock) { private static AssetLoader getAssetLoader(AssetLoader.Listener listener, Clock clock) {
Context context = ApplicationProvider.getApplicationContext(); Context context = ApplicationProvider.getApplicationContext();
Codec.DecoderFactory decoderFactory = new DefaultDecoderFactory(context); Codec.DecoderFactory decoderFactory = new DefaultDecoderFactory.Builder(context).build();
EditedMediaItem editedMediaItem = EditedMediaItem editedMediaItem =
new EditedMediaItem.Builder(MediaItem.fromUri("asset:///media/mp4/sample.mp4")).build(); new EditedMediaItem.Builder(MediaItem.fromUri("asset:///media/mp4/sample.mp4")).build();
return new ExoPlayerAssetLoader.Factory(context, decoderFactory, clock) return new ExoPlayerAssetLoader.Factory(context, decoderFactory, clock)

View File

@ -1047,7 +1047,7 @@ public final class MediaItemExportTest {
MediaSource.Factory mediaSourceFactory = MediaSource.Factory mediaSourceFactory =
new DefaultMediaSourceFactory( new DefaultMediaSourceFactory(
context, new SlowExtractorsFactory(/* delayBetweenReadsMs= */ 10)); context, new SlowExtractorsFactory(/* delayBetweenReadsMs= */ 10));
Codec.DecoderFactory decoderFactory = new DefaultDecoderFactory(context); Codec.DecoderFactory decoderFactory = new DefaultDecoderFactory.Builder(context).build();
AssetLoader.Factory assetLoaderFactory = AssetLoader.Factory assetLoaderFactory =
new ExoPlayerAssetLoader.Factory( new ExoPlayerAssetLoader.Factory(
context, context,