Giter Site home page Giter Site logo

go-glib's Introduction

Hi there ๐Ÿ‘‹

Check out my blog!

go-glib's People

Contributors

tinyzimmer avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

go-glib's Issues

Build fails on 32 bit architectures

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

runtime.LockOSThread() for gmainloop?

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

Unable to set property with integer value

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
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.