Open sdroege opened 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.
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.