Example #1
0
        void OnDisable()
        {
            if (_session != null)
            {
                // Close and dispose the FFmpeg session.
                _session.Close();
                _session.Dispose();
                _session = null;
            }

            if (_tempRT != null)
            {
                // Dispose the frame texture.
                GetComponent <Camera>().targetTexture = null;
                Destroy(_tempRT);
                _tempRT = null;
            }

            if (_blitter != null)
            {
                // Destroy the blitter game object.
                Destroy(_blitter);
                _blitter = null;
            }
        }
 public void StopCapture()
 {
     Debug.Log("StopCapture!!");
     StopAllCoroutines();
     if (_session != null)
     {
         _session.Close();
         _session.Dispose();
         _session = null;
     }
 }