/// <summary> /// This Is meant to be apply to a thread so it can constantly run can check for frames and not stop the program /// first make sure off is set to false /// then while not off check for frames and pass to filewriterforvideo /// when is off /// exit current while loop /// go to loop to finish out frames to process /// </summary> void FilerStreamerThread() { moff = false; while (!moff) { if (mCameraAffectivaRecorder.lastframe.Count > 0) { Affdex.Frame frame = mCameraAffectivaRecorder.lastframe.Dequeue(); mFilerWriterForVideo.AddBitmap(frame.getWidth(), frame.getHeight(), frame.getBGRByteArray(), frame.getColorFormat(), frame.getTimestamp()); System.Threading.Thread.Sleep(1); } } while (mCameraAffectivaRecorder.lastframe.Count > 0) { Affdex.Frame frame = mCameraAffectivaRecorder.lastframe.Dequeue(); mFilerWriterForVideo.AddBitmap(frame.getWidth(), frame.getHeight(), frame.getBGRByteArray(), frame.getColorFormat(), frame.getTimestamp()); System.Threading.Thread.Sleep(1); } mFilerWriterForVideo.CloseFileSaver(); }