mirror of
https://github.com/go-gst/go-gst.git
synced 2025-09-27 04:15:56 +08:00
allow nullable target for ghost pads
This commit is contained in:
@@ -123,8 +123,14 @@ func (g *GhostPad) GetTarget() *Pad {
|
|||||||
// SetTarget sets the new target of the ghostpad gpad. Any existing target is unlinked and links to the new target are
|
// SetTarget sets the new target of the ghostpad gpad. Any existing target is unlinked and links to the new target are
|
||||||
// established. if newtarget is nil the target will be cleared.
|
// established. if newtarget is nil the target will be cleared.
|
||||||
func (g *GhostPad) SetTarget(target *Pad) bool {
|
func (g *GhostPad) SetTarget(target *Pad) bool {
|
||||||
|
var ctarget *C.GstPad
|
||||||
|
|
||||||
|
if target != nil {
|
||||||
|
ctarget = target.Instance()
|
||||||
|
}
|
||||||
|
|
||||||
return gobool(C.gst_ghost_pad_set_target(
|
return gobool(C.gst_ghost_pad_set_target(
|
||||||
g.Instance(), target.Instance(),
|
g.Instance(), ctarget,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user