diff --git a/generator.go b/generator.go index 508b6a2..0a67a18 100644 --- a/generator.go +++ b/generator.go @@ -74,6 +74,18 @@ var Data = genmain.Data{ // during init t.GLibGetType = "" }), + + // PadProbeInfo must not be freed, so we mark it as borrowed. + gir.ModifyCallable("Gst-1.PadProbeCallback", func(c *gir.CallableAttrs) { + for _, p := range c.Parameters.Parameters { + if p.Name == "info" && p.Type.Name == "PadProbeInfo" { + p.TransferOwnership.TransferOwnership = "borrow" + return + } + } + + panic("PadProbeCallback does not have an info parameter") + }), }, Config: typesystem.Config{ Namespaces: map[string]typesystem.NamespaceConfig{ diff --git a/go.mod b/go.mod index e6fc2be..12efa55 100644 --- a/go.mod +++ b/go.mod @@ -13,4 +13,4 @@ require ( golang.org/x/sync v0.15.0 // indirect ) -replace github.com/diamondburned/gotk4 => github.com/rswilli/gotk4 v0.0.0-20250630082246-7bde21946e67 +replace github.com/diamondburned/gotk4 => github.com/rswilli/gotk4 v0.0.0-20250701112939-1be8c14e14f9 diff --git a/go.sum b/go.sum index b555b83..2f98e13 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/go-gst/go-glib v1.4.1-0.20241209142714-f53cebf18559 h1:AK60n6W3FLZTp9 github.com/go-gst/go-glib v1.4.1-0.20241209142714-f53cebf18559/go.mod h1:ZWT4LXOO2PH8lSNu/dR5O2yoNQJKEgmijNa2d7nByK8= github.com/go-gst/go-pointer v0.0.0-20241127163939-ba766f075b4c h1:x8kKRVDmz5BRlolmDZGcsuZ1l+js6TRL3QWBJjGVctM= github.com/go-gst/go-pointer v0.0.0-20241127163939-ba766f075b4c/go.mod h1:qKw5ZZ0U58W6PU/7F/Lopv+14nKYmdXlOd7VnAZ17Mk= -github.com/rswilli/gotk4 v0.0.0-20250630082246-7bde21946e67 h1:70vQ7g0OISrj+jYJhTCAQsVKXpV49Rz/5urHd2reQKI= -github.com/rswilli/gotk4 v0.0.0-20250630082246-7bde21946e67/go.mod h1:alpfblIRIC6MejV4eBLjWx61VeJvfQ/6dHGQZUkzSYE= +github.com/rswilli/gotk4 v0.0.0-20250701112939-1be8c14e14f9 h1:nwcMF9yiEzM3DlK/P4q/nter7+f4nJoe+NnI0AHcc18= +github.com/rswilli/gotk4 v0.0.0-20250701112939-1be8c14e14f9/go.mod h1:alpfblIRIC6MejV4eBLjWx61VeJvfQ/6dHGQZUkzSYE= golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw= golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM= golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= diff --git a/pkg/gst/gst_export.gen.go b/pkg/gst/gst_export.gen.go index 813c7f8..e1b711c 100644 --- a/pkg/gst/gst_export.gen.go +++ b/pkg/gst/gst_export.gen.go @@ -279,11 +279,12 @@ func _gotk4_gst1_PadProbeCallback(carg1 *C.GstPad, carg2 *C.GstPadProbeInfo, car } var pad Pad // in, none, converted - var info *PadProbeInfo // in, none, converted + var info *PadProbeInfo // in, borrow, converted var goret PadProbeReturn // return, none, casted pad = UnsafePadFromGlibNone(unsafe.Pointer(carg1)) - info = UnsafePadProbeInfoFromGlibNone(unsafe.Pointer(carg2)) + info = UnsafePadProbeInfoFromGlibBorrow(unsafe.Pointer(carg2)) + // borrow not bound to another value, this requires correct handling by the user goret = fn(pad, info)