mirror of
https://github.com/go-gst/go-gst.git
synced 2025-09-26 20:11:18 +08:00
GstPromise is a boxed type and needs to be passed to GValue accordingly
also handle nil unmarshalling
This commit is contained in:
@@ -188,14 +188,18 @@ func (p *Promise) ToGValue() (*glib.Value, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
val.SetInstance(unsafe.Pointer(p.Instance()))
|
||||
val.SetBoxed(unsafe.Pointer(p.Instance()))
|
||||
return val, nil
|
||||
}
|
||||
|
||||
func marshalPromise(p unsafe.Pointer) (interface{}, error) {
|
||||
c := C.g_value_get_object(toGValue(p))
|
||||
c := C.g_value_get_boxed(toGValue(p))
|
||||
obj := (*C.GstPromise)(unsafe.Pointer(c))
|
||||
|
||||
if obj == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
prom := &Promise{
|
||||
ptr: obj,
|
||||
done: nil, // cannot be awaited if received from FFI
|
||||
|
Reference in New Issue
Block a user