diff --git a/ndk/CHANGELOG.md b/ndk/CHANGELOG.md index 28fb4fa7..fcaa4c44 100644 --- a/ndk/CHANGELOG.md +++ b/ndk/CHANGELOG.md @@ -10,6 +10,7 @@ - **Breaking:** Upgrade `num_enum` crate from `0.5.1` to `0.6`. (#398) - **Breaking:** Renamed and moved "`media`" error types and helpers to a new `media_error` module. (#399) - **Breaking:** media_codec: Wrap common dequeued-buffer status codes in enum. (#401) +- **Breaking:** media_codec: Return `MaybeUninit` bytes in `buffer_mut()`. (#403) # 0.7.0 (2022-07-24) diff --git a/ndk/src/media/media_codec.rs b/ndk/src/media/media_codec.rs index 177b817f..b695579d 100644 --- a/ndk/src/media/media_codec.rs +++ b/ndk/src/media/media_codec.rs @@ -467,7 +467,7 @@ pub struct InputBuffer<'a> { } impl InputBuffer<'_> { - pub fn buffer_mut(&mut self) -> &mut [u8] { + pub fn buffer_mut(&mut self) -> &mut [MaybeUninit] { unsafe { let mut out_size = 0; let buffer_ptr = @@ -477,7 +477,7 @@ impl InputBuffer<'_> { "AMediaCodec_getInputBuffer returned NULL for index {}", self.index ); - slice::from_raw_parts_mut(buffer_ptr, out_size) + slice::from_raw_parts_mut(buffer_ptr.cast(), out_size) } } }