arturoc / gstreamer1.0-rs

Idiomatic bindings for Gstreamer on Rust.
MIT License
36 stars 14 forks source link

Buffer (and other miniobject) COW writability not mapped very well #24

Open sdroege opened 7 years ago

sdroege commented 7 years ago

You might want to take a look at https://github.com/sdroege/rsplugin/blob/master/gst-plugin/src/buffer.c and https://github.com/sdroege/rsplugin/blob/master/gst-plugin/src/miniobject.rs . I'm implementing the miniobject COW via something Arc-style.

With that you will only ever be able to get a &mut Buffer if the buffer is actually writable, and have to explicitly handle that instead of waiting for runtime errors or worse if make_writable() is not called manually.