예제 #1
0
파일: bin.go 프로젝트: revmischa/gst
func NewBin(name string) *Bin {
	s := (*C.gchar)(C.CString(name))
	defer C.free(unsafe.Pointer(s))
	b := new(Bin)
	b.SetPtr(glib.Pointer(C.gst_bin_new(s)))
	return b
}
예제 #2
0
// BinNew() is a wrapper around gst_bin_new().
func BinNew(name string) (*Bin, error) {
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))
	c := C.gst_bin_new((*C.gchar)(cname))
	if c == nil {
		return nil, nilPtrErr
	}
	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	b := wrapBin(obj)
	b.RefSink()
	runtime.SetFinalizer(&b.Object, (*Object).Unref)
	return b, nil
}