mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-13 03:33:56 +08:00
add more control binding functions
TODO: move DirectControlBinding into controller package
This commit is contained in:
@@ -14,7 +14,7 @@ func (cb *ControlBinding) Instance() *C.GstControlBinding {
|
||||
return C.toGstControlBinding(cb.Unsafe())
|
||||
}
|
||||
|
||||
type DirectControlBinding struct{ ControlBinding }
|
||||
type DirectControlBinding struct{ *ControlBinding }
|
||||
|
||||
func NewDirectControlBinding(obj *Object, prop string, csource *InterpolationControlSource) *DirectControlBinding {
|
||||
cprop := C.CString(prop)
|
||||
@@ -23,7 +23,7 @@ func NewDirectControlBinding(obj *Object, prop string, csource *InterpolationCon
|
||||
cbinding := C.gst_direct_control_binding_new(obj.Instance(), cprop, csource.Instance())
|
||||
|
||||
return &DirectControlBinding{
|
||||
ControlBinding: ControlBinding{
|
||||
ControlBinding: &ControlBinding{
|
||||
Object: wrapObject(glib.TransferNone(unsafe.Pointer(cbinding))),
|
||||
},
|
||||
}
|
||||
|
@@ -98,6 +98,10 @@ func (o *Object) AddControlBinding(binding *ControlBinding) {
|
||||
C.gst_object_add_control_binding(o.Instance(), binding.Instance())
|
||||
}
|
||||
|
||||
func (o *Object) RemoveControlBinding(binding *ControlBinding) {
|
||||
C.gst_object_remove_control_binding(o.Instance(), binding.Instance())
|
||||
}
|
||||
|
||||
// TODO: Consider wrapping GstObject GST_OBJECT_LOCK/GST_OBJECT_UNLOCK functionality
|
||||
// due to following flags related functionality is based on a regular uint32 field
|
||||
// and is not considered thread safe
|
||||
|
Reference in New Issue
Block a user