From e4e59cd929af4d80b84d9a392ae82cb4aa07cf0b Mon Sep 17 00:00:00 2001 From: tonihei Date: Tue, 17 Dec 2024 03:22:51 -0800 Subject: [PATCH] Switch default of async crypto mode to disabled There are reproducible issues with codec timeouts when using this API, so we disable it entirely until we know more about potential fixes and where they are available. Issue: androidx/media#1641 PiperOrigin-RevId: 707025950 (cherry picked from commit 71f82df57f53c69fe34417bbde64847049e27894) --- RELEASENOTES.md | 16 ++++++++++++++++ .../AsynchronousMediaCodecAdapter.java | 2 +- .../DefaultMediaCodecAdapterFactory.java | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 34c76aeaafd..caa9aa5636e 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -20,6 +20,22 @@ * Reduce default values for `bufferForPlaybackMs` and `bufferForPlaybackAfterRebufferMs` in `DefaultLoadControl` to 1000 and 2000 ms respectively. + * Add `MediaExtractorCompat`, a new class that provides equivalent + functionality to platform `MediaExtractor`. + * Move `BasePreloadManager.Listener` to a top level + `PreloadManagerListener`. + * `RenderersFactory.createSecondaryRenderer` can be implemented to provide + secondary renderers for pre-warming. Pre-warming enables quicker media + item transitions during playback. + * Enable sending `CmcdData` for manifest requests in adaptive streaming + formats DASH, HLS, and SmoothStreaming + ([#1951](https://github.com/androidx/media/issues/1951)). + * Provide `MediaCodecInfo` of the codec that will be initialized in + `MediaCodecRenderer.onReadyToInitializeCodec` + ([#1963](https://github.com/androidx/media/pull/1963)). + * Disable use of asynchronous decryption in MediaCodec to avoid reported + codec timeout issues with this platform API + ([#1641](https://github.com/androidx/media/issues/1641)). * Transformer: * Update parameters of `VideoFrameProcessor.registerInputStream` and `VideoFrameProcessor.Listener.onInputStreamRegistered` to use `Format`. diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/AsynchronousMediaCodecAdapter.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/AsynchronousMediaCodecAdapter.java index 00b38ffc7d8..225b80d2c77 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/AsynchronousMediaCodecAdapter.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/AsynchronousMediaCodecAdapter.java @@ -80,7 +80,7 @@ public Factory(@C.TrackType int trackType) { Supplier queueingThreadSupplier) { this.callbackThreadSupplier = callbackThreadSupplier; this.queueingThreadSupplier = queueingThreadSupplier; - enableSynchronousBufferQueueingWithAsyncCryptoFlag = true; + enableSynchronousBufferQueueingWithAsyncCryptoFlag = false; } /** diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/DefaultMediaCodecAdapterFactory.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/DefaultMediaCodecAdapterFactory.java index 6699c424cc6..a14b51d1d33 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/DefaultMediaCodecAdapterFactory.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/DefaultMediaCodecAdapterFactory.java @@ -67,7 +67,7 @@ public final class DefaultMediaCodecAdapterFactory implements MediaCodecAdapter. @Deprecated public DefaultMediaCodecAdapterFactory() { asynchronousMode = MODE_DEFAULT; - asyncCryptoFlagEnabled = true; + asyncCryptoFlagEnabled = false; context = null; } @@ -79,7 +79,7 @@ public DefaultMediaCodecAdapterFactory() { public DefaultMediaCodecAdapterFactory(Context context) { this.context = context; asynchronousMode = MODE_DEFAULT; - asyncCryptoFlagEnabled = true; + asyncCryptoFlagEnabled = false; } /**