ArtofKinect.Common.PointCloudStreamRecorder.ProcessFrame C# (CSharp) Method

ProcessFrame() private method

private ProcessFrame ( MotionFrame frame ) : void
frame MotionFrame
return void
        void ProcessFrame(MotionFrame frame)
        {
            int currentFrameId = _description.FrameCount;

            if (currentFrameId == 0)
            {
                _description.RecordingStartDateTimeUTC = frame.TimeUTC;
            }

            string filename = "frame" + currentFrameId.ToString("D8") + ".mfx";
            filename = Path.Combine(_scratchDirectory, filename);

            var bytes = _serializer.Serialize(frame);

            using (var FSFile = new FileStream(filename, FileMode.Create, FileAccess.Write,
                    FileShare.None, BlockSize, FileOptions.None))
            {
                FSFile.Write(bytes, 0, bytes.Length);
                FSFile.Close();
                //File.WriteAllBytes(filename, bytes);
            }

            currentFrameId++;
            _description.FrameCount = currentFrameId;
            _description.RecordingStopDateTimeUTC = frame.TimeUTC;
            if (currentFrameId % 10 == 0)
            {
                SaveDescription();
            }
        }