rust-av / dav1d-rs

libdav1d rust bindings
MIT License
37 stars 16 forks source link

Improve API for correctly handling input data ownership and allowing handling of errors #57

Closed sdroege closed 2 years ago

sdroege commented 2 years ago

The decoder did not consume it so it's still ours.

sdroege commented 2 years ago

@lu-zero What do you think about this? I'll give it some testing in the GStreamer plugin in a bit.

sdroege commented 2 years ago

The basic code flow now would be the same as for the C API, except that on EAGAIN for send_data() you'd call send_pending_data() until that returns Ok(()) instead of passing the same data to send_data() again (which I don't see how we can safely do that without exposing the whole Dav1dData stuff to the bindings).

sdroege commented 2 years ago

This is ready from my side and works correctly with the GStreamer plugin after updating the code (with reduced memory usage, more robust error handling, etc).

sdroege commented 2 years ago

https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/654 FWIW