Revert back to 10e57ce8d21b4516733894075001819f3cd6db6b for MediaEncoding

Remove some duplicate code that were causing warnings
This commit is contained in:
Mathieu Velten
2019-01-13 02:06:59 +01:00
parent 0586598d33
commit da16de48aa
6 changed files with 309 additions and 271 deletions

View File

@@ -11,9 +11,8 @@ 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>
@@ -22,15 +21,16 @@ namespace MediaBrowser.Controller.MediaEncoding
/// <value><c>true</c> if this instance has fixed resolution; otherwise, <c>false</c>.</value>
public bool HasFixedResolution => Width.HasValue || Height.HasValue;
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
public DeviceProfile DeviceProfile { get; set; }
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;
@@ -55,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; }
@@ -180,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; }
@@ -244,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; }
}
}