major rework of reference handling

This commit is contained in:
Avi Zimmerman
2021-01-19 00:18:30 +02:00
parent 63a53be42a
commit 1f7d60b390
79 changed files with 1239 additions and 800 deletions

View File

@@ -80,7 +80,7 @@ func (a *Source) GetCaps() *gst.Caps {
if caps == nil {
return nil
}
return gst.FromGstCapsUnsafe(unsafe.Pointer(caps))
return gst.FromGstCapsUnsafeFull(unsafe.Pointer(caps))
}
// GetCurrentLevelBytes gets the number of currently queued bytes inside appsrc.
@@ -131,7 +131,7 @@ func (a *Source) GetStreamType() StreamType {
func (a *Source) PushBuffer(buf *gst.Buffer) gst.FlowReturn {
ret := C.gst_app_src_push_buffer(
(*C.GstAppSrc)(a.Instance()),
(*C.GstBuffer)(unsafe.Pointer(buf.Instance())),
(*C.GstBuffer)(unsafe.Pointer(buf.Ref().Instance())),
)
return gst.FlowReturn(ret)
}
@@ -142,7 +142,7 @@ func (a *Source) PushBuffer(buf *gst.Buffer) gst.FlowReturn {
// When the block property is TRUE, this function can block until free space becomes available in the queue.
func (a *Source) PushBufferList(bufList *gst.BufferList) gst.FlowReturn {
return gst.FlowReturn(C.gst_app_src_push_buffer_list(
a.Instance(), (*C.GstBufferList)(unsafe.Pointer(bufList.Instance())),
a.Instance(), (*C.GstBufferList)(unsafe.Pointer(bufList.Ref().Instance())),
))
}