diff options
| author | Andrew Rabert <6550543+nvllsvm@users.noreply.github.com> | 2019-01-22 18:13:47 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-22 18:13:47 -0500 |
| commit | 28483bdb54be96ae83e0fded097f534d7e26ba1e (patch) | |
| tree | e7f4b92326417ebf55eecdf68a01d2c3b9e660d7 /MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs | |
| parent | 920c39454c05e979eabe81877269cd4517a03ccf (diff) | |
| parent | 8106c8393b711a7e1d40487e3caf2b014decbe28 (diff) | |
Merge pull request #651 from jellyfin/release-10.1.0
Release 10.1.0
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs')
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs index 101748a5a..be97c75a2 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -11,32 +11,26 @@ namespace MediaBrowser.Controller.MediaEncoding { public string OutputDirectory { get; set; } public string ItemId { get; set; } - public string MediaSourceId { get; set; } - public string AudioCodec { get; set; } + public string TempDirectory { get; set; } public bool ReadInputAtNativeFramerate { get; set; } /// <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 bool HasFixedResolution => Width.HasValue || Height.HasValue; + + public DeviceProfile DeviceProfile { get; set; } - private readonly CultureInfo _usCulture = new CultureInfo("en-US"); public EncodingJobOptions(StreamInfo info, DeviceProfile deviceProfile) { - OutputContainer = info.Container; + Container = info.Container; StartTimeTicks = info.StartPositionTicks; MaxWidth = info.MaxWidth; MaxHeight = info.MaxHeight; MaxFramerate = info.MaxFramerate; - ItemId = info.ItemId.ToString(""); + Id = info.ItemId; MediaSourceId = info.MediaSourceId; AudioCodec = info.TargetAudioCodec.FirstOrDefault(); MaxAudioChannels = info.GlobalMaxAudioChannels; @@ -61,6 +55,29 @@ namespace MediaBrowser.Controller.MediaEncoding // For now until api and media encoding layers are unified public class BaseEncodingJobOptions { + /// <summary> + /// Gets or sets the id. + /// </summary> + /// <value>The id.</value> + [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] + public Guid Id { get; set; } + + [ApiMember(Name = "MediaSourceId", Description = "The media version id, if playing an alternate version", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] + public string MediaSourceId { get; set; } + + [ApiMember(Name = "DeviceId", Description = "The device id of the client requesting. Used to stop encoding processes when needed.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public string DeviceId { get; set; } + + [ApiMember(Name = "Container", Description = "Container", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")] + public string Container { get; set; } + + /// <summary> + /// Gets or sets the audio codec. + /// </summary> + /// <value>The audio codec.</value> + [ApiMember(Name = "AudioCodec", Description = "Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public string AudioCodec { get; set; } + [ApiMember(Name = "EnableAutoStreamCopy", Description = "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")] public bool EnableAutoStreamCopy { get; set; } @@ -186,7 +203,7 @@ namespace MediaBrowser.Controller.MediaEncoding public bool RequireNonAnamorphic { get; set; } public int? TranscodingMaxAudioChannels { get; set; } public int? CpuCoreLimit { get; set; } - public string OutputContainer { get; set; } + public string LiveStreamId { get; set; } public bool EnableMpegtsM2TsMode { get; set; } @@ -234,8 +251,7 @@ namespace MediaBrowser.Controller.MediaEncoding public string GetOption(string name) { - string value; - if (StreamOptions.TryGetValue(name, out value)) + if (StreamOptions.TryGetValue(name, out var value)) { return value; } @@ -251,11 +267,5 @@ namespace MediaBrowser.Controller.MediaEncoding Context = EncodingContext.Streaming; StreamOptions = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); } - - public string TempDirectory { get; set; } - public string DeviceId { get; set; } - public Guid Id { get; set; } - public string Container { get; set; } - public DeviceProfile DeviceProfile { get; set; } } } |
