-
Notifications
You must be signed in to change notification settings - Fork 23
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
Fix some unsoundess and crash issues #48
Closed
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
36c0e8a
Fix some unsoundess and crash issues
Rodrigodd 1dad283
Update bindings for x86_64
katyo 4dbf88f
CI: Update NDK version to 21.4.7075529 (LTS)
katyo 06759f5
Update bindgen to 0.60
katyo 7f2fbc2
Updated bindings
katyo 1fe1e24
Add missing apk signing key for demo
katyo 6259786
fix warning for unused result
Rodrigodd 6367d3b
update ndk to 0.7
Rodrigodd d373232
Updated oboe library to 1.7.0
Rodrigodd e853223
Updated bindings
Rodrigodd 5882266
Stop using deprecated AudioStreamCallback
Rodrigodd 50894ec
Remove commented out code
Rodrigodd d9d5313
Use new API for setting the AudioStreamCallback
Rodrigodd ce797bc
Stop holding the audio callback in Rust side
Rodrigodd fea00f6
Update bindings
Rodrigodd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about accessing to AudioStream via shared pointer here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean using something like
*mut shared_ptr<oboe_AudioStream>
instead of*mut c_void
(and maybe ideally without the pointer indirection)?I had no experience in creating bindings between Rust and C++, so I was not sure how to pass a
shared_ptr
between them. If you simply putstd::shared_ptr<AudioStream>
inoboe_AudioStreamBuilder_openStreamShared
at C++ side, bindgen would use an opaque[u64; 2]
type.Maybe that was okay, or I could wrap the
shared_ptr
in another class or something (thinking back, that would allow accessingAudioStream
through a getter, instead of keeping two pointers in Rust side). But I opted for allocating theshared_ptr
on the heap, and passing a type-erased pointer to Rust side. This seemed to be less error-prone for me. But if anyone has a better idea on how to do it, I can change it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean I would like to avoid storing two pointers in
AudioStreamHandle
.Typical
shared_ptr<T>
layout in C++ looks as follows:Seems opaque type that bindgen propose is that we need (actually it is a
[*mut c_void; 2]
).To make things totally safe we may get raw pointer via function which we implement on C++ side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated #49.