Ejemplo n.º 1
0
        public virtual void ReleaseGUIResources()
        {
            // Releases all Direct3D related resources
            _initialized = false;

            FilterState   state;
            IMediaControl mc = (IMediaControl)_graphBuilder;

            mc.GetState(10, out state);
            if (state != FilterState.Stopped)
            {
                mc.StopWhenReady();
                mc.Stop();
            }

            if (_evr != null)
            {
                // Get the currently connected EVR Pins to restore the connections later
                FilterGraphTools.GetConnectedPins(_evr, PinDirection.Input, _evrConnectionPins);
                _graphBuilder.RemoveFilter(_evr);
                FilterGraphTools.TryRelease(ref _evr);
            }

            EvrDeinit(_presenterInstance);
            FreeEvrCallback();
        }