예제 #1
0
        public HResult Shutdown()
        {
            HResult hr = CheckShutdown();

            if (MFError.Succeeded(hr))
            {
                if (_spEventQueue != null)
                {
                    _spEventQueue.Shutdown();
                }
                if (_networkStreamAdapter != null)
                {
                    _networkStreamAdapter.Close();
                }

                foreach (var stream in _streams)
                {
                    (stream as MediaStream).Shutdown();
                }

                _eSourceState = SourceState.SourceState_Shutdown;
                _streams.Clear();
                _spEventQueue.Shutdown();
                _networkStreamAdapter = null;
            }

            return(hr);
        }
예제 #2
0
        private void Initialize()
        {
            // Create the event queue helper.
            _networkStreamAdapter = new NetworkMediaAdapter();
            _networkStreamAdapter.OnDataArrived += _networkStreamAdapter_OnDataArrived;
            _isOpenEventInvoked = false;

            // Create the event queue helper.
            ThrowIfError(MFExtern.MFCreateEventQueue(out _spEventQueue));
        }
예제 #3
0
        public RenderForm()
        {
            InitializeComponent();

            _drawDevice = new DrawDevice();
            ThrowIfError(_drawDevice.CreateDevice(Handle));

            _networkStreamAdapter = new NetworkMediaAdapter();
            _networkStreamAdapter.OnDataArrived += _networkStreamAdapter_OnDataArrived;

            _decoder = new H264Decoder();
            _decoder.OnSampleDecodeComplete += _decoder_OnSampleDecodeComplete;
        }