implement GstMeta, organize C code, add github action for linting

This commit is contained in:
tinyzimmer
2020-09-29 12:32:55 +03:00
parent 87fada8556
commit 5f21e41f70
31 changed files with 355 additions and 488 deletions

View File

@@ -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)
}