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

StreamExt::push_buffer question #9

Closed
bluecube opened this issue Apr 14, 2021 · 2 comments
Closed

StreamExt::push_buffer question #9

bluecube opened this issue Apr 14, 2021 · 2 comments

Comments

@bluecube
Copy link

bluecube commented Apr 14, 2021

Just a quick question -- documentation of StreamExt::push_buffer states that the function takes ownership of the buffer, yet it only borrows its argument. Is this intended? I am new to both aravis and Glib (and my rust skills are not very fresh either), so this could very well be a stupid error on my side, but it smells to me a bit.

I encountered this when trying to convert the ArvCamera example from C to rust. I wrote the buffer pushing like this: stream.push_buffer(aravis::Buffer::new_allocate(payload_size as usize)); and got an error "expected reference, found struct Buffer" (which actually makes sense, but I still feel that I want to pass the buffer, not a reference to it).

@de-vri-es
Copy link
Member

Hmm, you are correct that this is iffy.

Most of this code is auto-generated from the gobject introspection data, including that function.

It is possible to add a manual override for this function that takes a buffer by value, but I think the real solution in the end will be to write the high level API manually. This would also allow us to fix #7 and even #8.

The low level API can remain auto-generated of course.

@de-vri-es
Copy link
Member

de-vri-es commented Aug 1, 2024

This particular issue was resolved in #19 and released in 0.10.0 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants