-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enableDecoderFallback does not work as expected #1879
Comments
This sounds like you're expecting to see fallback between
This matches my reading of the documentation on the
The code looks like it should emit the event to media/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.java Lines 1140 to 1147 in c35a9d6
media/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/MediaCodecVideoRenderer.java Lines 1173 to 1176 in c35a9d6
When I try this in the demo app by enabling decoder fallback on the Aside:
i.e. this is only called after initialization is complete, so throwing an exception in here to simulate an initialization failure is technically too late. It happens to work at the moment, due to the structure of the code, but I wouldn't rely on this remaining true forever. |
Hello everyone,
I’m having trouble understanding the behavior of
enableDecoderFallback
and the specific level at which it operates. Essentially, I want to confirm thatenableDecoderFallback
is functioning as expected.Here’s what I did:
I customized
demos/main
with the following classes:VideoRendererEventListener
(fromVideoRendererEventListener
): to add logs and monitor behavior when exceptions are thrown.CustomMediaCodecRenderer
(fromMediaCodecVideoRenderer
): to generate exceptions and examine available decoders.CustomRendererFactory
(fromDefaultRenderersFactory
): to manage bothVideoRendererEventListener
andCustomMediaCodecRenderer
.With these helper classes, I performed the following tests:
CustomMediaCodecRenderer
instances at indices 0 and 1, and trigger an exception in index 0 (for example, by havinggetDecoderInfos()
return an empty list), playback fails, and there’s no indication that the player attempts to use index 1.CustomMediaCodecRenderer
at index 0 while keeping the hardware decoder selected by the player, playback behaves differently depending on where I place the exception. If I place it inonCodecInitialized
, playback continues; however, if I place it inonQueueInputBuffer
, playback doesn’t recover (see commentserror_1
,error_2
in the code).In each case, logs capture the error but don’t indicate any fallback from hardware to software within the same
CustomMediaCodecRenderer
. This raises some questions:CustomMediaCodecRenderer
has indeed switched to a fallback decoder?onQueueInputBuffer
) remain unhandled, causing playback to fail?Thank you for any insights!
Here is my fork with the changes I made
utilities classes:
Change in
PlayerActivity.java
The text was updated successfully, but these errors were encountered: