jellyfin-server/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs

99 lines
3.6 KiB
C#
Raw Normal View History

using MediaBrowser.Model.Dlna;
2015-01-02 06:12:58 +00:00
namespace MediaBrowser.Controller.MediaEncoding
{
public class EncodingJobOptions
{
public string OutputContainer { get; set; }
2015-01-17 04:29:53 +00:00
public string OutputDirectory { get; set; }
2015-01-02 06:12:58 +00:00
public long? StartTimeTicks { get; set; }
public int? Width { get; set; }
public int? Height { get; set; }
public int? MaxWidth { get; set; }
public int? MaxHeight { get; set; }
public bool Static = false;
public float? Framerate { get; set; }
public float? MaxFramerate { get; set; }
public string Profile { get; set; }
public int? Level { get; set; }
public string DeviceId { get; set; }
public string ItemId { get; set; }
public string MediaSourceId { get; set; }
public string AudioCodec { get; set; }
public bool EnableAutoStreamCopy { get; set; }
public int? MaxAudioChannels { get; set; }
public int? AudioChannels { get; set; }
public int? AudioBitRate { get; set; }
public int? AudioSampleRate { get; set; }
public DeviceProfile DeviceProfile { get; set; }
public EncodingContext Context { get; set; }
public string VideoCodec { get; set; }
2016-12-26 19:47:37 +00:00
public int? TranscodingMaxAudioChannels { get; set; }
2015-01-02 06:12:58 +00:00
public int? VideoBitRate { get; set; }
public int? AudioStreamIndex { get; set; }
public int? VideoStreamIndex { get; set; }
public int? SubtitleStreamIndex { get; set; }
public int? MaxRefFrames { get; set; }
public int? MaxVideoBitDepth { get; set; }
2015-04-09 17:30:18 +00:00
public int? CpuCoreLimit { get; set; }
public bool ReadInputAtNativeFramerate { get; set; }
2015-01-02 06:12:58 +00:00
public SubtitleDeliveryMethod SubtitleMethod { get; set; }
public bool CopyTimestamps { get; set; }
2015-01-02 06:12:58 +00:00
/// <summary>
/// Gets a value indicating whether this instance has fixed resolution.
/// </summary>
/// <value><c>true</c> if this instance has fixed resolution; otherwise, <c>false</c>.</value>
public bool HasFixedResolution
{
get
{
return Width.HasValue || Height.HasValue;
}
}
public EncodingJobOptions()
{
}
public EncodingJobOptions(StreamInfo info, DeviceProfile deviceProfile)
{
OutputContainer = info.Container;
StartTimeTicks = info.StartPositionTicks;
MaxWidth = info.MaxWidth;
MaxHeight = info.MaxHeight;
MaxFramerate = info.MaxFramerate;
Profile = info.VideoProfile;
Level = info.VideoLevel;
ItemId = info.ItemId;
MediaSourceId = info.MediaSourceId;
2016-06-26 16:21:10 +00:00
AudioCodec = info.TargetAudioCodec;
2015-01-02 06:12:58 +00:00
MaxAudioChannels = info.MaxAudioChannels;
AudioBitRate = info.AudioBitrate;
AudioSampleRate = info.TargetAudioSampleRate;
DeviceProfile = deviceProfile;
VideoCodec = info.VideoCodec;
VideoBitRate = info.VideoBitrate;
AudioStreamIndex = info.AudioStreamIndex;
MaxRefFrames = info.MaxRefFrames;
MaxVideoBitDepth = info.MaxVideoBitDepth;
SubtitleMethod = info.SubtitleDeliveryMethod;
Context = info.Context;
2016-12-26 19:47:37 +00:00
TranscodingMaxAudioChannels = info.TranscodingMaxAudioChannels;
2015-02-05 03:01:37 +00:00
2016-03-07 18:50:58 +00:00
if (info.SubtitleDeliveryMethod != SubtitleDeliveryMethod.External)
2015-02-05 03:01:37 +00:00
{
SubtitleStreamIndex = info.SubtitleStreamIndex;
}
2015-01-02 06:12:58 +00:00
}
}
}