Open mayurk2 opened 1 week ago
Update:
I solved this problem by copying the decoder output buffer to surface using openGL. This stack overflow answer was a great help - https://stackoverflow.com/a/21564236
This is still a problem with the most of the existing extension renderer I guess. I am re-opening this issue and let the moderator decide if any actions are required.
Version
ExoPlayer 2.16.1
More version details
I am developing an Extension renderer for dav1d decoder. The normal playback is working fine with this new renderer.
I have Main content in AV1 and mid-roll Ads in H264. So when the playback switches from main content to ads, internally Exoplayer switches from dav1d extension renderer to Media codec renderer.
I am noticing the below error when this switching happens.
And it eventually causes decoder initialisation failure.
I explored on this issue and I have some findings.
surface.lockCanvas()
in Java, I am doingANativeWindow_lock()
andANativeWindow_unlockAndPost()
just like it is done in existingextension-av1
for libgav1 renderer.Both of these posts points that after calling lock() on surface, internally it connects surface to CPU producer.
Surface::connect(NATIVE_WINDOW_API_CPU);
Since the surface is already connected to a producer, it is failing when media codec is trying to connect some producer again during initialisation.My questions are:
native_window.h
What are the alternate ways to achieve this? I need to re-use the same surface view for both AV1 and media codec renderers.
Additional findings I just checked how the media codec is handling surface.
libstagefright
. I am not sure how to access them from my native code.Devices that reproduce the issue
Not device specific. I reproduced on Redmi Note 9 Pro.
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
I am using my own extension renderer. But the problem seems to be generic.
Expected result
It should play without any error.
Actual result
The player fails to switch from extension renderer to media codec renderer.
Media
The extension renderer is not public. Hence cannot share the media URL.
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.