mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-13 03:33:56 +08:00
Squashed commit of the following:
commit 7f46be64521d7cdf4d94409f979143a55acd665a Author: Avi Zimmerman <avi.zimmerman@gmail.com> Date: Thu Jan 7 12:18:37 2021 +0200 improve plugin interfaces
This commit is contained in:
@@ -19,6 +19,7 @@ import "C"
|
||||
import (
|
||||
"path"
|
||||
"runtime"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// DebugColorFlags are terminal style flags you can use when creating your debugging
|
||||
@@ -98,14 +99,20 @@ func NewDebugCategory(name string, color DebugColorFlags, description string) *D
|
||||
|
||||
func (d *DebugCategory) logDepth(level DebugLevel, message string, depth int, obj *C.GObject) {
|
||||
function, file, line, _ := runtime.Caller(depth)
|
||||
cFile := C.CString(path.Base(file))
|
||||
cFunc := C.CString(runtime.FuncForPC(function).Name())
|
||||
cMsg := C.CString(message)
|
||||
defer C.free(unsafe.Pointer(cFile))
|
||||
defer C.free(unsafe.Pointer(cFunc))
|
||||
defer C.free(unsafe.Pointer(cMsg))
|
||||
C.cgoDebugLog(
|
||||
d.ptr,
|
||||
C.GstDebugLevel(level),
|
||||
C.CString(path.Base(file)),
|
||||
(C.CString(runtime.FuncForPC(function).Name())),
|
||||
(*C.gchar)(cFile),
|
||||
(*C.gchar)(cFunc),
|
||||
C.gint(line),
|
||||
obj,
|
||||
C.CString(message),
|
||||
(*C.gchar)(cMsg),
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user