You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace tuple structs with strongly typed and documented copy of raw struct. It would have to be converted to raw when added to the picture (or prior vaRenderPicture), but during this step we could clone Rc<>s to dependencies (like surfaces and EncCodedBuffer) to Picture<> so those wouldn't get dropped before sync. It would clean up some cros-codecs code.
Also Picture::add_buffer could accept a trait that would wrap our use cases. Like so:
traitBufferContents{constTYPE: bindings::VABufferType::Type;fnelement_size(&self) -> usize;fnnum_elements(&self) -> usize;unsafefndata_ptr(&mutself) -> *mut std::ffi::c_void;}// Or just use slice somehowpubstructBufferArray<T>whereT:BufferElement,{array:Vec<T::RawType>,// ... deps}impl<T>BufferContentsforBufferArray<T>whereT:BufferElement,{// ...}impl<T>BufferContentsforBox<T>// Or just TwhereT:BufferElement,{// ...}implBufferContentsforSliceData{// ...}
In this way we could handle buffer arrays and single element buffers transparently.
On top of that we maybe could look into doing some validations.
The text was updated successfully, but these errors were encountered:
Per @bgrzesik on #10:
We could use a private trait in favor of
BufferType
enum. Something like:Replace tuple structs with strongly typed and documented copy of raw struct. It would have to be converted to raw when added to the picture (or prior
vaRenderPicture
), but during this step we could cloneRc<>
s to dependencies (like surfaces and EncCodedBuffer) toPicture<>
so those wouldn't get dropped before sync. It would clean up some cros-codecs code.Also
Picture::add_buffer
could accept a trait that would wrap our use cases. Like so:In this way we could handle buffer arrays and single element buffers transparently.
On top of that we maybe could look into doing some validations.
The text was updated successfully, but these errors were encountered: