aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs')
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs83
1 files changed, 56 insertions, 27 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
index 1127a08de..6cd0c70d2 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
@@ -1,8 +1,10 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
-using MediaBrowser.Controller.Entities;
+using Jellyfin.Data.Entities;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Dto;
@@ -18,22 +20,37 @@ namespace MediaBrowser.Controller.MediaEncoding
public class EncodingJobInfo
{
public MediaStream VideoStream { get; set; }
+
public VideoType VideoType { get; set; }
+
public Dictionary<string, string> RemoteHttpHeaders { get; set; }
+
public string OutputVideoCodec { get; set; }
+
public MediaProtocol InputProtocol { get; set; }
+
public string MediaPath { get; set; }
+
public bool IsInputVideo { get; set; }
+
public IIsoMount IsoMount { get; set; }
+
public string[] PlayableStreamFileNames { get; set; }
+
public string OutputAudioCodec { get; set; }
+
public int? OutputVideoBitrate { get; set; }
+
public MediaStream SubtitleStream { get; set; }
+
public SubtitleDeliveryMethod SubtitleDeliveryMethod { get; set; }
+
public string[] SupportedSubtitleCodecs { get; set; }
public int InternalSubtitleStreamOffset { get; set; }
+
public MediaSourceInfo MediaSource { get; set; }
+
public User User { get; set; }
public long? RunTimeTicks { get; set; }
@@ -112,13 +129,19 @@ namespace MediaBrowser.Controller.MediaEncoding
public string AlbumCoverPath { get; set; }
public string InputAudioSync { get; set; }
+
public string InputVideoSync { get; set; }
+
public TransportStreamTimestamp InputTimestamp { get; set; }
public MediaStream AudioStream { get; set; }
+
public string[] SupportedAudioCodecs { get; set; }
+
public string[] SupportedVideoCodecs { get; set; }
+
public string InputContainer { get; set; }
+
public IsoType? IsoType { get; set; }
public BaseEncodingJobOptions BaseRequest { get; set; }
@@ -278,6 +301,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
public bool IsVideoRequest { get; set; }
+
public TranscodingJobType TranscodingType { get; set; }
public EncodingJobInfo(TranscodingJobType jobType)
@@ -302,7 +326,7 @@ namespace MediaBrowser.Controller.MediaEncoding
return false;
}
- return BaseRequest.BreakOnNonKeyFrames && string.Equals(videoCodec, "copy", StringComparison.OrdinalIgnoreCase);
+ return BaseRequest.BreakOnNonKeyFrames && EncodingHelper.IsCopyCodec(videoCodec);
}
return false;
@@ -318,7 +342,8 @@ namespace MediaBrowser.Controller.MediaEncoding
{
var size = new ImageDimensions(VideoStream.Width.Value, VideoStream.Height.Value);
- var newSize = DrawingUtils.Resize(size,
+ var newSize = DrawingUtils.Resize(
+ size,
BaseRequest.Width ?? 0,
BaseRequest.Height ?? 0,
BaseRequest.MaxWidth ?? 0,
@@ -344,7 +369,8 @@ namespace MediaBrowser.Controller.MediaEncoding
{
var size = new ImageDimensions(VideoStream.Width.Value, VideoStream.Height.Value);
- var newSize = DrawingUtils.Resize(size,
+ var newSize = DrawingUtils.Resize(
+ size,
BaseRequest.Width ?? 0,
BaseRequest.Height ?? 0,
BaseRequest.MaxWidth ?? 0,
@@ -367,7 +393,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputAudioCodec))
{
if (AudioStream != null)
{
@@ -390,7 +416,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputAudioCodec))
{
if (AudioStream != null)
{
@@ -403,13 +429,13 @@ namespace MediaBrowser.Controller.MediaEncoding
}
/// <summary>
- /// Predicts the audio sample rate that will be in the output stream
+ /// Predicts the audio sample rate that will be in the output stream.
/// </summary>
public double? TargetVideoLevel
{
get
{
- if (BaseRequest.Static || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.Level;
}
@@ -426,14 +452,14 @@ namespace MediaBrowser.Controller.MediaEncoding
}
/// <summary>
- /// Predicts the audio sample rate that will be in the output stream
+ /// Predicts the audio sample rate that will be in the output stream.
/// </summary>
public int? TargetVideoBitDepth
{
get
{
if (BaseRequest.Static
- || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.BitDepth;
}
@@ -451,7 +477,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.RefFrames;
}
@@ -461,14 +487,14 @@ namespace MediaBrowser.Controller.MediaEncoding
}
/// <summary>
- /// Predicts the audio sample rate that will be in the output stream
+ /// Predicts the audio sample rate that will be in the output stream.
/// </summary>
public float? TargetFramerate
{
get
{
if (BaseRequest.Static
- || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream == null ? null : (VideoStream.AverageFrameRate ?? VideoStream.RealFrameRate);
}
@@ -493,13 +519,13 @@ namespace MediaBrowser.Controller.MediaEncoding
}
/// <summary>
- /// Predicts the audio sample rate that will be in the output stream
+ /// Predicts the audio sample rate that will be in the output stream.
/// </summary>
public int? TargetPacketLength
{
get
{
- if (BaseRequest.Static || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.PacketLength;
}
@@ -509,13 +535,13 @@ namespace MediaBrowser.Controller.MediaEncoding
}
/// <summary>
- /// Predicts the audio sample rate that will be in the output stream
+ /// Predicts the audio sample rate that will be in the output stream.
/// </summary>
public string TargetVideoProfile
{
get
{
- if (BaseRequest.Static || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.Profile;
}
@@ -535,7 +561,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.CodecTag;
}
@@ -549,7 +575,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.IsAnamorphic;
}
@@ -562,7 +588,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
get
{
- if (string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.Codec;
}
@@ -575,7 +601,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
get
{
- if (string.Equals(OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(OutputAudioCodec))
{
return AudioStream?.Codec;
}
@@ -589,7 +615,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.IsInterlaced;
}
@@ -607,7 +633,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
get
{
- if (BaseRequest.Static || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.IsAVC;
}
@@ -657,6 +683,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
public IProgress<double> Progress { get; set; }
+
public virtual void ReportTranscodingProgress(TimeSpan? transcodingPosition, float? framerate, double? percentComplete, long? bytesTranscoded, int? bitRate)
{
Progress.Report(percentComplete.Value);
@@ -664,20 +691,22 @@ namespace MediaBrowser.Controller.MediaEncoding
}
/// <summary>
- /// Enum TranscodingJobType
+ /// Enum TranscodingJobType.
/// </summary>
public enum TranscodingJobType
{
/// <summary>
- /// The progressive
+ /// The progressive.
/// </summary>
Progressive,
+
/// <summary>
- /// The HLS
+ /// The HLS.
/// </summary>
Hls,
+
/// <summary>
- /// The dash
+ /// The dash.
/// </summary>
Dash
}