コード例 #1
0
ファイル: VLCStream.cs プロジェクト: uzbekdev1/main
        private void DisposePlayer()
        {
            if (_mFactory == null)
            {
                return;
            }
            try
            {
                _mPlayer.Dispose();
            }
            catch { }
            try
            {
                _mFactory.Dispose();
            }
            catch { }
            try
            {
                _mMedia.Dispose();
            }
            catch { }

            _mPlayer  = null;
            _mFactory = null;
            _mMedia   = null;
        }
コード例 #2
0
        /// <summary>
        /// Closes the media player and releases all resources.
        /// </summary>
        public void CloseMedia()
        {
            if (_player != null)
            {
                // Close the media player.
                _disk.Stop();
                _disk.Dispose();
                _player.Dispose();
                _media.Dispose();
            }

            _player = null;
            _disk   = null;
            _media  = null;
        }
コード例 #3
0
ファイル: VLCStream.cs プロジェクト: happycat2003/iSpy
        // Protected implementation of Dispose pattern.
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                try
                {
                    _abort.Close();
                    _abort.Dispose();
                    _mFactory?.Dispose();
                }
                catch
                {
                    // ignored
                }
            }

            // Free any unmanaged objects here.
            //
            _disposed = true;
        }
コード例 #4
0
ファイル: Vlc.cs プロジェクト: Pzkgw/Camera-Support
        //private string[] GetVlcMediaOptions()
        //{

        /*
         * if (SessionInfo.vlcMediaOptions == null)
         * {
         *  SessionInfo.vlcMediaOptions = new string[] {
         *  "--no-snapshot-preview" // vlcOpt && !vlcMediaOpt
         * }.Where(x => !string.IsNullOrEmpty(x)).ToArray();
         *
         * }
         *
         * return SessionInfo.vlcMediaOptions;*/

        // return null;
        //}


        /*      private string GetVlcLibLocation()
         *    {
         *
         *        string aP;
         *        if (Environment.Is64BitOperatingSystem)
         *            aP = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "VideoLAN\\VLC");
         *        else
         *            aP = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "VideoLAN\\VLC");
         */
        /*else if (!File.Exists(Path.Combine(aP, "libvlc.dll"))
         *             {
         *             Using fbdDialog As New FolderBrowserDialog()
         *             fbdDialog.Description = "Select VLC Path"
         *             fbdDialog.SelectedPath = Path.Combine(aP, "VideoLAN\VLC")
         *
         *             If fbdDialog.ShowDialog() = DialogResult.OK Then
         *             e.VlcLibDirectory = New DirectoryInfo(fbdDialog.SelectedPath)
         *         }
         *
         * e.VlcLibDirectory = new DirectoryInfo(aP);
         *
         * return "c:\\Program Files (x86)\\VideoLAN\\VLC";//aP;
         * }*/

        #region CleanUp

        internal void CleanUp()
        {
            SessionInfo.Logger.CleanUp();

            ToggleRunningMedia(false);

            _mFactory.Dispose();
            _mFactory = null;
        }
コード例 #5
0
ファイル: Vlc.cs プロジェクト: wxmiswxm/Camera-Support
        //private string[] GetVlcMediaOptions()
        //{

        /*
         * if (SessionInfo.vlcMediaOptions == null)
         * {
         *  SessionInfo.vlcMediaOptions = new string[] {
         *  "--no-snapshot-preview" // vlcOpt && !vlcMediaOpt
         * }.Where(x => !string.IsNullOrEmpty(x)).ToArray();
         *
         * }
         *
         * return SessionInfo.vlcMediaOptions;*/

        // return null;
        //}


        /*      private string GetVlcLibLocation()
         *    {
         *
         *        string aP;
         *        if (Environment.Is64BitOperatingSystem)
         *            aP = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "VideoLAN\\VLC");
         *        else
         *            aP = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "VideoLAN\\VLC");
         */
        /*else if (!File.Exists(Path.Combine(aP, "libvlc.dll"))
         *             {
         *             Using fbdDialog As New FolderBrowserDialog()
         *             fbdDialog.Description = "Select VLC Path"
         *             fbdDialog.SelectedPath = Path.Combine(aP, "VideoLAN\VLC")
         *
         *             If fbdDialog.ShowDialog() = DialogResult.OK Then
         *             e.VlcLibDirectory = New DirectoryInfo(fbdDialog.SelectedPath)
         *         }
         *
         * e.VlcLibDirectory = new DirectoryInfo(aP);
         *
         * return "c:\\Program Files (x86)\\VideoLAN\\VLC";//aP;
         * }*/

        #region CleanUp

        internal void CleanUp()
        {
            CLogger.On = false;

            ToggleRunningMedia(false);

            _mFactory.Dispose();
            _mFactory = null;
        }
コード例 #6
0
 private void Player_FormClosing(object sender, FormClosingEventArgs e)
 {
     try { m_player.Stop(); } catch
     {
     }
     m_factory.Dispose();
     m_media.Dispose();
     m_player.Dispose();
 }
コード例 #7
0
 private void Player_FormClosing(object sender, FormClosingEventArgs e)
 {
     try { _mPlayer.Stop(); } catch
     {
     }
     _mFactory.Dispose();
     _mMedia.Dispose();
     _mPlayer.Dispose();
 }
コード例 #8
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposing)
     {
         return;
     }
     DisposeMedia();
     _factory.Dispose();
     _player.Dispose();
 }
コード例 #9
0
 /// <summary>
 /// Disposes of object resources.
 /// </summary>
 /// <param name="disposeManagedResources">If true, managed resources should be
 /// disposed of in addition to unmanaged resources.</param>
 protected virtual void Dispose(bool disposeManagedResources)
 {
     if (disposeManagedResources)
     {
         m_factory.Dispose();
         m_player.Dispose();
         m_equalizer.Dispose();
         m_media.Dispose();
         m_media_preview.Dispose();
         m_memRender.Dispose();
         m_media_list.Dispose();
         m_list_player.Dispose();
         m_media_list_preview.Dispose();
         m_list_preview_player.Dispose();
     }
 }
コード例 #10
0
        // Protected implementation of Dispose pattern.
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                _mFactory?.Dispose();
                _stopEvent?.Close();
            }

            // Free any unmanaged objects here.
            //
            _disposed = true;
        }
コード例 #11
0
        public void ReleasenVLC()
        {
            CheckConnectionTimer.Stop();

            DisposeMedia();

            if (m_player != null)
            {
                m_player.Events.PlayerPositionChanged -= Events_PlayerPositionChanged;
                m_player.Events.TimeChanged           -= Events_TimeChanged;
                m_player.Events.MediaEnded            -= Events_MediaEnded;
                m_player.Events.PlayerStopped         -= Events_PlayerStopped;
                m_player.Dispose();
            }
            if (m_factory != null)
            {
                m_factory.Dispose();
            }

            //GC.SuppressFinalize(this);
        }
コード例 #12
0
ファイル: PlayerVLC.cs プロジェクト: Sirendium/IQ-RVS
 private void Player_FormClosing(object sender, FormClosingEventArgs e)
 {
     lock (_lock)
     {
         if (_mPlayer != null)
         {
             try
             {
                 _mPlayer.Stop();
             }
             catch
             {
             }
         }
         try
         {
             if (_mFactory != null)
             {
                 _mFactory.Dispose();
             }
             if (_mMedia != null)
             {
                 _mMedia.Dispose();
             }
             if (_mPlayer != null)
             {
                 _mPlayer.Dispose();
             }
         }
         catch
         {
         }
     }
     if (vNav != null)
     {
         vNav.ReleaseGraph();
     }
 }