Exemplo n.º 1
0
Arquivo: pad.go Projeto: revmischa/gst
func NewGhostPad(name string, target *Pad) *GhostPad {
	s := (*C.gchar)(C.CString(name))
	defer C.free(unsafe.Pointer(s))
	p := new(GhostPad)
	p.SetPtr(glib.Pointer(C.gst_ghost_pad_new(s, target.g())))
	return p
}
Exemplo n.º 2
0
// GhostPadNew() is a wrapper around gst_ghost_pad_new().
func GhostPadNew(name string, pad IPad) (*GhostPad, error) {
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))
	c := C.gst_ghost_pad_new((*C.gchar)(cname), pad.toPad())
	if c == nil {
		return nil, nilPtrErr
	}
	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	b := wrapGhostPad(obj)
	b.RefSink()
	runtime.SetFinalizer(&b.Object, (*Object).Unref)
	return b, nil
}