-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add SurfaceTexture
bindings
#267
Conversation
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.
looks good, I assume @MarijnS95 will have some comments too
I'm not sure about
though, have to think about it |
good point, it shouldn't be Sync as it will get released mutliple times on drop. Send is fine. |
Shouldn't clippy complain about Anyways, what about |
This is missing api level guards, which I think should be 28 for all methods. Perhaps also a general "surface-texture" feature flag can be added which enables this module? |
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.
looks good, I assume @MarijnS95 will have some comments too
Looks like yall covered most of it, and I do agree with all the comments that are still outstanding.
This only becomes a problem if we allow safely cloning/copying the As such, we should implement:
It does not seem like the NDK docs clarify any of this, so should perhaps look at |
Co-authored-by: Marijn Suijten <[email protected]>
Is it ok to merge now? PS: what is happening at the |
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.
Is it ok to merge now?
There are some unresolved comments still open, and quite a few marked resolved which haven't actually been addressed - I've unmarked those as unresolved.
PS: what is happening at the
format
task?
You can click on it to see what it wants. Basically make sure you run cargo fmt
before pushing your contribution upstream.
After that, all that remains is checking what's up with the Send
/Sync
.
I presume Send
is safe to have here unless there's some GL context magic going on that disallows a bound texture to be used on a different thread before it is unbound.
Sync
requires at least the above constraints too.
Co-authored-by: Marijn Suijten <[email protected]>
Co-authored-by: Marijn Suijten <[email protected]>
is it ok now? |
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 think we're good here. We can add back Sync
once we're sure the NDK/Java internally synchronize these threads, but the documentation on SurfaceTexture
mentions that certain operations are only valid when called on the thread that has an OpenGL context bound (which was previously used elsewhere), to me implying that it is safe to Send
a SurfaceTexture
across threads.
It seems like you've only copied the documentation summary of every function. Please make sure the entire paragraph is available or otherwise link to the appropriate function in the NDK docs: https://developer.android.com/ndk/reference/group/surface-texture
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.
That shouldn't have been an approval in light of missing documentation.
Co-authored-by: Marijn Suijten <[email protected]>
What about now? :) |
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 now? :)
No need to keep pinging/asking, I get notifications for your pushes and handle them as soon as appropriate. Especially when you ask, make sure that your PR is in tip-top shape first... Which it really isn't :(
@lattice0 Mind if I take over? |
Ok, do you want to finish the PR? I can apply the changes otherwise, haven't seen your message |
Not sure what was going on with your last push, but I've reverted those changes and redone the docs on this PR. Still looking for a balance to make doc links more consistent across the |
Support for ASurfaceTexture from NDK
Closes #262