/// <summary> /// Sets the direct access buffer for the VideoCamera. /// </summary> /// <param name="ptr"> /// Pointer to the direct access data buffer for the VideoCamera. /// </param> protected void SetDataBuffer(IntPtr ptr) { // Save data buffer this.dataBuffer = ptr; // Tell the kinect library about it KinectNative.freenect_set_video_buffer(this.parentDevice.devicePointer, ptr); // update image map this.UpdateNextFrameImageMap(); }
/// <summary> /// Updates the next frame imagemap that's waiting for data with any state changes /// </summary> protected void UpdateNextFrameImageMap() { if (this.DataBuffer == IntPtr.Zero) { // have to set our own buffer as the video buffer this.nextFrameImage = new ImageMap(this.DataFormat); KinectNative.freenect_set_video_buffer(this.parentDevice.devicePointer, this.nextFrameImage.DataPointer); } else { // already have a buffer from user this.nextFrameImage = new ImageMap(this.DataFormat, this.DataBuffer); } }