package audio /* #include "gst.go.h" GstClockTime framesToClockTime (gint frames, gint rate) { return GST_FRAMES_TO_CLOCK_TIME(frames, rate); } gint clockTimeToFrames(GstClockTime ct, gint rate) { return GST_CLOCK_TIME_TO_FRAMES(ct, rate); } */ import "C" import ( "unsafe" "github.com/go-gst/go-gst/gst" ) // FramesToClockTime calculates the Clocktime // from the given frames and rate. // // Deprecated: This is handwritten and will be removed in a future version. Please use the autogenerated bindings instead. func FramesToClockTime(frames, rate int) gst.ClockTime { ct := C.framesToClockTime(C.gint(frames), C.gint(rate)) return gst.ClockTime(ct) } // DurationToFrames calculates the number of frames from the given duration and sample rate. // // Deprecated: This is handwritten and will be removed in a future version. Please use the autogenerated bindings instead. func DurationToFrames(dur gst.ClockTime, rate int) int { return int(C.clockTimeToFrames(C.GstClockTime(dur), C.gint(rate))) } // gboolean converts a go bool to a C.gboolean. // // Deprecated: This is handwritten and will be removed in a future version. Please use the autogenerated bindings instead. func gboolean(b bool) C.gboolean { if b { return C.gboolean(1) } return C.gboolean(0) } // gobool provides an easy type conversion between C.gboolean and a go bool. // // Deprecated: This is handwritten and will be removed in a future version. Please use the autogenerated bindings instead. func gobool(b C.gboolean) bool { return int(b) > 0 } // // Deprecated: This is handwritten and will be removed in a future version. Please use the autogenerated bindings instead. func ptrToGVal(p unsafe.Pointer) *C.GValue { return (*C.GValue)(p) }