Skip to content
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

Adds option to change the decoder used by the player #893

Merged
merged 19 commits into from
Nov 27, 2022

Conversation

susonthapa
Copy link
Contributor

Changes
This PR adds an option to change between Hardware and Software decoding. When this option is changed the current player is recreated with the new decoder. We are using the mediaCodecSelector to control which decoder we want to select for the particular codec. The property MediaCodecInfo.hardwareAccelerated should be taken with a grain of salt.

Issues
Closes #760

@jellyfin-bot jellyfin-bot added this to the v2.5.0 milestone Nov 19, 2022
@susonthapa
Copy link
Contributor Author

I did a quick test on both the emulator and the real device and I got mixed results. This feature works as expected but the actual device might not support decoding the track with the specified decoder but that is more of an ExoPlayer issue than ours. I was thinking of maybe forcing the decoding even if the decoder doesn't support the capabilities(resolutions, profiles) but this turns out to be the default behavior of ExpoPlayer.

Here is a quick demo video on the emulator.

Kapture.2022-11-20.at.09.19.52.mp4

@susonthapa susonthapa marked this pull request as ready for review November 20, 2022 05:40
@Maxr1998 Maxr1998 self-requested a review November 20, 2022 09:45
Copy link
Member

@Maxr1998 Maxr1998 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I tweaked some small stuff myself already, but still left some other comments for you. Looking forward to merging this once these are addressed.

@jellyfin-bot jellyfin-bot added the merge conflict Conflicts prevent merging label Nov 25, 2022
@jellyfin-bot jellyfin-bot removed the merge conflict Conflicts prevent merging label Nov 26, 2022
@susonthapa
Copy link
Contributor Author

Thanks, @Maxr1998 for taking the time to review the code. I have made the requested changes. Please let me know if I need to change anything.

@Maxr1998
Copy link
Member

Maxr1998 commented Nov 27, 2022

Thanks, I left some more comments in the threads above. The rest is good now. One last request, I usually prefer line comments to start with an uppercase letter, so I'd appreciate if you could fix that as well. I apologize for being a bit nitpicky, I just prefer consistency 😅

@susonthapa
Copy link
Contributor Author

I understand @Maxr1998, I would have done the same if I were you. Since I am very new to this repository I will be making a lot of rookie mistakes so feel free to correct me. It will take me some time to get familiar with the coding style and app architecture.

@Maxr1998
Copy link
Member

It's ok, I just have relatively specific standards. Some of these style requirements should probably be documented somewhere.

Copy link
Member

@Maxr1998 Maxr1998 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution!

@Maxr1998 Maxr1998 merged commit 84312c7 into jellyfin:master Nov 27, 2022
@Maxr1998 Maxr1998 added enhancement New feature or request exoplayer Related to the ExoPlayer integration labels May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exoplayer Related to the ExoPlayer integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ExoPlayer: Add SW/HW decoding toggle
3 participants