Signature error in gstreamer-video-1.0 vapi, Gst.Video.Frame.info?
In 0.48.5 and master, there is the declaration
public weak Gst.Video.Info info;
However, the info
member is an embedded struct, not a pointer --- see the C definition. Should the weak
be removed?
Thanks for considering this question!
Use case: I am trying to manually fill in the fields of a Gst.Video.Info based on a GPU memory buffer I have allocated. I cannot get the generated C code to compile because it is treating info
as a GstVideoInfo*
rather than a GstVideoInfo
.
Tested with: Vala 0.48.5 on Ubuntu 18.04 on arm64.
Edit MCVEs attached.
The intent of these functions is to accept a struct from the caller and fill in its contents.
1. Download mcve984.vala and run:
valac --library foo --pkg gstreamer-video-1.0 -H mcve984.h -C mcve984.vala && gcc -c mcve984.c `pkg-config --cflags --libs gstreamer-1.0`
Results:
mcve984.c: In function ‘get_frame’:
mcve984.c:35:9: error: incompatible types when assigning to type ‘GstVideoInfo * {aka struct _GstVideoInfo *}’ from type ‘GstVideoInfo {aka struct _GstVideoInfo}’
_tmp1_ = _tmp0_.info;
2. What took me down this road was that I can't use ref
, which I would think might help. Download mcve984-ref.vala and run the same command as above, but with the filename changed:
valac --library foo --pkg gstreamer-video-1.0 -H mcve984-ref.h -C mcve984-ref.vala && gcc -c mcve984-ref.c `pkg-config --cflags --libs gstreamer-1.0`
Results:
mcve984-ref.vala:17.19-17.32: error: Argument 1: Cannot pass unowned ref argument to owned reference parameter
populate_info(ref frame.info);
^^^^^^^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)