当前位置: 首页>>代码示例>>C#>>正文


C# StreamState.Dispose方法代码示例

本文整理汇总了C#中MediaBrowser.Api.Playback.StreamState.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# StreamState.Dispose方法的具体用法?C# StreamState.Dispose怎么用?C# StreamState.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MediaBrowser.Api.Playback.StreamState的用法示例。


在下文中一共展示了StreamState.Dispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnFfMpegProcessExited

        /// <summary>
        /// Processes the exited.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="state">The state.</param>
        /// <param name="outputPath">The output path.</param>
        private void OnFfMpegProcessExited(Process process, StreamState state, string outputPath)
        {
            var job = ApiEntryPoint.Instance.GetTranscodingJob(outputPath, TranscodingJobType);

            if (job != null)
            {
                job.HasExited = true;
            }

            Logger.Debug("Disposing stream resources");
            state.Dispose();

            try
            {
                Logger.Info("FFMpeg exited with code {0}", process.ExitCode);
            }
            catch
            {
                Logger.Error("FFMpeg exited with an error.");
            }

            // This causes on exited to be called twice:
            //try
            //{
            //    // Dispose the process
            //    process.Dispose();
            //}
            //catch (Exception ex)
            //{
            //    Logger.ErrorException("Error disposing ffmpeg.", ex);
            //}
        }
开发者ID:rsolmn,项目名称:MediaBrowser,代码行数:38,代码来源:BaseStreamingService.cs

示例2: OnFfMpegProcessExited

        /// <summary>
        /// Processes the exited.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="state">The state.</param>
        protected void OnFfMpegProcessExited(Process process, StreamState state)
        {
            state.Dispose();

            var outputFilePath = GetOutputFilePath(state);

            try
            {
                Logger.Info("FFMpeg exited with code {0} for {1}", process.ExitCode, outputFilePath);
            }
            catch
            {
                Logger.Info("FFMpeg exited with an error for {0}", outputFilePath);
            }
        }
开发者ID:Rycius,项目名称:MediaBrowser,代码行数:20,代码来源:BaseStreamingService.cs


注:本文中的MediaBrowser.Api.Playback.StreamState.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。