-
Notifications
You must be signed in to change notification settings - Fork 111
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
Safe mediacodec bindings #216
Conversation
b6a72f1
to
d1f5e46
Compare
d1f5e46
to
0a547b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For starters, there are a lot of unnecessary as _
casts and typed initializations. Please either be explicit about a cast or remove it altogether.
Adding #![warn(trivial_casts)]
at the top of this file (hopefully we can do that repo-wide at some point) will help you track these down.
@MarijnS95 Ok, I should have addressed all your suggestions. I used:
|
Fwiw feel free to leave the warning at the top of the file for the meantime. I'll work out to combine that with #219. |
You may also use |
Ok, tried and no extra warnings or errors. |
There are still some warnings because of unused imports when using api-level-24, not only from my code |
That is something we should perhaps build-test in the CI and fix? Mind opening a separate PR for that (or issue if nontrivial)? |
Can this PR be merged? The warnings can be addressed in a second moment. |
LGTM, thanks @zarik5 |
I wasn't actually okay with this yet, but that's what I get for being on holiday. Doc comments with double instead of triple slashes, |
Sometimes things are good enough. But agree that it would be better with the changes you mentioned. |
If crates are going to be maintained (or at least PRs merged) with a "good is good enough" mentality I'll have to step down as a maintainer, as I can't be cleaning up behind peoples back to uphold an acceptable feeling of responsibility towards said project. That is, unless there's clear agreement and documentation that a PR is dragging on too long (in terms of discussions, not silence), and is best merged in preparation for followup changes to land through separate PRs. |
I'm sorry @MarijnS95, I realize that things were rushed. I tried picking up the style around but I did a poor job. The wrong doc comments were the most glaring mistake for me. I think it would really help a PR checklist (not necessarily in this repo, you could link to a good one in another repo or website). |
I don't think a checklist for standard style errors really exists or make sense; it should all be caught by (locally runnable) CI tools like We could however use a checklist for obvious things like requiring a changelog entry if a PR modifies public-facing API/behaviour. |
In any case, my post above links at least twice to https://rust-lang.github.io/api-guidelines/ - that's a good starting place if you're looking for more guidance. |
Add
MediaCodec
andMediaFormat
bindings with most of their methods. Crypto and DRM support is not implemented.Testing
Only the decoder code path is tested. sample
Note: This PR needs to be rebased after #213 is merged