diff options
| author | Andrew Rabert <6550543+nvllsvm@users.noreply.github.com> | 2019-01-20 18:11:51 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-20 18:11:51 -0500 |
| commit | a1fcf4ea0d418bc08743df4fa45a04198daf8e4f (patch) | |
| tree | 0ab6281d09ffd61e66e8f65cb9b86b357c5529a0 /MediaBrowser.Api/Playback/StreamState.cs | |
| parent | c8dd72886b265630606ef1c9e061f32995c9b841 (diff) | |
| parent | ae73f7b3e370f94d6e667a153be363ab89a24f78 (diff) | |
Merge pull request #613 from MatMaul/mediaencoding-dev
Update MediaEncoding
Diffstat (limited to 'MediaBrowser.Api/Playback/StreamState.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/StreamState.cs | 92 |
1 files changed, 15 insertions, 77 deletions
diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index 400ad47cc..96dc4ab4c 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -92,76 +92,60 @@ namespace MediaBrowser.Api.Playback } } - public int HlsListSize => 0; - public string UserAgent { get; set; } public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger, TranscodingJobType transcodingType) - : base(logger, mediaSourceManager, transcodingType) + : base(transcodingType) { _mediaSourceManager = mediaSourceManager; _logger = logger; } - public string MimeType { get; set; } - public bool EstimateContentLength { get; set; } public TranscodeSeekInfo TranscodeSeekInfo { get; set; } - public long? EncodingDurationTicks { get; set; } - - public string GetMimeType(string outputPath, bool enableStreamDefault = true) - { - if (!string.IsNullOrEmpty(MimeType)) - { - return MimeType; - } - - return MimeTypes.GetMimeType(outputPath, enableStreamDefault); - } - public bool EnableDlnaHeaders { get; set; } - public void Dispose() + public override void Dispose() { DisposeTranscodingThrottler(); - DisposeLiveStream(); DisposeLogStream(); + DisposeLiveStream(); TranscodingJob = null; } - private void DisposeLogStream() + private void DisposeTranscodingThrottler() { - if (LogFileStream != null) + if (TranscodingThrottler != null) { try { - LogFileStream.Dispose(); + TranscodingThrottler.Dispose(); } catch (Exception ex) { - _logger.LogError(ex, "Error disposing log stream"); + _logger.LogError(ex, "Error disposing TranscodingThrottler"); } - LogFileStream = null; + TranscodingThrottler = null; } } - private void DisposeTranscodingThrottler() + private void DisposeLogStream() { - if (TranscodingThrottler != null) + if (LogFileStream != null) { try { - TranscodingThrottler.Dispose(); + LogFileStream.Dispose(); } catch (Exception ex) { - _logger.LogError(ex, "Error disposing TranscodingThrottler"); + _logger.LogError(ex, "Error disposing log stream"); } - TranscodingThrottler = null; + LogFileStream = null; } } @@ -180,58 +164,12 @@ namespace MediaBrowser.Api.Playback } } - public string OutputFilePath { get; set; } - - public string ActualOutputVideoCodec - { - get - { - var codec = OutputVideoCodec; - - if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase)) - { - var stream = VideoStream; - - if (stream != null) - { - return stream.Codec; - } - - return null; - } - - return codec; - } - } - - public string ActualOutputAudioCodec - { - get - { - var codec = OutputAudioCodec; - - if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase)) - { - var stream = AudioStream; - - if (stream != null) - { - return stream.Codec; - } - - return null; - } - - return codec; - } - } - public DeviceProfile DeviceProfile { get; set; } public TranscodingJob TranscodingJob; - public override void ReportTranscodingProgress(TimeSpan? transcodingPosition, float framerate, double? percentComplete, long bytesTranscoded, int? bitRate) + public void ReportTranscodingProgress(TimeSpan? transcodingPosition, float? framerate, double? percentComplete, long? bytesTranscoded, int? bitRate) { - ApiEntryPoint.Instance.ReportTranscodingProgress(TranscodingJob, this, transcodingPosition, 0, percentComplete, 0, bitRate); + ApiEntryPoint.Instance.ReportTranscodingProgress(TranscodingJob, this, transcodingPosition, framerate, percentComplete, bytesTranscoded, bitRate); } } } |
