// Get the video mode data that matches the given CameraDeviceMode. public override VideoModeData GetVideoMode(CameraDeviceMode mode) { if (QCARRuntimeUtilities.IsPlayMode()) { return(WebCam.GetVideoMode()); } else { IntPtr videoModePtr = Marshal.AllocHGlobal( Marshal.SizeOf(typeof(VideoModeData))); QCARWrapper.Instance.CameraDeviceGetVideoMode((int)mode, videoModePtr); VideoModeData videoMode = (VideoModeData)Marshal.PtrToStructure (videoModePtr, typeof(VideoModeData)); Marshal.FreeHGlobal(videoModePtr); return(videoMode); } }