-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Buffer creation from native memory #149
Comments
Where is your native memory coming from? If you can allocate via the bindings you could potentially use the Buffer constructor and map that / pass it around that way? You could also map that one method via a JNA interface yourself and pass the pointer into We can consider PRs to extend the mapping with that functionality, but not until a stable v1 release is complete. |
The memory is allocated by an external entity already. |
Just for reference this was the temporary solution as suggested (many ways to handle enums, we just needed something that works). Natives.objectFor(...) is handled by JNA since Buffer already exists and can be defined as return type.
Used in AppSrc like this:
|
While it's good that works, note that relying on internal mapping directly to Buffer is unsupported. It will break in the near future as it relies on behaviour in lowlevel and that is not intended to be API stable. I suggested using You may also want to look at |
Ah, that's a good point - thanks for the heads-up! |
Adding enhancement and post 1.0 labels - would be good to get this and other additional Buffer / Memory behaviour in once we have a stable release out. |
Started looking at this, but punting forward again to 1.4. Need to consider API. Possibly direct ByteBuffer so as not to rely on JNA in public API. |
I want to construct a new
org.freedesktop.gstreamer.Buffer
object with data from a piece of native memory. For example, with the direct API, I could do something like this:Is there any way I could do this using the java library? Neither Buffer nor GSTBufferApi seems to have this functionality?
The intention is to avoid having to allocate a new identical piece of memory and perform a copy into that when sending the buffer to GStreamer.
The text was updated successfully, but these errors were encountered: