Skip to content

Conversation

ChunMinChang
Copy link
Member

Create an API to expose the alpha_item and premultiplied_alpha with Mp4parseAvifParser. This helps to add the alpha support in BMO1654462

@ChunMinChang ChunMinChang requested a review from baumanj December 7, 2020 18:10
@ChunMinChang ChunMinChang self-assigned this Dec 7, 2020
@baumanj
Copy link
Contributor

baumanj commented Dec 8, 2020

This looks fine. Though I can't think of a situation where we'd ever call mp4parse_avif_get_primary_item or mp4parse_avif_get_alpha_item without calling the other. So, maybe it would be worth rolling them into a single function? It's not worth it if you think it would make the code a lot worse, but considering we could potentially have pages with dozens or hundreds of AVIFs in the not too distant future, it seems worth avoiding an extra FFI call for each one.

@ChunMinChang
Copy link
Member Author

Thanks for the feedback. I don't have a preference on whether mp4parse_avif_get_primary_item and mp4parse_avif_get_alpha_item should be merged or not. I'll merge them and then update the PR.

@ChunMinChang
Copy link
Member Author

The usage of the new API becomes: https://phabricator.services.mozilla.com/D98950#C3418652NL510

@ChunMinChang
Copy link
Member Author

The reason for the test failure in Rust Nightly is mentioned in #260 (comment). It seems it's unrelated to the change here actually.

Copy link
Contributor

@baumanj baumanj left a comment

Choose a reason for hiding this comment

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

Happy to merge this after the typos in the doc comment are fixed. The functionality looks great. I like the introduction of the AvifImage type.

@baumanj baumanj merged commit 94fd2f1 into mozilla:master Dec 10, 2020
ChunMinChang added a commit to ChunMinChang/gecko-dev that referenced this pull request Dec 13, 2020
This imports the change of mozilla/mp4parse-rust#258

Now the git is refered to my personal git repo. Once the above PR is merged
in the upstream, the git will be updated back to the upstream instead.

This patch might be split to another bug once the PR 258 is merged. For
now, this is introduced to build the D98950.

Differential Revision: https://phabricator.services.mozilla.com/D98950
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants