halfway done with GstPad impl

This commit is contained in:
tinyzimmer
2020-10-03 09:44:47 +03:00
parent 79854aeba2
commit 02fa43822c
5 changed files with 378 additions and 57 deletions

View File

@@ -11,6 +11,10 @@ import (
"github.com/gotk3/gotk3/glib"
)
func toGObject(data unsafe.Pointer) *glib.Object {
return &glib.Object{GObject: glib.ToGObject(data)}
}
// gobool provides an easy type conversion between C.gboolean and a go bool.
func gobool(b C.gboolean) bool {
return int(b) > 0
@@ -103,7 +107,7 @@ func glistToStreamSlice(glist *C.GList) []*Stream {
out := make([]*Stream, 0)
l.FreeFull(func(item interface{}) {
st := item.(*C.GstStream)
out = append(out, wrapStream(&glib.Object{GObject: glib.ToGObject(unsafe.Pointer(st))}))
out = append(out, wrapStream(toGObject(unsafe.Pointer(st))))
})
return out
}