tinyzimmer / go-glib Goto Github PK
View Code? Open in Web Editor NEWGlib bindings for go. Originally forked from gotk3/gotk3.
License: GNU Lesser General Public License v3.0
Glib bindings for go. Originally forked from gotk3/gotk3.
License: GNU Lesser General Public License v3.0
Hi
Trying build for RPI GOOS=linux GOARCH=arm CGO_ENABLED=1
get build failure
# github.com/tinyzimmer/go-glib/glib
vendor/github.com/tinyzimmer/go-glib/glib/gobject.go:247:22: type [1073741824]int larger than address space
vendor/github.com/tinyzimmer/go-glib/glib/gobject.go:247:22: type [1073741824]int too large
vendor/github.com/tinyzimmer/go-glib/glib/gobjectclass.go:49:25: type [1073741824]*_Ctype_struct__GParamSpec larger than address space
vendor/github.com/tinyzimmer/go-glib/glib/gobjectclass.go:49:25: type [1073741824]*_Ctype_struct__GParamSpec too large
vendor/github.com/tinyzimmer/go-glib/glib/gparamspec.go:74:27: type [1073741824]_Ctype_struct__GFlagsValue larger than address space
vendor/github.com/tinyzimmer/go-glib/glib/gparamspec.go:74:27: type [1073741824]_Ctype_struct__GFlagsValue too large
I'm not sure but I think new Run() and potentially NewMainLoop() from https://github.com/tinyzimmer/go-glib/blob/main/glib/gmainloop.go#L53 should be enforcing runtime.LockOSThread()
or perhaps users of go-glib should call runtime.LockOSThread when creating and starting their main loop, if thats the case then perhaps that should be documented.
See:
https://github.com/golang/go/wiki/LockOSThread
For example, this project does so:
https://github.com/danielpaulus/quicktime_video_hack/blob/main/screencapture/gstadapter/gst_adapter.go#L154
Hi,
SetProperty() strictly checks property type and the type of value given so that it cannot set several property with integer value.
gobject.go
fakevideosrc, err := gst.NewElementWithName("videotestsrc", "vtestsrc")
err = fakevideosrc.SetProperty("pattern", 2)
if err != nil {
logger.Infof("err %v", err)
}
> log output
[main.go][func1] => err Invalid type gint for property pattern
I think, It is convenient for properties to allow integer value to be set with integer. In addition, gstreamer does like that.
In order to do this, I simply added following function, SetPropertyWithInteger().
I would like to hear your opinion.
func (v *Object) SetPropertyWithInteger(name string, value int) error {
prop, err := ValueInit(TYPE_INT)
if err != nil {
return err
}
prop.SetInt(value)
if err != nil {
return fmt.Errorf("Unable to perform type conversion: %s", err.Error())
}
cstr := C.CString(name)
defer C.free(unsafe.Pointer(cstr))
C.g_object_set_property(v.GObject, (*C.gchar)(cstr), prop.native())
return nil
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.