private IEnumerator FinalRenderCapture()
    {
        while (Application.isPlaying)
        {
            int flags = AVProWindowsMediaPlugin.PluginID | (int)AVProWindowsMediaPlugin.PluginEvent.UpdateAllTextures;
#if UNITY_5 && !UNITY_5_0 && !UNITY_5_1
            GL.IssuePluginEvent(AVProWindowsMediaPlugin.GetRenderEventFunc(), flags);
#else
            GL.IssuePluginEvent(flags);
#endif

            yield return(new WaitForEndOfFrame());
        }
    }
    public void Update()
    {
#if UNITY_EDITOR
        if (_instance == null)
        {
            return;
        }
#endif
        int flags = AVProWindowsMediaPlugin.PluginID | (int)AVProWindowsMediaPlugin.PluginEvent.UpdateAllTextures;
#if UNITY_5 && !UNITY_5_0 && !UNITY_5_1
        GL.IssuePluginEvent(AVProWindowsMediaPlugin.GetRenderEventFunc(), flags);
#else
        GL.IssuePluginEvent(flags);
#endif
    }
    private bool StartExtractFrames(string filePath, uint numSamples)
    {
        DestroyTextures();

        if (_movie.StartVideo(filePath, true, true, false, false, false, false, false, FilterMode.Bilinear, TextureWrapMode.Clamp))
        {
            _textures = new Texture2D[numSamples];
            _contents = new GUIContent[numSamples];
            for (int i = 0; i < numSamples; i++)
            {
                _contents[i] = new GUIContent(" ");
            }

            uint numFrames = _movie.DurationFrames;
            _frameStep    = numFrames / numSamples;
            _targetFrame  = 0;
            _textureIndex = 0;

            if (!_async)
            {
                _isExtracting = true;
                while (_isExtracting)
                {
#if UNITY_5 && !UNITY_5_0 && !UNITY_5_1
                    GL.IssuePluginEvent(AVProWindowsMediaPlugin.GetRenderEventFunc(), (int)AVProWindowsMediaPlugin.PluginEvent.UpdateAllTextures);
#else
                    GL.IssuePluginEvent(AVProWindowsMediaPlugin.PluginID | (int)AVProWindowsMediaPlugin.PluginEvent.UpdateAllTextures);
#endif

                    UpdateExtracting();
                }

                return(false);
            }

            return(true);
        }

        return(false);
    }