Beispiel #1
0
func PipelineWatchBus(pipeline *C.GstPipeline) chan *C.GstMessage {
	bus := C.gst_pipeline_get_bus(pipeline)
	defer C.gst_object_unref(asGPtr(bus))
	messages := make(chan *C.GstMessage)
	C.add_bus_watch(bus, unsafe.Pointer(&messages))
	return messages
}
Beispiel #2
0
// GetBus() is a wrapper around gst_pipeline_get_bus().
func (v *Pipeline) GetBus() (*Bus, error) {
	c := C.gst_pipeline_get_bus(v.native())
	if c == nil {
		return nil, nilPtrErr
	}
	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	b := wrapBus(obj)
	//b.RefSink()
	runtime.SetFinalizer(&b.Object, (*Object).Unref)
	return b, nil
}