Closed vixalien closed 2 months ago
I've also added various array tests for strings like strings, GTypes, etc...
I think this should be reviewed so that I can start working on the next batch of tests
running gstreamer example results in segmentation fault
you're right. this is due to GStreamer's insistence on passing everything as pointers. working on it
Hello. I haven't been able to diagnose what's wrong with GStreamer and I would suggest we merge this as-is (probably removing the gstreamer code) as other parts work.
This would allow us to iterate on other parts faster.
ping
so is this ready to merge now?
Yes, I guess. The GStreamer demo will still be (intentionally) broken though.
hello @vixalien
since I don't have enough time to maintain this project alone, and you did a great job with your contributions, I wanted to add you as a collaborator so you could merge and maintain codes. are you okay with that?
Hello. no worries. Do you have a matrix account or other chat so that we can communicate more easily?
In GI, some values are nested in pointers, while others are not.
Direct values (no pointers)
For example, given a function like the following:
To unbox the value above, you will just need to do
dataView.getFloat64()
.pointers
This is usually common in outArgs
To unbox the argument above, we need to get the value pointed to, and then finally get the value.
Doubly pointed to values
While extremely rare, it is possible that values are contained in a pointer to a pointer. To check for these values, we use
GITypeInfo.is_pointer
. Here is an example of this usage: https://gitlab.gnome.org/GNOME/gobject-introspection/-/blob/main/tests/scanner/regress.c?ref_type=heads#L647Because
out
(andinout
) arguments are already pointers, if such an argument hasis_pointer()
set to true, it effectively means it's a pointer to a pointer.To unbox these values, we need to double get the value, as implemented in this PR with a new value called
nPointers
.I've also added a GStreamer example, as that should be interesting...