How to set GstElement* to a Property in Golang?

It looks like cgocheck may not be the only headache?

Hi, I’m trying to utilize the “splitmuxsink” to split a streaming, hence need to set different muxer and an appSink elements to the “splitmuxsink”. Right now failed to do so.

To show the problem clearly, I picked some relevant codes into a snippet as below:

package main

import (
"fmt"

"github.com/go-gst/go-gst/gst"
)

func gstTest() {
gst.Init(nil)

var sink *gst.Element
var err error
if sink, err = gst.NewElement("splitmuxsink"); err != nil {
	fmt.Println("failed to create splitmuxsink: ", err)
	return
}

if err = sink.SetProperty("async-finalize", false); err != nil {
	fmt.Println("failed to set async-finalize to splitmuxsink: ", err)
	return
}

var mux *gst.Element
if mux, err = gst.NewElement("webmmux"); err != nil {
	fmt.Println("failed to create webmmux: ", err)
	return
}

if err = sink.SetProperty("muxer", mux); err != nil {
	fmt.Println("failed to set muxer to splitmuxsink: ", err)
	return
}

/*
   	var appSink *app.Sink

   	if appSink, err = app.NewAppSink(); err != nil {
   		fmt.Println("failed to create appSink: ", err)
   		return
   	}	   	
   	if err = sink.SetProperty("sink", appSink); err != nil {
   		fmt.Println("failed to set sink to splitmuxsink: ", err)
   		return
   	}
*/
}

Running the above codes will get error as “panic: runtime error: cgo argument has Go pointer to unpinned Go pointer”, while It seems that glib/gvalue.go already convert the go pointer to a unsafe.Pointer.

Running it with GODEBUG=cgocheck=0 will get error returned by SetProperty(), “Invalid type gpointer for property muxer”, which means gst.Element isn’t equal to GstElement?

I see in github nobody sets property of a GstElement with golang at all. So wondering how to do that?

Thanks in advance!