Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make HardwareBuffer::as_ptr() public #213

Merged
merged 3 commits into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ndk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

- ndk/media/image_reader: Make `HardwareBuffer::as_ptr()` public for interop with Vulkan.

# 0.6.0 (2022-01-05)

- **Breaking:** Upgrade to `ndk-sys 0.3.0` and migrate to `jni-sys` types that it now directly uses in its bindings.
Expand Down
7 changes: 6 additions & 1 deletion ndk/src/hardware_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ impl HardwareBuffer {
Self { inner: ptr }
}

fn as_ptr(&self) -> *mut ffi::AHardwareBuffer {
/// Returns the underlying [`ffi::AHardwareBuffer`] pointer
///
/// The pointer can be used to import this hardware buffer into a Vulkan memory object using [`VK_ANDROID_external_memory_android_hardware_buffer`].
///
/// [`VK_ANDROID_external_memory_android_hardware_buffer`]: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_ANDROID_external_memory_android_hardware_buffer.html
pub fn as_ptr(&self) -> *mut ffi::AHardwareBuffer {
zmerp marked this conversation as resolved.
Show resolved Hide resolved
self.inner.as_ptr()
}

Expand Down