Example #1
0
//export videoCallbackInterceptor
func videoCallbackInterceptor(device *C.freenect_device, video *byte, timestamp uint32) {

	if val, ok := devices[device]; ok && val.videoCallback != nil {
		attributes := C.freenect_get_current_video_mode(devices[device].device)

		videoSlice := C.GoBytes(unsafe.Pointer(video), C.int(attributes.bytes))
		val.videoCallback(val, videoSlice, timestamp)
	}
}
Example #2
0
//FREENECTAPI freenect_frame_mode freenect_get_current_video_mode(freenect_device *dev);
func (dev *Device) GetCurrentVideoMode() FrameMode {
	fm := C.freenect_get_current_video_mode(dev.ptr())
	return *(*FrameMode)(unsafe.Pointer(&fm))
}