mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-06 08:27:03 +08:00
implement GstMeta, organize C code, add github action for linting
This commit is contained in:
@@ -2,12 +2,15 @@ package gst
|
||||
|
||||
// #include "gst.go.h"
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/gotk3/gotk3/glib"
|
||||
)
|
||||
|
||||
// Buffer is a go representation of a GstBuffer.
|
||||
@@ -100,3 +103,10 @@ func (b *Buffer) Map() *MapInfo {
|
||||
C.gst_buffer_unmap(b.Instance(), (*C.GstMapInfo)(unsafe.Pointer(&mapInfo)))
|
||||
})
|
||||
}
|
||||
|
||||
// GetMeta retrieves the metadata on the buffer for the given api. If none exists
|
||||
// then nil is returned.
|
||||
func (b *Buffer) GetMeta(api glib.Type) *Meta {
|
||||
meta := C.gst_buffer_get_meta(b.Instance(), C.GType(api))
|
||||
return wrapMeta(meta)
|
||||
}
|
||||
|
Reference in New Issue
Block a user