-
Notifications
You must be signed in to change notification settings - Fork 59
Implement dav1d-rs
's Rust API
#1439
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
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for the much safer implementation! I'm still taking a closer look at the unsafe
s, as the few remaining are still quite critical, but I wanted to give some initial feedback in general first.
Pulled out the docs additions from #1439 into its own PR.
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.
@leo030303, could you rebase this on main
? There are a lot of other commits in here now, so it's harder to review.
Co-authored-by: Khyber Sen <[email protected]>
Co-authored-by: Khyber Sen <[email protected]>
Co-authored-by: Khyber Sen <[email protected]>
Co-authored-by: Khyber Sen <[email protected]>
Co-authored-by: Khyber Sen <[email protected]>
Co-authored-by: Khyber Sen <[email protected]>
Co-authored-by: Khyber Sen <[email protected]>
Co-authored-by: Khyber Sen <[email protected]>
Co-authored-by: Khyber Sen <[email protected]>
I think the core of this PR, the rust API, seems to be in a good place, for the work aligning the implementation closer to the spec I think it makes sense to do those under separate PR's, but overall I think the rust API should be good to merge if it all looks fine from your end |
I think this was closed accidentally? |
Oh, whoops, I didn't realize "fix" expressions for a PR comment close them. I thought it only worked on issues. |
Signed-off-by: Leo Ring <[email protected]>
Is there anything blocking this? I'd love to see this merged and published so we could drop the last remaining C library, |
I've copy pasted the PR from #1362 and updated it with some of the suggestions made on that pull request. The main changes are:
enum
s fromrav1d
instead of redefining new ones, and added in doc comments from the originaldav1d-rs
library to a few items.unsafe
code as I could and replaced it with the Rust methods fromrav1d
as much as possible.It currently works as a drop-in replacement for
dav1d-rs
; adding inuse rav1d as dav1d;
to my fork of image makes everything work fine.The only functional changes I made are I removed the
unsafe impl
s ofSend
andSync
forInnerPicture
soPicture
is no longerSync
orSend
. I looked through the code and I don't believeDisjointMut<Rav1dPictureDataComponentInner>
, which is a field of one of its children, is thread safe, though I'm open to correction there; I'm pretty unfamiliar withunsafe
Rust.I also don't have safety comments on the two
unsafe
blocks inrust_api.rs
; I'm unsure what these would look like, so open to suggestions there. These are mostly taken verbatim from the old pull request.