-
Notifications
You must be signed in to change notification settings - Fork 6k
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
MediaCodec.setOutputSurface #8329
Comments
I tried to check how it works on YouTube. After I pause, minimize the application and re-deploy, they ignore my user pause and apparently re-do exoplayer.prepare (mediaSource) |
This is a known bug of some implementations of some platform video codecs. ExoPlayer can not fix it, only workaround it by releasing the codec and then re-initializing it instead of setting the outputSurface: Lines 515 to 520 in be13805
Unfortunately, we can only find out which problematic decoders to workaround through issues like yours. You may try to enable the workaround by adding your problematic device here. If it solves your issue, please let us know so that we can add it the list for the next ExoPlayer version. |
@krocard Please clarify if I understood you correctly. In such situations, you check if the device is included in your list of problem devices and if it is found there, then mediaKodec is released, if it is not in the list, but the device has problems, I will get this exception |
Exactly. We have a list devices known to not support If a device has this If you could please answer the device you are observing the issue on, as well as it's android version, we will update this list and you should no longer see the issue. |
@krocard the problem device Xiaomi Mi Box S, In the settings, the model is called MIBOX4 |
Do you also know the android version this issue is observed on? |
in 9 android |
You can give me a release branch and I will test it on this device |
As reported by google#8329.
As reported by google#8329.
I have created a branch on my fork for you to test over 2.12.2: https://github.com/krocard/ExoPlayer/tree/mi-box-s-set-surface-workaround. The fix is krocard@e27732f. I believe the Lines 1579 to 1594 in be13805
I'm wondering if the MiBox 1,2,3 and mini also share the same bug. [internal change cl/347975125] |
@krocard, Hi, sorry for taking too long. Tell me in which version we can expect this change. Thank you |
The fix should be present in the next minor release 2.12.3. |
Reported by #8329. PiperOrigin-RevId: 350547523
Reported by #8329. PiperOrigin-RevId: 350547523
I have an Mibox 3, I can test with if needed you can also get control over it via remote if needed, not sure what I would be doing here to help out. |
2.12.3 was released a few weeks ago. If the issue is still observed on it or a more recent version, please reopen the issue. |
We already know about this problem and there are quite a few already closed issues. The problem is that some devices do not support DummySurface. And you need to be careful when working with the PlayerLayerView, if you set it visibility to GONE while the player is running, then we will get the below exception. If we pause the video, we need to wait for an unknown time (about 2 seconds on android TV devices) before we can block the visibility of GONE. All these problems can be solved, for example, we can use alpha instead of visibility to hide the display when we need it (There are cases when it is needed). But there is a case when I cannot solve the problem: The video is playing, the application is minimized, in onPause before calling super.onPause I execute exoPlayer.playWhenReady = false. But I will still get the following exception in the logs and when I deploy the application I will have a black screen on some devices. Why am I not listing what devices they are? Because there have already been many questions related to this exception, which you closed with crutches. Tell me how best to get out of the situation when you need to minimize the application on such a problematic device and not get a black screen when you deploy the application?
java.lang.IllegalArgumentException
at android.media.MediaCodec.native_setSurface(Native Method)
at android.media.MediaCodec.setOutputSurface(MediaCodec.java:1979)
at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setOutputSurfaceV23(MediaCodecVideoRenderer.java:1308)
at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setSurface(MediaCodecVideoRenderer.java:627)
at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.handleMessage(MediaCodecVideoRenderer.java:593)
at com.google.android.exoplayer2.ExoPlayerImplInternal.deliverMessage(ExoPlayerImplInternal.java:1022)
at com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageToTarget(ExoPlayerImplInternal.java:988)
at com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageInternal(ExoPlayerImplInternal.java:970)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:367)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:65)
The problem exists on exoplayer 11.7, I'm almost sure that in version 12, you did not fix it and it may not be fixed due to problems with MediaCodec
p.s. Conducted an experiment: Paused the video, waited 10 seconds, minimized the application. PlayerLayerView continues to exist, this is a TV and there are no screen rotations, but I get the same exception in the logs.
I researched a little the question, when the player is paused and I minimize the application, then this code is executed:
The text was updated successfully, but these errors were encountered: