예제 #1
0
        public void FlushScreenBuffer()
        {
            //切换到新buffer
            var newBuffer = new MemoryBuffer(DateTime.Now);
            var b         = buffer;

            buffer = newBuffer;

            //加入flushing
            lock (flushing)
            {
                flushing.Add(b);
            }
            var path   = getFileName(b.StartTime);
            var folder = Path.GetDirectoryName(path);

            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }
            new Thread(() =>
            {
                Ffmpeg.Save(getFileName(b.StartTime), b.Frames.ToArray());
                lock (flushing)
                {
                    flushing.Remove(b);
                }
            })
            {
                Priority     = ThreadPriority.BelowNormal,
                IsBackground = false
            }.Start();
        }