void init() { queue = new ConcurrentQueue <Bitmap>(); videoWriter = new VideoFileWriter(); TotalFrame = 0; Status = RecoderStatus.Strat; stopSignal = new ManualResetEvent(false); interval = 1000 / frameRate; }
public void Stop() { if (Status == RecoderStatus.Stop) { return; } stopSignal.Set(); thread.Abort(); thread.Join(); stopSignal.Close(); videoWriter.Close(); Status = RecoderStatus.Stop; }