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

Fix VP9 on Android M and below by advertising profile level #8462

Merged
merged 5 commits into from
Jan 19, 2021

Conversation

zeninsta
Copy link
Contributor

@zeninsta zeninsta commented Jan 15, 2021

On Android M and below, VP9 codecCapabilities do not advertise profile level support. In this case, estimate the level from MediaCodecInfo.VideoCapabilities instead. https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html

This change is ported from chromium media: https://chromium.googlesource.com/chromium/src/media/+/master/base/android/java/src/org/chromium/media/MediaCodecUtil.java#296

@google-cla
Copy link

google-cla bot commented Jan 15, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Jan 15, 2021
@google-cla google-cla bot added cla: yes and removed cla: no labels Jan 15, 2021
Copy link
Contributor

@ojw28 ojw28 left a comment

Choose a reason for hiding this comment

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

Please see the inline comments. If these can be addressed then we will get this merged. Thanks!

@zeninsta zeninsta changed the title Fix VP9 on Android L and M by advertising profile level Fix VP9 on Android M and below by advertising profile level Jan 18, 2021
@ojw28
Copy link
Contributor

ojw28 commented Jan 18, 2021

Thanks! We will get this merged in.

Copy link
Contributor

@ojw28 ojw28 left a comment

Choose a reason for hiding this comment

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

See some more inline comments. In particular, I think the bitrate values are incorrect.

VideoCapabilities videoCapabilities = capabilities.getVideoCapabilities();

if (videoCapabilities == null) {
return new CodecProfileLevel[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would make sense to always assume VP9Level1 is supported.

@ojw28 ojw28 merged commit c40d1c6 into google:dev-v2 Jan 19, 2021
@ojw28
Copy link
Contributor

ojw28 commented Jan 19, 2021

Hi. I merged this with the bitrate adjustments and a few other tweaks. You can view and check the final version here. Please let us know if there are any issues, and thanks for your contribution!

@google google locked and limited conversation to collaborators Mar 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants