-
Notifications
You must be signed in to change notification settings - Fork 21
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
Gstreamer bindings #103
Comments
With a bunch of manual fixes I've been able to get it running, but that doesn't seem like the ideal way to do things |
in reference to #102:
{ action }:
let src = import ./src.nix;
in import "${src.gotk4-nix}/${action}.nix" {
base = {
pname = "gotk4";
version = "dev";
buildInputs = pkgs: with pkgs; [ gst_all_1.gstreamer ];
};
pkgs = import "${src.gotk4-nix}/pkgs.nix" {
sourceNixpkgs = builtins.fetchTarball {
name = "gotk4-nixpkgs";
url = "https://github.com/NixOS/nixpkgs/archive/fbfb79400a08bf754e32b4d4fc3f7d8f8055cf94.tar.gz";
sha256 = "0pgyx1l1gj33g5i9kwjar7dc3sal2g14mhfljcajj8bqzzrbc3za";
};
useFetched = true;
};
} and running
|
Also, I added |
Commit b27ae8a should fix the generator to work with this. It should just generate now. |
This is a weird error. I can't find an instance of |
You'll also have to add |
I'm not sure why your IDE is reporting these as errors. They build fine using the standard compiler. |
Probably just a false positive. I added the package
|
Interesting. Is this a recursive type definition? Maybe add more logging there. |
Where would I add logging? I'm not seeing anything relevant in the log output. Maybe there are too many types being generated? When I start it with the debugger enabled, it seems like there are a bit over 200 Goroutines active when it crashes |
I've narrowed down the error to one GIR Namespace that I've excluded for now and that's working fine. _arg1 = (C.guintptr)(unsafe.Pointer(handle)) to _arg1 = (C.guintptr)(handle) in https://github.com/OmegaRogue/gotk4-gstreamer/blob/main/pkg/gstvideo/videooverlay.go |
Can you paste the relevant XML section(s) for these functions? |
<method name="set_window_handle"
c:identifier="gst_video_overlay_set_window_handle">
<doc xml:space="preserve"
filename="gst-libs/gst/video/videooverlay.c"
line="330">This will call the video overlay's set_window_handle method. You
should use this method to tell to an overlay to display video output to a
specific window (e.g. an XWindow on X11). Passing 0 as the @handle will
tell the overlay to stop using that window and create an internal one.</doc>
<source-position filename="gst-libs/gst/video/videooverlay.h"
line="92"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="overlay" transfer-ownership="none">
<doc xml:space="preserve"
filename="gst-libs/gst/video/videooverlay.c"
line="332">a #GstVideoOverlay to set the window on.</doc>
<type name="VideoOverlay" c:type="GstVideoOverlay*"/>
</instance-parameter>
<parameter name="handle" transfer-ownership="none">
<doc xml:space="preserve"
filename="gst-libs/gst/video/videooverlay.c"
line="333">a handle referencing the window.</doc>
<type name="guintptr" c:type="guintptr"/>
</parameter>
</parameters>
</method>
<method name="got_window_handle"
c:identifier="gst_video_overlay_got_window_handle">
<doc xml:space="preserve"
filename="gst-libs/gst/video/videooverlay.c"
line="355">This will post a "have-window-handle" element message on the bus.
This function should only be used by video overlay plugin developers.</doc>
<source-position filename="gst-libs/gst/video/videooverlay.h"
line="98"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="overlay" transfer-ownership="none">
<doc xml:space="preserve"
filename="gst-libs/gst/video/videooverlay.c"
line="357">a #GstVideoOverlay which got a window</doc>
<type name="VideoOverlay" c:type="GstVideoOverlay*"/>
</instance-parameter>
<parameter name="handle" transfer-ownership="none">
<doc xml:space="preserve"
filename="gst-libs/gst/video/videooverlay.c"
line="358">a platform-specific handle referencing the window</doc>
<type name="guintptr" c:type="guintptr"/>
</parameter>
</parameters>
</method>
<virtual-method name="set_window_handle" invoker="set_window_handle">
<doc xml:space="preserve"
filename="gst-libs/gst/video/videooverlay.c"
line="330">This will call the video overlay's set_window_handle method. You
should use this method to tell to an overlay to display video output to a
specific window (e.g. an XWindow on X11). Passing 0 as the @handle will
tell the overlay to stop using that window and create an internal one.</doc>
<source-position filename="gst-libs/gst/video/videooverlay.h"
line="69"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="overlay" transfer-ownership="none">
<doc xml:space="preserve"
filename="gst-libs/gst/video/videooverlay.c"
line="332">a #GstVideoOverlay to set the window on.</doc>
<type name="VideoOverlay" c:type="GstVideoOverlay*"/>
</instance-parameter>
<parameter name="handle" transfer-ownership="none">
<doc xml:space="preserve"
filename="gst-libs/gst/video/videooverlay.c"
line="333">a handle referencing the window.</doc>
<type name="guintptr" c:type="guintptr"/>
</parameter>
</parameters>
</virtual-method>
`` |
Hmm, maybe the C function definition in the code is wrong. It happens sometimes. Maybe try using |
i really dont see anything that could be wrong there &gir.CallableAttrs{
Name: "got_window_handle",
CIdentifier: "gst_video_overlay_got_window_handle",
ShadowedBy: "",
Shadows: "",
Throws: false,
MovedTo: "",
Parameters: &gir.Parameters{
XMLName: xml.Name{Space:"http://www.gtk.org/introspection/core/1.0", Local:"parameters"},
InstanceParameter: &gir.InstanceParameter{
XMLName: xml.Name{Space:"http://www.gtk.org/introspection/core/1.0", Local:"instance-parameter"},
ParameterAttrs: gir.ParameterAttrs{
Name: "overlay",
Direction: "",
Scope: "",
Closure: (*int)(nil),
Destroy: (*int)(nil),
CallerAllocates: false,
Skip: false,
Optional: false,
Nullable: false,
TransferOwnership: gir.TransferOwnership{TransferOwnership:"none"},
AnyType: gir.AnyType{
Type: &gir.Type{
XMLName: xml.Name{Space:"http://www.gtk.org/introspection/core/1.0", Local:"type"},
Name: "VideoOverlay",
CType: "GstVideoOverlay*",
Introspectable: (*bool)(nil),
DocElements: gir.DocElements{},
Types: nil,
},
Array: (*gir.Array)(nil),
},
Doc: &gir.Doc{
XMLName: xml.Name{Space:"http://www.gtk.org/introspection/core/1.0", Local:"doc"},
Filename: "gst-libs/gst/video/videooverlay.c",
String: "a #GstVideoOverlay which got a window",
Line: 357,
},
},
},
Parameters: {
{
XMLName: xml.Name{Space:"http://www.gtk.org/introspection/core/1.0", Local:"parameter"},
ParameterAttrs: gir.ParameterAttrs{
Name: "handle",
Direction: "",
Scope: "",
Closure: (*int)(nil),
Destroy: (*int)(nil),
CallerAllocates: false,
Skip: false,
Optional: false,
Nullable: false,
TransferOwnership: gir.TransferOwnership{TransferOwnership:"none"},
AnyType: gir.AnyType{
Type: &gir.Type{
XMLName: xml.Name{Space:"http://www.gtk.org/introspection/core/1.0", Local:"type"},
Name: "guintptr",
CType: "guintptr",
Introspectable: (*bool)(nil),
DocElements: gir.DocElements{},
Types: nil,
},
Array: (*gir.Array)(nil),
},
Doc: &gir.Doc{
XMLName: xml.Name{Space:"http://www.gtk.org/introspection/core/1.0", Local:"doc"},
Filename: "gst-libs/gst/video/videooverlay.c",
String: "a platform-specific handle referencing the window",
Line: 358,
},
},
},
},
},
ReturnValue: &gir.ReturnValue{
XMLName: xml.Name{Space:"http://www.gtk.org/introspection/core/1.0", Local:"return-value"},
Scope: "",
Closure: (*int)(nil),
Destroy: (*int)(nil),
Introspectable: false,
Nullable: false,
Skip: false,
AllowNone: false,
TransferOwnership: gir.TransferOwnership{TransferOwnership:"none"},
DocElements: gir.DocElements{},
AnyType: gir.AnyType{
Type: &gir.Type{
XMLName: xml.Name{Space:"http://www.gtk.org/introspection/core/1.0", Local:"type"},
Name: "none",
CType: "void",
Introspectable: (*bool)(nil),
DocElements: gir.DocElements{},
Types: nil,
},
Array: (*gir.Array)(nil),
},
},
InfoAttrs: gir.InfoAttrs{},
InfoElements: gir.InfoElements{
DocElements: gir.DocElements{
Doc: &gir.Doc{
XMLName: xml.Name{Space:"http://www.gtk.org/introspection/core/1.0", Local:"doc"},
Filename: "gst-libs/gst/video/videooverlay.c",
String: "This will post a \"have-window-handle\" element message on the bus.\n\nThis function should only be used by video overlay plugin developers.",
Line: 355,
},
DocDeprecated: (*gir.DocDeprecated)(nil),
SourcePosition: &gir.SourcePosition{
XMLName: xml.Name{Space:"http://www.gtk.org/introspection/core/1.0", Local:"source-position"},
Filename: "gst-libs/gst/video/videooverlay.h",
Line: 98,
Column: 0,
},
},
Annotations: nil,
},
} |
I'm thinking either the code generator is not capable (yet?) of properly handing You can also change the parameter to be a different (but equivalent) type that the generator can handle. Assuming the |
has anything changed about this in the past year? |
Sorry, I've not been working on this until now. Could you try commit 541c72d? |
So, I generated gstreamer bindings (outside of the nix environment, I havent been able to figure out how to install gstreamer there properly) and I'm trying to run approximately the same example i wrote with self written bindings, step by step.
There wasn't anything generated for gst_init, which needs to be called before using anything else from gstreamer, and once i built the first part of my example, which just calls self written bindings for gst_init and then uses the generated bindings to check if its initialized, i get these errors:
Here is the example:
The text was updated successfully, but these errors were encountered: