ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Blacklisting resolution layers support for Renderer Errors

Open SaurabhOfficial opened this issue 3 years ago • 9 comments

[REQUIRED] Use case description

Describe the use case or problem you are trying to solve in detail. If there are any standards or specifications involved, please provide the relevant details.

Having blacklisting support for renderer errors as well, in addition to IOExceptions currently, i.e for e.g if we get Output protection error during playback for 1080p layer we should continue playing the lower resolution layer?

Proposed solution

A clear and concise description of your proposed solution, if you have one. Exposing another function like the getRetryDelayMs() but for renderer errors.

Alternatives considered

Blacklisting that particular device for higher resolution content which is showing inconsistent behavior in terms of output protection errors

SaurabhOfficial avatar Aug 10 '22 09:08 SaurabhOfficial

Will you please write a description with what exactly you are requesting?

christosts avatar Aug 10 '22 15:08 christosts

okay, I will try to explain again, so for now if we face any IO exception during loading content we can override the getRetryDelayMsFor() method and do any custom behavior like blacklisting the source or defining a custom delay for that particular error. but in case of any renderer error like an output protection error, we don't have any means to blacklist the adaptive layer per se (please correct me if I am wrong). what I was suggesting with this feature request is to allow blacklisting or custom error handling of Rendered Type errors as well, so that any if any particular resolution layer is not supported on that device then we can simply ignore that layer during Runtime rather than throwing an exception.

SaurabhOfficial avatar Aug 11 '22 15:08 SaurabhOfficial

but in case of any renderer error like an output protection error, we don't have any means to blacklist the adaptive layer per se (please correct me if I am wrong).

Have you looked at the Track selection documentation how to customize it. You should be able to remove a video track from being selected.

christosts avatar Aug 12 '22 17:08 christosts

How do we know at the initialization phase if any particular video track dosent meet output protection requirements 👀

dino-saurabh avatar Aug 12 '22 17:08 dino-saurabh

Apologies if I wasn't clear. Track selection parameters can change after playback begins as well. From reading

what I was suggesting with this feature request is to allow blacklisting or custom error handling of Rendered Type errors as well, so that any if any particular resolution layer is not supported on that device then we can simply ignore that layer during Runtime rather than throwing an exception.

I assume you want to react to rendering errors by disabling specific adaptive layers. Once those errors occur (you can attach a Player.Listener to get the error) you can change the track selection parameters (Player.setTrackSelectionParameters), disabling the specific adaptive layer. Isn't this what you are trying to achieve?

christosts avatar Aug 12 '22 17:08 christosts

Yes, thats what I wanted to achieve @christosts , Thank you for suggesting this approach will try it out. Happy weekend ✌️

dino-saurabh avatar Aug 12 '22 17:08 dino-saurabh

Hey @SaurabhOfficial. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Sep 01 '22 01:09 google-oss-bot

disabling the specific adaptive layer. Isn't this what you are trying to achieve?

@christosts I was able to blacklist a particular track group but did not find anything in the docs which would help me blacklist any particular adaptive layer.

SaurabhOfficial avatar Sep 06 '22 10:09 SaurabhOfficial

The issue description says

Blacklisting that particular device for higher resolution content which is showing inconsistent behavior in terms of output protection errors

So I'm assuming you want to set a threshold on the maximum resolution. You can do that with

player.setTrackSelectionParameters(
    player.getTrackSelectionParameters()
        .buildUpon()
        .setMaxVideoSize(width, height)
        .build());

Where width and height define the maximum resolution you want the player to select. If you don't know the adaptive layer resolutions, you can read the Querying the available tracks documentation how to detect the resolutions when playback starts.

You can also use setMaxVideoSizeSd() which is equivalent to calling setMaxVideoSize(1279, 719).

christosts avatar Sep 06 '22 15:09 christosts