Example #1
0
 private void CloseOutput(FractionUInt32?averageFrameRate, bool disposing)
 {
     if (_videoWriter != null)
     {
         _videoWriter.Finish(averageFrameRate ?? new FractionUInt32(25, 1));
         if (disposing && _videoWriter.Path != null)
         {
             try { File.Delete(_videoWriter.Path); }
             catch { }
         }
         _videoWriter = null;
     }
     if (_audioWriter != null)
     {
         _audioWriter.Finish();
         if (disposing && _audioWriter.Path != null)
         {
             try { File.Delete(_audioWriter.Path); }
             catch { }
         }
         _audioWriter = null;
     }
     if (_timeCodeWriter != null)
     {
         _timeCodeWriter.Finish();
         if (disposing && _timeCodeWriter.Path != null)
         {
             try { File.Delete(_timeCodeWriter.Path); }
             catch { }
         }
         _timeCodeWriter = null;
     }
 }
        public void Stop()
        {
            lock (frameQueue_)
                lock (readyFrames_)
                {
                    foreach (Shared.IMocapRecorder rec in cameras_)
                    {
                        rec.StopRecording();
                    }

                    while (frameQueue_.Count > 0)
                    {
                        Bitmap bmp = ImageUtil.BitmapUtil.ToStrip(frameQueue_[0].CameraImages, frameQueue_[0].CameraImages[0].Size);
                        readyFrames_.Add(bmp);
                        frameQueue_.RemoveAt(0);
                    }

                    while (readyFrames_.Count > 0)
                    {
                        writer_.PushFrame(readyFrames_[0]);
                        readyFrames_.RemoveAt(0);
                    }
                    writer_.Finish();
                    writer_ = null;
                }
            Program.RemoveThread(workingThread_);
            Program.RemoveThread(writingThread_);
            workingThread_.Abort();
            writingThread_.Abort();
            workingThread_ = null;
            writingThread_ = null;
        }
Example #3
0
 private void CloseOutput(FractionUInt32? averageFrameRate)
 {
     if (_videoWriter != null)
     {
         _videoWriter.Finish(averageFrameRate ?? new FractionUInt32(25, 1));
         _videoWriter = null;
     }
     if (_audioWriter != null)
     {
         _audioWriter.Dispose();
         _audioWriter = null;
     }
 }